diff --git a/coreutils/changelog/0.0.1.1/index.html b/coreutils/changelog/0.0.1.1/index.html index e09fe3bb7..f83871b86 100644 --- a/coreutils/changelog/0.0.1.1/index.html +++ b/coreutils/changelog/0.0.1.1/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.1/index.html b/coreutils/changelog/0.0.1/index.html index 2e87051a8..bbee186a3 100644 --- a/coreutils/changelog/0.0.1/index.html +++ b/coreutils/changelog/0.0.1/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.12/index.html b/coreutils/changelog/0.0.12/index.html index e2ec8896d..46f96a6b7 100644 --- a/coreutils/changelog/0.0.12/index.html +++ b/coreutils/changelog/0.0.12/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.13/index.html b/coreutils/changelog/0.0.13/index.html index 43626e1df..b719217b1 100644 --- a/coreutils/changelog/0.0.13/index.html +++ b/coreutils/changelog/0.0.13/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.14/index.html b/coreutils/changelog/0.0.14/index.html index 8a6d1454b..22183998b 100644 --- a/coreutils/changelog/0.0.14/index.html +++ b/coreutils/changelog/0.0.14/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.15/index.html b/coreutils/changelog/0.0.15/index.html index 43be1e0df..c98aa2491 100644 --- a/coreutils/changelog/0.0.15/index.html +++ b/coreutils/changelog/0.0.15/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.16/index.html b/coreutils/changelog/0.0.16/index.html index 2b1ffde49..ffbae1df5 100644 --- a/coreutils/changelog/0.0.16/index.html +++ b/coreutils/changelog/0.0.16/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.17/index.html b/coreutils/changelog/0.0.17/index.html index 35f62d117..d303ec18e 100644 --- a/coreutils/changelog/0.0.17/index.html +++ b/coreutils/changelog/0.0.17/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.18/index.html b/coreutils/changelog/0.0.18/index.html index 3f0d235ae..9de9b6571 100644 --- a/coreutils/changelog/0.0.18/index.html +++ b/coreutils/changelog/0.0.18/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.19/index.html b/coreutils/changelog/0.0.19/index.html index c38e29230..e1b4d3357 100644 --- a/coreutils/changelog/0.0.19/index.html +++ b/coreutils/changelog/0.0.19/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.2/index.html b/coreutils/changelog/0.0.2/index.html index 6c79420f5..0f50c92b9 100644 --- a/coreutils/changelog/0.0.2/index.html +++ b/coreutils/changelog/0.0.2/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.20/index.html b/coreutils/changelog/0.0.20/index.html index 4d06d3c3e..e02889f10 100644 --- a/coreutils/changelog/0.0.20/index.html +++ b/coreutils/changelog/0.0.20/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.3/index.html b/coreutils/changelog/0.0.3/index.html index f3016e81f..21e552c41 100644 --- a/coreutils/changelog/0.0.3/index.html +++ b/coreutils/changelog/0.0.3/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.4/index.html b/coreutils/changelog/0.0.4/index.html index 41df359fa..2e1b4dc73 100644 --- a/coreutils/changelog/0.0.4/index.html +++ b/coreutils/changelog/0.0.4/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.5/index.html b/coreutils/changelog/0.0.5/index.html index a73a43041..b31493135 100644 --- a/coreutils/changelog/0.0.5/index.html +++ b/coreutils/changelog/0.0.5/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.6/index.html b/coreutils/changelog/0.0.6/index.html index 2803b6cf2..0bdd724a7 100644 --- a/coreutils/changelog/0.0.6/index.html +++ b/coreutils/changelog/0.0.6/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.7/index.html b/coreutils/changelog/0.0.7/index.html index 192c32ce0..626a6c436 100644 --- a/coreutils/changelog/0.0.7/index.html +++ b/coreutils/changelog/0.0.7/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.8/index.html b/coreutils/changelog/0.0.8/index.html index d8717110f..485602aad 100644 --- a/coreutils/changelog/0.0.8/index.html +++ b/coreutils/changelog/0.0.8/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/0.0.9/index.html b/coreutils/changelog/0.0.9/index.html index cf41f4a47..53fefc1ec 100644 --- a/coreutils/changelog/0.0.9/index.html +++ b/coreutils/changelog/0.0.9/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/changelog/index.html b/coreutils/changelog/index.html index be0180f83..31d2f50f6 100644 --- a/coreutils/changelog/index.html +++ b/coreutils/changelog/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

@@ -720,7 +720,7 @@ - + \ No newline at end of file diff --git a/coreutils/dev/.lock b/coreutils/dev/.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/coreutils/dev/arch/all.html b/coreutils/dev/arch/all.html deleted file mode 100644 index 4b4fff884..000000000 --- a/coreutils/dev/arch/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/arch/fn.main.html b/coreutils/dev/arch/fn.main.html deleted file mode 100644 index c92e17386..000000000 --- a/coreutils/dev/arch/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in arch - Rust

Function arch::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/arch/index.html b/coreutils/dev/arch/index.html deleted file mode 100644 index 158e8ed2c..000000000 --- a/coreutils/dev/arch/index.html +++ /dev/null @@ -1 +0,0 @@ -arch - Rust
\ No newline at end of file diff --git a/coreutils/dev/arch/sidebar-items.js b/coreutils/dev/arch/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/arch/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/base32/all.html b/coreutils/dev/base32/all.html deleted file mode 100644 index 96a4c0af4..000000000 --- a/coreutils/dev/base32/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/base32/fn.main.html b/coreutils/dev/base32/fn.main.html deleted file mode 100644 index 77ebf5c40..000000000 --- a/coreutils/dev/base32/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in base32 - Rust

Function base32::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/base32/index.html b/coreutils/dev/base32/index.html deleted file mode 100644 index fe5b0ecb1..000000000 --- a/coreutils/dev/base32/index.html +++ /dev/null @@ -1 +0,0 @@ -base32 - Rust
\ No newline at end of file diff --git a/coreutils/dev/base32/sidebar-items.js b/coreutils/dev/base32/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/base32/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/base64/all.html b/coreutils/dev/base64/all.html deleted file mode 100644 index 4b8f2256a..000000000 --- a/coreutils/dev/base64/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/base64/fn.main.html b/coreutils/dev/base64/fn.main.html deleted file mode 100644 index 9cb860cd4..000000000 --- a/coreutils/dev/base64/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in base64 - Rust

Function base64::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/base64/index.html b/coreutils/dev/base64/index.html deleted file mode 100644 index f2c954f44..000000000 --- a/coreutils/dev/base64/index.html +++ /dev/null @@ -1 +0,0 @@ -base64 - Rust
\ No newline at end of file diff --git a/coreutils/dev/base64/sidebar-items.js b/coreutils/dev/base64/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/base64/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/basename/all.html b/coreutils/dev/basename/all.html deleted file mode 100644 index b2f05f477..000000000 --- a/coreutils/dev/basename/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/basename/fn.main.html b/coreutils/dev/basename/fn.main.html deleted file mode 100644 index 8abc39e7a..000000000 --- a/coreutils/dev/basename/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in basename - Rust

Function basename::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/basename/index.html b/coreutils/dev/basename/index.html deleted file mode 100644 index f8b57d5a1..000000000 --- a/coreutils/dev/basename/index.html +++ /dev/null @@ -1 +0,0 @@ -basename - Rust
\ No newline at end of file diff --git a/coreutils/dev/basename/sidebar-items.js b/coreutils/dev/basename/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/basename/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/basenc/all.html b/coreutils/dev/basenc/all.html deleted file mode 100644 index 8d9dc2ed2..000000000 --- a/coreutils/dev/basenc/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/basenc/fn.main.html b/coreutils/dev/basenc/fn.main.html deleted file mode 100644 index f09d8b00a..000000000 --- a/coreutils/dev/basenc/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in basenc - Rust

Function basenc::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/basenc/index.html b/coreutils/dev/basenc/index.html deleted file mode 100644 index 8bedeca66..000000000 --- a/coreutils/dev/basenc/index.html +++ /dev/null @@ -1 +0,0 @@ -basenc - Rust
\ No newline at end of file diff --git a/coreutils/dev/basenc/sidebar-items.js b/coreutils/dev/basenc/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/basenc/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/cat/all.html b/coreutils/dev/cat/all.html deleted file mode 100644 index a1240585b..000000000 --- a/coreutils/dev/cat/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/cat/fn.main.html b/coreutils/dev/cat/fn.main.html deleted file mode 100644 index 6a6a64437..000000000 --- a/coreutils/dev/cat/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in cat - Rust

Function cat::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/cat/index.html b/coreutils/dev/cat/index.html deleted file mode 100644 index 7d3a53432..000000000 --- a/coreutils/dev/cat/index.html +++ /dev/null @@ -1 +0,0 @@ -cat - Rust
\ No newline at end of file diff --git a/coreutils/dev/cat/sidebar-items.js b/coreutils/dev/cat/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/cat/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/chcon/all.html b/coreutils/dev/chcon/all.html deleted file mode 100644 index f7270a9c3..000000000 --- a/coreutils/dev/chcon/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/chcon/fn.main.html b/coreutils/dev/chcon/fn.main.html deleted file mode 100644 index fa32fb016..000000000 --- a/coreutils/dev/chcon/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in chcon - Rust

Function chcon::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/chcon/index.html b/coreutils/dev/chcon/index.html deleted file mode 100644 index 9df9a58af..000000000 --- a/coreutils/dev/chcon/index.html +++ /dev/null @@ -1 +0,0 @@ -chcon - Rust
\ No newline at end of file diff --git a/coreutils/dev/chcon/sidebar-items.js b/coreutils/dev/chcon/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/chcon/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/chgrp/all.html b/coreutils/dev/chgrp/all.html deleted file mode 100644 index e6c8517f9..000000000 --- a/coreutils/dev/chgrp/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/chgrp/fn.main.html b/coreutils/dev/chgrp/fn.main.html deleted file mode 100644 index 902baca51..000000000 --- a/coreutils/dev/chgrp/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in chgrp - Rust

Function chgrp::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/chgrp/index.html b/coreutils/dev/chgrp/index.html deleted file mode 100644 index a62ab51ca..000000000 --- a/coreutils/dev/chgrp/index.html +++ /dev/null @@ -1 +0,0 @@ -chgrp - Rust
\ No newline at end of file diff --git a/coreutils/dev/chgrp/sidebar-items.js b/coreutils/dev/chgrp/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/chgrp/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/chmod/all.html b/coreutils/dev/chmod/all.html deleted file mode 100644 index 51d6f0880..000000000 --- a/coreutils/dev/chmod/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/chmod/fn.main.html b/coreutils/dev/chmod/fn.main.html deleted file mode 100644 index 87ee8501d..000000000 --- a/coreutils/dev/chmod/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in chmod - Rust

Function chmod::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/chmod/index.html b/coreutils/dev/chmod/index.html deleted file mode 100644 index 823d8d994..000000000 --- a/coreutils/dev/chmod/index.html +++ /dev/null @@ -1 +0,0 @@ -chmod - Rust
\ No newline at end of file diff --git a/coreutils/dev/chmod/sidebar-items.js b/coreutils/dev/chmod/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/chmod/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/chown/all.html b/coreutils/dev/chown/all.html deleted file mode 100644 index ff541131c..000000000 --- a/coreutils/dev/chown/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/chown/fn.main.html b/coreutils/dev/chown/fn.main.html deleted file mode 100644 index 04abec7e0..000000000 --- a/coreutils/dev/chown/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in chown - Rust

Function chown::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/chown/index.html b/coreutils/dev/chown/index.html deleted file mode 100644 index afcaa6b7d..000000000 --- a/coreutils/dev/chown/index.html +++ /dev/null @@ -1 +0,0 @@ -chown - Rust
\ No newline at end of file diff --git a/coreutils/dev/chown/sidebar-items.js b/coreutils/dev/chown/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/chown/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/chroot/all.html b/coreutils/dev/chroot/all.html deleted file mode 100644 index 35db48ba1..000000000 --- a/coreutils/dev/chroot/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/chroot/fn.main.html b/coreutils/dev/chroot/fn.main.html deleted file mode 100644 index 0499d5731..000000000 --- a/coreutils/dev/chroot/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in chroot - Rust

Function chroot::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/chroot/index.html b/coreutils/dev/chroot/index.html deleted file mode 100644 index 42d8f5081..000000000 --- a/coreutils/dev/chroot/index.html +++ /dev/null @@ -1 +0,0 @@ -chroot - Rust
\ No newline at end of file diff --git a/coreutils/dev/chroot/sidebar-items.js b/coreutils/dev/chroot/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/chroot/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/cksum/all.html b/coreutils/dev/cksum/all.html deleted file mode 100644 index bdfded36a..000000000 --- a/coreutils/dev/cksum/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/cksum/fn.main.html b/coreutils/dev/cksum/fn.main.html deleted file mode 100644 index 010ec5f52..000000000 --- a/coreutils/dev/cksum/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in cksum - Rust

Function cksum::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/cksum/index.html b/coreutils/dev/cksum/index.html deleted file mode 100644 index 22b85f0cf..000000000 --- a/coreutils/dev/cksum/index.html +++ /dev/null @@ -1 +0,0 @@ -cksum - Rust
\ No newline at end of file diff --git a/coreutils/dev/cksum/sidebar-items.js b/coreutils/dev/cksum/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/cksum/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/comm/all.html b/coreutils/dev/comm/all.html deleted file mode 100644 index b71d7500a..000000000 --- a/coreutils/dev/comm/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/comm/fn.main.html b/coreutils/dev/comm/fn.main.html deleted file mode 100644 index 0de61898e..000000000 --- a/coreutils/dev/comm/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in comm - Rust

Function comm::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/comm/index.html b/coreutils/dev/comm/index.html deleted file mode 100644 index e14350b1d..000000000 --- a/coreutils/dev/comm/index.html +++ /dev/null @@ -1 +0,0 @@ -comm - Rust
\ No newline at end of file diff --git a/coreutils/dev/comm/sidebar-items.js b/coreutils/dev/comm/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/comm/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/coreutils/all.html b/coreutils/dev/coreutils/all.html deleted file mode 100644 index e621d0e3e..000000000 --- a/coreutils/dev/coreutils/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/coreutils/constant.VERSION.html b/coreutils/dev/coreutils/constant.VERSION.html deleted file mode 100644 index f79af8280..000000000 --- a/coreutils/dev/coreutils/constant.VERSION.html +++ /dev/null @@ -1 +0,0 @@ -VERSION in coreutils - Rust

Constant coreutils::VERSION

source ·
pub(crate) const VERSION: &str = _;
\ No newline at end of file diff --git a/coreutils/dev/coreutils/fn.binary_path.html b/coreutils/dev/coreutils/fn.binary_path.html deleted file mode 100644 index 5d2076d31..000000000 --- a/coreutils/dev/coreutils/fn.binary_path.html +++ /dev/null @@ -1 +0,0 @@ -binary_path in coreutils - Rust

Function coreutils::binary_path

source ·
pub(crate) fn binary_path(args: &mut impl Iterator<Item = OsString>) -> PathBuf
\ No newline at end of file diff --git a/coreutils/dev/coreutils/fn.gen_completions.html b/coreutils/dev/coreutils/fn.gen_completions.html deleted file mode 100644 index d44e6bafb..000000000 --- a/coreutils/dev/coreutils/fn.gen_completions.html +++ /dev/null @@ -1,5 +0,0 @@ -gen_completions in coreutils - Rust

Function coreutils::gen_completions

source ·
pub(crate) fn gen_completions<T: Args>(
-    args: impl Iterator<Item = OsString>,
-    util_map: &OrderedMap<&'static str, (fn(_: T) -> i32, fn() -> Command)>
-) -> !
Expand description

Prints completions for the utility in the first parameter for the shell in the second parameter to stdout

-
\ No newline at end of file diff --git a/coreutils/dev/coreutils/fn.gen_coreutils_app.html b/coreutils/dev/coreutils/fn.gen_coreutils_app.html deleted file mode 100644 index 7d2321216..000000000 --- a/coreutils/dev/coreutils/fn.gen_coreutils_app.html +++ /dev/null @@ -1,3 +0,0 @@ -gen_coreutils_app in coreutils - Rust
pub(crate) fn gen_coreutils_app<T: Args>(
-    util_map: &OrderedMap<&'static str, (fn(_: T) -> i32, fn() -> Command)>
-) -> Command
\ No newline at end of file diff --git a/coreutils/dev/coreutils/fn.gen_manpage.html b/coreutils/dev/coreutils/fn.gen_manpage.html deleted file mode 100644 index 51ccdc974..000000000 --- a/coreutils/dev/coreutils/fn.gen_manpage.html +++ /dev/null @@ -1,5 +0,0 @@ -gen_manpage in coreutils - Rust

Function coreutils::gen_manpage

source ·
pub(crate) fn gen_manpage<T: Args>(
-    args: impl Iterator<Item = OsString>,
-    util_map: &OrderedMap<&'static str, (fn(_: T) -> i32, fn() -> Command)>
-) -> !
Expand description

Generate the manpage for the utility in the first parameter

-
\ No newline at end of file diff --git a/coreutils/dev/coreutils/fn.main.html b/coreutils/dev/coreutils/fn.main.html deleted file mode 100644 index e5bc2e9a1..000000000 --- a/coreutils/dev/coreutils/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in coreutils - Rust

Function coreutils::main

source ·
pub(crate) fn main()
\ No newline at end of file diff --git a/coreutils/dev/coreutils/fn.name.html b/coreutils/dev/coreutils/fn.name.html deleted file mode 100644 index effd1b2c9..000000000 --- a/coreutils/dev/coreutils/fn.name.html +++ /dev/null @@ -1 +0,0 @@ -name in coreutils - Rust

Function coreutils::name

source ·
pub(crate) fn name(binary_path: &Path) -> Option<&str>
\ No newline at end of file diff --git a/coreutils/dev/coreutils/fn.usage.html b/coreutils/dev/coreutils/fn.usage.html deleted file mode 100644 index 25f828177..000000000 --- a/coreutils/dev/coreutils/fn.usage.html +++ /dev/null @@ -1,4 +0,0 @@ -usage in coreutils - Rust

Function coreutils::usage

source ·
pub(crate) fn usage<T>(
-    utils: &OrderedMap<&'static str, (fn(_: T) -> i32, fn() -> Command)>,
-    name: &str
-)
\ No newline at end of file diff --git a/coreutils/dev/coreutils/fn.util_map.html b/coreutils/dev/coreutils/fn.util_map.html deleted file mode 100644 index aa71c31d0..000000000 --- a/coreutils/dev/coreutils/fn.util_map.html +++ /dev/null @@ -1,3 +0,0 @@ -util_map in coreutils - Rust

Function coreutils::util_map

source ·
pub(crate) fn util_map<T: Args>(
-    
-) -> OrderedMap<&'static str, (fn(_: T) -> i32, fn() -> Command)>
\ No newline at end of file diff --git a/coreutils/dev/coreutils/index.html b/coreutils/dev/coreutils/index.html deleted file mode 100644 index 39a249563..000000000 --- a/coreutils/dev/coreutils/index.html +++ /dev/null @@ -1 +0,0 @@ -coreutils - Rust

Crate coreutils

source ·

Constants

Functions

Type Definitions

\ No newline at end of file diff --git a/coreutils/dev/coreutils/sidebar-items.js b/coreutils/dev/coreutils/sidebar-items.js deleted file mode 100644 index 2aefa1167..000000000 --- a/coreutils/dev/coreutils/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["VERSION"],"fn":["binary_path","gen_completions","gen_coreutils_app","gen_manpage","main","name","usage","util_map"],"type":["UtilityMap"]}; \ No newline at end of file diff --git a/coreutils/dev/coreutils/type.UtilityMap.html b/coreutils/dev/coreutils/type.UtilityMap.html deleted file mode 100644 index 67b524e7a..000000000 --- a/coreutils/dev/coreutils/type.UtilityMap.html +++ /dev/null @@ -1 +0,0 @@ -UtilityMap in coreutils - Rust

Type Definition coreutils::UtilityMap

source ·
pub(crate) type UtilityMap<T> = OrderedMap<&'static str, (fn(_: T) -> i32, fn() -> Command)>;
\ No newline at end of file diff --git a/coreutils/dev/cp/all.html b/coreutils/dev/cp/all.html deleted file mode 100644 index 650b92848..000000000 --- a/coreutils/dev/cp/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/cp/fn.main.html b/coreutils/dev/cp/fn.main.html deleted file mode 100644 index 684902e85..000000000 --- a/coreutils/dev/cp/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in cp - Rust

Function cp::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/cp/index.html b/coreutils/dev/cp/index.html deleted file mode 100644 index ca39dea16..000000000 --- a/coreutils/dev/cp/index.html +++ /dev/null @@ -1 +0,0 @@ -cp - Rust

Crate cp

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/cp/sidebar-items.js b/coreutils/dev/cp/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/cp/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/crates.js b/coreutils/dev/crates.js deleted file mode 100644 index 57faae0da..000000000 --- a/coreutils/dev/crates.js +++ /dev/null @@ -1 +0,0 @@ -window.ALL_CRATES = ["arch","base32","base64","basename","basenc","cat","chcon","chgrp","chmod","chown","chroot","cksum","comm","coreutils","cp","csplit","cut","date","dd","df","dir","dircolors","dirname","du","echo","env","expand","expr","factor","false","fmt","fold","groups","hashsum","head","hostid","hostname","id","install","join","kill","libstdbuf","link","ln","logname","ls","mkdir","mkfifo","mknod","mktemp","more","mv","nice","nl","nohup","nproc","numfmt","od","paste","pathchk","pinky","pr","printenv","printf","ptx","pwd","readlink","realpath","relpath","rm","rmdir","runcon","seq","shred","shuf","sleep","sort","split","stat","stdbuf","stty","sum","sync","tac","tail","tee","test","timeout","touch","tr","true","truncate","tsort","tty","uname","unexpand","uniq","unlink","uptime","users","uu_arch","uu_base32","uu_base64","uu_basename","uu_basenc","uu_cat","uu_chcon","uu_chgrp","uu_chmod","uu_chown","uu_chroot","uu_cksum","uu_comm","uu_cp","uu_csplit","uu_cut","uu_date","uu_dd","uu_df","uu_dir","uu_dircolors","uu_dirname","uu_du","uu_echo","uu_env","uu_expand","uu_expr","uu_factor","uu_false","uu_fmt","uu_fold","uu_groups","uu_hashsum","uu_head","uu_hostid","uu_hostname","uu_id","uu_install","uu_join","uu_kill","uu_link","uu_ln","uu_logname","uu_ls","uu_mkdir","uu_mkfifo","uu_mknod","uu_mktemp","uu_more","uu_mv","uu_nice","uu_nl","uu_nohup","uu_nproc","uu_numfmt","uu_od","uu_paste","uu_pathchk","uu_pinky","uu_pr","uu_printenv","uu_printf","uu_ptx","uu_pwd","uu_readlink","uu_realpath","uu_relpath","uu_rm","uu_rmdir","uu_runcon","uu_seq","uu_shred","uu_shuf","uu_sleep","uu_sort","uu_split","uu_stat","uu_stdbuf","uu_stty","uu_sum","uu_sync","uu_tac","uu_tail","uu_tee","uu_test","uu_timeout","uu_touch","uu_tr","uu_true","uu_truncate","uu_tsort","uu_tty","uu_uname","uu_unexpand","uu_uniq","uu_unlink","uu_uptime","uu_users","uu_vdir","uu_wc","uu_who","uu_whoami","uu_yes","uucore","uucore_procs","uudoc","uuhelp_parser","vdir","wc","who","whoami","yes"]; \ No newline at end of file diff --git a/coreutils/dev/csplit/all.html b/coreutils/dev/csplit/all.html deleted file mode 100644 index 2517d03a6..000000000 --- a/coreutils/dev/csplit/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/csplit/fn.main.html b/coreutils/dev/csplit/fn.main.html deleted file mode 100644 index 07a58a79c..000000000 --- a/coreutils/dev/csplit/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in csplit - Rust

Function csplit::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/csplit/index.html b/coreutils/dev/csplit/index.html deleted file mode 100644 index 6862f1d25..000000000 --- a/coreutils/dev/csplit/index.html +++ /dev/null @@ -1 +0,0 @@ -csplit - Rust
\ No newline at end of file diff --git a/coreutils/dev/csplit/sidebar-items.js b/coreutils/dev/csplit/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/csplit/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/cut/all.html b/coreutils/dev/cut/all.html deleted file mode 100644 index 30bf7b0af..000000000 --- a/coreutils/dev/cut/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/cut/fn.main.html b/coreutils/dev/cut/fn.main.html deleted file mode 100644 index 85bf2feb9..000000000 --- a/coreutils/dev/cut/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in cut - Rust

Function cut::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/cut/index.html b/coreutils/dev/cut/index.html deleted file mode 100644 index 38ede5f67..000000000 --- a/coreutils/dev/cut/index.html +++ /dev/null @@ -1 +0,0 @@ -cut - Rust
\ No newline at end of file diff --git a/coreutils/dev/cut/sidebar-items.js b/coreutils/dev/cut/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/cut/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/date/all.html b/coreutils/dev/date/all.html deleted file mode 100644 index 3ec702120..000000000 --- a/coreutils/dev/date/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/date/fn.main.html b/coreutils/dev/date/fn.main.html deleted file mode 100644 index a8ee1a989..000000000 --- a/coreutils/dev/date/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in date - Rust

Function date::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/date/index.html b/coreutils/dev/date/index.html deleted file mode 100644 index 67aa836e9..000000000 --- a/coreutils/dev/date/index.html +++ /dev/null @@ -1 +0,0 @@ -date - Rust
\ No newline at end of file diff --git a/coreutils/dev/date/sidebar-items.js b/coreutils/dev/date/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/date/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/dd/all.html b/coreutils/dev/dd/all.html deleted file mode 100644 index 699acd2bf..000000000 --- a/coreutils/dev/dd/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/dd/fn.main.html b/coreutils/dev/dd/fn.main.html deleted file mode 100644 index ce9a0dd57..000000000 --- a/coreutils/dev/dd/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in dd - Rust

Function dd::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/dd/index.html b/coreutils/dev/dd/index.html deleted file mode 100644 index d1ffc67be..000000000 --- a/coreutils/dev/dd/index.html +++ /dev/null @@ -1 +0,0 @@ -dd - Rust

Crate dd

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/dd/sidebar-items.js b/coreutils/dev/dd/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/dd/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/df/all.html b/coreutils/dev/df/all.html deleted file mode 100644 index bfe61d885..000000000 --- a/coreutils/dev/df/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/df/fn.main.html b/coreutils/dev/df/fn.main.html deleted file mode 100644 index c9ba391b5..000000000 --- a/coreutils/dev/df/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in df - Rust

Function df::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/df/index.html b/coreutils/dev/df/index.html deleted file mode 100644 index e1cc19069..000000000 --- a/coreutils/dev/df/index.html +++ /dev/null @@ -1 +0,0 @@ -df - Rust

Crate df

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/df/sidebar-items.js b/coreutils/dev/df/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/df/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/dir/all.html b/coreutils/dev/dir/all.html deleted file mode 100644 index 5ed24d4df..000000000 --- a/coreutils/dev/dir/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/dir/fn.main.html b/coreutils/dev/dir/fn.main.html deleted file mode 100644 index 8703ae5ae..000000000 --- a/coreutils/dev/dir/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in dir - Rust

Function dir::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/dir/index.html b/coreutils/dev/dir/index.html deleted file mode 100644 index 9ed8b681c..000000000 --- a/coreutils/dev/dir/index.html +++ /dev/null @@ -1 +0,0 @@ -dir - Rust
\ No newline at end of file diff --git a/coreutils/dev/dir/sidebar-items.js b/coreutils/dev/dir/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/dir/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/dircolors/all.html b/coreutils/dev/dircolors/all.html deleted file mode 100644 index a9ce3611b..000000000 --- a/coreutils/dev/dircolors/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/dircolors/fn.main.html b/coreutils/dev/dircolors/fn.main.html deleted file mode 100644 index a517dec4e..000000000 --- a/coreutils/dev/dircolors/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in dircolors - Rust

Function dircolors::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/dircolors/index.html b/coreutils/dev/dircolors/index.html deleted file mode 100644 index 6cfa8cb83..000000000 --- a/coreutils/dev/dircolors/index.html +++ /dev/null @@ -1 +0,0 @@ -dircolors - Rust
\ No newline at end of file diff --git a/coreutils/dev/dircolors/sidebar-items.js b/coreutils/dev/dircolors/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/dircolors/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/dirname/all.html b/coreutils/dev/dirname/all.html deleted file mode 100644 index 820e4930f..000000000 --- a/coreutils/dev/dirname/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/dirname/fn.main.html b/coreutils/dev/dirname/fn.main.html deleted file mode 100644 index 8c154bace..000000000 --- a/coreutils/dev/dirname/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in dirname - Rust

Function dirname::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/dirname/index.html b/coreutils/dev/dirname/index.html deleted file mode 100644 index 63b162a27..000000000 --- a/coreutils/dev/dirname/index.html +++ /dev/null @@ -1 +0,0 @@ -dirname - Rust
\ No newline at end of file diff --git a/coreutils/dev/dirname/sidebar-items.js b/coreutils/dev/dirname/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/dirname/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/du/all.html b/coreutils/dev/du/all.html deleted file mode 100644 index 22115de5e..000000000 --- a/coreutils/dev/du/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/du/fn.main.html b/coreutils/dev/du/fn.main.html deleted file mode 100644 index fc7cd30f8..000000000 --- a/coreutils/dev/du/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in du - Rust

Function du::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/du/index.html b/coreutils/dev/du/index.html deleted file mode 100644 index 346a75af2..000000000 --- a/coreutils/dev/du/index.html +++ /dev/null @@ -1 +0,0 @@ -du - Rust

Crate du

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/du/sidebar-items.js b/coreutils/dev/du/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/du/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/echo/all.html b/coreutils/dev/echo/all.html deleted file mode 100644 index 805c6f6f7..000000000 --- a/coreutils/dev/echo/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/echo/fn.main.html b/coreutils/dev/echo/fn.main.html deleted file mode 100644 index f07cf2ab1..000000000 --- a/coreutils/dev/echo/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in echo - Rust

Function echo::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/echo/index.html b/coreutils/dev/echo/index.html deleted file mode 100644 index 86d808a33..000000000 --- a/coreutils/dev/echo/index.html +++ /dev/null @@ -1 +0,0 @@ -echo - Rust
\ No newline at end of file diff --git a/coreutils/dev/echo/sidebar-items.js b/coreutils/dev/echo/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/echo/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/env/all.html b/coreutils/dev/env/all.html deleted file mode 100644 index f4ad97983..000000000 --- a/coreutils/dev/env/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/env/fn.main.html b/coreutils/dev/env/fn.main.html deleted file mode 100644 index ec08c0736..000000000 --- a/coreutils/dev/env/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in env - Rust

Function env::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/env/index.html b/coreutils/dev/env/index.html deleted file mode 100644 index e74b66b97..000000000 --- a/coreutils/dev/env/index.html +++ /dev/null @@ -1 +0,0 @@ -env - Rust
\ No newline at end of file diff --git a/coreutils/dev/env/sidebar-items.js b/coreutils/dev/env/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/env/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/expand/all.html b/coreutils/dev/expand/all.html deleted file mode 100644 index 8ec63eec1..000000000 --- a/coreutils/dev/expand/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/expand/fn.main.html b/coreutils/dev/expand/fn.main.html deleted file mode 100644 index 51e7b8c88..000000000 --- a/coreutils/dev/expand/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in expand - Rust

Function expand::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/expand/index.html b/coreutils/dev/expand/index.html deleted file mode 100644 index 8b2ebfc17..000000000 --- a/coreutils/dev/expand/index.html +++ /dev/null @@ -1 +0,0 @@ -expand - Rust
\ No newline at end of file diff --git a/coreutils/dev/expand/sidebar-items.js b/coreutils/dev/expand/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/expand/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/expr/all.html b/coreutils/dev/expr/all.html deleted file mode 100644 index 702b478e9..000000000 --- a/coreutils/dev/expr/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/expr/fn.main.html b/coreutils/dev/expr/fn.main.html deleted file mode 100644 index 3a1c497aa..000000000 --- a/coreutils/dev/expr/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in expr - Rust

Function expr::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/expr/index.html b/coreutils/dev/expr/index.html deleted file mode 100644 index d3821b4e3..000000000 --- a/coreutils/dev/expr/index.html +++ /dev/null @@ -1 +0,0 @@ -expr - Rust
\ No newline at end of file diff --git a/coreutils/dev/expr/sidebar-items.js b/coreutils/dev/expr/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/expr/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/factor/all.html b/coreutils/dev/factor/all.html deleted file mode 100644 index 9b46d4fc2..000000000 --- a/coreutils/dev/factor/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/factor/fn.main.html b/coreutils/dev/factor/fn.main.html deleted file mode 100644 index a4223210b..000000000 --- a/coreutils/dev/factor/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in factor - Rust

Function factor::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/factor/index.html b/coreutils/dev/factor/index.html deleted file mode 100644 index 889fcf30e..000000000 --- a/coreutils/dev/factor/index.html +++ /dev/null @@ -1 +0,0 @@ -factor - Rust
\ No newline at end of file diff --git a/coreutils/dev/factor/sidebar-items.js b/coreutils/dev/factor/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/factor/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/false/all.html b/coreutils/dev/false/all.html deleted file mode 100644 index cf92ecbf4..000000000 --- a/coreutils/dev/false/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/false/fn.main.html b/coreutils/dev/false/fn.main.html deleted file mode 100644 index a51a65ac8..000000000 --- a/coreutils/dev/false/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in false - Rust

Function false::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/false/index.html b/coreutils/dev/false/index.html deleted file mode 100644 index 51fd213df..000000000 --- a/coreutils/dev/false/index.html +++ /dev/null @@ -1 +0,0 @@ -false - Rust
\ No newline at end of file diff --git a/coreutils/dev/false/sidebar-items.js b/coreutils/dev/false/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/false/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/fmt/all.html b/coreutils/dev/fmt/all.html deleted file mode 100644 index 0146cec39..000000000 --- a/coreutils/dev/fmt/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/fmt/fn.main.html b/coreutils/dev/fmt/fn.main.html deleted file mode 100644 index 84178efee..000000000 --- a/coreutils/dev/fmt/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in fmt - Rust

Function fmt::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/fmt/index.html b/coreutils/dev/fmt/index.html deleted file mode 100644 index f26b3c11b..000000000 --- a/coreutils/dev/fmt/index.html +++ /dev/null @@ -1 +0,0 @@ -fmt - Rust
\ No newline at end of file diff --git a/coreutils/dev/fmt/sidebar-items.js b/coreutils/dev/fmt/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/fmt/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/fold/all.html b/coreutils/dev/fold/all.html deleted file mode 100644 index 44b6fdde4..000000000 --- a/coreutils/dev/fold/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/fold/fn.main.html b/coreutils/dev/fold/fn.main.html deleted file mode 100644 index 520d93748..000000000 --- a/coreutils/dev/fold/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in fold - Rust

Function fold::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/fold/index.html b/coreutils/dev/fold/index.html deleted file mode 100644 index 333ee20b0..000000000 --- a/coreutils/dev/fold/index.html +++ /dev/null @@ -1 +0,0 @@ -fold - Rust
\ No newline at end of file diff --git a/coreutils/dev/fold/sidebar-items.js b/coreutils/dev/fold/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/fold/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/groups/all.html b/coreutils/dev/groups/all.html deleted file mode 100644 index 1ed34ba77..000000000 --- a/coreutils/dev/groups/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/groups/fn.main.html b/coreutils/dev/groups/fn.main.html deleted file mode 100644 index a0d1926c1..000000000 --- a/coreutils/dev/groups/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in groups - Rust

Function groups::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/groups/index.html b/coreutils/dev/groups/index.html deleted file mode 100644 index eb55fed7f..000000000 --- a/coreutils/dev/groups/index.html +++ /dev/null @@ -1 +0,0 @@ -groups - Rust
\ No newline at end of file diff --git a/coreutils/dev/groups/sidebar-items.js b/coreutils/dev/groups/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/groups/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/hashsum/all.html b/coreutils/dev/hashsum/all.html deleted file mode 100644 index a622b7ef5..000000000 --- a/coreutils/dev/hashsum/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/hashsum/fn.main.html b/coreutils/dev/hashsum/fn.main.html deleted file mode 100644 index 11aab448a..000000000 --- a/coreutils/dev/hashsum/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in hashsum - Rust

Function hashsum::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/hashsum/index.html b/coreutils/dev/hashsum/index.html deleted file mode 100644 index 116173600..000000000 --- a/coreutils/dev/hashsum/index.html +++ /dev/null @@ -1 +0,0 @@ -hashsum - Rust
\ No newline at end of file diff --git a/coreutils/dev/hashsum/sidebar-items.js b/coreutils/dev/hashsum/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/hashsum/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/head/all.html b/coreutils/dev/head/all.html deleted file mode 100644 index 8b040e288..000000000 --- a/coreutils/dev/head/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/head/fn.main.html b/coreutils/dev/head/fn.main.html deleted file mode 100644 index d7b722d24..000000000 --- a/coreutils/dev/head/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in head - Rust

Function head::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/head/index.html b/coreutils/dev/head/index.html deleted file mode 100644 index ed390258e..000000000 --- a/coreutils/dev/head/index.html +++ /dev/null @@ -1 +0,0 @@ -head - Rust
\ No newline at end of file diff --git a/coreutils/dev/head/sidebar-items.js b/coreutils/dev/head/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/head/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/help.html b/coreutils/dev/help.html deleted file mode 100644 index 59b11eb7e..000000000 --- a/coreutils/dev/help.html +++ /dev/null @@ -1 +0,0 @@ -Rustdoc help

Rustdoc help

Back
\ No newline at end of file diff --git a/coreutils/dev/hostid/all.html b/coreutils/dev/hostid/all.html deleted file mode 100644 index 3ba8114dc..000000000 --- a/coreutils/dev/hostid/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/hostid/fn.main.html b/coreutils/dev/hostid/fn.main.html deleted file mode 100644 index 8411e16f6..000000000 --- a/coreutils/dev/hostid/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in hostid - Rust

Function hostid::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/hostid/index.html b/coreutils/dev/hostid/index.html deleted file mode 100644 index a4e8ae6cd..000000000 --- a/coreutils/dev/hostid/index.html +++ /dev/null @@ -1 +0,0 @@ -hostid - Rust
\ No newline at end of file diff --git a/coreutils/dev/hostid/sidebar-items.js b/coreutils/dev/hostid/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/hostid/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/hostname/all.html b/coreutils/dev/hostname/all.html deleted file mode 100644 index 13bed3eba..000000000 --- a/coreutils/dev/hostname/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/hostname/fn.main.html b/coreutils/dev/hostname/fn.main.html deleted file mode 100644 index 323b5f16e..000000000 --- a/coreutils/dev/hostname/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in hostname - Rust

Function hostname::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/hostname/index.html b/coreutils/dev/hostname/index.html deleted file mode 100644 index 853ff8522..000000000 --- a/coreutils/dev/hostname/index.html +++ /dev/null @@ -1 +0,0 @@ -hostname - Rust
\ No newline at end of file diff --git a/coreutils/dev/hostname/sidebar-items.js b/coreutils/dev/hostname/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/hostname/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/id/all.html b/coreutils/dev/id/all.html deleted file mode 100644 index e3f450b3c..000000000 --- a/coreutils/dev/id/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/id/fn.main.html b/coreutils/dev/id/fn.main.html deleted file mode 100644 index bb5de7d1b..000000000 --- a/coreutils/dev/id/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in id - Rust

Function id::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/id/index.html b/coreutils/dev/id/index.html deleted file mode 100644 index 983f5411e..000000000 --- a/coreutils/dev/id/index.html +++ /dev/null @@ -1 +0,0 @@ -id - Rust

Crate id

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/id/sidebar-items.js b/coreutils/dev/id/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/id/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/implementors/clap_builder/builder/value_parser/trait.TypedValueParser.js b/coreutils/dev/implementors/clap_builder/builder/value_parser/trait.TypedValueParser.js deleted file mode 100644 index 68d166589..000000000 --- a/coreutils/dev/implementors/clap_builder/builder/value_parser/trait.TypedValueParser.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[["impl TypedValueParser for ShortcutValueParser"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/clone/trait.Clone.js b/coreutils/dev/implementors/core/clone/trait.Clone.js deleted file mode 100644 index c0aa57718..000000000 --- a/coreutils/dev/implementors/core/clone/trait.Clone.js +++ /dev/null @@ -1,14 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl Clone for Preserve"],["impl Clone for ClobberMode"],["impl Clone for SparseMode"],["impl Clone for ReflinkMode"],["impl Clone for OverwriteMode"]], -"uu_dd":[["impl Clone for Alarm"]], -"uu_factor":[["impl Clone for Factors"]], -"uu_install":[["impl Clone for MainFunction"]], -"uu_kill":[["impl Clone for Mode"]], -"uu_ln":[["impl Clone for OverwriteMode"]], -"uu_mv":[["impl Clone for OverwriteMode"]], -"uu_numfmt":[["impl Clone for RoundMethod"]], -"uu_sort":[["impl<'a> Clone for Line<'a>"],["impl Clone for GeneralF64ParseResult"],["impl Clone for GlobalSettings"]], -"uu_stty":[["impl<T: Clone> Clone for Flag<T>"]], -"uu_tail":[["impl Clone for BytesChunk"],["impl Clone for FollowMode"],["impl Clone for Signum"]], -"uucore":[["impl Clone for BackupMode"],["impl Clone for Passwd"],["impl Clone for UpdateMode"],["impl Clone for Verbosity"],["impl Clone for MissingHandling"],["impl Clone for FsUsage"],["impl Clone for MountInfo"],["impl Clone for ResolveMode"],["impl Clone for Quotes"],["impl Clone for ShortcutValueParser"],["impl Clone for Group"],["impl Clone for VerbosityLevel"],["impl Clone for Format"],["impl Clone for LineEnding"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/cmp/trait.Eq.js b/coreutils/dev/implementors/core/cmp/trait.Eq.js deleted file mode 100644 index 97472e621..000000000 --- a/coreutils/dev/implementors/core/cmp/trait.Eq.js +++ /dev/null @@ -1,12 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl Eq for Preserve"],["impl Eq for OverwriteMode"],["impl Eq for SparseMode"],["impl Eq for ClobberMode"],["impl Eq for ReflinkMode"]], -"uu_dircolors":[["impl Eq for OutputFmt"]], -"uu_factor":[["impl Eq for Factors"]], -"uu_install":[["impl Eq for MainFunction"]], -"uu_ln":[["impl Eq for OverwriteMode"]], -"uu_ls":[["impl Eq for Format"]], -"uu_mv":[["impl Eq for OverwriteMode"]], -"uu_numfmt":[["impl Eq for FormatOptions"],["impl Eq for InvalidModes"]], -"uu_tail":[["impl Eq for FollowMode"],["impl Eq for FilterMode"],["impl Eq for BytesChunk"],["impl Eq for Signum"]], -"uucore":[["impl Eq for TraverseSymlinks"],["impl Eq for Verbosity"],["impl Eq for Range"],["impl Eq for VerbosityLevel"],["impl Eq for BackupError"],["impl Eq for ParseSizeError"],["impl Eq for ResolveMode"],["impl Eq for FileInformation"],["impl Eq for UpdateMode"],["impl Eq for MissingHandling"],["impl Eq for BackupMode"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/cmp/trait.Ord.js b/coreutils/dev/implementors/core/cmp/trait.Ord.js deleted file mode 100644 index f86137904..000000000 --- a/coreutils/dev/implementors/core/cmp/trait.Ord.js +++ /dev/null @@ -1,4 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl Ord for Preserve"]], -"uucore":[["impl Ord for Range"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/cmp/trait.PartialEq.js b/coreutils/dev/implementors/core/cmp/trait.PartialEq.js deleted file mode 100644 index 70777d681..000000000 --- a/coreutils/dev/implementors/core/cmp/trait.PartialEq.js +++ /dev/null @@ -1,13 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl PartialEq<ClobberMode> for ClobberMode"],["impl PartialEq<ReflinkMode> for ReflinkMode"],["impl PartialEq<OverwriteMode> for OverwriteMode"],["impl PartialEq<SparseMode> for SparseMode"],["impl PartialEq<Preserve> for Preserve"]], -"uu_dircolors":[["impl PartialEq<OutputFmt> for OutputFmt"]], -"uu_factor":[["impl PartialEq<Factors> for Factors"]], -"uu_install":[["impl PartialEq<MainFunction> for MainFunction"]], -"uu_ln":[["impl PartialEq<OverwriteMode> for OverwriteMode"]], -"uu_ls":[["impl PartialEq<Format> for Format"]], -"uu_mv":[["impl PartialEq<OverwriteMode> for OverwriteMode"]], -"uu_numfmt":[["impl PartialEq<FormatOptions> for FormatOptions"],["impl PartialEq<InvalidModes> for InvalidModes"]], -"uu_sort":[["impl PartialEq<GeneralF64ParseResult> for GeneralF64ParseResult"]], -"uu_tail":[["impl PartialEq<FilterMode> for FilterMode"],["impl PartialEq<BytesChunk> for BytesChunk"],["impl PartialEq<Signum> for Signum"],["impl PartialEq<FollowMode> for FollowMode"]], -"uucore":[["impl PartialEq<Range> for Range"],["impl PartialEq<LineEnding> for LineEnding"],["impl PartialEq<VerbosityLevel> for VerbosityLevel"],["impl PartialEq<BackupError> for BackupError"],["impl PartialEq<BackupMode> for BackupMode"],["impl PartialEq<Verbosity> for Verbosity"],["impl PartialEq<ParseSizeError> for ParseSizeError"],["impl PartialEq<TraverseSymlinks> for TraverseSymlinks"],["impl PartialEq<FileInformation> for FileInformation"],["impl PartialEq<ResolveMode> for ResolveMode"],["impl PartialEq<MissingHandling> for MissingHandling"],["impl PartialEq<UpdateMode> for UpdateMode"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/cmp/trait.PartialOrd.js b/coreutils/dev/implementors/core/cmp/trait.PartialOrd.js deleted file mode 100644 index 049e78376..000000000 --- a/coreutils/dev/implementors/core/cmp/trait.PartialOrd.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl PartialOrd<Preserve> for Preserve"]], -"uu_sort":[["impl PartialOrd<GeneralF64ParseResult> for GeneralF64ParseResult"]], -"uucore":[["impl PartialOrd<Range> for Range"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/convert/trait.From.js b/coreutils/dev/implementors/core/convert/trait.From.js deleted file mode 100644 index 33b52d09d..000000000 --- a/coreutils/dev/implementors/core/convert/trait.From.js +++ /dev/null @@ -1,4 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl From<Error> for Error"],["impl<'a> From<Context<String, Error>> for Error"],["impl From<Error> for Error"],["impl From<StripPrefixError> for Error"],["impl<'a> From<Context<&'a str, Error>> for Error"],["impl From<String> for Error"],["impl From<&'static str> for Error"]], -"uucore":[["impl From<Error<RichFormatter>> for Box<dyn UError>"],["impl From<DecodeError> for DecodeError"],["impl<T> From<T> for Box<dyn UError>where\n T: UError + 'static,"],["impl From<i32> for Box<dyn UError>"],["impl From<Errno> for UIoError"],["impl From<Error> for DecodeError"],["impl<I, T> From<I> for ShortcutValueParserwhere\n I: IntoIterator<Item = T>,\n T: Into<PossibleValue>,"],["impl From<LineEnding> for u8"],["impl From<Error> for Box<dyn UError>"],["impl From<Errno> for Box<dyn UError>"],["impl From<Error> for UIoError"],["impl From<DecodeError> for DecodeError"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/default/trait.Default.js b/coreutils/dev/implementors/core/default/trait.Default.js deleted file mode 100644 index c283ecea1..000000000 --- a/coreutils/dev/implementors/core/default/trait.Default.js +++ /dev/null @@ -1,9 +0,0 @@ -(function() {var implementors = { -"uu_fmt":[["impl Default for FmtOptions"]], -"uu_nl":[["impl Default for Settings"]], -"uu_numfmt":[["impl Default for FormatOptions"]], -"uu_sort":[["impl Default for GlobalSettings"]], -"uu_stty":[["impl Default for TermSize"]], -"uu_tail":[["impl Default for Settings"],["impl Default for FilterMode"]], -"uucore":[["impl<'parser> Default for Parser<'parser>"],["impl Default for LineEnding"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/error/trait.Error.js b/coreutils/dev/implementors/core/error/trait.Error.js deleted file mode 100644 index 727e49e7f..000000000 --- a/coreutils/dev/implementors/core/error/trait.Error.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl Error for Error"]], -"uu_numfmt":[["impl Error for NumfmtError"]], -"uucore":[["impl Error for ExitCode"],["impl Error for ParseSizeError"],["impl Error for UUsageError"],["impl Error for ClapErrorWrapper"],["impl Error for DecodeError"],["impl Error for USimpleError"],["impl Error for UIoError"],["impl Error for BackupError"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/fmt/trait.Debug.js b/coreutils/dev/implementors/core/fmt/trait.Debug.js deleted file mode 100644 index 42d8c143d..000000000 --- a/coreutils/dev/implementors/core/fmt/trait.Debug.js +++ /dev/null @@ -1,14 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl Debug for Error"],["impl Debug for Preserve"],["impl Debug for Attributes"]], -"uu_dd":[["impl Debug for Alarm"]], -"uu_dircolors":[["impl Debug for OutputFmt"]], -"uu_factor":[["impl Debug for Factors"]], -"uu_ln":[["impl Debug for OverwriteMode"]], -"uu_ls":[["impl Debug for Format"]], -"uu_numfmt":[["impl Debug for FormatOptions"],["impl Debug for InvalidModes"],["impl Debug for NumfmtError"]], -"uu_sort":[["impl<'a> Debug for Line<'a>"],["impl Debug for GeneralF64ParseResult"]], -"uu_stat":[["impl Debug for OutputType"]], -"uu_stty":[["impl<T: Debug> Debug for Flag<T>"],["impl Debug for TermSize"]], -"uu_tail":[["impl Debug for VerificationResult"],["impl Debug for FollowMode"],["impl Debug for LinesChunk"],["impl Debug for Settings"],["impl Debug for FilterMode"],["impl Debug for BytesChunk"],["impl Debug for Signum"]], -"uucore":[["impl Debug for UIoError"],["impl Debug for USimpleError"],["impl Debug for Passwd"],["impl Debug for Verbosity"],["impl Debug for LineEnding"],["impl Debug for Range"],["impl Debug for MissingHandling"],["impl Debug for ResolveMode"],["impl Debug for FsUsage"],["impl Debug for ClapErrorWrapper"],["impl Debug for BackupError"],["impl Debug for DecodeError"],["impl Debug for ExitCode"],["impl Debug for UUsageError"],["impl Debug for BackupMode"],["impl Debug for ParseSizeError"],["impl Debug for UpdateMode"],["impl Debug for Group"],["impl Debug for VerbosityLevel"],["impl Debug for MountInfo"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/fmt/trait.Display.js b/coreutils/dev/implementors/core/fmt/trait.Display.js deleted file mode 100644 index 259124111..000000000 --- a/coreutils/dev/implementors/core/fmt/trait.Display.js +++ /dev/null @@ -1,6 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl Display for Error"]], -"uu_factor":[["impl Display for Factors"]], -"uu_numfmt":[["impl Display for NumfmtError"]], -"uucore":[["impl Display for UUsageError"],["impl Display for ParseSizeError"],["impl Display for BackupError"],["impl Display for ExitCode"],["impl Display for DecodeError"],["impl Display for LineEnding"],["impl Display for UIoError"],["impl Display for USimpleError"],["impl Display for ClapErrorWrapper"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/hash/trait.Hash.js b/coreutils/dev/implementors/core/hash/trait.Hash.js deleted file mode 100644 index d61a8101b..000000000 --- a/coreutils/dev/implementors/core/hash/trait.Hash.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[["impl Hash for FileInformation"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/iter/traits/iterator/trait.Iterator.js b/coreutils/dev/implementors/core/iter/traits/iterator/trait.Iterator.js deleted file mode 100644 index 155383850..000000000 --- a/coreutils/dev/implementors/core/iter/traits/iterator/trait.Iterator.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"uu_numfmt":[["impl<'a> Iterator for WhitespaceSplitter<'a>"]], -"uu_tail":[["impl<'a> Iterator for ReverseChunks<'a>"]], -"uucore":[["impl Iterator for UtmpxIter"],["impl<B: BufRead> Iterator for Lines<B>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/marker/trait.Copy.js b/coreutils/dev/implementors/core/marker/trait.Copy.js deleted file mode 100644 index dcb7a1797..000000000 --- a/coreutils/dev/implementors/core/marker/trait.Copy.js +++ /dev/null @@ -1,9 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl Copy for OverwriteMode"],["impl Copy for Preserve"],["impl Copy for ReflinkMode"],["impl Copy for SparseMode"],["impl Copy for ClobberMode"]], -"uu_kill":[["impl Copy for Mode"]], -"uu_numfmt":[["impl Copy for RoundMethod"]], -"uu_sort":[["impl Copy for GeneralF64ParseResult"]], -"uu_stty":[["impl<T: Copy> Copy for Flag<T>"]], -"uu_tail":[["impl Copy for FollowMode"],["impl Copy for Signum"]], -"uucore":[["impl Copy for Format"],["impl Copy for Quotes"],["impl Copy for ResolveMode"],["impl Copy for BackupMode"],["impl Copy for MissingHandling"],["impl Copy for LineEnding"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/marker/trait.Freeze.js b/coreutils/dev/implementors/core/marker/trait.Freeze.js deleted file mode 100644 index 2a876ddeb..000000000 --- a/coreutils/dev/implementors/core/marker/trait.Freeze.js +++ /dev/null @@ -1,22 +0,0 @@ -(function() {var implementors = { -"uu_base32":[["impl Freeze for Config",1,["uu_base32::base_common::Config"]]], -"uu_cp":[["impl Freeze for Error",1,["uu_cp::Error"]],["impl Freeze for ClobberMode",1,["uu_cp::ClobberMode"]],["impl Freeze for OverwriteMode",1,["uu_cp::OverwriteMode"]],["impl Freeze for ReflinkMode",1,["uu_cp::ReflinkMode"]],["impl Freeze for SparseMode",1,["uu_cp::SparseMode"]],["impl Freeze for TargetType",1,["uu_cp::TargetType"]],["impl Freeze for CopyMode",1,["uu_cp::CopyMode"]],["impl Freeze for Attributes",1,["uu_cp::Attributes"]],["impl Freeze for Preserve",1,["uu_cp::Preserve"]],["impl Freeze for Options",1,["uu_cp::Options"]]], -"uu_csplit":[["impl Freeze for CsplitOptions",1,["uu_csplit::CsplitOptions"]]], -"uu_dd":[["impl Freeze for Alarm",1,["uu_dd::Alarm"]]], -"uu_dircolors":[["impl Freeze for OutputFmt",1,["uu_dircolors::OutputFmt"]]], -"uu_factor":[["impl !Freeze for Factors",1,["uu_factor::factor::Factors"]]], -"uu_fmt":[["impl Freeze for FmtOptions",1,["uu_fmt::FmtOptions"]]], -"uu_install":[["impl Freeze for Behavior",1,["uu_install::Behavior"]],["impl Freeze for MainFunction",1,["uu_install::MainFunction"]]], -"uu_kill":[["impl Freeze for Mode",1,["uu_kill::Mode"]]], -"uu_ln":[["impl Freeze for Settings",1,["uu_ln::Settings"]],["impl Freeze for OverwriteMode",1,["uu_ln::OverwriteMode"]]], -"uu_ls":[["impl Freeze for Format",1,["uu_ls::Format"]],["impl Freeze for Config",1,["uu_ls::Config"]]], -"uu_mv":[["impl Freeze for Behavior",1,["uu_mv::Behavior"]],["impl Freeze for OverwriteMode",1,["uu_mv::OverwriteMode"]]], -"uu_nl":[["impl Freeze for Settings",1,["uu_nl::Settings"]]], -"uu_numfmt":[["impl Freeze for NumfmtError",1,["uu_numfmt::errors::NumfmtError"]],["impl<'a> Freeze for WhitespaceSplitter<'a>",1,["uu_numfmt::format::WhitespaceSplitter"]],["impl Freeze for TransformOptions",1,["uu_numfmt::options::TransformOptions"]],["impl Freeze for InvalidModes",1,["uu_numfmt::options::InvalidModes"]],["impl Freeze for NumfmtOptions",1,["uu_numfmt::options::NumfmtOptions"]],["impl Freeze for RoundMethod",1,["uu_numfmt::options::RoundMethod"]],["impl Freeze for FormatOptions",1,["uu_numfmt::options::FormatOptions"]]], -"uu_sort":[["impl Freeze for Output",1,["uu_sort::Output"]],["impl Freeze for GlobalSettings",1,["uu_sort::GlobalSettings"]],["impl<'a> Freeze for Line<'a>",1,["uu_sort::Line"]],["impl Freeze for GeneralF64ParseResult",1,["uu_sort::GeneralF64ParseResult"]]], -"uu_stat":[["impl Freeze for OutputType",1,["uu_stat::OutputType"]]], -"uu_stty":[["impl<T> Freeze for Flag<T>where\n T: Freeze,",1,["uu_stty::Flag"]],["impl Freeze for TermSize",1,["uu_stty::TermSize"]]], -"uu_tail":[["impl Freeze for Signum",1,["uu_tail::args::Signum"]],["impl Freeze for FilterMode",1,["uu_tail::args::FilterMode"]],["impl Freeze for FollowMode",1,["uu_tail::args::FollowMode"]],["impl Freeze for VerificationResult",1,["uu_tail::args::VerificationResult"]],["impl Freeze for Settings",1,["uu_tail::args::Settings"]],["impl<'a> Freeze for ReverseChunks<'a>",1,["uu_tail::chunks::ReverseChunks"]],["impl Freeze for BytesChunk",1,["uu_tail::chunks::BytesChunk"]],["impl Freeze for BytesChunkBuffer",1,["uu_tail::chunks::BytesChunkBuffer"]],["impl Freeze for LinesChunk",1,["uu_tail::chunks::LinesChunk"]],["impl Freeze for LinesChunkBuffer",1,["uu_tail::chunks::LinesChunkBuffer"]]], -"uucore":[["impl Freeze for DecodeError",1,["uucore::features::encoding::DecodeError"]],["impl Freeze for EncodeError",1,["uucore::features::encoding::EncodeError"]],["impl Freeze for Format",1,["uucore::features::encoding::Format"]],["impl<R> Freeze for Data<R>where\n R: Freeze,",1,["uucore::features::encoding::Data"]],["impl Freeze for FileInformation",1,["uucore::features::fs::FileInformation"]],["impl Freeze for MissingHandling",1,["uucore::features::fs::MissingHandling"]],["impl Freeze for ResolveMode",1,["uucore::features::fs::ResolveMode"]],["impl Freeze for MountInfo",1,["uucore::features::fsext::MountInfo"]],["impl Freeze for FsUsage",1,["uucore::features::fsext::FsUsage"]],["impl<B> Freeze for Lines<B>where\n B: Freeze,",1,["uucore::features::lines::Lines"]],["impl<T> Freeze for RingBuffer<T>",1,["uucore::features::ringbuffer::RingBuffer"]],["impl Freeze for Blake2b",1,["uucore::features::sum::Blake2b"]],["impl Freeze for Blake3",1,["uucore::features::sum::Blake3"]],["impl Freeze for Sm3",1,["uucore::features::sum::Sm3"]],["impl Freeze for CRC",1,["uucore::features::sum::CRC"]],["impl Freeze for BSD",1,["uucore::features::sum::BSD"]],["impl Freeze for SYSV",1,["uucore::features::sum::SYSV"]],["impl Freeze for Md5",1,["uucore::features::sum::Md5"]],["impl Freeze for Sha1",1,["uucore::features::sum::Sha1"]],["impl Freeze for Sha224",1,["uucore::features::sum::Sha224"]],["impl Freeze for Sha256",1,["uucore::features::sum::Sha256"]],["impl Freeze for Sha384",1,["uucore::features::sum::Sha384"]],["impl Freeze for Sha512",1,["uucore::features::sum::Sha512"]],["impl Freeze for Sha3_224",1,["uucore::features::sum::Sha3_224"]],["impl Freeze for Sha3_256",1,["uucore::features::sum::Sha3_256"]],["impl Freeze for Sha3_384",1,["uucore::features::sum::Sha3_384"]],["impl Freeze for Sha3_512",1,["uucore::features::sum::Sha3_512"]],["impl Freeze for Shake128",1,["uucore::features::sum::Shake128"]],["impl Freeze for Shake256",1,["uucore::features::sum::Shake256"]],["impl<'a> Freeze for DigestWriter<'a>",1,["uucore::features::sum::DigestWriter"]],["impl Freeze for Passwd",1,["uucore::features::entries::Passwd"]],["impl Freeze for Group",1,["uucore::features::entries::Group"]],["impl Freeze for VerbosityLevel",1,["uucore::features::perms::VerbosityLevel"]],["impl Freeze for Verbosity",1,["uucore::features::perms::Verbosity"]],["impl Freeze for IfFrom",1,["uucore::features::perms::IfFrom"]],["impl Freeze for TraverseSymlinks",1,["uucore::features::perms::TraverseSymlinks"]],["impl Freeze for ChownExecutor",1,["uucore::features::perms::ChownExecutor"]],["impl Freeze for GidUidOwnerFilter",1,["uucore::features::perms::GidUidOwnerFilter"]],["impl Freeze for Utmpx",1,["uucore::features::utmpx::Utmpx"]],["impl Freeze for UtmpxIter",1,["uucore::features::utmpx::UtmpxIter"]],["impl Freeze for BackupMode",1,["uucore::mods::backup_control::BackupMode"]],["impl Freeze for BackupError",1,["uucore::mods::backup_control::BackupError"]],["impl Freeze for USimpleError",1,["uucore::mods::error::USimpleError"]],["impl Freeze for UUsageError",1,["uucore::mods::error::UUsageError"]],["impl Freeze for UIoError",1,["uucore::mods::error::UIoError"]],["impl Freeze for ExitCode",1,["uucore::mods::error::ExitCode"]],["impl Freeze for ClapErrorWrapper",1,["uucore::mods::error::ClapErrorWrapper"]],["impl Freeze for LineEnding",1,["uucore::mods::line_ending::LineEnding"]],["impl Freeze for Range",1,["uucore::mods::ranges::Range"]],["impl Freeze for UpdateMode",1,["uucore::mods::update_control::UpdateMode"]],["impl Freeze for QuotingStyle",1,["uucore::mods::quoting_style::QuotingStyle"]],["impl Freeze for Quotes",1,["uucore::mods::quoting_style::Quotes"]],["impl<'parser> Freeze for Parser<'parser>",1,["uucore::parser::parse_size::Parser"]],["impl Freeze for ParseSizeError",1,["uucore::parser::parse_size::ParseSizeError"]],["impl Freeze for ShortcutValueParser",1,["uucore::parser::shortcut_value_parser::ShortcutValueParser"]]], -"uudoc":[["impl<'a, 'b> Freeze for MDWriter<'a, 'b>",1,["uudoc::MDWriter"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/marker/trait.Send.js b/coreutils/dev/implementors/core/marker/trait.Send.js deleted file mode 100644 index 7ab1c0e7f..000000000 --- a/coreutils/dev/implementors/core/marker/trait.Send.js +++ /dev/null @@ -1,22 +0,0 @@ -(function() {var implementors = { -"uu_base32":[["impl Send for Config",1,["uu_base32::base_common::Config"]]], -"uu_cp":[["impl Send for Error",1,["uu_cp::Error"]],["impl Send for ClobberMode",1,["uu_cp::ClobberMode"]],["impl Send for OverwriteMode",1,["uu_cp::OverwriteMode"]],["impl Send for ReflinkMode",1,["uu_cp::ReflinkMode"]],["impl Send for SparseMode",1,["uu_cp::SparseMode"]],["impl Send for TargetType",1,["uu_cp::TargetType"]],["impl Send for CopyMode",1,["uu_cp::CopyMode"]],["impl Send for Attributes",1,["uu_cp::Attributes"]],["impl Send for Preserve",1,["uu_cp::Preserve"]],["impl Send for Options",1,["uu_cp::Options"]]], -"uu_csplit":[["impl !Send for CsplitOptions",1,["uu_csplit::CsplitOptions"]]], -"uu_dd":[["impl Send for Alarm",1,["uu_dd::Alarm"]]], -"uu_dircolors":[["impl Send for OutputFmt",1,["uu_dircolors::OutputFmt"]]], -"uu_factor":[["impl Send for Factors",1,["uu_factor::factor::Factors"]]], -"uu_fmt":[["impl Send for FmtOptions",1,["uu_fmt::FmtOptions"]]], -"uu_install":[["impl Send for Behavior",1,["uu_install::Behavior"]],["impl Send for MainFunction",1,["uu_install::MainFunction"]]], -"uu_kill":[["impl Send for Mode",1,["uu_kill::Mode"]]], -"uu_ln":[["impl Send for Settings",1,["uu_ln::Settings"]],["impl Send for OverwriteMode",1,["uu_ln::OverwriteMode"]]], -"uu_ls":[["impl Send for Format",1,["uu_ls::Format"]],["impl Send for Config",1,["uu_ls::Config"]]], -"uu_mv":[["impl Send for Behavior",1,["uu_mv::Behavior"]],["impl Send for OverwriteMode",1,["uu_mv::OverwriteMode"]]], -"uu_nl":[["impl Send for Settings",1,["uu_nl::Settings"]]], -"uu_numfmt":[["impl Send for NumfmtError",1,["uu_numfmt::errors::NumfmtError"]],["impl<'a> Send for WhitespaceSplitter<'a>",1,["uu_numfmt::format::WhitespaceSplitter"]],["impl Send for TransformOptions",1,["uu_numfmt::options::TransformOptions"]],["impl Send for InvalidModes",1,["uu_numfmt::options::InvalidModes"]],["impl Send for NumfmtOptions",1,["uu_numfmt::options::NumfmtOptions"]],["impl Send for RoundMethod",1,["uu_numfmt::options::RoundMethod"]],["impl Send for FormatOptions",1,["uu_numfmt::options::FormatOptions"]]], -"uu_sort":[["impl Send for Output",1,["uu_sort::Output"]],["impl Send for GlobalSettings",1,["uu_sort::GlobalSettings"]],["impl<'a> Send for Line<'a>",1,["uu_sort::Line"]],["impl Send for GeneralF64ParseResult",1,["uu_sort::GeneralF64ParseResult"]]], -"uu_stat":[["impl Send for OutputType",1,["uu_stat::OutputType"]]], -"uu_stty":[["impl<T> Send for Flag<T>where\n T: Send,",1,["uu_stty::Flag"]],["impl Send for TermSize",1,["uu_stty::TermSize"]]], -"uu_tail":[["impl Send for Signum",1,["uu_tail::args::Signum"]],["impl Send for FilterMode",1,["uu_tail::args::FilterMode"]],["impl Send for FollowMode",1,["uu_tail::args::FollowMode"]],["impl Send for VerificationResult",1,["uu_tail::args::VerificationResult"]],["impl Send for Settings",1,["uu_tail::args::Settings"]],["impl<'a> Send for ReverseChunks<'a>",1,["uu_tail::chunks::ReverseChunks"]],["impl Send for BytesChunk",1,["uu_tail::chunks::BytesChunk"]],["impl Send for BytesChunkBuffer",1,["uu_tail::chunks::BytesChunkBuffer"]],["impl Send for LinesChunk",1,["uu_tail::chunks::LinesChunk"]],["impl Send for LinesChunkBuffer",1,["uu_tail::chunks::LinesChunkBuffer"]]], -"uucore":[["impl Send for DecodeError",1,["uucore::features::encoding::DecodeError"]],["impl Send for EncodeError",1,["uucore::features::encoding::EncodeError"]],["impl Send for Format",1,["uucore::features::encoding::Format"]],["impl<R> Send for Data<R>where\n R: Send,",1,["uucore::features::encoding::Data"]],["impl Send for FileInformation",1,["uucore::features::fs::FileInformation"]],["impl Send for MissingHandling",1,["uucore::features::fs::MissingHandling"]],["impl Send for ResolveMode",1,["uucore::features::fs::ResolveMode"]],["impl Send for MountInfo",1,["uucore::features::fsext::MountInfo"]],["impl Send for FsUsage",1,["uucore::features::fsext::FsUsage"]],["impl<B> Send for Lines<B>where\n B: Send,",1,["uucore::features::lines::Lines"]],["impl<T> Send for RingBuffer<T>where\n T: Send,",1,["uucore::features::ringbuffer::RingBuffer"]],["impl Send for Blake2b",1,["uucore::features::sum::Blake2b"]],["impl Send for Blake3",1,["uucore::features::sum::Blake3"]],["impl Send for Sm3",1,["uucore::features::sum::Sm3"]],["impl Send for CRC",1,["uucore::features::sum::CRC"]],["impl Send for BSD",1,["uucore::features::sum::BSD"]],["impl Send for SYSV",1,["uucore::features::sum::SYSV"]],["impl Send for Md5",1,["uucore::features::sum::Md5"]],["impl Send for Sha1",1,["uucore::features::sum::Sha1"]],["impl Send for Sha224",1,["uucore::features::sum::Sha224"]],["impl Send for Sha256",1,["uucore::features::sum::Sha256"]],["impl Send for Sha384",1,["uucore::features::sum::Sha384"]],["impl Send for Sha512",1,["uucore::features::sum::Sha512"]],["impl Send for Sha3_224",1,["uucore::features::sum::Sha3_224"]],["impl Send for Sha3_256",1,["uucore::features::sum::Sha3_256"]],["impl Send for Sha3_384",1,["uucore::features::sum::Sha3_384"]],["impl Send for Sha3_512",1,["uucore::features::sum::Sha3_512"]],["impl Send for Shake128",1,["uucore::features::sum::Shake128"]],["impl Send for Shake256",1,["uucore::features::sum::Shake256"]],["impl<'a> !Send for DigestWriter<'a>",1,["uucore::features::sum::DigestWriter"]],["impl Send for Passwd",1,["uucore::features::entries::Passwd"]],["impl Send for Group",1,["uucore::features::entries::Group"]],["impl Send for VerbosityLevel",1,["uucore::features::perms::VerbosityLevel"]],["impl Send for Verbosity",1,["uucore::features::perms::Verbosity"]],["impl Send for IfFrom",1,["uucore::features::perms::IfFrom"]],["impl Send for TraverseSymlinks",1,["uucore::features::perms::TraverseSymlinks"]],["impl Send for ChownExecutor",1,["uucore::features::perms::ChownExecutor"]],["impl Send for GidUidOwnerFilter",1,["uucore::features::perms::GidUidOwnerFilter"]],["impl Send for Utmpx",1,["uucore::features::utmpx::Utmpx"]],["impl !Send for UtmpxIter",1,["uucore::features::utmpx::UtmpxIter"]],["impl Send for BackupMode",1,["uucore::mods::backup_control::BackupMode"]],["impl Send for BackupError",1,["uucore::mods::backup_control::BackupError"]],["impl Send for USimpleError",1,["uucore::mods::error::USimpleError"]],["impl Send for UUsageError",1,["uucore::mods::error::UUsageError"]],["impl Send for UIoError",1,["uucore::mods::error::UIoError"]],["impl Send for ExitCode",1,["uucore::mods::error::ExitCode"]],["impl Send for ClapErrorWrapper",1,["uucore::mods::error::ClapErrorWrapper"]],["impl Send for LineEnding",1,["uucore::mods::line_ending::LineEnding"]],["impl Send for Range",1,["uucore::mods::ranges::Range"]],["impl Send for UpdateMode",1,["uucore::mods::update_control::UpdateMode"]],["impl Send for QuotingStyle",1,["uucore::mods::quoting_style::QuotingStyle"]],["impl Send for Quotes",1,["uucore::mods::quoting_style::Quotes"]],["impl<'parser> Send for Parser<'parser>",1,["uucore::parser::parse_size::Parser"]],["impl Send for ParseSizeError",1,["uucore::parser::parse_size::ParseSizeError"]],["impl Send for ShortcutValueParser",1,["uucore::parser::shortcut_value_parser::ShortcutValueParser"]]], -"uudoc":[["impl<'a, 'b> !Send for MDWriter<'a, 'b>",1,["uudoc::MDWriter"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/marker/trait.StructuralEq.js b/coreutils/dev/implementors/core/marker/trait.StructuralEq.js deleted file mode 100644 index 974b7aa54..000000000 --- a/coreutils/dev/implementors/core/marker/trait.StructuralEq.js +++ /dev/null @@ -1,12 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl StructuralEq for Preserve"],["impl StructuralEq for ReflinkMode"],["impl StructuralEq for SparseMode"],["impl StructuralEq for ClobberMode"],["impl StructuralEq for OverwriteMode"]], -"uu_dircolors":[["impl StructuralEq for OutputFmt"]], -"uu_factor":[["impl StructuralEq for Factors"]], -"uu_install":[["impl StructuralEq for MainFunction"]], -"uu_ln":[["impl StructuralEq for OverwriteMode"]], -"uu_ls":[["impl StructuralEq for Format"]], -"uu_mv":[["impl StructuralEq for OverwriteMode"]], -"uu_numfmt":[["impl StructuralEq for InvalidModes"],["impl StructuralEq for FormatOptions"]], -"uu_tail":[["impl StructuralEq for Signum"],["impl StructuralEq for BytesChunk"],["impl StructuralEq for FollowMode"],["impl StructuralEq for FilterMode"]], -"uucore":[["impl StructuralEq for Range"],["impl StructuralEq for ResolveMode"],["impl StructuralEq for BackupMode"],["impl StructuralEq for MissingHandling"],["impl StructuralEq for VerbosityLevel"],["impl StructuralEq for ParseSizeError"],["impl StructuralEq for TraverseSymlinks"],["impl StructuralEq for BackupError"],["impl StructuralEq for UpdateMode"],["impl StructuralEq for Verbosity"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/marker/trait.StructuralPartialEq.js b/coreutils/dev/implementors/core/marker/trait.StructuralPartialEq.js deleted file mode 100644 index e59afbd86..000000000 --- a/coreutils/dev/implementors/core/marker/trait.StructuralPartialEq.js +++ /dev/null @@ -1,13 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl StructuralPartialEq for ClobberMode"],["impl StructuralPartialEq for Preserve"],["impl StructuralPartialEq for SparseMode"],["impl StructuralPartialEq for ReflinkMode"],["impl StructuralPartialEq for OverwriteMode"]], -"uu_dircolors":[["impl StructuralPartialEq for OutputFmt"]], -"uu_factor":[["impl StructuralPartialEq for Factors"]], -"uu_install":[["impl StructuralPartialEq for MainFunction"]], -"uu_ln":[["impl StructuralPartialEq for OverwriteMode"]], -"uu_ls":[["impl StructuralPartialEq for Format"]], -"uu_mv":[["impl StructuralPartialEq for OverwriteMode"]], -"uu_numfmt":[["impl StructuralPartialEq for FormatOptions"],["impl StructuralPartialEq for InvalidModes"]], -"uu_sort":[["impl StructuralPartialEq for GeneralF64ParseResult"]], -"uu_tail":[["impl StructuralPartialEq for BytesChunk"],["impl StructuralPartialEq for FilterMode"],["impl StructuralPartialEq for Signum"],["impl StructuralPartialEq for FollowMode"]], -"uucore":[["impl StructuralPartialEq for LineEnding"],["impl StructuralPartialEq for ResolveMode"],["impl StructuralPartialEq for TraverseSymlinks"],["impl StructuralPartialEq for VerbosityLevel"],["impl StructuralPartialEq for Verbosity"],["impl StructuralPartialEq for BackupMode"],["impl StructuralPartialEq for BackupError"],["impl StructuralPartialEq for ParseSizeError"],["impl StructuralPartialEq for MissingHandling"],["impl StructuralPartialEq for Range"],["impl StructuralPartialEq for UpdateMode"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/marker/trait.Sync.js b/coreutils/dev/implementors/core/marker/trait.Sync.js deleted file mode 100644 index 435a2161d..000000000 --- a/coreutils/dev/implementors/core/marker/trait.Sync.js +++ /dev/null @@ -1,22 +0,0 @@ -(function() {var implementors = { -"uu_base32":[["impl Sync for Config",1,["uu_base32::base_common::Config"]]], -"uu_cp":[["impl Sync for Error",1,["uu_cp::Error"]],["impl Sync for ClobberMode",1,["uu_cp::ClobberMode"]],["impl Sync for OverwriteMode",1,["uu_cp::OverwriteMode"]],["impl Sync for ReflinkMode",1,["uu_cp::ReflinkMode"]],["impl Sync for SparseMode",1,["uu_cp::SparseMode"]],["impl Sync for TargetType",1,["uu_cp::TargetType"]],["impl Sync for CopyMode",1,["uu_cp::CopyMode"]],["impl Sync for Attributes",1,["uu_cp::Attributes"]],["impl Sync for Preserve",1,["uu_cp::Preserve"]],["impl Sync for Options",1,["uu_cp::Options"]]], -"uu_csplit":[["impl !Sync for CsplitOptions",1,["uu_csplit::CsplitOptions"]]], -"uu_dd":[["impl Sync for Alarm",1,["uu_dd::Alarm"]]], -"uu_dircolors":[["impl Sync for OutputFmt",1,["uu_dircolors::OutputFmt"]]], -"uu_factor":[["impl !Sync for Factors",1,["uu_factor::factor::Factors"]]], -"uu_fmt":[["impl Sync for FmtOptions",1,["uu_fmt::FmtOptions"]]], -"uu_install":[["impl Sync for Behavior",1,["uu_install::Behavior"]],["impl Sync for MainFunction",1,["uu_install::MainFunction"]]], -"uu_kill":[["impl Sync for Mode",1,["uu_kill::Mode"]]], -"uu_ln":[["impl Sync for Settings",1,["uu_ln::Settings"]],["impl Sync for OverwriteMode",1,["uu_ln::OverwriteMode"]]], -"uu_ls":[["impl Sync for Format",1,["uu_ls::Format"]],["impl Sync for Config",1,["uu_ls::Config"]]], -"uu_mv":[["impl Sync for Behavior",1,["uu_mv::Behavior"]],["impl Sync for OverwriteMode",1,["uu_mv::OverwriteMode"]]], -"uu_nl":[["impl Sync for Settings",1,["uu_nl::Settings"]]], -"uu_numfmt":[["impl Sync for NumfmtError",1,["uu_numfmt::errors::NumfmtError"]],["impl<'a> Sync for WhitespaceSplitter<'a>",1,["uu_numfmt::format::WhitespaceSplitter"]],["impl Sync for TransformOptions",1,["uu_numfmt::options::TransformOptions"]],["impl Sync for InvalidModes",1,["uu_numfmt::options::InvalidModes"]],["impl Sync for NumfmtOptions",1,["uu_numfmt::options::NumfmtOptions"]],["impl Sync for RoundMethod",1,["uu_numfmt::options::RoundMethod"]],["impl Sync for FormatOptions",1,["uu_numfmt::options::FormatOptions"]]], -"uu_sort":[["impl Sync for Output",1,["uu_sort::Output"]],["impl Sync for GlobalSettings",1,["uu_sort::GlobalSettings"]],["impl<'a> Sync for Line<'a>",1,["uu_sort::Line"]],["impl Sync for GeneralF64ParseResult",1,["uu_sort::GeneralF64ParseResult"]]], -"uu_stat":[["impl Sync for OutputType",1,["uu_stat::OutputType"]]], -"uu_stty":[["impl<T> Sync for Flag<T>where\n T: Sync,",1,["uu_stty::Flag"]],["impl Sync for TermSize",1,["uu_stty::TermSize"]]], -"uu_tail":[["impl Sync for Signum",1,["uu_tail::args::Signum"]],["impl Sync for FilterMode",1,["uu_tail::args::FilterMode"]],["impl Sync for FollowMode",1,["uu_tail::args::FollowMode"]],["impl Sync for VerificationResult",1,["uu_tail::args::VerificationResult"]],["impl Sync for Settings",1,["uu_tail::args::Settings"]],["impl<'a> Sync for ReverseChunks<'a>",1,["uu_tail::chunks::ReverseChunks"]],["impl Sync for BytesChunk",1,["uu_tail::chunks::BytesChunk"]],["impl Sync for BytesChunkBuffer",1,["uu_tail::chunks::BytesChunkBuffer"]],["impl Sync for LinesChunk",1,["uu_tail::chunks::LinesChunk"]],["impl Sync for LinesChunkBuffer",1,["uu_tail::chunks::LinesChunkBuffer"]]], -"uucore":[["impl Sync for DecodeError",1,["uucore::features::encoding::DecodeError"]],["impl Sync for EncodeError",1,["uucore::features::encoding::EncodeError"]],["impl Sync for Format",1,["uucore::features::encoding::Format"]],["impl<R> Sync for Data<R>where\n R: Sync,",1,["uucore::features::encoding::Data"]],["impl Sync for FileInformation",1,["uucore::features::fs::FileInformation"]],["impl Sync for MissingHandling",1,["uucore::features::fs::MissingHandling"]],["impl Sync for ResolveMode",1,["uucore::features::fs::ResolveMode"]],["impl Sync for MountInfo",1,["uucore::features::fsext::MountInfo"]],["impl Sync for FsUsage",1,["uucore::features::fsext::FsUsage"]],["impl<B> Sync for Lines<B>where\n B: Sync,",1,["uucore::features::lines::Lines"]],["impl<T> Sync for RingBuffer<T>where\n T: Sync,",1,["uucore::features::ringbuffer::RingBuffer"]],["impl Sync for Blake2b",1,["uucore::features::sum::Blake2b"]],["impl Sync for Blake3",1,["uucore::features::sum::Blake3"]],["impl Sync for Sm3",1,["uucore::features::sum::Sm3"]],["impl Sync for CRC",1,["uucore::features::sum::CRC"]],["impl Sync for BSD",1,["uucore::features::sum::BSD"]],["impl Sync for SYSV",1,["uucore::features::sum::SYSV"]],["impl Sync for Md5",1,["uucore::features::sum::Md5"]],["impl Sync for Sha1",1,["uucore::features::sum::Sha1"]],["impl Sync for Sha224",1,["uucore::features::sum::Sha224"]],["impl Sync for Sha256",1,["uucore::features::sum::Sha256"]],["impl Sync for Sha384",1,["uucore::features::sum::Sha384"]],["impl Sync for Sha512",1,["uucore::features::sum::Sha512"]],["impl Sync for Sha3_224",1,["uucore::features::sum::Sha3_224"]],["impl Sync for Sha3_256",1,["uucore::features::sum::Sha3_256"]],["impl Sync for Sha3_384",1,["uucore::features::sum::Sha3_384"]],["impl Sync for Sha3_512",1,["uucore::features::sum::Sha3_512"]],["impl Sync for Shake128",1,["uucore::features::sum::Shake128"]],["impl Sync for Shake256",1,["uucore::features::sum::Shake256"]],["impl<'a> !Sync for DigestWriter<'a>",1,["uucore::features::sum::DigestWriter"]],["impl Sync for Passwd",1,["uucore::features::entries::Passwd"]],["impl Sync for Group",1,["uucore::features::entries::Group"]],["impl Sync for VerbosityLevel",1,["uucore::features::perms::VerbosityLevel"]],["impl Sync for Verbosity",1,["uucore::features::perms::Verbosity"]],["impl Sync for IfFrom",1,["uucore::features::perms::IfFrom"]],["impl Sync for TraverseSymlinks",1,["uucore::features::perms::TraverseSymlinks"]],["impl Sync for ChownExecutor",1,["uucore::features::perms::ChownExecutor"]],["impl Sync for GidUidOwnerFilter",1,["uucore::features::perms::GidUidOwnerFilter"]],["impl Sync for Utmpx",1,["uucore::features::utmpx::Utmpx"]],["impl !Sync for UtmpxIter",1,["uucore::features::utmpx::UtmpxIter"]],["impl Sync for BackupMode",1,["uucore::mods::backup_control::BackupMode"]],["impl Sync for BackupError",1,["uucore::mods::backup_control::BackupError"]],["impl Sync for USimpleError",1,["uucore::mods::error::USimpleError"]],["impl Sync for UUsageError",1,["uucore::mods::error::UUsageError"]],["impl Sync for UIoError",1,["uucore::mods::error::UIoError"]],["impl Sync for ExitCode",1,["uucore::mods::error::ExitCode"]],["impl Sync for ClapErrorWrapper",1,["uucore::mods::error::ClapErrorWrapper"]],["impl Sync for LineEnding",1,["uucore::mods::line_ending::LineEnding"]],["impl Sync for Range",1,["uucore::mods::ranges::Range"]],["impl Sync for UpdateMode",1,["uucore::mods::update_control::UpdateMode"]],["impl Sync for QuotingStyle",1,["uucore::mods::quoting_style::QuotingStyle"]],["impl Sync for Quotes",1,["uucore::mods::quoting_style::Quotes"]],["impl<'parser> Sync for Parser<'parser>",1,["uucore::parser::parse_size::Parser"]],["impl Sync for ParseSizeError",1,["uucore::parser::parse_size::ParseSizeError"]],["impl Sync for ShortcutValueParser",1,["uucore::parser::shortcut_value_parser::ShortcutValueParser"]]], -"uudoc":[["impl<'a, 'b> !Sync for MDWriter<'a, 'b>",1,["uudoc::MDWriter"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/marker/trait.Unpin.js b/coreutils/dev/implementors/core/marker/trait.Unpin.js deleted file mode 100644 index a7d72b94c..000000000 --- a/coreutils/dev/implementors/core/marker/trait.Unpin.js +++ /dev/null @@ -1,22 +0,0 @@ -(function() {var implementors = { -"uu_base32":[["impl Unpin for Config",1,["uu_base32::base_common::Config"]]], -"uu_cp":[["impl Unpin for Error",1,["uu_cp::Error"]],["impl Unpin for ClobberMode",1,["uu_cp::ClobberMode"]],["impl Unpin for OverwriteMode",1,["uu_cp::OverwriteMode"]],["impl Unpin for ReflinkMode",1,["uu_cp::ReflinkMode"]],["impl Unpin for SparseMode",1,["uu_cp::SparseMode"]],["impl Unpin for TargetType",1,["uu_cp::TargetType"]],["impl Unpin for CopyMode",1,["uu_cp::CopyMode"]],["impl Unpin for Attributes",1,["uu_cp::Attributes"]],["impl Unpin for Preserve",1,["uu_cp::Preserve"]],["impl Unpin for Options",1,["uu_cp::Options"]]], -"uu_csplit":[["impl Unpin for CsplitOptions",1,["uu_csplit::CsplitOptions"]]], -"uu_dd":[["impl Unpin for Alarm",1,["uu_dd::Alarm"]]], -"uu_dircolors":[["impl Unpin for OutputFmt",1,["uu_dircolors::OutputFmt"]]], -"uu_factor":[["impl Unpin for Factors",1,["uu_factor::factor::Factors"]]], -"uu_fmt":[["impl Unpin for FmtOptions",1,["uu_fmt::FmtOptions"]]], -"uu_install":[["impl Unpin for Behavior",1,["uu_install::Behavior"]],["impl Unpin for MainFunction",1,["uu_install::MainFunction"]]], -"uu_kill":[["impl Unpin for Mode",1,["uu_kill::Mode"]]], -"uu_ln":[["impl Unpin for Settings",1,["uu_ln::Settings"]],["impl Unpin for OverwriteMode",1,["uu_ln::OverwriteMode"]]], -"uu_ls":[["impl Unpin for Format",1,["uu_ls::Format"]],["impl Unpin for Config",1,["uu_ls::Config"]]], -"uu_mv":[["impl Unpin for Behavior",1,["uu_mv::Behavior"]],["impl Unpin for OverwriteMode",1,["uu_mv::OverwriteMode"]]], -"uu_nl":[["impl Unpin for Settings",1,["uu_nl::Settings"]]], -"uu_numfmt":[["impl Unpin for NumfmtError",1,["uu_numfmt::errors::NumfmtError"]],["impl<'a> Unpin for WhitespaceSplitter<'a>",1,["uu_numfmt::format::WhitespaceSplitter"]],["impl Unpin for TransformOptions",1,["uu_numfmt::options::TransformOptions"]],["impl Unpin for InvalidModes",1,["uu_numfmt::options::InvalidModes"]],["impl Unpin for NumfmtOptions",1,["uu_numfmt::options::NumfmtOptions"]],["impl Unpin for RoundMethod",1,["uu_numfmt::options::RoundMethod"]],["impl Unpin for FormatOptions",1,["uu_numfmt::options::FormatOptions"]]], -"uu_sort":[["impl Unpin for Output",1,["uu_sort::Output"]],["impl Unpin for GlobalSettings",1,["uu_sort::GlobalSettings"]],["impl<'a> Unpin for Line<'a>",1,["uu_sort::Line"]],["impl Unpin for GeneralF64ParseResult",1,["uu_sort::GeneralF64ParseResult"]]], -"uu_stat":[["impl Unpin for OutputType",1,["uu_stat::OutputType"]]], -"uu_stty":[["impl<T> Unpin for Flag<T>where\n T: Unpin,",1,["uu_stty::Flag"]],["impl Unpin for TermSize",1,["uu_stty::TermSize"]]], -"uu_tail":[["impl Unpin for Signum",1,["uu_tail::args::Signum"]],["impl Unpin for FilterMode",1,["uu_tail::args::FilterMode"]],["impl Unpin for FollowMode",1,["uu_tail::args::FollowMode"]],["impl Unpin for VerificationResult",1,["uu_tail::args::VerificationResult"]],["impl Unpin for Settings",1,["uu_tail::args::Settings"]],["impl<'a> Unpin for ReverseChunks<'a>",1,["uu_tail::chunks::ReverseChunks"]],["impl Unpin for BytesChunk",1,["uu_tail::chunks::BytesChunk"]],["impl Unpin for BytesChunkBuffer",1,["uu_tail::chunks::BytesChunkBuffer"]],["impl Unpin for LinesChunk",1,["uu_tail::chunks::LinesChunk"]],["impl Unpin for LinesChunkBuffer",1,["uu_tail::chunks::LinesChunkBuffer"]]], -"uucore":[["impl Unpin for DecodeError",1,["uucore::features::encoding::DecodeError"]],["impl Unpin for EncodeError",1,["uucore::features::encoding::EncodeError"]],["impl Unpin for Format",1,["uucore::features::encoding::Format"]],["impl<R> Unpin for Data<R>where\n R: Unpin,",1,["uucore::features::encoding::Data"]],["impl Unpin for FileInformation",1,["uucore::features::fs::FileInformation"]],["impl Unpin for MissingHandling",1,["uucore::features::fs::MissingHandling"]],["impl Unpin for ResolveMode",1,["uucore::features::fs::ResolveMode"]],["impl Unpin for MountInfo",1,["uucore::features::fsext::MountInfo"]],["impl Unpin for FsUsage",1,["uucore::features::fsext::FsUsage"]],["impl<B> Unpin for Lines<B>where\n B: Unpin,",1,["uucore::features::lines::Lines"]],["impl<T> Unpin for RingBuffer<T>where\n T: Unpin,",1,["uucore::features::ringbuffer::RingBuffer"]],["impl Unpin for Blake2b",1,["uucore::features::sum::Blake2b"]],["impl Unpin for Blake3",1,["uucore::features::sum::Blake3"]],["impl Unpin for Sm3",1,["uucore::features::sum::Sm3"]],["impl Unpin for CRC",1,["uucore::features::sum::CRC"]],["impl Unpin for BSD",1,["uucore::features::sum::BSD"]],["impl Unpin for SYSV",1,["uucore::features::sum::SYSV"]],["impl Unpin for Md5",1,["uucore::features::sum::Md5"]],["impl Unpin for Sha1",1,["uucore::features::sum::Sha1"]],["impl Unpin for Sha224",1,["uucore::features::sum::Sha224"]],["impl Unpin for Sha256",1,["uucore::features::sum::Sha256"]],["impl Unpin for Sha384",1,["uucore::features::sum::Sha384"]],["impl Unpin for Sha512",1,["uucore::features::sum::Sha512"]],["impl Unpin for Sha3_224",1,["uucore::features::sum::Sha3_224"]],["impl Unpin for Sha3_256",1,["uucore::features::sum::Sha3_256"]],["impl Unpin for Sha3_384",1,["uucore::features::sum::Sha3_384"]],["impl Unpin for Sha3_512",1,["uucore::features::sum::Sha3_512"]],["impl Unpin for Shake128",1,["uucore::features::sum::Shake128"]],["impl Unpin for Shake256",1,["uucore::features::sum::Shake256"]],["impl<'a> Unpin for DigestWriter<'a>",1,["uucore::features::sum::DigestWriter"]],["impl Unpin for Passwd",1,["uucore::features::entries::Passwd"]],["impl Unpin for Group",1,["uucore::features::entries::Group"]],["impl Unpin for VerbosityLevel",1,["uucore::features::perms::VerbosityLevel"]],["impl Unpin for Verbosity",1,["uucore::features::perms::Verbosity"]],["impl Unpin for IfFrom",1,["uucore::features::perms::IfFrom"]],["impl Unpin for TraverseSymlinks",1,["uucore::features::perms::TraverseSymlinks"]],["impl Unpin for ChownExecutor",1,["uucore::features::perms::ChownExecutor"]],["impl Unpin for GidUidOwnerFilter",1,["uucore::features::perms::GidUidOwnerFilter"]],["impl Unpin for Utmpx",1,["uucore::features::utmpx::Utmpx"]],["impl Unpin for UtmpxIter",1,["uucore::features::utmpx::UtmpxIter"]],["impl Unpin for BackupMode",1,["uucore::mods::backup_control::BackupMode"]],["impl Unpin for BackupError",1,["uucore::mods::backup_control::BackupError"]],["impl Unpin for USimpleError",1,["uucore::mods::error::USimpleError"]],["impl Unpin for UUsageError",1,["uucore::mods::error::UUsageError"]],["impl Unpin for UIoError",1,["uucore::mods::error::UIoError"]],["impl Unpin for ExitCode",1,["uucore::mods::error::ExitCode"]],["impl Unpin for ClapErrorWrapper",1,["uucore::mods::error::ClapErrorWrapper"]],["impl Unpin for LineEnding",1,["uucore::mods::line_ending::LineEnding"]],["impl Unpin for Range",1,["uucore::mods::ranges::Range"]],["impl Unpin for UpdateMode",1,["uucore::mods::update_control::UpdateMode"]],["impl Unpin for QuotingStyle",1,["uucore::mods::quoting_style::QuotingStyle"]],["impl Unpin for Quotes",1,["uucore::mods::quoting_style::Quotes"]],["impl<'parser> Unpin for Parser<'parser>",1,["uucore::parser::parse_size::Parser"]],["impl Unpin for ParseSizeError",1,["uucore::parser::parse_size::ParseSizeError"]],["impl Unpin for ShortcutValueParser",1,["uucore::parser::shortcut_value_parser::ShortcutValueParser"]]], -"uudoc":[["impl<'a, 'b> Unpin for MDWriter<'a, 'b>",1,["uudoc::MDWriter"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/ops/drop/trait.Drop.js b/coreutils/dev/implementors/core/ops/drop/trait.Drop.js deleted file mode 100644 index ad23664a1..000000000 --- a/coreutils/dev/implementors/core/ops/drop/trait.Drop.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[["impl Drop for UtmpxIter"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/coreutils/dev/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js deleted file mode 100644 index 659338836..000000000 --- a/coreutils/dev/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ /dev/null @@ -1,22 +0,0 @@ -(function() {var implementors = { -"uu_base32":[["impl RefUnwindSafe for Config",1,["uu_base32::base_common::Config"]]], -"uu_cp":[["impl !RefUnwindSafe for Error",1,["uu_cp::Error"]],["impl RefUnwindSafe for ClobberMode",1,["uu_cp::ClobberMode"]],["impl RefUnwindSafe for OverwriteMode",1,["uu_cp::OverwriteMode"]],["impl RefUnwindSafe for ReflinkMode",1,["uu_cp::ReflinkMode"]],["impl RefUnwindSafe for SparseMode",1,["uu_cp::SparseMode"]],["impl RefUnwindSafe for TargetType",1,["uu_cp::TargetType"]],["impl RefUnwindSafe for CopyMode",1,["uu_cp::CopyMode"]],["impl RefUnwindSafe for Attributes",1,["uu_cp::Attributes"]],["impl RefUnwindSafe for Preserve",1,["uu_cp::Preserve"]],["impl RefUnwindSafe for Options",1,["uu_cp::Options"]]], -"uu_csplit":[["impl !RefUnwindSafe for CsplitOptions",1,["uu_csplit::CsplitOptions"]]], -"uu_dd":[["impl RefUnwindSafe for Alarm",1,["uu_dd::Alarm"]]], -"uu_dircolors":[["impl RefUnwindSafe for OutputFmt",1,["uu_dircolors::OutputFmt"]]], -"uu_factor":[["impl !RefUnwindSafe for Factors",1,["uu_factor::factor::Factors"]]], -"uu_fmt":[["impl RefUnwindSafe for FmtOptions",1,["uu_fmt::FmtOptions"]]], -"uu_install":[["impl RefUnwindSafe for Behavior",1,["uu_install::Behavior"]],["impl RefUnwindSafe for MainFunction",1,["uu_install::MainFunction"]]], -"uu_kill":[["impl RefUnwindSafe for Mode",1,["uu_kill::Mode"]]], -"uu_ln":[["impl RefUnwindSafe for Settings",1,["uu_ln::Settings"]],["impl RefUnwindSafe for OverwriteMode",1,["uu_ln::OverwriteMode"]]], -"uu_ls":[["impl RefUnwindSafe for Format",1,["uu_ls::Format"]],["impl RefUnwindSafe for Config",1,["uu_ls::Config"]]], -"uu_mv":[["impl RefUnwindSafe for Behavior",1,["uu_mv::Behavior"]],["impl RefUnwindSafe for OverwriteMode",1,["uu_mv::OverwriteMode"]]], -"uu_nl":[["impl RefUnwindSafe for Settings",1,["uu_nl::Settings"]]], -"uu_numfmt":[["impl RefUnwindSafe for NumfmtError",1,["uu_numfmt::errors::NumfmtError"]],["impl<'a> RefUnwindSafe for WhitespaceSplitter<'a>",1,["uu_numfmt::format::WhitespaceSplitter"]],["impl RefUnwindSafe for TransformOptions",1,["uu_numfmt::options::TransformOptions"]],["impl RefUnwindSafe for InvalidModes",1,["uu_numfmt::options::InvalidModes"]],["impl RefUnwindSafe for NumfmtOptions",1,["uu_numfmt::options::NumfmtOptions"]],["impl RefUnwindSafe for RoundMethod",1,["uu_numfmt::options::RoundMethod"]],["impl RefUnwindSafe for FormatOptions",1,["uu_numfmt::options::FormatOptions"]]], -"uu_sort":[["impl RefUnwindSafe for Output",1,["uu_sort::Output"]],["impl RefUnwindSafe for GlobalSettings",1,["uu_sort::GlobalSettings"]],["impl<'a> RefUnwindSafe for Line<'a>",1,["uu_sort::Line"]],["impl RefUnwindSafe for GeneralF64ParseResult",1,["uu_sort::GeneralF64ParseResult"]]], -"uu_stat":[["impl RefUnwindSafe for OutputType",1,["uu_stat::OutputType"]]], -"uu_stty":[["impl<T> RefUnwindSafe for Flag<T>where\n T: RefUnwindSafe,",1,["uu_stty::Flag"]],["impl RefUnwindSafe for TermSize",1,["uu_stty::TermSize"]]], -"uu_tail":[["impl RefUnwindSafe for Signum",1,["uu_tail::args::Signum"]],["impl RefUnwindSafe for FilterMode",1,["uu_tail::args::FilterMode"]],["impl RefUnwindSafe for FollowMode",1,["uu_tail::args::FollowMode"]],["impl RefUnwindSafe for VerificationResult",1,["uu_tail::args::VerificationResult"]],["impl RefUnwindSafe for Settings",1,["uu_tail::args::Settings"]],["impl<'a> RefUnwindSafe for ReverseChunks<'a>",1,["uu_tail::chunks::ReverseChunks"]],["impl RefUnwindSafe for BytesChunk",1,["uu_tail::chunks::BytesChunk"]],["impl RefUnwindSafe for BytesChunkBuffer",1,["uu_tail::chunks::BytesChunkBuffer"]],["impl RefUnwindSafe for LinesChunk",1,["uu_tail::chunks::LinesChunk"]],["impl RefUnwindSafe for LinesChunkBuffer",1,["uu_tail::chunks::LinesChunkBuffer"]]], -"uucore":[["impl !RefUnwindSafe for DecodeError",1,["uucore::features::encoding::DecodeError"]],["impl RefUnwindSafe for EncodeError",1,["uucore::features::encoding::EncodeError"]],["impl RefUnwindSafe for Format",1,["uucore::features::encoding::Format"]],["impl<R> RefUnwindSafe for Data<R>where\n R: RefUnwindSafe,",1,["uucore::features::encoding::Data"]],["impl RefUnwindSafe for FileInformation",1,["uucore::features::fs::FileInformation"]],["impl RefUnwindSafe for MissingHandling",1,["uucore::features::fs::MissingHandling"]],["impl RefUnwindSafe for ResolveMode",1,["uucore::features::fs::ResolveMode"]],["impl RefUnwindSafe for MountInfo",1,["uucore::features::fsext::MountInfo"]],["impl RefUnwindSafe for FsUsage",1,["uucore::features::fsext::FsUsage"]],["impl<B> RefUnwindSafe for Lines<B>where\n B: RefUnwindSafe,",1,["uucore::features::lines::Lines"]],["impl<T> RefUnwindSafe for RingBuffer<T>where\n T: RefUnwindSafe,",1,["uucore::features::ringbuffer::RingBuffer"]],["impl RefUnwindSafe for Blake2b",1,["uucore::features::sum::Blake2b"]],["impl RefUnwindSafe for Blake3",1,["uucore::features::sum::Blake3"]],["impl RefUnwindSafe for Sm3",1,["uucore::features::sum::Sm3"]],["impl RefUnwindSafe for CRC",1,["uucore::features::sum::CRC"]],["impl RefUnwindSafe for BSD",1,["uucore::features::sum::BSD"]],["impl RefUnwindSafe for SYSV",1,["uucore::features::sum::SYSV"]],["impl RefUnwindSafe for Md5",1,["uucore::features::sum::Md5"]],["impl RefUnwindSafe for Sha1",1,["uucore::features::sum::Sha1"]],["impl RefUnwindSafe for Sha224",1,["uucore::features::sum::Sha224"]],["impl RefUnwindSafe for Sha256",1,["uucore::features::sum::Sha256"]],["impl RefUnwindSafe for Sha384",1,["uucore::features::sum::Sha384"]],["impl RefUnwindSafe for Sha512",1,["uucore::features::sum::Sha512"]],["impl RefUnwindSafe for Sha3_224",1,["uucore::features::sum::Sha3_224"]],["impl RefUnwindSafe for Sha3_256",1,["uucore::features::sum::Sha3_256"]],["impl RefUnwindSafe for Sha3_384",1,["uucore::features::sum::Sha3_384"]],["impl RefUnwindSafe for Sha3_512",1,["uucore::features::sum::Sha3_512"]],["impl RefUnwindSafe for Shake128",1,["uucore::features::sum::Shake128"]],["impl RefUnwindSafe for Shake256",1,["uucore::features::sum::Shake256"]],["impl<'a> !RefUnwindSafe for DigestWriter<'a>",1,["uucore::features::sum::DigestWriter"]],["impl RefUnwindSafe for Passwd",1,["uucore::features::entries::Passwd"]],["impl RefUnwindSafe for Group",1,["uucore::features::entries::Group"]],["impl RefUnwindSafe for VerbosityLevel",1,["uucore::features::perms::VerbosityLevel"]],["impl RefUnwindSafe for Verbosity",1,["uucore::features::perms::Verbosity"]],["impl RefUnwindSafe for IfFrom",1,["uucore::features::perms::IfFrom"]],["impl RefUnwindSafe for TraverseSymlinks",1,["uucore::features::perms::TraverseSymlinks"]],["impl RefUnwindSafe for ChownExecutor",1,["uucore::features::perms::ChownExecutor"]],["impl RefUnwindSafe for GidUidOwnerFilter",1,["uucore::features::perms::GidUidOwnerFilter"]],["impl RefUnwindSafe for Utmpx",1,["uucore::features::utmpx::Utmpx"]],["impl RefUnwindSafe for UtmpxIter",1,["uucore::features::utmpx::UtmpxIter"]],["impl RefUnwindSafe for BackupMode",1,["uucore::mods::backup_control::BackupMode"]],["impl RefUnwindSafe for BackupError",1,["uucore::mods::backup_control::BackupError"]],["impl RefUnwindSafe for USimpleError",1,["uucore::mods::error::USimpleError"]],["impl RefUnwindSafe for UUsageError",1,["uucore::mods::error::UUsageError"]],["impl !RefUnwindSafe for UIoError",1,["uucore::mods::error::UIoError"]],["impl RefUnwindSafe for ExitCode",1,["uucore::mods::error::ExitCode"]],["impl !RefUnwindSafe for ClapErrorWrapper",1,["uucore::mods::error::ClapErrorWrapper"]],["impl RefUnwindSafe for LineEnding",1,["uucore::mods::line_ending::LineEnding"]],["impl RefUnwindSafe for Range",1,["uucore::mods::ranges::Range"]],["impl RefUnwindSafe for UpdateMode",1,["uucore::mods::update_control::UpdateMode"]],["impl RefUnwindSafe for QuotingStyle",1,["uucore::mods::quoting_style::QuotingStyle"]],["impl RefUnwindSafe for Quotes",1,["uucore::mods::quoting_style::Quotes"]],["impl<'parser> RefUnwindSafe for Parser<'parser>",1,["uucore::parser::parse_size::Parser"]],["impl RefUnwindSafe for ParseSizeError",1,["uucore::parser::parse_size::ParseSizeError"]],["impl RefUnwindSafe for ShortcutValueParser",1,["uucore::parser::shortcut_value_parser::ShortcutValueParser"]]], -"uudoc":[["impl<'a, 'b> !RefUnwindSafe for MDWriter<'a, 'b>",1,["uudoc::MDWriter"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/coreutils/dev/implementors/core/panic/unwind_safe/trait.UnwindSafe.js deleted file mode 100644 index 70f5a4fb6..000000000 --- a/coreutils/dev/implementors/core/panic/unwind_safe/trait.UnwindSafe.js +++ /dev/null @@ -1,22 +0,0 @@ -(function() {var implementors = { -"uu_base32":[["impl UnwindSafe for Config",1,["uu_base32::base_common::Config"]]], -"uu_cp":[["impl !UnwindSafe for Error",1,["uu_cp::Error"]],["impl UnwindSafe for ClobberMode",1,["uu_cp::ClobberMode"]],["impl UnwindSafe for OverwriteMode",1,["uu_cp::OverwriteMode"]],["impl UnwindSafe for ReflinkMode",1,["uu_cp::ReflinkMode"]],["impl UnwindSafe for SparseMode",1,["uu_cp::SparseMode"]],["impl UnwindSafe for TargetType",1,["uu_cp::TargetType"]],["impl UnwindSafe for CopyMode",1,["uu_cp::CopyMode"]],["impl UnwindSafe for Attributes",1,["uu_cp::Attributes"]],["impl UnwindSafe for Preserve",1,["uu_cp::Preserve"]],["impl UnwindSafe for Options",1,["uu_cp::Options"]]], -"uu_csplit":[["impl !UnwindSafe for CsplitOptions",1,["uu_csplit::CsplitOptions"]]], -"uu_dd":[["impl UnwindSafe for Alarm",1,["uu_dd::Alarm"]]], -"uu_dircolors":[["impl UnwindSafe for OutputFmt",1,["uu_dircolors::OutputFmt"]]], -"uu_factor":[["impl UnwindSafe for Factors",1,["uu_factor::factor::Factors"]]], -"uu_fmt":[["impl UnwindSafe for FmtOptions",1,["uu_fmt::FmtOptions"]]], -"uu_install":[["impl UnwindSafe for Behavior",1,["uu_install::Behavior"]],["impl UnwindSafe for MainFunction",1,["uu_install::MainFunction"]]], -"uu_kill":[["impl UnwindSafe for Mode",1,["uu_kill::Mode"]]], -"uu_ln":[["impl UnwindSafe for Settings",1,["uu_ln::Settings"]],["impl UnwindSafe for OverwriteMode",1,["uu_ln::OverwriteMode"]]], -"uu_ls":[["impl UnwindSafe for Format",1,["uu_ls::Format"]],["impl UnwindSafe for Config",1,["uu_ls::Config"]]], -"uu_mv":[["impl UnwindSafe for Behavior",1,["uu_mv::Behavior"]],["impl UnwindSafe for OverwriteMode",1,["uu_mv::OverwriteMode"]]], -"uu_nl":[["impl UnwindSafe for Settings",1,["uu_nl::Settings"]]], -"uu_numfmt":[["impl UnwindSafe for NumfmtError",1,["uu_numfmt::errors::NumfmtError"]],["impl<'a> UnwindSafe for WhitespaceSplitter<'a>",1,["uu_numfmt::format::WhitespaceSplitter"]],["impl UnwindSafe for TransformOptions",1,["uu_numfmt::options::TransformOptions"]],["impl UnwindSafe for InvalidModes",1,["uu_numfmt::options::InvalidModes"]],["impl UnwindSafe for NumfmtOptions",1,["uu_numfmt::options::NumfmtOptions"]],["impl UnwindSafe for RoundMethod",1,["uu_numfmt::options::RoundMethod"]],["impl UnwindSafe for FormatOptions",1,["uu_numfmt::options::FormatOptions"]]], -"uu_sort":[["impl UnwindSafe for Output",1,["uu_sort::Output"]],["impl UnwindSafe for GlobalSettings",1,["uu_sort::GlobalSettings"]],["impl<'a> UnwindSafe for Line<'a>",1,["uu_sort::Line"]],["impl UnwindSafe for GeneralF64ParseResult",1,["uu_sort::GeneralF64ParseResult"]]], -"uu_stat":[["impl UnwindSafe for OutputType",1,["uu_stat::OutputType"]]], -"uu_stty":[["impl<T> UnwindSafe for Flag<T>where\n T: UnwindSafe,",1,["uu_stty::Flag"]],["impl UnwindSafe for TermSize",1,["uu_stty::TermSize"]]], -"uu_tail":[["impl UnwindSafe for Signum",1,["uu_tail::args::Signum"]],["impl UnwindSafe for FilterMode",1,["uu_tail::args::FilterMode"]],["impl UnwindSafe for FollowMode",1,["uu_tail::args::FollowMode"]],["impl UnwindSafe for VerificationResult",1,["uu_tail::args::VerificationResult"]],["impl UnwindSafe for Settings",1,["uu_tail::args::Settings"]],["impl<'a> UnwindSafe for ReverseChunks<'a>",1,["uu_tail::chunks::ReverseChunks"]],["impl UnwindSafe for BytesChunk",1,["uu_tail::chunks::BytesChunk"]],["impl UnwindSafe for BytesChunkBuffer",1,["uu_tail::chunks::BytesChunkBuffer"]],["impl UnwindSafe for LinesChunk",1,["uu_tail::chunks::LinesChunk"]],["impl UnwindSafe for LinesChunkBuffer",1,["uu_tail::chunks::LinesChunkBuffer"]]], -"uucore":[["impl !UnwindSafe for DecodeError",1,["uucore::features::encoding::DecodeError"]],["impl UnwindSafe for EncodeError",1,["uucore::features::encoding::EncodeError"]],["impl UnwindSafe for Format",1,["uucore::features::encoding::Format"]],["impl<R> UnwindSafe for Data<R>where\n R: UnwindSafe,",1,["uucore::features::encoding::Data"]],["impl UnwindSafe for FileInformation",1,["uucore::features::fs::FileInformation"]],["impl UnwindSafe for MissingHandling",1,["uucore::features::fs::MissingHandling"]],["impl UnwindSafe for ResolveMode",1,["uucore::features::fs::ResolveMode"]],["impl UnwindSafe for MountInfo",1,["uucore::features::fsext::MountInfo"]],["impl UnwindSafe for FsUsage",1,["uucore::features::fsext::FsUsage"]],["impl<B> UnwindSafe for Lines<B>where\n B: UnwindSafe,",1,["uucore::features::lines::Lines"]],["impl<T> UnwindSafe for RingBuffer<T>where\n T: UnwindSafe,",1,["uucore::features::ringbuffer::RingBuffer"]],["impl UnwindSafe for Blake2b",1,["uucore::features::sum::Blake2b"]],["impl UnwindSafe for Blake3",1,["uucore::features::sum::Blake3"]],["impl UnwindSafe for Sm3",1,["uucore::features::sum::Sm3"]],["impl UnwindSafe for CRC",1,["uucore::features::sum::CRC"]],["impl UnwindSafe for BSD",1,["uucore::features::sum::BSD"]],["impl UnwindSafe for SYSV",1,["uucore::features::sum::SYSV"]],["impl UnwindSafe for Md5",1,["uucore::features::sum::Md5"]],["impl UnwindSafe for Sha1",1,["uucore::features::sum::Sha1"]],["impl UnwindSafe for Sha224",1,["uucore::features::sum::Sha224"]],["impl UnwindSafe for Sha256",1,["uucore::features::sum::Sha256"]],["impl UnwindSafe for Sha384",1,["uucore::features::sum::Sha384"]],["impl UnwindSafe for Sha512",1,["uucore::features::sum::Sha512"]],["impl UnwindSafe for Sha3_224",1,["uucore::features::sum::Sha3_224"]],["impl UnwindSafe for Sha3_256",1,["uucore::features::sum::Sha3_256"]],["impl UnwindSafe for Sha3_384",1,["uucore::features::sum::Sha3_384"]],["impl UnwindSafe for Sha3_512",1,["uucore::features::sum::Sha3_512"]],["impl UnwindSafe for Shake128",1,["uucore::features::sum::Shake128"]],["impl UnwindSafe for Shake256",1,["uucore::features::sum::Shake256"]],["impl<'a> !UnwindSafe for DigestWriter<'a>",1,["uucore::features::sum::DigestWriter"]],["impl UnwindSafe for Passwd",1,["uucore::features::entries::Passwd"]],["impl UnwindSafe for Group",1,["uucore::features::entries::Group"]],["impl UnwindSafe for VerbosityLevel",1,["uucore::features::perms::VerbosityLevel"]],["impl UnwindSafe for Verbosity",1,["uucore::features::perms::Verbosity"]],["impl UnwindSafe for IfFrom",1,["uucore::features::perms::IfFrom"]],["impl UnwindSafe for TraverseSymlinks",1,["uucore::features::perms::TraverseSymlinks"]],["impl UnwindSafe for ChownExecutor",1,["uucore::features::perms::ChownExecutor"]],["impl UnwindSafe for GidUidOwnerFilter",1,["uucore::features::perms::GidUidOwnerFilter"]],["impl UnwindSafe for Utmpx",1,["uucore::features::utmpx::Utmpx"]],["impl UnwindSafe for UtmpxIter",1,["uucore::features::utmpx::UtmpxIter"]],["impl UnwindSafe for BackupMode",1,["uucore::mods::backup_control::BackupMode"]],["impl UnwindSafe for BackupError",1,["uucore::mods::backup_control::BackupError"]],["impl UnwindSafe for USimpleError",1,["uucore::mods::error::USimpleError"]],["impl UnwindSafe for UUsageError",1,["uucore::mods::error::UUsageError"]],["impl !UnwindSafe for UIoError",1,["uucore::mods::error::UIoError"]],["impl UnwindSafe for ExitCode",1,["uucore::mods::error::ExitCode"]],["impl !UnwindSafe for ClapErrorWrapper",1,["uucore::mods::error::ClapErrorWrapper"]],["impl UnwindSafe for LineEnding",1,["uucore::mods::line_ending::LineEnding"]],["impl UnwindSafe for Range",1,["uucore::mods::ranges::Range"]],["impl UnwindSafe for UpdateMode",1,["uucore::mods::update_control::UpdateMode"]],["impl UnwindSafe for QuotingStyle",1,["uucore::mods::quoting_style::QuotingStyle"]],["impl UnwindSafe for Quotes",1,["uucore::mods::quoting_style::Quotes"]],["impl<'parser> UnwindSafe for Parser<'parser>",1,["uucore::parser::parse_size::Parser"]],["impl UnwindSafe for ParseSizeError",1,["uucore::parser::parse_size::ParseSizeError"]],["impl UnwindSafe for ShortcutValueParser",1,["uucore::parser::shortcut_value_parser::ShortcutValueParser"]]], -"uudoc":[["impl<'a, 'b> !UnwindSafe for MDWriter<'a, 'b>",1,["uudoc::MDWriter"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/core/str/traits/trait.FromStr.js b/coreutils/dev/implementors/core/str/traits/trait.FromStr.js deleted file mode 100644 index 6224b61cd..000000000 --- a/coreutils/dev/implementors/core/str/traits/trait.FromStr.js +++ /dev/null @@ -1,4 +0,0 @@ -(function() {var implementors = { -"uu_numfmt":[["impl FromStr for InvalidModes"],["impl FromStr for FormatOptions"]], -"uucore":[["impl FromStr for Range"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/os_display/native/trait.Quotable.js b/coreutils/dev/implementors/os_display/native/trait.Quotable.js deleted file mode 100644 index 8fd88546f..000000000 --- a/coreutils/dev/implementors/os_display/native/trait.Quotable.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/std/io/trait.Write.js b/coreutils/dev/implementors/std/io/trait.Write.js deleted file mode 100644 index ccab9b8a3..000000000 --- a/coreutils/dev/implementors/std/io/trait.Write.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[["impl<'a> Write for DigestWriter<'a>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uu_dircolors/trait.StrUtils.js b/coreutils/dev/implementors/uu_dircolors/trait.StrUtils.js deleted file mode 100644 index a305abeab..000000000 --- a/coreutils/dev/implementors/uu_dircolors/trait.StrUtils.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uu_dircolors":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uu_pinky/trait.Capitalize.js b/coreutils/dev/implementors/uu_pinky/trait.Capitalize.js deleted file mode 100644 index 9ad85875d..000000000 --- a/coreutils/dev/implementors/uu_pinky/trait.Capitalize.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uu_pinky":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uucore/features/entries/trait.Locate.js b/coreutils/dev/implementors/uucore/features/entries/trait.Locate.js deleted file mode 100644 index bfafd3517..000000000 --- a/coreutils/dev/implementors/uucore/features/entries/trait.Locate.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"uu_chgrp":[], -"uu_chown":[], -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uucore/features/fsext/trait.BirthTime.js b/coreutils/dev/implementors/uucore/features/fsext/trait.BirthTime.js deleted file mode 100644 index 8fd88546f..000000000 --- a/coreutils/dev/implementors/uucore/features/fsext/trait.BirthTime.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uucore/features/fsext/trait.FsMeta.js b/coreutils/dev/implementors/uucore/features/fsext/trait.FsMeta.js deleted file mode 100644 index 8fd88546f..000000000 --- a/coreutils/dev/implementors/uucore/features/fsext/trait.FsMeta.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uucore/features/process/trait.ChildExt.js b/coreutils/dev/implementors/uucore/features/process/trait.ChildExt.js deleted file mode 100644 index 8fd88546f..000000000 --- a/coreutils/dev/implementors/uucore/features/process/trait.ChildExt.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uucore/features/sum/trait.Digest.js b/coreutils/dev/implementors/uucore/features/sum/trait.Digest.js deleted file mode 100644 index 8fd88546f..000000000 --- a/coreutils/dev/implementors/uucore/features/sum/trait.Digest.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uucore/mods/error/trait.FromIo.js b/coreutils/dev/implementors/uucore/mods/error/trait.FromIo.js deleted file mode 100644 index 8fd88546f..000000000 --- a/coreutils/dev/implementors/uucore/mods/error/trait.FromIo.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uucore/mods/error/trait.UClapError.js b/coreutils/dev/implementors/uucore/mods/error/trait.UClapError.js deleted file mode 100644 index 8fd88546f..000000000 --- a/coreutils/dev/implementors/uucore/mods/error/trait.UClapError.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uucore/mods/error/trait.UError.js b/coreutils/dev/implementors/uucore/mods/error/trait.UError.js deleted file mode 100644 index edbe7489a..000000000 --- a/coreutils/dev/implementors/uucore/mods/error/trait.UError.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"uu_cp":[["impl UError for Error"]], -"uu_numfmt":[["impl UError for NumfmtError"]], -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/implementors/uucore/trait.Args.js b/coreutils/dev/implementors/uucore/trait.Args.js deleted file mode 100644 index 8fd88546f..000000000 --- a/coreutils/dev/implementors/uucore/trait.Args.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"uucore":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/coreutils/dev/install/all.html b/coreutils/dev/install/all.html deleted file mode 100644 index b6dc0b86d..000000000 --- a/coreutils/dev/install/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/install/fn.main.html b/coreutils/dev/install/fn.main.html deleted file mode 100644 index 5a71bb11f..000000000 --- a/coreutils/dev/install/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in install - Rust

Function install::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/install/index.html b/coreutils/dev/install/index.html deleted file mode 100644 index d4204e190..000000000 --- a/coreutils/dev/install/index.html +++ /dev/null @@ -1 +0,0 @@ -install - Rust
\ No newline at end of file diff --git a/coreutils/dev/install/sidebar-items.js b/coreutils/dev/install/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/install/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/join/all.html b/coreutils/dev/join/all.html deleted file mode 100644 index 02bf5fbb3..000000000 --- a/coreutils/dev/join/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/join/fn.main.html b/coreutils/dev/join/fn.main.html deleted file mode 100644 index bb71fa0fc..000000000 --- a/coreutils/dev/join/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in join - Rust

Function join::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/join/index.html b/coreutils/dev/join/index.html deleted file mode 100644 index 1bbe32c7b..000000000 --- a/coreutils/dev/join/index.html +++ /dev/null @@ -1 +0,0 @@ -join - Rust
\ No newline at end of file diff --git a/coreutils/dev/join/sidebar-items.js b/coreutils/dev/join/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/join/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/kill/all.html b/coreutils/dev/kill/all.html deleted file mode 100644 index bb7df4cb3..000000000 --- a/coreutils/dev/kill/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/kill/fn.main.html b/coreutils/dev/kill/fn.main.html deleted file mode 100644 index 001ffedae..000000000 --- a/coreutils/dev/kill/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in kill - Rust

Function kill::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/kill/index.html b/coreutils/dev/kill/index.html deleted file mode 100644 index 66d4343c1..000000000 --- a/coreutils/dev/kill/index.html +++ /dev/null @@ -1 +0,0 @@ -kill - Rust
\ No newline at end of file diff --git a/coreutils/dev/kill/sidebar-items.js b/coreutils/dev/kill/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/kill/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/libstdbuf/all.html b/coreutils/dev/libstdbuf/all.html deleted file mode 100644 index 83f50eaa9..000000000 --- a/coreutils/dev/libstdbuf/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/libstdbuf/fn.__stdbuf.html b/coreutils/dev/libstdbuf/fn.__stdbuf.html deleted file mode 100644 index 3c6ab28f5..000000000 --- a/coreutils/dev/libstdbuf/fn.__stdbuf.html +++ /dev/null @@ -1,4 +0,0 @@ -__stdbuf in libstdbuf - Rust

Function libstdbuf::__stdbuf

source ·
#[no_mangle]
-pub unsafe extern "C" fn __stdbuf()
Expand description

Safety

-

ToDO … (safety note)

-
\ No newline at end of file diff --git a/coreutils/dev/libstdbuf/index.html b/coreutils/dev/libstdbuf/index.html deleted file mode 100644 index 3009efb6c..000000000 --- a/coreutils/dev/libstdbuf/index.html +++ /dev/null @@ -1 +0,0 @@ -libstdbuf - Rust

Crate libstdbuf

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/libstdbuf/sidebar-items.js b/coreutils/dev/libstdbuf/sidebar-items.js deleted file mode 100644 index b774f8529..000000000 --- a/coreutils/dev/libstdbuf/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["__stdbuf"]}; \ No newline at end of file diff --git a/coreutils/dev/link/all.html b/coreutils/dev/link/all.html deleted file mode 100644 index 0ff48ba47..000000000 --- a/coreutils/dev/link/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/link/fn.main.html b/coreutils/dev/link/fn.main.html deleted file mode 100644 index 6b63ff5a1..000000000 --- a/coreutils/dev/link/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in link - Rust

Function link::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/link/index.html b/coreutils/dev/link/index.html deleted file mode 100644 index 4461dba15..000000000 --- a/coreutils/dev/link/index.html +++ /dev/null @@ -1 +0,0 @@ -link - Rust
\ No newline at end of file diff --git a/coreutils/dev/link/sidebar-items.js b/coreutils/dev/link/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/link/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/ln/all.html b/coreutils/dev/ln/all.html deleted file mode 100644 index 702046ff2..000000000 --- a/coreutils/dev/ln/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/ln/fn.main.html b/coreutils/dev/ln/fn.main.html deleted file mode 100644 index b00becea4..000000000 --- a/coreutils/dev/ln/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in ln - Rust

Function ln::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/ln/index.html b/coreutils/dev/ln/index.html deleted file mode 100644 index 04452feea..000000000 --- a/coreutils/dev/ln/index.html +++ /dev/null @@ -1 +0,0 @@ -ln - Rust

Crate ln

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/ln/sidebar-items.js b/coreutils/dev/ln/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/ln/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/logname/all.html b/coreutils/dev/logname/all.html deleted file mode 100644 index fa222b742..000000000 --- a/coreutils/dev/logname/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/logname/fn.main.html b/coreutils/dev/logname/fn.main.html deleted file mode 100644 index d10bdd04f..000000000 --- a/coreutils/dev/logname/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in logname - Rust

Function logname::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/logname/index.html b/coreutils/dev/logname/index.html deleted file mode 100644 index a710c7b80..000000000 --- a/coreutils/dev/logname/index.html +++ /dev/null @@ -1 +0,0 @@ -logname - Rust
\ No newline at end of file diff --git a/coreutils/dev/logname/sidebar-items.js b/coreutils/dev/logname/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/logname/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/ls/all.html b/coreutils/dev/ls/all.html deleted file mode 100644 index b2cc25ce2..000000000 --- a/coreutils/dev/ls/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/ls/fn.main.html b/coreutils/dev/ls/fn.main.html deleted file mode 100644 index 2d1d22545..000000000 --- a/coreutils/dev/ls/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in ls - Rust

Function ls::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/ls/index.html b/coreutils/dev/ls/index.html deleted file mode 100644 index a0095a385..000000000 --- a/coreutils/dev/ls/index.html +++ /dev/null @@ -1 +0,0 @@ -ls - Rust

Crate ls

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/ls/sidebar-items.js b/coreutils/dev/ls/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/ls/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/mkdir/all.html b/coreutils/dev/mkdir/all.html deleted file mode 100644 index 492a43cbb..000000000 --- a/coreutils/dev/mkdir/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/mkdir/fn.main.html b/coreutils/dev/mkdir/fn.main.html deleted file mode 100644 index 200692207..000000000 --- a/coreutils/dev/mkdir/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in mkdir - Rust

Function mkdir::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/mkdir/index.html b/coreutils/dev/mkdir/index.html deleted file mode 100644 index 032a42b1e..000000000 --- a/coreutils/dev/mkdir/index.html +++ /dev/null @@ -1 +0,0 @@ -mkdir - Rust
\ No newline at end of file diff --git a/coreutils/dev/mkdir/sidebar-items.js b/coreutils/dev/mkdir/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/mkdir/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/mkfifo/all.html b/coreutils/dev/mkfifo/all.html deleted file mode 100644 index e4f772a12..000000000 --- a/coreutils/dev/mkfifo/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/mkfifo/fn.main.html b/coreutils/dev/mkfifo/fn.main.html deleted file mode 100644 index 1ac3620ed..000000000 --- a/coreutils/dev/mkfifo/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in mkfifo - Rust

Function mkfifo::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/mkfifo/index.html b/coreutils/dev/mkfifo/index.html deleted file mode 100644 index 65c826680..000000000 --- a/coreutils/dev/mkfifo/index.html +++ /dev/null @@ -1 +0,0 @@ -mkfifo - Rust
\ No newline at end of file diff --git a/coreutils/dev/mkfifo/sidebar-items.js b/coreutils/dev/mkfifo/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/mkfifo/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/mknod/all.html b/coreutils/dev/mknod/all.html deleted file mode 100644 index df48043b1..000000000 --- a/coreutils/dev/mknod/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/mknod/fn.main.html b/coreutils/dev/mknod/fn.main.html deleted file mode 100644 index e7d7d6438..000000000 --- a/coreutils/dev/mknod/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in mknod - Rust

Function mknod::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/mknod/index.html b/coreutils/dev/mknod/index.html deleted file mode 100644 index 7c155afaa..000000000 --- a/coreutils/dev/mknod/index.html +++ /dev/null @@ -1 +0,0 @@ -mknod - Rust
\ No newline at end of file diff --git a/coreutils/dev/mknod/sidebar-items.js b/coreutils/dev/mknod/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/mknod/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/mktemp/all.html b/coreutils/dev/mktemp/all.html deleted file mode 100644 index 9cca8fac2..000000000 --- a/coreutils/dev/mktemp/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/mktemp/fn.main.html b/coreutils/dev/mktemp/fn.main.html deleted file mode 100644 index 9b2d99330..000000000 --- a/coreutils/dev/mktemp/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in mktemp - Rust

Function mktemp::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/mktemp/index.html b/coreutils/dev/mktemp/index.html deleted file mode 100644 index 5a7403d7f..000000000 --- a/coreutils/dev/mktemp/index.html +++ /dev/null @@ -1 +0,0 @@ -mktemp - Rust
\ No newline at end of file diff --git a/coreutils/dev/mktemp/sidebar-items.js b/coreutils/dev/mktemp/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/mktemp/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/more/all.html b/coreutils/dev/more/all.html deleted file mode 100644 index ca47ee46b..000000000 --- a/coreutils/dev/more/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/more/fn.main.html b/coreutils/dev/more/fn.main.html deleted file mode 100644 index c40d34c64..000000000 --- a/coreutils/dev/more/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in more - Rust

Function more::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/more/index.html b/coreutils/dev/more/index.html deleted file mode 100644 index 2f3233591..000000000 --- a/coreutils/dev/more/index.html +++ /dev/null @@ -1 +0,0 @@ -more - Rust
\ No newline at end of file diff --git a/coreutils/dev/more/sidebar-items.js b/coreutils/dev/more/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/more/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/mv/all.html b/coreutils/dev/mv/all.html deleted file mode 100644 index d75a0a05d..000000000 --- a/coreutils/dev/mv/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/mv/fn.main.html b/coreutils/dev/mv/fn.main.html deleted file mode 100644 index 693af9854..000000000 --- a/coreutils/dev/mv/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in mv - Rust

Function mv::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/mv/index.html b/coreutils/dev/mv/index.html deleted file mode 100644 index 61bb881c3..000000000 --- a/coreutils/dev/mv/index.html +++ /dev/null @@ -1 +0,0 @@ -mv - Rust

Crate mv

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/mv/sidebar-items.js b/coreutils/dev/mv/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/mv/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/nice/all.html b/coreutils/dev/nice/all.html deleted file mode 100644 index 77e71ca2f..000000000 --- a/coreutils/dev/nice/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/nice/fn.main.html b/coreutils/dev/nice/fn.main.html deleted file mode 100644 index 53d9f6c4e..000000000 --- a/coreutils/dev/nice/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in nice - Rust

Function nice::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/nice/index.html b/coreutils/dev/nice/index.html deleted file mode 100644 index f16f24410..000000000 --- a/coreutils/dev/nice/index.html +++ /dev/null @@ -1 +0,0 @@ -nice - Rust
\ No newline at end of file diff --git a/coreutils/dev/nice/sidebar-items.js b/coreutils/dev/nice/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/nice/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/nl/all.html b/coreutils/dev/nl/all.html deleted file mode 100644 index d8c70f8bc..000000000 --- a/coreutils/dev/nl/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/nl/fn.main.html b/coreutils/dev/nl/fn.main.html deleted file mode 100644 index c1ce49161..000000000 --- a/coreutils/dev/nl/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in nl - Rust

Function nl::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/nl/index.html b/coreutils/dev/nl/index.html deleted file mode 100644 index 4932a7a2f..000000000 --- a/coreutils/dev/nl/index.html +++ /dev/null @@ -1 +0,0 @@ -nl - Rust

Crate nl

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/nl/sidebar-items.js b/coreutils/dev/nl/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/nl/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/nohup/all.html b/coreutils/dev/nohup/all.html deleted file mode 100644 index 89d3b0550..000000000 --- a/coreutils/dev/nohup/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/nohup/fn.main.html b/coreutils/dev/nohup/fn.main.html deleted file mode 100644 index 3b0ce851a..000000000 --- a/coreutils/dev/nohup/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in nohup - Rust

Function nohup::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/nohup/index.html b/coreutils/dev/nohup/index.html deleted file mode 100644 index b0c51d9e9..000000000 --- a/coreutils/dev/nohup/index.html +++ /dev/null @@ -1 +0,0 @@ -nohup - Rust
\ No newline at end of file diff --git a/coreutils/dev/nohup/sidebar-items.js b/coreutils/dev/nohup/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/nohup/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/nproc/all.html b/coreutils/dev/nproc/all.html deleted file mode 100644 index bf055a205..000000000 --- a/coreutils/dev/nproc/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/nproc/fn.main.html b/coreutils/dev/nproc/fn.main.html deleted file mode 100644 index 4a4255b08..000000000 --- a/coreutils/dev/nproc/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in nproc - Rust

Function nproc::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/nproc/index.html b/coreutils/dev/nproc/index.html deleted file mode 100644 index c576d08b1..000000000 --- a/coreutils/dev/nproc/index.html +++ /dev/null @@ -1 +0,0 @@ -nproc - Rust
\ No newline at end of file diff --git a/coreutils/dev/nproc/sidebar-items.js b/coreutils/dev/nproc/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/nproc/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/numfmt/all.html b/coreutils/dev/numfmt/all.html deleted file mode 100644 index 38b7a1efd..000000000 --- a/coreutils/dev/numfmt/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/numfmt/fn.main.html b/coreutils/dev/numfmt/fn.main.html deleted file mode 100644 index c2f90d3ba..000000000 --- a/coreutils/dev/numfmt/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in numfmt - Rust

Function numfmt::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/numfmt/index.html b/coreutils/dev/numfmt/index.html deleted file mode 100644 index 731ddac3c..000000000 --- a/coreutils/dev/numfmt/index.html +++ /dev/null @@ -1 +0,0 @@ -numfmt - Rust
\ No newline at end of file diff --git a/coreutils/dev/numfmt/sidebar-items.js b/coreutils/dev/numfmt/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/numfmt/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/od/all.html b/coreutils/dev/od/all.html deleted file mode 100644 index 74cececd6..000000000 --- a/coreutils/dev/od/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/od/fn.main.html b/coreutils/dev/od/fn.main.html deleted file mode 100644 index fd091ead9..000000000 --- a/coreutils/dev/od/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in od - Rust

Function od::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/od/index.html b/coreutils/dev/od/index.html deleted file mode 100644 index 1d7e51764..000000000 --- a/coreutils/dev/od/index.html +++ /dev/null @@ -1 +0,0 @@ -od - Rust

Crate od

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/od/sidebar-items.js b/coreutils/dev/od/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/od/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/paste/all.html b/coreutils/dev/paste/all.html deleted file mode 100644 index 1c225b4c5..000000000 --- a/coreutils/dev/paste/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/paste/fn.main.html b/coreutils/dev/paste/fn.main.html deleted file mode 100644 index 694ff0b62..000000000 --- a/coreutils/dev/paste/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in paste - Rust

Function paste::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/paste/index.html b/coreutils/dev/paste/index.html deleted file mode 100644 index 682e79318..000000000 --- a/coreutils/dev/paste/index.html +++ /dev/null @@ -1 +0,0 @@ -paste - Rust
\ No newline at end of file diff --git a/coreutils/dev/paste/sidebar-items.js b/coreutils/dev/paste/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/paste/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/pathchk/all.html b/coreutils/dev/pathchk/all.html deleted file mode 100644 index 5d941c4bd..000000000 --- a/coreutils/dev/pathchk/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/pathchk/fn.main.html b/coreutils/dev/pathchk/fn.main.html deleted file mode 100644 index 11f9778ae..000000000 --- a/coreutils/dev/pathchk/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in pathchk - Rust

Function pathchk::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/pathchk/index.html b/coreutils/dev/pathchk/index.html deleted file mode 100644 index ab0b1e858..000000000 --- a/coreutils/dev/pathchk/index.html +++ /dev/null @@ -1 +0,0 @@ -pathchk - Rust
\ No newline at end of file diff --git a/coreutils/dev/pathchk/sidebar-items.js b/coreutils/dev/pathchk/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/pathchk/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/pinky/all.html b/coreutils/dev/pinky/all.html deleted file mode 100644 index 161b9e1a2..000000000 --- a/coreutils/dev/pinky/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/pinky/fn.main.html b/coreutils/dev/pinky/fn.main.html deleted file mode 100644 index 296ea5e82..000000000 --- a/coreutils/dev/pinky/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in pinky - Rust

Function pinky::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/pinky/index.html b/coreutils/dev/pinky/index.html deleted file mode 100644 index 2ef52b48b..000000000 --- a/coreutils/dev/pinky/index.html +++ /dev/null @@ -1 +0,0 @@ -pinky - Rust
\ No newline at end of file diff --git a/coreutils/dev/pinky/sidebar-items.js b/coreutils/dev/pinky/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/pinky/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/pr/all.html b/coreutils/dev/pr/all.html deleted file mode 100644 index 219a02b3b..000000000 --- a/coreutils/dev/pr/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/pr/fn.main.html b/coreutils/dev/pr/fn.main.html deleted file mode 100644 index 6fb5981e9..000000000 --- a/coreutils/dev/pr/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in pr - Rust

Function pr::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/pr/index.html b/coreutils/dev/pr/index.html deleted file mode 100644 index 0ac494aa0..000000000 --- a/coreutils/dev/pr/index.html +++ /dev/null @@ -1 +0,0 @@ -pr - Rust

Crate pr

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/pr/sidebar-items.js b/coreutils/dev/pr/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/pr/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/printenv/all.html b/coreutils/dev/printenv/all.html deleted file mode 100644 index e8c1e3b73..000000000 --- a/coreutils/dev/printenv/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/printenv/fn.main.html b/coreutils/dev/printenv/fn.main.html deleted file mode 100644 index a0cb380f0..000000000 --- a/coreutils/dev/printenv/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in printenv - Rust

Function printenv::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/printenv/index.html b/coreutils/dev/printenv/index.html deleted file mode 100644 index f4819380c..000000000 --- a/coreutils/dev/printenv/index.html +++ /dev/null @@ -1 +0,0 @@ -printenv - Rust
\ No newline at end of file diff --git a/coreutils/dev/printenv/sidebar-items.js b/coreutils/dev/printenv/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/printenv/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/printf/all.html b/coreutils/dev/printf/all.html deleted file mode 100644 index 2d8b54d70..000000000 --- a/coreutils/dev/printf/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/printf/fn.main.html b/coreutils/dev/printf/fn.main.html deleted file mode 100644 index be3d4fe01..000000000 --- a/coreutils/dev/printf/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in printf - Rust

Function printf::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/printf/index.html b/coreutils/dev/printf/index.html deleted file mode 100644 index 6ffc31d40..000000000 --- a/coreutils/dev/printf/index.html +++ /dev/null @@ -1 +0,0 @@ -printf - Rust
\ No newline at end of file diff --git a/coreutils/dev/printf/sidebar-items.js b/coreutils/dev/printf/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/printf/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/ptx/all.html b/coreutils/dev/ptx/all.html deleted file mode 100644 index 333e542e6..000000000 --- a/coreutils/dev/ptx/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/ptx/fn.main.html b/coreutils/dev/ptx/fn.main.html deleted file mode 100644 index b0a26d5e2..000000000 --- a/coreutils/dev/ptx/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in ptx - Rust

Function ptx::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/ptx/index.html b/coreutils/dev/ptx/index.html deleted file mode 100644 index f1b8353d8..000000000 --- a/coreutils/dev/ptx/index.html +++ /dev/null @@ -1 +0,0 @@ -ptx - Rust
\ No newline at end of file diff --git a/coreutils/dev/ptx/sidebar-items.js b/coreutils/dev/ptx/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/ptx/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/pwd/all.html b/coreutils/dev/pwd/all.html deleted file mode 100644 index 2d9f09511..000000000 --- a/coreutils/dev/pwd/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/pwd/fn.main.html b/coreutils/dev/pwd/fn.main.html deleted file mode 100644 index 28f70bf37..000000000 --- a/coreutils/dev/pwd/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in pwd - Rust

Function pwd::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/pwd/index.html b/coreutils/dev/pwd/index.html deleted file mode 100644 index bd0fd6b10..000000000 --- a/coreutils/dev/pwd/index.html +++ /dev/null @@ -1 +0,0 @@ -pwd - Rust
\ No newline at end of file diff --git a/coreutils/dev/pwd/sidebar-items.js b/coreutils/dev/pwd/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/pwd/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/readlink/all.html b/coreutils/dev/readlink/all.html deleted file mode 100644 index 84b930373..000000000 --- a/coreutils/dev/readlink/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/readlink/fn.main.html b/coreutils/dev/readlink/fn.main.html deleted file mode 100644 index d5d6003e9..000000000 --- a/coreutils/dev/readlink/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in readlink - Rust

Function readlink::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/readlink/index.html b/coreutils/dev/readlink/index.html deleted file mode 100644 index b2b2001c3..000000000 --- a/coreutils/dev/readlink/index.html +++ /dev/null @@ -1 +0,0 @@ -readlink - Rust
\ No newline at end of file diff --git a/coreutils/dev/readlink/sidebar-items.js b/coreutils/dev/readlink/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/readlink/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/realpath/all.html b/coreutils/dev/realpath/all.html deleted file mode 100644 index d3142e310..000000000 --- a/coreutils/dev/realpath/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/realpath/fn.main.html b/coreutils/dev/realpath/fn.main.html deleted file mode 100644 index 6327819a5..000000000 --- a/coreutils/dev/realpath/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in realpath - Rust

Function realpath::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/realpath/index.html b/coreutils/dev/realpath/index.html deleted file mode 100644 index e5b0d1fb8..000000000 --- a/coreutils/dev/realpath/index.html +++ /dev/null @@ -1 +0,0 @@ -realpath - Rust
\ No newline at end of file diff --git a/coreutils/dev/realpath/sidebar-items.js b/coreutils/dev/realpath/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/realpath/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/relpath/all.html b/coreutils/dev/relpath/all.html deleted file mode 100644 index be0af0c5f..000000000 --- a/coreutils/dev/relpath/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/relpath/fn.main.html b/coreutils/dev/relpath/fn.main.html deleted file mode 100644 index e5b2da7a5..000000000 --- a/coreutils/dev/relpath/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in relpath - Rust

Function relpath::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/relpath/index.html b/coreutils/dev/relpath/index.html deleted file mode 100644 index 1d8d271e9..000000000 --- a/coreutils/dev/relpath/index.html +++ /dev/null @@ -1 +0,0 @@ -relpath - Rust
\ No newline at end of file diff --git a/coreutils/dev/relpath/sidebar-items.js b/coreutils/dev/relpath/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/relpath/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/rm/all.html b/coreutils/dev/rm/all.html deleted file mode 100644 index 63e352515..000000000 --- a/coreutils/dev/rm/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/rm/fn.main.html b/coreutils/dev/rm/fn.main.html deleted file mode 100644 index db8b982a7..000000000 --- a/coreutils/dev/rm/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in rm - Rust

Function rm::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/rm/index.html b/coreutils/dev/rm/index.html deleted file mode 100644 index 42447ecaf..000000000 --- a/coreutils/dev/rm/index.html +++ /dev/null @@ -1 +0,0 @@ -rm - Rust

Crate rm

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/rm/sidebar-items.js b/coreutils/dev/rm/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/rm/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/rmdir/all.html b/coreutils/dev/rmdir/all.html deleted file mode 100644 index 09d901f1e..000000000 --- a/coreutils/dev/rmdir/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/rmdir/fn.main.html b/coreutils/dev/rmdir/fn.main.html deleted file mode 100644 index 92d91c61f..000000000 --- a/coreutils/dev/rmdir/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in rmdir - Rust

Function rmdir::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/rmdir/index.html b/coreutils/dev/rmdir/index.html deleted file mode 100644 index bea66982f..000000000 --- a/coreutils/dev/rmdir/index.html +++ /dev/null @@ -1 +0,0 @@ -rmdir - Rust
\ No newline at end of file diff --git a/coreutils/dev/rmdir/sidebar-items.js b/coreutils/dev/rmdir/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/rmdir/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/runcon/all.html b/coreutils/dev/runcon/all.html deleted file mode 100644 index fe310157c..000000000 --- a/coreutils/dev/runcon/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/runcon/fn.main.html b/coreutils/dev/runcon/fn.main.html deleted file mode 100644 index c29a4c972..000000000 --- a/coreutils/dev/runcon/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in runcon - Rust

Function runcon::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/runcon/index.html b/coreutils/dev/runcon/index.html deleted file mode 100644 index 4080697aa..000000000 --- a/coreutils/dev/runcon/index.html +++ /dev/null @@ -1 +0,0 @@ -runcon - Rust
\ No newline at end of file diff --git a/coreutils/dev/runcon/sidebar-items.js b/coreutils/dev/runcon/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/runcon/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/search-index.js b/coreutils/dev/search-index.js deleted file mode 100644 index 2888e77ab..000000000 --- a/coreutils/dev/search-index.js +++ /dev/null @@ -1,216 +0,0 @@ -var searchIndex = JSON.parse('{\ -"arch":{"doc":"","t":"F","n":["main"],"q":[[0,"arch"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"base32":{"doc":"","t":"F","n":["main"],"q":[[0,"base32"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"base64":{"doc":"","t":"F","n":["main"],"q":[[0,"base64"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"basename":{"doc":"","t":"F","n":["main"],"q":[[0,"basename"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"basenc":{"doc":"","t":"F","n":["main"],"q":[[0,"basenc"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"cat":{"doc":"","t":"F","n":["main"],"q":[[0,"cat"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"chcon":{"doc":"","t":"F","n":["main"],"q":[[0,"chcon"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"chgrp":{"doc":"","t":"F","n":["main"],"q":[[0,"chgrp"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"chmod":{"doc":"","t":"F","n":["main"],"q":[[0,"chmod"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"chown":{"doc":"","t":"F","n":["main"],"q":[[0,"chown"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"chroot":{"doc":"","t":"F","n":["main"],"q":[[0,"chroot"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"cksum":{"doc":"","t":"F","n":["main"],"q":[[0,"cksum"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"comm":{"doc":"","t":"F","n":["main"],"q":[[0,"comm"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"coreutils":{"doc":"","t":"GRFFFFFFFF","n":["UtilityMap","VERSION","binary_path","gen_completions","gen_coreutils_app","gen_manpage","main","name","usage","util_map"],"q":[[0,"coreutils"]],"d":["","","","Prints completions for the utility in the first parameter …","","Generate the manpage for the utility in the first parameter","","","",""],"i":[0,0,0,0,0,0,0,0,0,0],"f":[0,0,[1,2],[[1,[4,[3]]],5],[[[4,[3]]],6],[[1,[4,[3]]],5],[[]],[7,[[8,[3]]]],[[[4,[3]],3]],[[],[[4,[3]]]]],"c":[],"p":[[8,"Iterator"],[3,"PathBuf"],[15,"str"],[3,"OrderedMap"],[15,"never"],[3,"Command"],[3,"Path"],[4,"Option"]]},\ -"cp":{"doc":"","t":"F","n":["main"],"q":[[0,"cp"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"csplit":{"doc":"","t":"F","n":["main"],"q":[[0,"csplit"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"cut":{"doc":"","t":"F","n":["main"],"q":[[0,"cut"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"date":{"doc":"","t":"F","n":["main"],"q":[[0,"date"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"dd":{"doc":"","t":"F","n":["main"],"q":[[0,"dd"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"df":{"doc":"","t":"F","n":["main"],"q":[[0,"df"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"dir":{"doc":"","t":"F","n":["main"],"q":[[0,"dir"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"dircolors":{"doc":"","t":"F","n":["main"],"q":[[0,"dircolors"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"dirname":{"doc":"","t":"F","n":["main"],"q":[[0,"dirname"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"du":{"doc":"","t":"F","n":["main"],"q":[[0,"du"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"echo":{"doc":"","t":"F","n":["main"],"q":[[0,"echo"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"env":{"doc":"","t":"F","n":["main"],"q":[[0,"env"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"expand":{"doc":"","t":"F","n":["main"],"q":[[0,"expand"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"expr":{"doc":"","t":"F","n":["main"],"q":[[0,"expr"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"factor":{"doc":"","t":"F","n":["main"],"q":[[0,"factor"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"false":{"doc":"","t":"F","n":["main"],"q":[[0,"false"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"fmt":{"doc":"","t":"F","n":["main"],"q":[[0,"fmt"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"fold":{"doc":"","t":"F","n":["main"],"q":[[0,"fold"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"groups":{"doc":"","t":"F","n":["main"],"q":[[0,"groups"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"hashsum":{"doc":"","t":"F","n":["main"],"q":[[0,"hashsum"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"head":{"doc":"","t":"F","n":["main"],"q":[[0,"head"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"hostid":{"doc":"","t":"F","n":["main"],"q":[[0,"hostid"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"hostname":{"doc":"","t":"F","n":["main"],"q":[[0,"hostname"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"id":{"doc":"","t":"F","n":["main"],"q":[[0,"id"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"install":{"doc":"","t":"F","n":["main"],"q":[[0,"install"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"join":{"doc":"","t":"F","n":["main"],"q":[[0,"join"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"kill":{"doc":"","t":"F","n":["main"],"q":[[0,"kill"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"libstdbuf":{"doc":"","t":"F","n":["__stdbuf"],"q":[[0,"libstdbuf"]],"d":["Safety"],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"link":{"doc":"","t":"F","n":["main"],"q":[[0,"link"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"ln":{"doc":"","t":"F","n":["main"],"q":[[0,"ln"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"logname":{"doc":"","t":"F","n":["main"],"q":[[0,"logname"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"ls":{"doc":"","t":"F","n":["main"],"q":[[0,"ls"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"mkdir":{"doc":"","t":"F","n":["main"],"q":[[0,"mkdir"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"mkfifo":{"doc":"","t":"F","n":["main"],"q":[[0,"mkfifo"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"mknod":{"doc":"","t":"F","n":["main"],"q":[[0,"mknod"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"mktemp":{"doc":"","t":"F","n":["main"],"q":[[0,"mktemp"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"more":{"doc":"","t":"F","n":["main"],"q":[[0,"more"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"mv":{"doc":"","t":"F","n":["main"],"q":[[0,"mv"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"nice":{"doc":"","t":"F","n":["main"],"q":[[0,"nice"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"nl":{"doc":"","t":"F","n":["main"],"q":[[0,"nl"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"nohup":{"doc":"","t":"F","n":["main"],"q":[[0,"nohup"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"nproc":{"doc":"","t":"F","n":["main"],"q":[[0,"nproc"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"numfmt":{"doc":"","t":"F","n":["main"],"q":[[0,"numfmt"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"od":{"doc":"","t":"F","n":["main"],"q":[[0,"od"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"paste":{"doc":"","t":"F","n":["main"],"q":[[0,"paste"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"pathchk":{"doc":"","t":"F","n":["main"],"q":[[0,"pathchk"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"pinky":{"doc":"","t":"F","n":["main"],"q":[[0,"pinky"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"pr":{"doc":"","t":"F","n":["main"],"q":[[0,"pr"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"printenv":{"doc":"","t":"F","n":["main"],"q":[[0,"printenv"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"printf":{"doc":"","t":"F","n":["main"],"q":[[0,"printf"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"ptx":{"doc":"","t":"F","n":["main"],"q":[[0,"ptx"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"pwd":{"doc":"","t":"F","n":["main"],"q":[[0,"pwd"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"readlink":{"doc":"","t":"F","n":["main"],"q":[[0,"readlink"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"realpath":{"doc":"","t":"F","n":["main"],"q":[[0,"realpath"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"relpath":{"doc":"","t":"F","n":["main"],"q":[[0,"relpath"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"rm":{"doc":"","t":"F","n":["main"],"q":[[0,"rm"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"rmdir":{"doc":"","t":"F","n":["main"],"q":[[0,"rmdir"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"runcon":{"doc":"","t":"F","n":["main"],"q":[[0,"runcon"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"seq":{"doc":"","t":"F","n":["main"],"q":[[0,"seq"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"shred":{"doc":"","t":"F","n":["main"],"q":[[0,"shred"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"shuf":{"doc":"","t":"F","n":["main"],"q":[[0,"shuf"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"sleep":{"doc":"","t":"F","n":["main"],"q":[[0,"sleep"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"sort":{"doc":"","t":"F","n":["main"],"q":[[0,"sort"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"split":{"doc":"","t":"F","n":["main"],"q":[[0,"split"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"stat":{"doc":"","t":"F","n":["main"],"q":[[0,"stat"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"stdbuf":{"doc":"","t":"F","n":["main"],"q":[[0,"stdbuf"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"stty":{"doc":"","t":"F","n":["main"],"q":[[0,"stty"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"sum":{"doc":"","t":"F","n":["main"],"q":[[0,"sum"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"sync":{"doc":"","t":"F","n":["main"],"q":[[0,"sync"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"tac":{"doc":"","t":"F","n":["main"],"q":[[0,"tac"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"tail":{"doc":"","t":"F","n":["main"],"q":[[0,"tail"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"tee":{"doc":"","t":"F","n":["main"],"q":[[0,"tee"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"test":{"doc":"","t":"F","n":["main"],"q":[[0,"test"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"timeout":{"doc":"","t":"F","n":["main"],"q":[[0,"timeout"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"touch":{"doc":"","t":"F","n":["main"],"q":[[0,"touch"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"tr":{"doc":"","t":"F","n":["main"],"q":[[0,"tr"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"true":{"doc":"","t":"F","n":["main"],"q":[[0,"true"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"truncate":{"doc":"","t":"F","n":["main"],"q":[[0,"truncate"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"tsort":{"doc":"","t":"F","n":["main"],"q":[[0,"tsort"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"tty":{"doc":"","t":"F","n":["main"],"q":[[0,"tty"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"uname":{"doc":"","t":"F","n":["main"],"q":[[0,"uname"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"unexpand":{"doc":"","t":"F","n":["main"],"q":[[0,"unexpand"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"uniq":{"doc":"","t":"F","n":["main"],"q":[[0,"uniq"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"unlink":{"doc":"","t":"F","n":["main"],"q":[[0,"unlink"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"uptime":{"doc":"","t":"F","n":["main"],"q":[[0,"uptime"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"users":{"doc":"","t":"F","n":["main"],"q":[[0,"users"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"uu_arch":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_arch"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_base32":{"doc":"","t":"AFFHDFLLMLLFFMLAFMLLLMHHHH","n":["base_common","uu_app","uumain","BASE_CMD_PARSE_ERROR","Config","base_app","borrow","borrow_mut","decode","from","from","get_input","handle_input","ignore_garbage","into","options","parse_base_cmd_args","to_read","try_from","try_into","type_id","wrap_cols","DECODE","FILE","IGNORE_GARBAGE","WRAP"],"q":[[0,"uu_base32"],[3,"uu_base32::base_common"],[22,"uu_base32::base_common::options"]],"d":["","","","","","","","","","Returns the argument unchanged.","","","","","Calls U::from(self).","","","","","","","","","","",""],"i":[0,0,0,0,0,0,6,6,6,6,6,0,0,6,6,0,0,6,6,6,6,6,0,0,0,0],"f":[0,[[],1],[2,3],0,0,[[4,4],1],[[]],[[]],0,[[]],[5,[[7,[6]]]],[[6,8],[[7,[[10,[9]]]]]],[[9,11,[13,[12]],14,14],7],0,[[]],0,[[2,4,4],[[7,[6]]]],0,[[],15],[[],15],[[],16],0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"],[15,"str"],[3,"ArgMatches"],[3,"Config"],[6,"UResult"],[3,"Stdin"],[8,"Read"],[3,"Box"],[4,"Format"],[15,"usize"],[4,"Option"],[15,"bool"],[4,"Result"],[3,"TypeId"]]},\ -"uu_base64":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_base64"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_basename":{"doc":"","t":"AFFHHHH","n":["options","uu_app","uumain","MULTIPLE","NAME","SUFFIX","ZERO"],"q":[[0,"uu_basename"],[3,"uu_basename::options"]],"d":["","","","","","",""],"i":[0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_basenc":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_basenc"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_cat":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_cat"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_chcon":{"doc":"","t":"AFFHHHHHHHHAAAHHHHHHH","n":["options","uu_app","uumain","HELP","RANGE","RECURSIVE","REFERENCE","ROLE","TYPE","USER","VERBOSE","dereference","preserve_root","sym_links","DEREFERENCE","NO_DEREFERENCE","NO_PRESERVE_ROOT","PRESERVE_ROOT","FOLLOW_ARG_DIR_SYM_LINK","FOLLOW_DIR_SYM_LINKS","NO_FOLLOW_SYM_LINKS"],"q":[[0,"uu_chcon"],[3,"uu_chcon::options"],[14,"uu_chcon::options::dereference"],[16,"uu_chcon::options::preserve_root"],[18,"uu_chcon::options::sym_links"]],"d":["","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_chgrp":{"doc":"","t":"AFFDIDLLLLLLLLLLLLLFFMMFFLLKLLLLMMLLLLLLLLMFMMMMF","n":["entries","uu_app","uumain","Group","Locate","Passwd","belongs_to","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","fmt","fmt","from","from","get_groups","get_groups_gnu","gid","gid","gid2grp","grp2gid","into","into","locate","locate","locate","locate","locate","name","name","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uid","uid2usr","user_dir","user_info","user_passwd","user_shell","usr2uid"],"q":[[0,"uu_chgrp"],[3,"uu_chgrp::entries"]],"d":["Get password/group file entry","","","","Fetch desired entry.","","This is a wrapper function for libc::getgrouplist.","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","From: …","The list of group IDs returned from GNU’s groups and GNU…","AKA passwd.pw_gid","AKA group.gr_gid","","","Calls U::from(self).","Calls U::from(self).","","","","","","AKA passwd.pw_name","AKA group.gr_name","","","","","","","","","AKA passwd.pw_uid","","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell",""],"i":[0,0,0,0,0,0,4,4,8,4,8,4,8,4,8,4,8,4,8,0,0,4,8,0,0,4,8,18,4,4,8,8,4,8,4,8,4,8,4,8,4,8,4,0,4,4,4,4,0],"f":[0,[[],1],[2,3],0,0,0,[4,[[7,[5,6]]]],[[]],[[]],[[]],[[]],[4,4],[8,8],[[]],[[]],[[4,9],[[11,[10]]]],[[8,9],[[11,[10]]]],[[]],[[]],[[],[[11,[[7,[5,6]],12]]]],[[[13,[5]]],[[11,[[7,[5,6]],12]]]],0,0,[5,[[11,[14,12]]]],[15,[[11,[5,12]]]],[[]],[[]],[[],[[11,[16,12]]]],[15,[[11,[4,12]]]],[5,[[11,[4,12]]]],[5,[[11,[8,12]]]],[15,[[11,[8,12]]]],0,0,[[]],[[]],[[],11],[[],11],[[],11],[[],11],[[],17],[[],17],0,[5,[[11,[14,12]]]],0,0,0,0,[15,[[11,[5,12]]]]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"],[3,"Passwd"],[15,"u32"],[3,"Global"],[3,"Vec"],[3,"Group"],[3,"Formatter"],[3,"Error"],[4,"Result"],[3,"Error"],[4,"Option"],[3,"String"],[15,"str"],[8,"Sized"],[3,"TypeId"],[8,"Locate"]]},\ -"uu_chmod":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_chmod"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_chown":{"doc":"","t":"DIDLLLLLLLLLALLLLMMLLKLLLLMMLLLLLLLLMMMMMFFDIDFFMMFFKMMMFMMMMF","n":["Group","Locate","Passwd","belongs_to","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","entries","fmt","fmt","from","from","gid","gid","into","into","locate","locate","locate","locate","locate","name","name","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uid","user_dir","user_info","user_passwd","user_shell","uu_app","uumain","Group","Locate","Passwd","get_groups","get_groups_gnu","gid","gid","gid2grp","grp2gid","locate","name","name","uid","uid2usr","user_dir","user_info","user_passwd","user_shell","usr2uid"],"q":[[0,"uu_chown"],[43,"uu_chown::entries"]],"d":["","Fetch desired entry.","","This is a wrapper function for libc::getgrouplist.","","","","","","","","","Get password/group file entry","","","Returns the argument unchanged.","Returns the argument unchanged.","AKA passwd.pw_gid","AKA group.gr_gid","Calls U::from(self).","Calls U::from(self).","","","","","","AKA passwd.pw_name","AKA group.gr_name","","","","","","","","","AKA passwd.pw_uid","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell","","","","Fetch desired entry.","","From: …","The list of group IDs returned from GNU’s groups and GNU…","AKA passwd.pw_gid","AKA group.gr_gid","","","","AKA passwd.pw_name","AKA group.gr_name","AKA passwd.pw_uid","","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell",""],"i":[0,0,0,1,1,5,1,5,1,5,1,5,0,1,5,1,5,1,5,1,5,18,1,1,5,5,1,5,1,5,1,5,1,5,1,5,1,1,1,1,1,0,0,0,0,0,0,0,1,5,0,0,18,1,5,1,0,1,1,1,1,0],"f":[0,0,0,[1,[[4,[2,3]]]],[[]],[[]],[[]],[[]],[1,1],[5,5],[[]],[[]],0,[[1,6],[[8,[7]]]],[[5,6],[[8,[7]]]],[[]],[[]],0,0,[[]],[[]],[[],[[8,[9,10]]]],[11,[[8,[1,10]]]],[2,[[8,[1,10]]]],[11,[[8,[5,10]]]],[2,[[8,[5,10]]]],0,0,[[]],[[]],[[],8],[[],8],[[],8],[[],8],[[],12],[[],12],0,0,0,0,0,[[],13],[14,15],0,0,0,[[],[[8,[[4,[2,3]],10]]]],[[[16,[2]]],[[8,[[4,[2,3]],10]]]],0,0,[2,[[8,[17,10]]]],[11,[[8,[2,10]]]],[[],[[8,[9,10]]]],0,0,0,[2,[[8,[17,10]]]],0,0,0,0,[11,[[8,[2,10]]]]],"c":[],"p":[[3,"Passwd"],[15,"u32"],[3,"Global"],[3,"Vec"],[3,"Group"],[3,"Formatter"],[3,"Error"],[4,"Result"],[8,"Sized"],[3,"Error"],[15,"str"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"],[4,"Option"],[3,"String"],[8,"Locate"]]},\ -"uu_chroot":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_chroot"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_cksum":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_cksum"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_comm":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_comm"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_cp":{"doc":"","t":"SNNNDNNNNENEGSNENNNNNNNSNSNNNNNNNDEEENNENNNENNNMMMMLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLMFMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMFMMMMMMLLMLMMLMMMMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMFFMFMM","n":["ALL","Always","Always","AttrOnly","Attributes","Auto","Auto","Backup","Clobber","ClobberMode","Copy","CopyMode","CopyResult","DEFAULT","Directory","Error","Error","File","Force","Interactive","InvalidArgument","IoErr","IoErrContext","LINKS","Link","NONE","Never","Never","No","NoClobber","NotADirectory","NotAllFilesCopied","NotImplemented","Options","OverwriteMode","Preserve","ReflinkMode","RemoveDestination","Skipped","SparseMode","Standard","StripPrefixError","SymLink","TargetType","Update","WalkDirErr","Yes","attributes","attributes_only","backup","backup_suffix","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cli_dereference","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","code","context","copy","copy_contents","copy_mode","debug","dereference","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","links","localize_to_target","mode","no_target_dir","one_file_system","overwrite","ownership","parents","parse_iter","partial_cmp","progress_bar","provide","recursive","reflink_mode","source","sparse_mode","strip_trailing_slashes","target_dir","timestamps","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","union","update","uu_app","uumain","verbose","verify_target_type","xattr","required"],"q":[[0,"uu_cp"],[193,"uu_cp::Preserve"]],"d":["","","","","Preservation settings for various attributes","","","Invalid arguments to backup","Default Always overwrite existing files","Specifies how to overwrite files.","","Copy action to perform","","","","","General copy error","","","Prompt before overwriting a file","Result of a skipped file","Simple io::Error wrapper","Wrapper for io::Error with path context","","","","","","","Never overwrite a file","","Represents the state when a non-fatal error has occurred …","All standard options are included as an an implementation …","Options for the cp command","Specifies whether files should be overwritten.","","Possible arguments for --reflink.","","Result of a skipped file Currently happens when “no” …","Possible arguments for --sparse.","","Simple std::path::StripPrefixError wrapper","","The expected file type of copy target","","Simple walkdir::Error wrapper","","--preserve=[=ATTRIBUTE_LIST] and …","--attributes-only","--backup[=CONTROL], -b","-S, --suffix","","","","","","","","","","","","","","","","","","","","","-H","","","","","","","","","","","","","","Copy all sources to target.","--copy-contents","Determines the type of copying that should be done","--debug","-L, --dereference","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Remove the root prefix from source and prefix it with …","","-T, --no-target-dir","-x, --one-file-system","Specifies what to do with an existing destination","","--parents","","","-g, --progress","","-R, -r, --recursive","--reflink[=WHEN]","","--sparse[=WHEN]","--strip-trailing-slashes","-t, --target-directory","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","--update[=UPDATE]","","","-v, --verbose","Generate an error message if target is not the correct …","",""],"i":[17,3,4,33,0,3,4,7,2,0,33,0,0,17,32,0,7,32,1,2,7,7,7,17,33,17,3,4,5,2,7,7,7,0,0,0,0,1,7,0,1,7,33,0,33,7,5,12,12,12,12,32,33,12,7,1,2,3,4,17,5,32,33,12,7,1,2,3,4,17,5,12,1,2,3,4,5,1,2,3,4,5,5,7,17,0,12,12,12,12,1,2,3,4,5,1,2,3,4,5,7,7,17,5,32,33,12,7,7,7,7,7,7,7,7,1,2,3,4,17,5,32,33,12,7,1,2,3,4,17,5,17,0,17,12,12,12,17,12,17,5,12,7,12,12,7,12,12,12,17,1,2,3,4,5,7,32,33,12,7,1,2,3,4,17,5,32,33,12,7,1,2,3,4,17,5,32,33,12,7,1,2,3,4,17,5,17,12,0,0,12,0,17,34],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[1,1],[2,2],[3,3],[4,4],[5,5],[[]],[[]],[[]],[[]],[[]],[[5,5],6],[7,8],0,[[[10,[9]],11,12],13],0,0,0,0,[[1,1],14],[[2,2],14],[[3,3],14],[[4,4],14],[[5,5],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[7,15],16],[[7,15],16],[[17,15],16],[[5,15],16],[[]],[[]],[[]],[[[20,[18,19]]],7],[21,7],[[[20,[22,19]]],7],[23,7],[18,7],[19,7],[[]],[22,7],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[11,11,11],[[13,[9]]]],0,0,0,0,0,0,[24,[[25,[17,7]]]],[[5,5],[[26,[6]]]],0,[27],0,0,[7,[[26,[28]]]],0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[],18],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],25],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[17,17],17],0,[[],30],[31,8],0,[[11,32],13],0,0],"c":[],"p":[[4,"ClobberMode"],[4,"OverwriteMode"],[4,"ReflinkMode"],[4,"SparseMode"],[4,"Preserve"],[4,"Ordering"],[4,"Error"],[15,"i32"],[3,"PathBuf"],[15,"slice"],[3,"Path"],[3,"Options"],[6,"CopyResult"],[15,"bool"],[3,"Formatter"],[6,"Result"],[3,"Attributes"],[3,"String"],[3,"Error"],[3,"Context"],[3,"Error"],[15,"str"],[3,"StripPrefixError"],[8,"Iterator"],[4,"Result"],[4,"Option"],[3,"Demand"],[8,"Error"],[3,"TypeId"],[3,"Command"],[8,"Args"],[4,"TargetType"],[4,"CopyMode"],[13,"Yes"]]},\ -"uu_csplit":{"doc":"","t":"DLLFLLLLLFF","n":["CsplitOptions","borrow","borrow_mut","csplit","from","into","try_from","try_into","type_id","uu_app","uumain"],"q":[[0,"uu_csplit"]],"d":["Command line options for csplit.","","","Splits a file into severals according to the command line …","Returns the argument unchanged.","Calls U::from(self).","","","","",""],"i":[0,1,1,0,1,1,1,1,1,0,0],"f":[0,[[]],[[]],[[1,[2,[0]],3],[[4,[0]]]],[[]],[[]],[[],4],[[],4],[[],5],[[],6],[7,8]],"c":[],"p":[[3,"CsplitOptions"],[3,"Vec"],[8,"BufRead"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_cut":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_cut"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_date":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_date"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_dd":{"doc":"","t":"DLLLLLLLLLLLLLFFL","n":["Alarm","borrow","borrow_mut","clone","clone_into","fmt","from","get_interval","into","is_triggered","to_owned","try_from","try_into","type_id","uu_app","uumain","with_interval"],"q":[[0,"uu_dd"]],"d":["A timer which triggers on a given interval","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","",""],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1],"f":[0,[[]],[[]],[1,1],[[]],[[1,2],3],[[]],[1,4],[[]],[1,5],[[]],[[],6],[[],6],[[],7],[[],8],[9,10],[4,1]],"c":[],"p":[[3,"Alarm"],[3,"Formatter"],[6,"Result"],[3,"Duration"],[15,"bool"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_df":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_df"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_dir":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_dir"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_dircolors":{"doc":"","t":"NNENINLLLLLKLFLKKLLLFF","n":["CShell","Display","OutputFmt","Shell","StrUtils","Unknown","borrow","borrow_mut","eq","equivalent","fmt","fnmatch","from","guess_syntax","into","purify","split_two","try_from","try_into","type_id","uu_app","uumain"],"q":[[0,"uu_dircolors"]],"d":["","","","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","Remove comments and trim whitespace","Like split_whitespace() but only produce 2 components","","","","",""],"i":[1,1,0,1,0,1,1,1,1,1,1,11,1,0,1,11,11,1,1,1,0,0],"f":[0,0,0,0,0,0,[[]],[[]],[[1,1],2],[[],2],[[1,3],4],[5,2],[[]],[[],1],[[]],[[]],[[]],[[],6],[[],6],[[],7],[[],8],[9,10]],"c":[],"p":[[4,"OutputFmt"],[15,"bool"],[3,"Formatter"],[6,"Result"],[15,"str"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"],[8,"StrUtils"]]},\ -"uu_dirname":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_dirname"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_du":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_du"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_echo":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_echo"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_env":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_env"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_expand":{"doc":"","t":"AFFHHHH","n":["options","uu_app","uumain","FILES","INITIAL","NO_UTF8","TABS"],"q":[[0,"uu_expand"],[3,"uu_expand::options"]],"d":["","","","","","",""],"i":[0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_expr":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_expr"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_factor":{"doc":"","t":"DLLLLLLLFLLLLALLALLLLLFFLFRRRFF","n":["Factors","add","borrow","borrow_mut","clone","clone_into","eq","equivalent","factor","fmt","fmt","from","into","numeric","one","push","table","to_owned","to_string","try_from","try_into","type_id","uu_app","uumain","vzip","gcd","CHUNK_SIZE","NEXT_PRIME","PRIME_INVERSIONS_U64","factor","factor_chunk"],"q":[[0,"uu_factor"],[25,"uu_factor::numeric"],[26,"uu_factor::table"]],"d":["","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","",""],"i":[0,1,1,1,1,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0],"f":[0,[[1,2,3]],[[]],[[]],[1,1],[[]],[[1,1],4],[[],4],[2,1],[[1,5],6],[[1,5],6],[[]],[[]],0,[[],1],[[1,2]],0,[[]],[[],7],[[],8],[[],8],[[],9],[[],10],[11,12],[[]],[[2,2],2],0,0,0,[[2,1]],[[[13,[2]],[13,[1]]]]],"c":[],"p":[[3,"Factors"],[15,"u64"],[15,"u8"],[15,"bool"],[3,"Formatter"],[6,"Result"],[3,"String"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"],[15,"array"]]},\ -"uu_false":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_false"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_fmt":{"doc":"","t":"GDLLLLLLLLFF","n":["FileOrStdReader","FmtOptions","borrow","borrow_mut","default","from","into","try_from","try_into","type_id","uu_app","uumain"],"q":[[0,"uu_fmt"]],"d":["","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","",""],"i":[0,0,1,1,1,1,1,1,1,1,0,0],"f":[0,0,[[]],[[]],[[],1],[[]],[[]],[[],2],[[],2],[[],3],[[],4],[5,6]],"c":[],"p":[[3,"FmtOptions"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_fold":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_fold"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_groups":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_groups"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_hashsum":{"doc":"","t":"FFFFFF","n":["uu_app_b3sum","uu_app_bits","uu_app_common","uu_app_custom","uu_app_length","uumain"],"q":[[0,"uu_hashsum"]],"d":["","","","","",""],"i":[0,0,0,0,0,0],"f":[[[],1],[[],1],[[],1],[[],1],[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_head":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_head"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_hostid":{"doc":"","t":"FFF","n":["gethostid","uu_app","uumain"],"q":[[0,"uu_hostid"]],"d":["","",""],"i":[0,0,0],"f":[0,[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_hostname":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_hostname"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_id":{"doc":"","t":"CFF","n":["libc","uu_app","uumain"],"q":[[0,"uu_id"]],"d":["","",""],"i":[0,0,0],"f":[0,[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_install":{"doc":"","t":"DNENLLLLLLLLLLLLLLLLLLLLFF","n":["Behavior","Directory","MainFunction","Standard","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","eq","equivalent","from","from","into","into","mode","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uu_app","uumain"],"q":[[0,"uu_install"]],"d":["","Create directories","","Install files to locations (primary functionality)","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Determine the mode for chmod after copy.","","","","","","","","",""],"i":[0,1,0,1,3,1,3,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,3,1,0,0],"f":[0,0,0,0,[[]],[[]],[[]],[[]],[1,1],[[]],[[1,1],2],[[],2],[[]],[[]],[[]],[[]],[3,4],[[]],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],7],[8,9]],"c":[],"p":[[4,"MainFunction"],[15,"bool"],[3,"Behavior"],[15,"u32"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_join":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_join"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_kill":{"doc":"","t":"NNENLLLLLLALLLLFFHHHH","n":["Kill","List","Mode","Table","borrow","borrow_mut","clone","clone_into","from","into","options","to_owned","try_from","try_into","type_id","uu_app","uumain","LIST","PIDS_OR_SIGNALS","SIGNAL","TABLE"],"q":[[0,"uu_kill"],[17,"uu_kill::options"]],"d":["","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","",""],"i":[1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0],"f":[0,0,0,0,[[]],[[]],[1,1],[[]],[[]],[[]],0,[[]],[[],2],[[],2],[[],3],[[],4],[5,6],0,0,0,0],"c":[],"p":[[4,"Mode"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_link":{"doc":"","t":"AFFH","n":["options","uu_app","uumain","FILES"],"q":[[0,"uu_link"],[3,"uu_link::options"]],"d":["","","",""],"i":[0,0,0,0],"f":[0,[[],1],[2,3],0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_ln":{"doc":"","t":"NNNEDLLLLLLLLLLLLLLLLLLLLFF","n":["Force","Interactive","NoClobber","OverwriteMode","Settings","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","eq","equivalent","fmt","from","from","into","into","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uu_app","uumain"],"q":[[0,"uu_ln"]],"d":["","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","",""],"i":[1,1,1,0,0,10,1,10,1,1,1,1,1,1,10,1,10,1,1,10,1,10,1,10,1,0,0],"f":[0,0,0,0,0,[[]],[[]],[[]],[[]],[1,1],[[]],[[1,1],2],[[],2],[[1,3],4],[[]],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],7],[8,9]],"c":[],"p":[[4,"OverwriteMode"],[15,"bool"],[3,"Formatter"],[6,"Result"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"],[3,"Settings"]]},\ -"uu_logname":{"doc":"","t":"FFF","n":["getlogin","uu_app","uumain"],"q":[[0,"uu_logname"]],"d":["","",""],"i":[0,0,0],"f":[0,[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_ls":{"doc":"","t":"NNNDENNLLLLLLLMLLLLLFAMLLLLLLFFHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH","n":["Across","Columns","Commas","Config","Format","Long","OneLine","borrow","borrow","borrow_mut","borrow_mut","eq","equivalent","fmt","format","from","from","from","into","into","list","options","quoting_style","try_from","try_from","try_into","try_into","type_id","type_id","uu_app","uumain","AUTHOR","COLOR","CONTEXT","DIRECTORY","DIRED","FORMAT","FULL_TIME","GROUP_DIRECTORIES_FIRST","HELP","HIDE","HIDE_CONTROL_CHARS","IGNORE","IGNORE_BACKUPS","INDICATOR_STYLE","INODE","NO_GROUP","PATHS","QUOTING_STYLE","RECURSIVE","REVERSE","SHOW_CONTROL_CHARS","SORT","TIME","TIME_STYLE","WIDTH","ZERO","dereference","files","format","indicator_style","quoting","size","sort","time","ALL","ARGS","DIR_ARGS","ALL","ALMOST_ALL","ACROSS","COLUMNS","COMMAS","LONG","LONG_NO_GROUP","LONG_NO_OWNER","LONG_NUMERIC_UID_GID","ONE_LINE","TAB_SIZE","CLASSIFY","FILE_TYPE","SLASH","C","ESCAPE","LITERAL","ALLOCATION_SIZE","BLOCK_SIZE","HUMAN_READABLE","KIBIBYTES","SI","EXTENSION","NONE","SIZE","TIME","VERSION","ACCESS","CHANGE"],"q":[[0,"uu_ls"],[31,"uu_ls::options"],[65,"uu_ls::options::dereference"],[68,"uu_ls::options::files"],[70,"uu_ls::options::format"],[79,"uu_ls::options::indicator_style"],[82,"uu_ls::options::quoting"],[85,"uu_ls::options::size"],[90,"uu_ls::options::sort"],[95,"uu_ls::options::time"]],"d":["","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[1,1,1,0,0,1,1,6,1,6,1,1,1,1,6,6,6,1,6,1,0,0,6,6,1,6,1,6,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[1,1],2],[[],2],[[1,3],4],0,[5,[[7,[6]]]],[[]],[[]],[[]],[[]],[[[9,[8]],6],7],0,0,[[],10],[[],10],[[],10],[[],10],[[],11],[[],11],[[],12],[13,14],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[4,"Format"],[15,"bool"],[3,"Formatter"],[6,"Result"],[3,"ArgMatches"],[3,"Config"],[6,"UResult"],[3,"Path"],[3,"Vec"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_mkdir":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_mkdir"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_mkfifo":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_mkfifo"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_mknod":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_mknod"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_mktemp":{"doc":"","t":"FFF","n":["dry_exec","uu_app","uumain"],"q":[[0,"uu_mktemp"]],"d":["","",""],"i":[0,0,0],"f":[[[1,1,2,1],3],[[],4],[5,6]],"c":[],"p":[[15,"str"],[15,"usize"],[6,"UResult"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_more":{"doc":"","t":"AFFRRRRRRRRRRRR","n":["options","uu_app","uumain","CLEAN_PRINT","FILES","FROM_LINE","LINES","LOGICAL","NO_PAUSE","NUMBER","PATTERN","PLAIN","PRINT_OVER","SILENT","SQUEEZE"],"q":[[0,"uu_more"],[3,"uu_more::options"]],"d":["","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_mv":{"doc":"","t":"DNNNELLLLLLLLLLLLLLLLLLLFF","n":["Behavior","Force","Interactive","NoClobber","OverwriteMode","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","eq","equivalent","from","from","into","into","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uu_app","uumain"],"q":[[0,"uu_mv"]],"d":["","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","",""],"i":[0,1,1,1,0,8,1,8,1,1,1,1,1,8,1,8,1,1,8,1,8,1,8,1,0,0],"f":[0,0,0,0,0,[[]],[[]],[[]],[[]],[1,1],[[]],[[1,1],2],[[],2],[[]],[[]],[[]],[[]],[[]],[[],3],[[],3],[[],3],[[],3],[[],4],[[],4],[[],5],[6,7]],"c":[],"p":[[4,"OverwriteMode"],[15,"bool"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"],[3,"Behavior"]]},\ -"uu_nice":{"doc":"","t":"AFFHH","n":["options","uu_app","uumain","ADJUSTMENT","COMMAND"],"q":[[0,"uu_nice"],[3,"uu_nice::options"]],"d":["","","","",""],"i":[0,0,0,0,0],"f":[0,[[],1],[2,3],0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_nl":{"doc":"","t":"DLLLLLALLLFFRRRRRRRRRRRRR","n":["Settings","borrow","borrow_mut","default","from","into","options","try_from","try_into","type_id","uu_app","uumain","BODY_NUMBERING","FILE","FOOTER_NUMBERING","HEADER_NUMBERING","HELP","JOIN_BLANK_LINES","LINE_INCREMENT","NO_RENUMBER","NUMBER_FORMAT","NUMBER_SEPARATOR","NUMBER_WIDTH","SECTION_DELIMITER","STARTING_LINE_NUMBER"],"q":[[0,"uu_nl"],[12,"uu_nl::options"]],"d":["","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","",""],"i":[0,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,[[]],[[]],[[],1],[[]],[[]],0,[[],2],[[],2],[[],3],[[],4],[5,6],0,0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Settings"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_nohup":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_nohup"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_nproc":{"doc":"","t":"RFF","n":["_SC_NPROCESSORS_CONF","uu_app","uumain"],"q":[[0,"uu_nproc"]],"d":["","",""],"i":[0,0,0],"f":[0,[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_numfmt":{"doc":"","t":"AAAFFNNNELLLLLLLLLLLLDLLFFLLLLLMLLLNRNRRRRRRRNDNRRRNERNDRRERRRRRNDNNLLLLLLLLLLLLLMLLLLMLLMLLLLLMLLMMMLLLLLMMMMMLMMMMLMMLLLLLLLLLLLLLLLM","n":["errors","format","options","uu_app","uumain","FormattingError","IllegalArgument","IoError","NumfmtError","borrow","borrow_mut","code","fmt","fmt","from","into","provide","to_string","try_from","try_into","type_id","WhitespaceSplitter","borrow","borrow_mut","div_round","format_and_print","from","into","into_iter","multiunzip","next","s","try_from","try_into","type_id","Abort","DELIMITER","Down","FIELD","FIELD_DEFAULT","FORMAT","FROM","FROM_DEFAULT","FROM_UNIT","FROM_UNIT_DEFAULT","Fail","FormatOptions","FromZero","HEADER","HEADER_DEFAULT","INVALID","Ignore","InvalidModes","NUMBER","Nearest","NumfmtOptions","PADDING","ROUND","RoundMethod","SUFFIX","TO","TO_DEFAULT","TO_UNIT","TO_UNIT_DEFAULT","TowardsZero","TransformOptions","Up","Warn","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","default","delimiter","eq","eq","equivalent","equivalent","fields","fmt","fmt","format","from","from","from","from","from","from","from_str","from_str","from_unit","grouping","header","into","into","into","into","into","invalid","padding","padding","precision","prefix","round","round","suffix","suffix","to","to_owned","to_unit","transform","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","zero_padding"],"q":[[0,"uu_numfmt"],[5,"uu_numfmt::errors"],[21,"uu_numfmt::format"],[35,"uu_numfmt::options"]],"d":["","","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","Iterate over a line’s fields, where each field is a …","","","Divide numerator by denominator, with rounding.","Format a line of text according to the selected options.","Returns the argument unchanged.","Calls U::from(self).","","","Yield the next field in the input string as a tuple …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,4,4,4,0,4,4,4,4,4,4,4,4,4,4,4,4,0,15,15,0,0,15,15,15,15,15,15,15,15,15,18,0,12,0,0,0,0,0,0,0,18,0,12,0,0,0,18,0,0,12,0,0,0,0,0,0,0,0,0,12,0,12,18,20,14,18,12,17,20,14,18,12,17,12,12,17,14,18,17,18,17,14,18,17,14,20,14,18,12,17,20,18,17,20,17,14,20,14,18,12,17,14,14,17,17,17,12,14,14,17,20,12,20,14,20,14,18,12,17,20,14,18,12,17,20,14,18,12,17,17],"f":[0,0,0,[[],1],[2,3],0,0,0,0,[[]],[[]],[4,3],[[4,5],6],[[4,5],6],[[]],[[]],[7],[[],8],[[],9],[[],9],[[],10],0,[[]],[[]],[[11,11,12],11],[[13,14],[[9,[8]]]],[[]],[[]],[[]],[[]],[15,16],0,[[],9],[[],9],[[],10],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[12,12],[[]],[[],17],0,[[18,18],19],[[17,17],19],[[],19],[[],19],0,[[18,5],6],[[17,5],6],0,[[]],[[]],[[]],[[]],[[]],0,[13,[[9,[18]]]],[13,[[9,[17]]]],0,0,0,[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,[[12,11],11],0,0,0,0,[[]],0,0,[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],10],[[],10],[[],10],[[],10],[[],10],0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"],[4,"NumfmtError"],[3,"Formatter"],[6,"Result"],[3,"Demand"],[3,"String"],[4,"Result"],[3,"TypeId"],[15,"f64"],[4,"RoundMethod"],[15,"str"],[3,"NumfmtOptions"],[3,"WhitespaceSplitter"],[4,"Option"],[3,"FormatOptions"],[4,"InvalidModes"],[15,"bool"],[3,"TransformOptions"]]},\ -"uu_od":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_od"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_paste":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_paste"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_pathchk":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_pathchk"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_pinky":{"doc":"","t":"IKFF","n":["Capitalize","capitalize","uu_app","uumain"],"q":[[0,"uu_pinky"]],"d":["","","",""],"i":[0,5,0,0],"f":[0,[[],1],[[],2],[3,4]],"c":[],"p":[[3,"String"],[3,"Command"],[8,"Args"],[15,"i32"],[8,"Capitalize"]]},\ -"uu_pr":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_pr"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_printenv":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_printenv"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_printf":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_printf"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_ptx":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_ptx"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_pwd":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_pwd"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_readlink":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_readlink"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_realpath":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_realpath"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_relpath":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_relpath"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_rm":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_rm"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_rmdir":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_rmdir"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_runcon":{"doc":"","t":"AFFRRRRR","n":["options","uu_app","uumain","COMPUTE","RANGE","ROLE","TYPE","USER"],"q":[[0,"uu_runcon"],[3,"uu_runcon::options"]],"d":["","","","","","","",""],"i":[0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_seq":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_seq"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_shred":{"doc":"","t":"AFFRRRRRRRR","n":["options","uu_app","uumain","EXACT","FILE","FORCE","ITERATIONS","REMOVE","SIZE","VERBOSE","ZERO"],"q":[[0,"uu_shred"],[3,"uu_shred::options"]],"d":["","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_shuf":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_shuf"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_sleep":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_sleep"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_sort":{"doc":"","t":"EDNNDNNNDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFFLLLL","n":["GeneralF64ParseResult","GlobalSettings","Infinity","Invalid","Line","NaN","NegInfinity","Number","Output","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","default","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","eq","fmt","fmt","from","from","from","from","init","init","init","init","into","into","into","into","partial_cmp","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","uu_app","uumain","vzip","vzip","vzip","vzip"],"q":[[0,"uu_sort"]],"d":["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,3,3,0,3,3,3,0,15,1,2,3,15,1,2,3,1,2,3,1,2,3,1,15,1,2,3,15,1,2,3,15,1,2,3,3,2,3,15,1,2,3,15,1,2,3,15,1,2,3,3,1,2,3,15,1,2,3,15,1,2,3,15,1,2,3,0,0,15,1,2,3],"f":[0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,1],[2,2],[3,3],[[]],[[]],[[]],[[],1],[4],[4],[4],[4],[4],[4],[4],[4],[4],[4],[4],[4],[[3,3],5],[[2,6],7],[[3,6],7],[[]],[[]],[[]],[[]],[[],4],[[],4],[[],4],[[],4],[[]],[[]],[[]],[[]],[[3,3],[[9,[8]]]],[[]],[[]],[[]],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],11],[[],11],[[],11],[[],11],[[],12],[13,14],[[]],[[]],[[]],[[]]],"c":[],"p":[[3,"GlobalSettings"],[3,"Line"],[4,"GeneralF64ParseResult"],[15,"usize"],[15,"bool"],[3,"Formatter"],[6,"Result"],[4,"Ordering"],[4,"Option"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"],[3,"Output"]]},\ -"uu_split":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_split"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_stat":{"doc":"","t":"NENNNNNLLLLLLLLFF","n":["Integer","OutputType","Str","Unknown","Unsigned","UnsignedHex","UnsignedOct","borrow","borrow_mut","fmt","from","into","try_from","try_into","type_id","uu_app","uumain"],"q":[[0,"uu_stat"]],"d":["","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","",""],"i":[1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0],"f":[0,0,0,0,0,0,0,[[]],[[]],[[1,2],3],[[]],[[]],[[],4],[[],4],[[],5],[[],6],[7,8]],"c":[],"p":[[4,"OutputType"],[3,"Formatter"],[6,"Result"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_stdbuf":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_stdbuf"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_stty":{"doc":"","t":"DDLLLLLLLLLLLLLLLLLFFLLLLLLLFF","n":["Flag","TermSize","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default","fmt","fmt","from","from","hidden","into","into","new","new_grouped","sane","tiocgwinsz","tiocswinsz","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uu_app","uumain"],"q":[[0,"uu_stty"]],"d":["","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","","","","Get terminal window size","Set terminal window size","","","","","","","","",""],"i":[0,0,2,3,2,3,2,2,3,2,3,2,3,2,2,3,2,2,2,0,0,2,2,3,2,3,2,3,0,0],"f":[0,0,[[]],[[]],[[]],[[]],[[[2,[1]]],[[2,[1]]]],[[]],[[],3],[[[2,[4]],5],6],[[3,5],6],[[]],[[]],[2,2],[[]],[[]],[7,2],[7,2],[2,2],[[8,3],[[9,[8]]]],[[8,3],[[9,[8]]]],[[]],[[],10],[[],10],[[],10],[[],10],[[],11],[[],11],[[],12],[13,14]],"c":[],"p":[[8,"Clone"],[3,"Flag"],[3,"TermSize"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[15,"str"],[6,"c_int"],[6,"Result"],[4,"Result"],[3,"TypeId"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_sum":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_sum"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_sync":{"doc":"","t":"AFFHH","n":["options","uu_app","uumain","DATA","FILE_SYSTEM"],"q":[[0,"uu_sync"],[3,"uu_sync::options"]],"d":["","","","",""],"i":[0,0,0,0,0],"f":[0,[[],1],[2,3],0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_tac":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_tac"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_tail":{"doc":"","t":"AAACFNNNEENNNNNNNNDEELLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLMLLLLLMMLAFFMMMMLLLLLLLLLLLLLLLLLMFMLRRRRRRRRRRRRRARRRRDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRR","n":["args","chunks","text","uu_app","uumain","Bytes","CannotFollowStdinByName","Descriptor","FilterMode","FollowMode","Lines","MinusZero","Name","Negative","NoOutput","Ok","PlusZero","Positive","Settings","Signum","VerificationResult","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","check_warnings","clone","clone","clone_into","clone_into","default","default","eq","eq","eq","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","follow","from","from","from","from","from","from","from_obsolete_args","has_only_stdin","has_stdin","inputs","into","into","into","into","into","max_unchanged_stats","mode","num_inputs","options","parse_args","parse_obsolete","pid","presume_input_pipe","retry","sleep_sec","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","use_polling","uu_app","verbose","verify","ARG_FILES","BYTES","DISABLE_INOTIFY_TERM","FOLLOW","FOLLOW_RETRY","LINES","MAX_UNCHANGED_STATS","PID","PRESUME_INPUT_PIPE","RETRY","SLEEP_INT","USE_POLLING","ZERO_TERM","verbosity","QUIET","VERBOSE","BLOCK_SIZE","BUFFER_SIZE","BytesChunk","BytesChunkBuffer","LinesChunk","LinesChunkBuffer","ReverseChunks","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","eq","equivalent","fill","fill","fill","fill","fmt","fmt","from","from","from","from","from","get_buffer","get_buffer","get_buffer_with","get_buffer_with","get_lines","has_data","has_data","has_data","into","into","into","into","into","into_iter","new","new","new","new","new","next","print","print","print_bytes","print_lines","to_owned","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","BACKEND","BAD_FD","BECOME_INACCESSIBLE","DASH","DEV_PTMX","DEV_STDIN","DEV_TTY","FD0","IS_A_DIRECTORY","NO_FILES_REMAINING","NO_SUCH_FILE","STDIN_HEADER"],"q":[[0,"uu_tail"],[5,"uu_tail::args"],[96,"uu_tail::args::options"],[110,"uu_tail::args::options::verbosity"],[112,"uu_tail::chunks"],[184,"uu_tail::text"]],"d":["","Iterating over a file by chunks, either starting at the …","","","","","","","","","Mode for lines delimited by delimiter as u8","","","","","","","","","","","","","","","","","","","","","Check Settings for problematic configurations of tail …","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","FILE(s) positional arguments","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Verify Settings and try to find unsolvable …","","","","","","","","","","","","","","","","","When reading files in reverse in bounded_tail, this is the …","The size of the backing buffer of a LinesChunk or …","A BytesChunk storing a fixed size number of bytes in a …","An abstraction layer on top of BytesChunk mainly to …","Works similar to a BytesChunk but also stores the number …","An abstraction layer on top of LinesChunk mainly to …","An iterator over a file in non-overlapping chunks from the …","","","","","","","","","","","","","","","Fills this buffer with chunks and consumes the reader …","Fills this buffer with chunks and consumes the reader …","Fills self.buffer with maximal BUFFER_SIZE number of …","Fills self.buffer with maximal BUFFER_SIZE number of …","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Receive the internal buffer safely, so it returns a slice …","Returns this buffer safely. See BytesChunk::get_buffer","Like BytesChunk::get_buffer, but returning a slice from …","Returns this buffer safely with an offset applied. See …","Return the number of lines the buffer contains. self.lines …","","","Returns true if this buffer has stored any bytes.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Creates a new BytesChunkBuffer.","Create a new LinesChunkBuffer","","","","","","Print the bytes contained in this buffer beginning from …","Print the bytes contained in this buffer calculated with …","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,6,10,5,0,0,6,4,5,4,10,10,4,4,0,0,0,4,6,5,10,3,4,6,5,10,3,3,4,5,4,5,6,3,4,6,5,4,6,5,4,6,5,10,3,3,4,6,5,10,3,3,3,3,3,3,4,6,5,10,3,3,3,3,0,0,0,3,3,3,3,4,5,4,6,5,10,3,4,6,5,10,3,4,6,5,10,3,3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,20,22,19,23,27,20,22,19,23,19,19,19,19,20,22,19,23,19,23,27,20,22,19,23,19,23,19,23,23,20,19,23,27,20,22,19,23,27,27,20,22,19,23,27,20,22,23,23,19,27,20,22,19,23,27,20,22,19,23,27,20,22,19,23,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,0,0,0,[1,2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[3],[4,4],[5,5],[[]],[[]],[[],6],[[],3],[[4,4],7],[[6,6],7],[[5,5],7],[[],7],[[],7],[[],7],[[4,8],9],[[6,8],9],[[5,8],9],[[10,8],9],[[3,8],9],0,[[]],[[]],[[]],[[]],[[]],[11,[[12,[3]]]],0,[3,7],[3,7],0,[[]],[[]],[[]],[[]],[[]],0,0,[3,15],0,[1,[[12,[3]]]],[[13,[14,[13]]],[[12,[[14,[3]]]]]],0,0,0,0,[[]],[[]],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],17],[[],17],[[],17],[[],17],[[],17],0,[[],18],0,[3,10],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[19,19],[[]],[[19,19],7],[[],7],[[20,21],12],[[22,21],12],[[19,21],[[12,[[14,[15]]]]]],[[23,21],[[12,[[14,[15]]]]]],[[19,8],9],[[23,8],9],[[]],[[]],[[]],[[]],[[]],[19,[[25,[24]]]],[23,[[25,[24]]]],[[19,15],[[25,[24]]]],[[23,15],[[25,[24]]]],[23,15],[20,7],[19,7],[23,7],[[]],[[]],[[]],[[]],[[]],[[]],[26,27],[28,20],[[24,28],22],[[],19],[24,23],[27,14],[[20,29],12],[[22,29],12],[[23,29,15],12],[[23,29,15],12],[[]],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],17],[[],17],[[],17],[[],17],[[],17],0,0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[8,"Args"],[15,"i32"],[3,"Settings"],[4,"Signum"],[4,"FollowMode"],[4,"FilterMode"],[15,"bool"],[3,"Formatter"],[6,"Result"],[4,"VerificationResult"],[3,"ArgMatches"],[6,"UResult"],[3,"OsString"],[4,"Option"],[15,"usize"],[4,"Result"],[3,"TypeId"],[3,"Command"],[3,"BytesChunk"],[3,"BytesChunkBuffer"],[8,"BufRead"],[3,"LinesChunkBuffer"],[3,"LinesChunk"],[15,"u8"],[15,"slice"],[3,"File"],[3,"ReverseChunks"],[15,"u64"],[8,"Write"]]},\ -"uu_tee":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_tee"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_test":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_test"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_timeout":{"doc":"","t":"AFFHHHHHHH","n":["options","uu_app","uumain","COMMAND","DURATION","FOREGROUND","KILL_AFTER","PRESERVE_STATUS","SIGNAL","VERBOSE"],"q":[[0,"uu_timeout"],[3,"uu_timeout::options"]],"d":["","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_touch":{"doc":"","t":"AFFHHHHHHHAHHH","n":["options","uu_app","uumain","ACCESS","HELP","MODIFICATION","NO_CREATE","NO_DEREF","SOURCES","TIME","sources","DATE","REFERENCE","TIMESTAMP"],"q":[[0,"uu_touch"],[3,"uu_touch::options"],[11,"uu_touch::options::sources"]],"d":["","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_tr":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_tr"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_true":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_true"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_truncate":{"doc":"","t":"AFFHHHHH","n":["options","uu_app","uumain","ARG_FILES","IO_BLOCKS","NO_CREATE","REFERENCE","SIZE"],"q":[[0,"uu_truncate"],[3,"uu_truncate::options"]],"d":["","","","","","","",""],"i":[0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_tsort":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_tsort"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_tty":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_tty"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_uname":{"doc":"","t":"AFFHHHHHHHHH","n":["options","uu_app","uumain","ALL","HARDWARE_PLATFORM","KERNEL_NAME","KERNEL_RELEASE","KERNEL_VERSION","MACHINE","NODENAME","OS","PROCESSOR"],"q":[[0,"uu_uname"],[3,"uu_uname::options"]],"d":["","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_unexpand":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_unexpand"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_uniq":{"doc":"","t":"AFFHHHHHHHHHH","n":["options","uu_app","uumain","ALL_REPEATED","CHECK_CHARS","COUNT","GROUP","IGNORE_CASE","REPEATED","SKIP_CHARS","SKIP_FIELDS","UNIQUE","ZERO_TERMINATED"],"q":[[0,"uu_uniq"],[3,"uu_uniq::options"]],"d":["","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,[[],1],[2,3],0,0,0,0,0,0,0,0,0,0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_unlink":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_unlink"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_uptime":{"doc":"","t":"AFFH","n":["options","uu_app","uumain","SINCE"],"q":[[0,"uu_uptime"],[3,"uu_uptime::options"]],"d":["","","",""],"i":[0,0,0,0],"f":[0,[[],1],[2,3],0],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_users":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_users"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_vdir":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_vdir"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_wc":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_wc"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_who":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_who"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_whoami":{"doc":"","t":"FF","n":["uu_app","uumain"],"q":[[0,"uu_whoami"]],"d":["",""],"i":[0,0],"f":[[[],1],[2,3]],"c":[],"p":[[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uu_yes":{"doc":"","t":"FFF","n":["exec","uu_app","uumain"],"q":[[0,"uu_yes"]],"d":["","",""],"i":[0,0,0],"f":[[[[2,[1]]],3],[[],4],[5,6]],"c":[],"p":[[15,"u8"],[15,"slice"],[6,"Result"],[3,"Command"],[8,"Args"],[15,"i32"]]},\ -"uucore":{"doc":"","t":"IFAOLLOOAAAAFFAAFOOOOAAXAAAAAAAAAAOAAFAFAOOOOAAOAFAANRHENENNNNNALLLLLLLFFLLLLLLLLLFLLLFLLLLLLLLLHHHFFFIDLLLLLLLLLLLLLLLFFKLLLLLNNNNNNNDNEGNEENNNLLLLLLLLLLFLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFFDIDLLLLLLLLLLLLLFFMMFFLLKLLLLMMLLLLLLLLMFMMMMFDDIIIDGDDLLLLLLLLLLLLLLLLMMLLLLLLLLLLLLLLLLLFLLLLLKMMLLLLLLLLLFFLLLLLLLLLLLLLLLLLLLLOLLLKNDNNENNNEFFLLLLLLFLLLLFFFLLLLLLLLLLLLLLOLFLLLLFFFLFFLLLLLLLLLLLIIDDDFKLMMMKKLMMLLLLLLLLLLLLMMMLLMMMMMMMMMMMMMMMMMMMMMMLLLKLKLLLLKLMKLLLLLKLMMMKLLKFFFFMFDFLLLKLKLLLLLLLLLLENNLLLLLLLLLLLLLLLLDLLLLLFLLLLFFFFFFFFFFFNNEDNMMLLLLMLMLLLLLLLLLLFLLLLLLLLLLLFNNNDNDNENNNENNNDELLLLLLLLLLLLFLLLLMMMMMALLLLLLLMMMLLLLLLLLMLLLLLLMAMMMMLLMLLLLLLLLLLLLLLLLLLMFDIDFFMMFFKMMMFMMMMFRRRRRRRAAAARRRRRRRRRRRGGLFFFFIFFFFKKKNNNNEENNLLLLLLFLLLLLLLLLLLMMMMMDLLLFFLLLLLLMLMLLLLDLLMLLLLLLLLDLLLLLLLLLLLLLLLHHFFFFFDDDDIDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNNEALLLLFLLLLLLLLLHHFFRRRHRRRRRRRRRRRDDLLLLLLFLLLFLLLLLLLLLLLLFLLLLLLLLLFF","n":["Args","args_os","backup_control","bin","collect_ignore","collect_lossy","crash","crash_if_err","display","encoding","entries","error","execution_phrase","format_usage","fs","fsext","get_utility_is_second_arg","has","help_about","help_section","help_usage","line_ending","lines","main","memo","mode","os","panic","parse_glob","parse_size","parse_time","perms","pipes","process","prompt_yes","quoting_style","ranges","read_yes","ringbuffer","set_utility_is_second_arg","shortcut_value_parser","show","show_error","show_if_err","show_warning","signals","sum","uio_error","update_control","util_name","utmpx","version_cmp","AmbiguousArgument","BACKUP_CONTROL_LONG_HELP","BACKUP_CONTROL_VALUES","BackupError","BackupImpossible","BackupMode","ExistingBackup","InvalidArgument","NoBackup","NumberedBackup","SimpleBackup","arguments","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","code","determine_backup_mode","determine_backup_suffix","eq","eq","equivalent","equivalent","fmt","fmt","fmt","from","from","get_backup_path","into","into","provide","source_is_target_backup","to_owned","to_string","try_from","try_from","try_into","try_into","type_id","type_id","usage","OPT_BACKUP","OPT_BACKUP_NO_ARG","OPT_SUFFIX","backup","backup_no_args","suffix","Quotable","Quoted","borrow","borrow_mut","clone","clone_into","external","fmt","fmt","force","from","from","into","maybe_quote","maybe_quote","native","native_raw","print_verbatim","println_verbatim","quote","to_owned","to_string","try_from","try_into","type_id","Base16","Base2Lsbf","Base2Msbf","Base32","Base32Hex","Base64","Base64Url","Data","Decode","DecodeError","DecodeResult","DecodeZ85","EncodeError","Format","Io","Z85","Z85InputLenNotMultipleOf4","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","decode","decode","encode","encode","fmt","fmt","from","from","from","from","from","from","from","ignore_garbage","into","into","into","into","line_wrap","new","provide","source","to_owned","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","wrap_print","wrap_write","Group","Locate","Passwd","belongs_to","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","fmt","fmt","from","from","get_groups","get_groups_gnu","gid","gid","gid2grp","grp2gid","into","into","locate","locate","locate","locate","locate","name","name","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uid","uid2usr","user_dir","user_info","user_passwd","user_shell","usr2uid","ClapErrorWrapper","ExitCode","FromIo","UClapError","UError","UIoError","UResult","USimpleError","UUsageError","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","code","code","code","code","code","code","code","code","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","get_exit_code","into","into","into","into","into","map_err_context","message","message","new","new","new","new","provide","provide","provide","provide","provide","set_exit_code","strip_errno","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","uio_error","usage","usage","usage","with_exit_code","Existing","FileInformation","Logical","Missing","MissingHandling","None","Normal","Physical","ResolveMode","are_hardlinks_or_one_way_symlink_to_same_file","are_hardlinks_to_same_file","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","canonicalize","clone","clone","clone_into","clone_into","dir_strip_dot_for_creation","display_permissions","display_permissions_unix","eq","eq","eq","equivalent","equivalent","equivalent","file_size","fmt","fmt","from","from","from","from_file","from_path","has","hash","infos_refer_to_same_file","inode","into","into","into","is_symlink_loop","make_path_relative_to","normalize_path","number_of_links","paths_refer_to_same_file","resolve_relative_path","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","BirthTime","FsMeta","FsUsage","MountInfo","StatFs","StatFs","avail_blocks","avail_blocks","bavail","bavail_top_bit_set","bfree","birth","block_size","block_size","blocks","blocksize","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","dev_id","dev_name","dummy","eq","equivalent","f_bavail","f_bavail","f_bfree","f_bfree","f_blocks","f_blocks","f_bsize","f_bsize","f_ffree","f_ffree","f_files","f_files","f_frsize","f_frsize","f_fsid","f_fsid","f_namelen","f_namelen","f_type","f_type","ffree","files","fmt","fmt","fmt","free_blocks","free_blocks","free_file_nodes","free_file_nodes","from","from","from","fs_type","fs_type","fs_type","fsid","fsid","hash","into","into","into","io_size","io_size","mount_dir","mount_option","mount_root","namelen","namelen","new","pretty_birth","pretty_filetype","pretty_fstype","pretty_time","read_fs_list","remote","statfs","statfs_fn","statfs_fn","to_owned","to_owned","to_owned","total_blocks","total_blocks","total_file_nodes","total_file_nodes","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","LineEnding","Newline","Nul","borrow","borrow_mut","clone","clone_into","default","eq","fmt","fmt","from","from_zero_flag","into","to_owned","to_string","try_from","try_into","type_id","Lines","borrow","borrow_mut","from","into","into_iter","lines","next","try_from","try_into","type_id","printf","sprintf","get_umask","parse_mode","parse_numeric","parse_symbolic","strip_minus_from_mode","is_wsl_1","is_wsl_2","mute_sigpipe_panic","from_str","InvalidSuffix","ParseFailure","ParseSizeError","Parser","SizeTooBig","allow_list","b_byte_count","borrow","borrow","borrow_mut","borrow_mut","capital_b_bytes","default","default_unit","description","eq","equivalent","fmt","fmt","from","from","into","into","parse","parse_size","provide","to_string","try_from","try_from","try_into","try_into","type_id","type_id","with_allow_list","with_b_byte_count","with_default_unit","from_str","All","All","Changes","ChownExecutor","First","GidUidOwnerFilter","Group","IfFrom","None","Normal","Silent","TraverseSymlinks","User","UserGroup","Verbose","Verbosity","VerbosityLevel","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chown_base","clone","clone","clone_into","clone_into","dereference","dest_gid","dest_gid","dest_uid","dest_uid","entries","eq","eq","eq","equivalent","equivalent","equivalent","exec","files","filter","filter","fmt","fmt","from","from","from","from","from","from","groups_only","into","into","into","into","into","into","level","options","preserve_root","raw_owner","raw_owner","recursive","to_owned","to_owned","traverse_symlinks","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","verbosity","wrap_chown","Group","Locate","Passwd","get_groups","get_groups_gnu","gid","gid","gid2grp","grp2gid","locate","name","name","uid","uid2usr","user_dir","user_info","user_passwd","user_shell","usr2uid","ARG_FILES","ARG_GROUP","ARG_OWNER","FROM","HELP","RECURSIVE","REFERENCE","dereference","preserve_root","traverse","verbosity","DEREFERENCE","NO_DEREFERENCE","NO_PRESERVE","PRESERVE","EVERY","NO_TRAVERSE","TRAVERSE","CHANGES","QUIET","SILENT","VERBOSE","Error","Result","map_err_context","pipe","splice","splice_exact","vmsplice","ChildExt","getegid","geteuid","getgid","getuid","send_signal","send_signal_group","wait_or_timeout","C","Double","Literal","None","Quotes","QuotingStyle","Shell","Single","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","escape_name","from","from","into","into","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","always_quote","escape","quotes","show_control","show_control","Range","borrow","borrow_mut","cmp","complement","contain","eq","equivalent","fmt","from","from_list","from_str","high","into","low","partial_cmp","try_from","try_into","type_id","RingBuffer","borrow","borrow_mut","data","from","from_iter","into","new","push_back","try_from","try_into","type_id","ShortcutValueParser","borrow","borrow_mut","clone","clone_into","from","from","into","into_resettable","new","parse_ref","possible_values","to_owned","try_from","try_into","type_id","ALL_SIGNALS","DEFAULT_SIGNAL","enable_pipe_errors","ignore_interrupts","is_signal","signal_by_name_or_value","signal_name_by_value","BSD","Blake2b","Blake3","CRC","Digest","DigestWriter","Md5","SYSV","Sha1","Sha224","Sha256","Sha384","Sha3_224","Sha3_256","Sha3_384","Sha3_512","Sha512","Shake128","Shake256","Sm3","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","div_ceil","finalize","flush","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_finalize","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","hash_update","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","new","new","new","new","new","new","new","new","new","new","new","new","new","new","new","new","new","new","new","new","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bits","output_bytes","output_bytes","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","reset","result_str","result_str","result_str","result_str","result_str","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","with_output_bytes","write","ReplaceAll","ReplaceIfOlder","ReplaceNone","UpdateMode","arguments","borrow","borrow_mut","clone","clone_into","determine_update_mode","eq","equivalent","fmt","from","into","to_owned","try_from","try_into","type_id","OPT_UPDATE","OPT_UPDATE_NO_ARG","update","update_no_args","ACCOUNTING","BOOT_TIME","DEAD_PROCESS","DEFAULT_FILE","EMPTY","INIT_PROCESS","LOGIN_PROCESS","NEW_TIME","OLD_TIME","RUN_LVL","USER_PROCESS","UT_HOSTSIZE","UT_IDSIZE","UT_LINESIZE","UT_NAMESIZE","Utmpx","UtmpxIter","borrow","borrow","borrow_mut","borrow_mut","canon_host","drop","endutxent","exit_status","from","from","getutxent","host","into","into","into_inner","into_iter","is_user_process","iter_all_records","iter_all_records_from","login_time","next","pid","record_type","setutxent","terminal_suffix","try_from","try_from","try_into","try_into","tty_device","type_id","type_id","user","utmpxname","version_cmp"],"q":[[0,"uucore"],[52,"uucore::backup_control"],[96,"uucore::backup_control::arguments"],[102,"uucore::display"],[127,"uucore::encoding"],[192,"uucore::entries"],[238,"uucore::error"],[327,"uucore::fs"],[390,"uucore::fsext"],[497,"uucore::line_ending"],[516,"uucore::lines"],[527,"uucore::memo"],[529,"uucore::mode"],[534,"uucore::os"],[536,"uucore::panic"],[537,"uucore::parse_glob"],[538,"uucore::parse_size"],[574,"uucore::parse_time"],[575,"uucore::perms"],[669,"uucore::perms::entries"],[688,"uucore::perms::options"],[699,"uucore::perms::options::dereference"],[701,"uucore::perms::options::preserve_root"],[703,"uucore::perms::options::traverse"],[706,"uucore::perms::options::verbosity"],[710,"uucore::pipes"],[717,"uucore::process"],[725,"uucore::quoting_style"],[751,"uucore::quoting_style::QuotingStyle"],[756,"uucore::ranges"],[775,"uucore::ringbuffer"],[787,"uucore::shortcut_value_parser"],[803,"uucore::signals"],[810,"uucore::sum"],[1071,"uucore::update_control"],[1090,"uucore::update_control::arguments"],[1094,"uucore::utmpx"],[1145,"uucore::version_cmp"]],"d":["","","Implement GNU-style backup functionality.","Execute utility code for util.","Collects the iterator into a Vec<String>, removing any …","Collects the iterator into a Vec<String>, lossily …","Display an error and std::process::exit","Unwrap a std::result::Result, crashing instead of …","","","Get password/group file entry","All utils return exit with an exit code. Usually, the …","Derive the complete execution phrase for “usage”.","Generate the usage string for clap.","Set of functions to manage files and symlinks","Set of functions to manage file systems","","Used to check if the mode has its perm bit set.","Get the about text from the help file.","Reads a section from a file of the util as a str literal.","Get the usage from the help file.","Provides consistent newline/zero terminator handling for -z…","Iterate over lines, including the line ending character(s).","","Main entry point for our implementation of printf.","Set of functions to parse modes","","Custom panic hooks that allow silencing certain types of …","Parsing a glob Pattern from a string.","","Parsing a duration from a string.","Common functions to manage permissions","","Set of functions to manage IDs","Prompt the user with a formatted string and returns true …","","","Read a line from stdin and check whether the first …","A fixed-size ring buffer.","","","Display a crate::error::UError and set global exit code.","Show an error to stderr in a similar style to GNU …","Display an error and set global exit code in error case.","Print a warning message to stderr.","","Implementations of digest functions, like md5 and sha1.","Shorthand to construct UIoError-instances.","Implement GNU-style update functionality.","Derive the utility name.","Aims to provide platform-independent methods to obtain …","","An ambiguous argument (e.g. ‘n’) was given as backup …","","","Backup error types.","Currently unused","Available backup modes.","Argument ‘existing’, ‘nil’","An invalid argument (e.g. ‘foo’) was given as backup …","Argument ‘none’, ‘off’","Argument ‘numbered’, ‘t’","Argument ‘simple’, ‘never’","Arguments for backup-related functionality.","","","","","","","","Determine the “mode” for the backup operation to …","Obtain the suffix to use for a backup.","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","","Returns true if the source file is likely to be the simple …","","","","","","","","","","","","","‘–backup’ argument","‘-b’ argument","‘-S, –suffix’ argument","An extension trait to apply quoting to strings.","A wrapper around string types for displaying with quoting …","","","","","When quoting for PowerShell, toggle whether to quote for …","","","Toggle forced quoting. If true, quotes are added even if …","Returns the argument unchanged.","","Calls U::from(self).","Like quote(), but don’t actually add quotes unless …","Like quote(), but don’t actually add quotes unless …","Quote a string with the default style for the platform.","Quote an OsStr with the default style for the platform.","Like println_verbatim, without the trailing newline.","Print a path (or OsStr-like object) directly to stdout, …","Returns an object that implements Display for printing …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","Fetch desired entry.","","This is a wrapper function for libc::getgrouplist.","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","From: …","The list of group IDs returned from GNU’s groups and GNU…","AKA passwd.pw_gid","AKA group.gr_gid","","","Calls U::from(self).","Calls U::from(self).","","","","","","AKA passwd.pw_name","AKA group.gr_name","","","","","","","","","AKA passwd.pw_uid","","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell","","A wrapper for clap::Error that implements UError","A special error type that does not print any message when …","Enables the conversion from std::io::Error to UError and …","Extension trait for clap::Error to adjust the exit code.","Custom errors defined by the utils and uucore.","Wrapper type around std::io::Error.","Result type that should be returned by all utils.","A simple error type with an exit code and a message that …","","","","","","","","","","","","Error code of a custom error.","Error code of a custom error.","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Get the last exit code set with set_exit_code. The default …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","Set the exit code for the program if uumain returns Ok(()).","Strip the trailing “ (os error XX)“ from io error …","","","","","","","","","","","","","","","","","","","","","Shorthand to construct UIoError-instances.","Print usage help to a custom error.","Print usage help to a custom error.","","","Resolve symbolic links, ignoring errors on the final …","Information to uniquely identify a file","Resolve ‘..’ elements before symlinks","Resolve symbolic links, ignoring errors on the non-final …","Controls how symbolic links should be handled when …","Do not resolve any symbolic links.","Return an error if any part of the path is missing.","Resolve symlinks as encountered when processing the path","Controls when symbolic links are resolved","Checks if either two paths are hard links to the same file …","Checks if two paths are hard links to the same file.","","","","","","","Return the canonical, absolute form of a path.","","","","","For some programs like install or mkdir, dir/. can be …","Display the permissions of a file On non unix like system, …","Display the permissions of a file on a unix like system","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Get information from a currently open file","Get information for a given path.","Used to check if the mode has its perm bit set.","","Checks if p1 and p2 are the same file information. If …","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Checks if there is a symlink loop in the given path.","Converts absolute path to be relative to absolute to path.","Normalize a path by removing relative information For …","","Checks if p1 and p2 are the same file. If error happens …","resolve a relative path","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","Read file system list.","","","","","","","","","","","","","","","","","","","","","Line ending of either \\\\n or \\\\0","","","","","","","","","","","Returns the argument unchanged.","Create a LineEnding from a -z/--zero flag","Calls U::from(self).","","","","","","An iterator over the lines of an instance of BufRead.","","","Returns the argument unchanged.","Calls U::from(self).","","Returns an iterator over the lines, including line ending …","","","","","Write a formatted string to stdout.","Create a new formatted string.","","","","","","Test if the program is running under WSL","","Terminate without error on panics that occur due to broken …","Parse a glob Pattern from a string.","","","","Parser for sizes in SI or IEC units (multiples of 1000 or …","","Whitelist for the suffix","Whether to treat “b” as a “byte count” instead of …","","","","","Whether to treat the suffix “B” as meaning “bytes”.","","Default unit when no suffix is provided","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Parse a size string into a number of bytes.","Parse a size string into a number of bytes.","","","","","","","","","","","","Parse a duration from a string.","","","","","","","","","","","","","","","","","The various level of verbosity","","","","","","","","","","","","","Base implementation for chgrp and chown.","","","","","","","","","","Get password/group file entry","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Perform the change of owner on a path with the various …","","Fetch desired entry.","","From: …","The list of group IDs returned from GNU’s groups and GNU…","AKA passwd.pw_gid","AKA group.gr_gid","","","","AKA passwd.pw_name","AKA group.gr_name","AKA passwd.pw_uid","","AKA passwd.pw_dir","AKA passwd.pw_gecos","AKA passwd.pw_passwd","AKA passwd.pw_shell","","","","","","","","","","","","","","","","","","","","","","","","Nix’s main error type.","Nix Result Type","","A wrapper around nix::unistd::pipe that ensures the pipe …","Less noisy wrapper around nix::fcntl::splice.","Splice wrapper which fully finishes the write.","Copy data from bytes into target, which must be a pipe.","Missing methods for Child objects","getegid() returns the effective group ID of the calling …","geteuid() returns the effective user ID of the calling …","getgid() returns the real group ID of the calling process.","getuid() returns the real user ID of the calling process.","Send a signal to a Child process.","Send a signal to a process group.","Wait for a process to finish or return after the specified …","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","Test if at least one of the given Ranges contain the …","","","","Returns the argument unchanged.","","Parse a string of the form a-b into a Range","","Calls U::from(self).","","","","","","A fixed-size ring buffer backed by a VecDeque.","","","","Returns the argument unchanged.","","Calls U::from(self).","","Append a value to the end of the ring buffer.","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","first element of the tuple is the blake2b state second is …","","","","A struct that writes to a digest.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Return a new Blake2b instance with a custom output bytes …","","","","","","","","","","","Determine the “mode” for the update operation to …","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","Iterator of login records","","","","","Canonicalize host name using DNS","","","A.K.A. ut.ut_exit","Returns the argument unchanged.","Returns the argument unchanged.","","A.K.A. ut.ut_host","Calls U::from(self).","Calls U::from(self).","Consumes the Utmpx, returning the underlying C struct utmpx","","","Iterate through all the utmp records.","Iterate through all the utmp records from a specific file.","A.K.A. ut.ut_tv","","A.K.A. ut.ut_pid","A.K.A. ut.ut_type","","A.K.A. ut.ut_id","","","","","A.K.A. ut.ut_line","","","A.K.A. ut.ut_user","",""],"i":[0,0,0,0,80,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,6,7,6,6,6,0,6,7,6,7,6,6,7,0,0,6,7,6,7,6,7,7,6,7,0,6,7,7,0,6,7,6,7,6,7,6,7,7,0,0,0,0,0,0,0,0,20,20,20,20,20,20,20,20,20,20,20,22,22,20,20,0,0,22,20,20,20,20,20,27,27,27,27,27,27,27,0,34,0,0,34,0,0,34,27,33,33,32,34,27,33,32,34,27,27,27,0,32,0,32,34,34,33,32,34,34,34,34,27,32,33,32,34,27,32,32,34,34,27,34,33,32,34,27,33,32,34,27,33,32,34,27,0,0,0,0,0,41,41,43,41,43,41,43,41,43,41,43,41,43,0,0,41,43,0,0,41,43,124,41,41,43,43,41,43,41,43,41,43,41,43,41,43,41,0,41,41,41,41,0,0,0,0,0,0,0,0,0,0,46,47,50,48,49,46,47,50,48,49,54,54,46,47,48,49,46,47,46,46,47,47,50,50,48,48,49,49,46,47,50,50,50,48,49,0,46,47,50,48,49,125,46,47,46,47,50,48,46,47,50,48,49,0,0,46,47,50,48,49,46,47,50,48,49,46,47,50,48,49,46,47,50,48,49,0,54,54,47,126,57,0,58,57,0,58,57,58,0,0,0,61,57,58,61,57,58,0,57,58,57,58,0,0,0,61,57,58,61,57,58,61,57,58,61,57,58,61,61,0,61,0,61,61,57,58,0,0,0,61,0,0,57,58,61,57,58,61,57,58,61,57,58,0,0,0,0,0,0,127,67,70,70,70,128,127,67,70,70,69,70,67,69,70,67,69,70,67,69,70,67,69,69,69,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,70,70,69,70,67,127,67,127,67,69,70,67,127,67,69,127,67,67,69,70,67,127,67,69,69,69,127,67,70,128,0,0,0,0,69,0,0,0,69,70,67,127,67,127,67,69,70,67,69,70,67,69,70,67,0,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,0,73,73,73,73,73,0,73,73,73,73,0,0,0,0,0,0,0,0,0,0,0,77,77,0,0,77,76,76,76,77,76,77,76,76,76,77,77,77,77,77,76,77,76,77,76,0,77,77,76,77,76,77,76,77,76,76,76,0,129,83,81,0,83,0,129,0,83,81,81,0,129,129,81,0,0,129,84,130,81,82,83,129,84,130,81,82,83,0,81,82,81,82,84,84,130,84,130,0,81,82,83,81,82,83,84,84,84,130,81,82,129,84,130,81,82,83,82,129,84,130,81,82,83,82,0,84,84,130,84,81,82,84,129,84,130,81,82,83,129,84,130,81,82,83,129,84,130,81,82,83,84,0,0,0,0,0,0,41,43,0,0,124,41,43,41,0,41,41,41,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,0,0,0,0,0,0,0,0,0,131,131,131,88,87,88,87,0,0,88,87,88,87,88,87,87,87,0,88,87,88,87,87,88,87,88,87,88,87,132,132,133,132,134,0,89,89,89,0,0,89,89,89,89,89,89,89,89,89,89,89,89,89,0,91,91,91,91,91,91,91,91,91,91,91,0,92,92,92,92,92,92,92,92,92,92,92,92,92,92,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,98,0,98,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,98,117,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,98,117,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,98,117,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,117,117,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,117,102,103,104,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,98,99,98,118,118,118,0,0,118,118,118,118,0,118,118,118,118,118,118,118,118,118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119,120,119,120,119,120,0,119,119,120,0,119,119,120,119,120,119,119,119,119,120,119,119,0,119,119,120,119,120,119,119,120,119,0,0],"f":[0,[[],1],0,0,[[],[[3,[2]]]],[[],[[3,[2]]]],0,0,0,0,0,0,[[],4],[4,2],0,0,[[],5],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[],5],0,[[]],0,0,0,0,0,0,0,0,0,[[],4],0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[6,6],[[]],[7,8],[9,[[10,[6]]]],[9,2],[[6,6],5],[[7,7],5],[[],5],[[],5],[[6,11],12],[[7,11],12],[[7,11],12],[[]],[[]],[[6,13,4],[[15,[14]]]],[[]],[[]],[16],[[13,13,4],5],[[]],[[],2],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],[7,5],0,0,0,[[],19],[[],19],[[],19],0,0,[[]],[[]],[20,20],[[]],[[20,5],20],[[20,11],[[17,[21]]]],[[20,11],[[17,[21]]]],[[20,5],20],[[]],[[[0,[22,23]]],20],[[]],[[],20],[[],20],[4,20],[24,20],[[[25,[24]]],26],[[[25,[24]]],26],[[],20],[[]],[[],2],[[],17],[[],17],[[],18],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[27,27],[[]],[[27,[29,[28]]],30],[[[32,[31]]],30],[[27,[29,[28]]],[[17,[2,33]]]],[[[32,[31]]],[[17,[2,33]]]],[[34,11],12],[[34,11],12],[[]],[[]],[35,34],[36,34],[[]],[37,34],[[]],[[[32,[31]],5],[[32,[31]]]],[[]],[[]],[[]],[[]],[[[32,[31]],38],[[32,[31]]]],[[31,27],[[32,[31]]]],[16],[34,[[15,[39]]]],[[]],[[],2],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],[[],18],[[],18],[[[32,[31]],4]],[[40,38,4],26],0,0,0,[41,[[3,[42]]]],[[]],[[]],[[]],[[]],[41,41],[43,43],[[]],[[]],[[41,11],12],[[43,11],12],[[]],[[]],[[],[[26,[[3,[42]]]]]],[[[15,[44]]],[[26,[[3,[42]]]]]],0,0,[42,[[26,[2]]]],[4,[[26,[42]]]],[[]],[[]],[[],[[26,[23]]]],[45,[[26,[41]]]],[4,[[26,[41]]]],[4,[[26,[43]]]],[42,[[26,[43]]]],0,0,[[]],[[]],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],0,[45,[[26,[2]]]],0,0,0,0,[4,[[26,[45]]]],0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],8],[[],8],[46,8],[47,8],[48,8],[49,8],0,0,[[46,11],[[17,[21]]]],[[46,11],12],[[47,11],[[17,[21]]]],[[47,11],12],[[50,11],12],[[50,11],[[17,[21]]]],[[48,11],12],[[48,11],[[17,[21]]]],[[49,11],12],[[49,11],[[17,[21]]]],[[]],[[]],[37,50],[51,50],[[]],[[]],[[]],[[],8],[[]],[[]],[[]],[[]],[[]],[52],0,0,[[8,[53,[2]]],[[55,[54]]]],[[8,[53,[2]]],[[55,[54]]]],[[56,[53,[2]]],[[55,[54]]]],[8,[[55,[54]]]],[16],[16],[16],[16],[16],[8],[37,2],[[],2],[[],2],[[],2],[[],2],[[],2],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],[[],18],[[],18],[[],18],0,[[],5],[[],5],[47,5],[8],0,0,0,0,0,0,0,0,0,[[13,13],5],[[13,13],5],[[]],[[]],[[]],[[]],[[]],[[]],[[[25,[13]],57,58],[[26,[14]]]],[57,57],[58,58],[[]],[[]],[13,14],[[59,5],2],[[60,5],2],[[61,61],5],[[57,57],5],[[58,58],5],[[],5],[[],5],[[],5],[61,62],[[57,11],12],[[58,11],12],[[]],[[]],[[]],[63,[[26,[61]]]],[[[25,[13]],5],[[26,[61]]]],0,[[61,64]],[[[26,[61]],[26,[61]]],5],[61,62],[[]],[[]],[[]],[13,5],[[[25,[13]],[25,[13]]],14],[13,14],[61,62],[[[25,[13]],[25,[13]],5],5],[13,[[65,[13]]]],[[]],[[]],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],[[],18],0,0,0,0,0,[[66,67],8],[[],62],[67,62],0,0,0,[[],62],[[],68],[67,68],0,0,[[]],[[]],[[]],[[]],[[]],[[]],[69,69],[70,70],[67,67],[[]],[[]],[[]],0,0,0,[[67,67],5],[[],5],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[69,11],12],[[70,11],12],[[67,11],[[17,[21]]]],[[],62],[67,62],[[],62],[67,62],[[]],[[]],[[]],[[],68],[67,68],0,[[],62],[67,62],[[67,64]],[[]],[[]],[[]],[[],62],[67,62],0,0,0,[[],62],[67,62],[67,70],[[],2],[[60,62],4],[68,[[65,[4]]]],[[68,68],2],[[],[[17,[[3,[69]],37]]]],0,[[[53,[[3,[28]]]]],[[17,[67,2]]]],0,[[66,67],8],[[]],[[]],[[]],[[],62],[67,62],[[],62],[67,62],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],[[],18],0,0,0,[[]],[[]],[71,71],[[]],[[],71],[[71,71],5],[[71,11],12],[[71,11],12],[[]],[5,71],[[]],[[]],[[],2],[[],17],[[],17],[[],18],0,[[]],[[]],[[]],[[]],[[]],[[72,28],[[73,[72]]]],[[[73,[72]]],[[15,[[26,[[3,[28]]]]]]]],[[],17],[[],17],[[],18],[[4,[29,[2]]],10],[[4,[29,[2]]],[[10,[2]]]],[[],44],[4,[[17,[60,2]]]],[[44,4,5],[[17,[44,2]]]],[[44,4,44,5],[[17,[44,2]]]],[[[3,[2]]],5],[[],5],[[],5],[[]],[4,[[17,[74,75]]]],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],0,[[],76],0,[77,4],[[77,77],5],[[],5],[[77,11],12],[[77,11],[[17,[21]]]],[[]],[[]],[[]],[[]],[[76,4],[[17,[62,77]]]],[4,[[17,[62,77]]]],[16],[[],2],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],[[76,[29,[4]]],76],[[76,5],76],[[76,4],76],[4,[[17,[78,2]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[79,80,4,5],10],[81,81],[82,82],[[]],[[]],0,0,0,0,0,0,[[81,81],5],[[82,82],5],[[83,83],5],[[],5],[[],5],[[],5],[84,10],0,0,0,[[81,11],12],[[82,11],12],[[]],[[]],[[]],[[]],[[]],[[]],0,[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,[[]],[[]],0,[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],0,[[[25,[13]],59,[15,[44]],[15,[44]],5,82],[[17,[2,2]]]],0,0,0,[[],[[26,[[3,[42]]]]]],[[[15,[44]]],[[26,[[3,[42]]]]]],0,0,[42,[[26,[2]]]],[4,[[26,[42]]]],[[],[[26,[23]]]],0,0,0,[45,[[26,[2]]]],0,0,0,0,[4,[[26,[45]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[51,52],10],[[],85],[[63,63,38],[[85,[38]]]],[[63,63,38],85],[[63,[29,[28]]],[[85,[38]]]],0,[[],42],[[],45],[[],42],[[],45],[38,26],[38,26],[78,[[26,[[15,[86]]]]]],0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[87,87],[[]],[[24,88],2],[[]],[[]],[[]],[[]],[[]],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],0,0,0,0,0,0,[[]],[[]],[[89,89],90],[[[29,[89]]],[[3,[89]]]],[[[29,[89]],38],5],[[89,89],5],[[],5],[[89,11],12],[[]],[4,[[17,[[3,[89]],2]]]],[4,[[17,[89,4]]]],0,[[]],0,[[89,89],[[15,[90]]]],[[],17],[[],17],[[],18],0,[[]],[[]],0,[[]],[[1,38],91],[[]],[38,91],[91,15],[[],17],[[],17],[[],18],0,[[]],[[]],[92,92],[[]],[[]],[93,92],[[]],[[],[[95,[94]]]],[[[53,[92]]],92],[[92,79,[15,[19]],24],[[17,[96]]]],[92,[[15,[[55,[1]]]]]],[[]],[[],17],[[],17],[[],18],0,0,[[],[[17,[97]]]],[[],[[17,[97]]]],[38,5],[4,[[15,[38]]]],[38,[[15,[4]]]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[38,38],38],[98,5],[98,26],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[29,[28]]]],[[99,[29,[28]]]],[[100,[29,[28]]]],[[101,[29,[28]]]],[[102,[29,[28]]]],[[103,[29,[28]]]],[[104,[29,[28]]]],[[105,[29,[28]]]],[[106,[29,[28]]]],[[107,[29,[28]]]],[[108,[29,[28]]]],[[109,[29,[28]]]],[[110,[29,[28]]]],[[111,[29,[28]]]],[[112,[29,[28]]]],[[113,[29,[28]]]],[[114,[29,[28]]]],[[115,[29,[28]]]],[[116,[29,[28]]]],[[[29,[28]]]],[[99,[29,[28]]]],[[100,[29,[28]]]],[[101,[29,[28]]]],[[102,[29,[28]]]],[[103,[29,[28]]]],[[104,[29,[28]]]],[[105,[29,[28]]]],[[106,[29,[28]]]],[[107,[29,[28]]]],[[108,[29,[28]]]],[[109,[29,[28]]]],[[110,[29,[28]]]],[[111,[29,[28]]]],[[112,[29,[28]]]],[[113,[29,[28]]]],[[114,[29,[28]]]],[[115,[29,[28]]]],[[116,[29,[28]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],23],[[],99],[[],100],[[],101],[[],102],[[],103],[[],104],[[],105],[[],106],[[],107],[[],108],[[],109],[[],110],[[],111],[[],112],[[],113],[[],114],[[],115],[[],116],[[[55,[117]],5],98],[[],38],[99,38],[100,38],[101,38],[102,38],[103,38],[104,38],[105,38],[106,38],[107,38],[108,38],[109,38],[110,38],[111,38],[112,38],[113,38],[114,38],[115,38],[116,38],[[],38],[[],38],[[]],[99],[100],[101],[102],[103],[104],[105],[106],[107],[108],[109],[110],[111],[112],[113],[114],[115],[116],[[],2],[[],2],[102,2],[103,2],[104,2],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[38,99],[[98,[29,[28]]],[[26,[38]]]],0,0,0,0,0,[[]],[[]],[118,118],[[]],[9,118],[[118,118],5],[[],5],[[118,11],12],[[]],[[]],[[]],[[],17],[[],17],[[],18],0,0,[[],19],[[],19],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[119,[[26,[2]]]],[120],[[]],[119],[[]],[[]],[[],121],[119,2],[[]],[[]],[119,121],[[]],[119,5],[[],120],[[[25,[13]]],120],[119,122],[120,15],[119,8],[119,123],[[]],[119,2],[[],17],[[],17],[[],17],[[],17],[119,2],[[],18],[[],18],[119,2],[66,8],[[4,4],90]],"c":[],"p":[[8,"Iterator"],[3,"String"],[3,"Vec"],[15,"str"],[15,"bool"],[4,"BackupMode"],[4,"BackupError"],[15,"i32"],[3,"ArgMatches"],[6,"UResult"],[3,"Formatter"],[6,"Result"],[3,"Path"],[3,"PathBuf"],[4,"Option"],[3,"Demand"],[4,"Result"],[3,"TypeId"],[3,"Arg"],[3,"Quoted"],[3,"Error"],[8,"Quotable"],[8,"Sized"],[3,"OsStr"],[8,"AsRef"],[6,"Result"],[4,"Format"],[15,"u8"],[15,"slice"],[6,"DecodeResult"],[8,"Read"],[3,"Data"],[4,"EncodeError"],[4,"DecodeError"],[3,"DecodeError"],[4,"DecodeError"],[3,"Error"],[15,"usize"],[8,"Error"],[8,"Write"],[3,"Passwd"],[6,"gid_t"],[3,"Group"],[15,"u32"],[6,"uid_t"],[3,"USimpleError"],[3,"UUsageError"],[3,"ExitCode"],[3,"ClapErrorWrapper"],[3,"UIoError"],[6,"Error"],[8,"FnOnce"],[8,"Into"],[8,"UError"],[3,"Box"],[4,"ErrorKind"],[4,"MissingHandling"],[4,"ResolveMode"],[3,"Metadata"],[6,"mode_t"],[3,"FileInformation"],[15,"u64"],[8,"AsRawFd"],[8,"Hasher"],[4,"Cow"],[15,"i8"],[3,"statfs_fn"],[15,"i64"],[3,"MountInfo"],[3,"FsUsage"],[4,"LineEnding"],[8,"BufRead"],[3,"Lines"],[3,"Pattern"],[3,"PatternError"],[3,"Parser"],[4,"ParseSizeError"],[3,"Duration"],[3,"Command"],[8,"Args"],[4,"VerbosityLevel"],[3,"Verbosity"],[4,"TraverseSymlinks"],[3,"ChownExecutor"],[6,"Result"],[3,"ExitStatus"],[4,"Quotes"],[4,"QuotingStyle"],[3,"Range"],[4,"Ordering"],[3,"RingBuffer"],[3,"ShortcutValueParser"],[8,"IntoIterator"],[3,"ValueParser"],[4,"Resettable"],[6,"Error"],[4,"Errno"],[3,"DigestWriter"],[3,"Blake2b"],[3,"Blake3"],[3,"Sm3"],[3,"CRC"],[3,"BSD"],[3,"SYSV"],[3,"Md5"],[3,"Sha1"],[3,"Sha224"],[3,"Sha256"],[3,"Sha384"],[3,"Sha512"],[3,"Sha3_224"],[3,"Sha3_256"],[3,"Sha3_384"],[3,"Sha3_512"],[3,"Shake128"],[3,"Shake256"],[8,"Digest"],[4,"UpdateMode"],[3,"Utmpx"],[3,"UtmpxIter"],[3,"utmpx"],[3,"OffsetDateTime"],[15,"i16"],[8,"Locate"],[8,"FromIo"],[8,"UClapError"],[8,"FsMeta"],[8,"BirthTime"],[4,"IfFrom"],[3,"GidUidOwnerFilter"],[8,"ChildExt"],[13,"Shell"],[13,"C"],[13,"Literal"]]},\ -"uucore_procs":{"doc":"","t":"OOOX","n":["help_about","help_section","help_usage","main"],"q":[[0,"uucore_procs"]],"d":["Get the about text from the help file.","Reads a section from a file of the util as a str literal.","Get the usage from the help file.",""],"i":[0,0,0,0],"f":[0,0,0,0],"c":[],"p":[]},\ -"uudoc":{"doc":"","t":"DGLLLLLMLLLLLFLLFLMMLLMLLLLFMLLM","n":["MDWriter","UtilityMap","about","additional","after_help","borrow","borrow_mut","command","deref","deref_mut","drop","examples","from","get_zip_content","init","into","main","markdown","markdown","name","options","platforms","tldr_zip","try_from","try_into","type_id","usage","util_map","utils_per_platform","version","vzip","w"],"q":[[0,"uudoc"]],"d":["","","","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","","","","","","","","","","","","",""],"i":[0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1],"f":[0,0,[1,2],[1,2],[1,2],[[]],[[]],0,[3],[3],[3],[1,2],[[]],[[[6,[[0,[4,5]]]],7],[[9,[8]]]],[[],3],[[]],[[],2],[1,2],0,0,[1,2],[1,2],0,[[],10],[[],10],[[],11],[1,2],[[],[[12,[7]]]],0,[1,2],[[]],0],"c":[],"p":[[3,"MDWriter"],[6,"Result"],[15,"usize"],[8,"Read"],[8,"Seek"],[3,"ZipArchive"],[15,"str"],[3,"String"],[4,"Option"],[4,"Result"],[3,"TypeId"],[3,"OrderedMap"]]},\ -"uuhelp_parser":{"doc":"A collection of functions to parse the markdown code of …","t":"FFF","n":["parse_about","parse_section","parse_usage"],"q":[[0,"uuhelp_parser"]],"d":["Parses the text between the first markdown code block and …","Get a single section from content","Parses the first markdown code block into a usage string"],"i":[0,0,0],"f":[[1,2],[[1,1],[[3,[2]]]],[1,2]],"c":[],"p":[[15,"str"],[3,"String"],[4,"Option"]]},\ -"vdir":{"doc":"","t":"F","n":["main"],"q":[[0,"vdir"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"wc":{"doc":"","t":"F","n":["main"],"q":[[0,"wc"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"who":{"doc":"","t":"F","n":["main"],"q":[[0,"who"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"whoami":{"doc":"","t":"F","n":["main"],"q":[[0,"whoami"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]},\ -"yes":{"doc":"","t":"F","n":["main"],"q":[[0,"yes"]],"d":[""],"i":[0],"f":[[[]]],"c":[],"p":[]}\ -}'); -if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; -if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/coreutils/dev/seq/all.html b/coreutils/dev/seq/all.html deleted file mode 100644 index 525d100db..000000000 --- a/coreutils/dev/seq/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/seq/fn.main.html b/coreutils/dev/seq/fn.main.html deleted file mode 100644 index 2fe9aebf7..000000000 --- a/coreutils/dev/seq/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in seq - Rust

Function seq::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/seq/index.html b/coreutils/dev/seq/index.html deleted file mode 100644 index 09a8afc19..000000000 --- a/coreutils/dev/seq/index.html +++ /dev/null @@ -1 +0,0 @@ -seq - Rust
\ No newline at end of file diff --git a/coreutils/dev/seq/sidebar-items.js b/coreutils/dev/seq/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/seq/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/settings.html b/coreutils/dev/settings.html deleted file mode 100644 index 4dbdfb353..000000000 --- a/coreutils/dev/settings.html +++ /dev/null @@ -1 +0,0 @@ -Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/coreutils/dev/shred/all.html b/coreutils/dev/shred/all.html deleted file mode 100644 index c2b3a7ba8..000000000 --- a/coreutils/dev/shred/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/shred/fn.main.html b/coreutils/dev/shred/fn.main.html deleted file mode 100644 index d3cf81a1f..000000000 --- a/coreutils/dev/shred/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in shred - Rust

Function shred::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/shred/index.html b/coreutils/dev/shred/index.html deleted file mode 100644 index d997fbba3..000000000 --- a/coreutils/dev/shred/index.html +++ /dev/null @@ -1 +0,0 @@ -shred - Rust
\ No newline at end of file diff --git a/coreutils/dev/shred/sidebar-items.js b/coreutils/dev/shred/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/shred/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/shuf/all.html b/coreutils/dev/shuf/all.html deleted file mode 100644 index 1277998be..000000000 --- a/coreutils/dev/shuf/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/shuf/fn.main.html b/coreutils/dev/shuf/fn.main.html deleted file mode 100644 index 3082de3c8..000000000 --- a/coreutils/dev/shuf/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in shuf - Rust

Function shuf::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/shuf/index.html b/coreutils/dev/shuf/index.html deleted file mode 100644 index e3fd4d3d7..000000000 --- a/coreutils/dev/shuf/index.html +++ /dev/null @@ -1 +0,0 @@ -shuf - Rust
\ No newline at end of file diff --git a/coreutils/dev/shuf/sidebar-items.js b/coreutils/dev/shuf/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/shuf/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/sleep/all.html b/coreutils/dev/sleep/all.html deleted file mode 100644 index b357cd683..000000000 --- a/coreutils/dev/sleep/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/sleep/fn.main.html b/coreutils/dev/sleep/fn.main.html deleted file mode 100644 index aad19ab1b..000000000 --- a/coreutils/dev/sleep/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in sleep - Rust

Function sleep::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/sleep/index.html b/coreutils/dev/sleep/index.html deleted file mode 100644 index ee5903b0a..000000000 --- a/coreutils/dev/sleep/index.html +++ /dev/null @@ -1 +0,0 @@ -sleep - Rust
\ No newline at end of file diff --git a/coreutils/dev/sleep/sidebar-items.js b/coreutils/dev/sleep/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/sleep/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/sort/all.html b/coreutils/dev/sort/all.html deleted file mode 100644 index 9848b2d2a..000000000 --- a/coreutils/dev/sort/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/sort/fn.main.html b/coreutils/dev/sort/fn.main.html deleted file mode 100644 index 8fca2500f..000000000 --- a/coreutils/dev/sort/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in sort - Rust

Function sort::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/sort/index.html b/coreutils/dev/sort/index.html deleted file mode 100644 index 771832f62..000000000 --- a/coreutils/dev/sort/index.html +++ /dev/null @@ -1 +0,0 @@ -sort - Rust
\ No newline at end of file diff --git a/coreutils/dev/sort/sidebar-items.js b/coreutils/dev/sort/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/sort/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/source-files.js b/coreutils/dev/source-files.js deleted file mode 100644 index b77b9ee7a..000000000 --- a/coreutils/dev/source-files.js +++ /dev/null @@ -1,215 +0,0 @@ -var sourcesIndex = JSON.parse('{\ -"arch":["",[],["main.rs"]],\ -"base32":["",[],["main.rs"]],\ -"base64":["",[],["main.rs"]],\ -"basename":["",[],["main.rs"]],\ -"basenc":["",[],["main.rs"]],\ -"cat":["",[],["main.rs"]],\ -"chcon":["",[],["main.rs"]],\ -"chgrp":["",[],["main.rs"]],\ -"chmod":["",[],["main.rs"]],\ -"chown":["",[],["main.rs"]],\ -"chroot":["",[],["main.rs"]],\ -"cksum":["",[],["main.rs"]],\ -"comm":["",[],["main.rs"]],\ -"coreutils":["",[],["coreutils.rs"]],\ -"cp":["",[],["main.rs"]],\ -"csplit":["",[],["main.rs"]],\ -"cut":["",[],["main.rs"]],\ -"date":["",[],["main.rs"]],\ -"dd":["",[],["main.rs"]],\ -"df":["",[],["main.rs"]],\ -"dir":["",[],["main.rs"]],\ -"dircolors":["",[],["main.rs"]],\ -"dirname":["",[],["main.rs"]],\ -"du":["",[],["main.rs"]],\ -"echo":["",[],["main.rs"]],\ -"env":["",[],["main.rs"]],\ -"expand":["",[],["main.rs"]],\ -"expr":["",[],["main.rs"]],\ -"factor":["",[],["main.rs"]],\ -"false":["",[],["main.rs"]],\ -"fmt":["",[],["main.rs"]],\ -"fold":["",[],["main.rs"]],\ -"groups":["",[],["main.rs"]],\ -"hashsum":["",[],["main.rs"]],\ -"head":["",[],["main.rs"]],\ -"hostid":["",[],["main.rs"]],\ -"hostname":["",[],["main.rs"]],\ -"id":["",[],["main.rs"]],\ -"install":["",[],["main.rs"]],\ -"join":["",[],["main.rs"]],\ -"kill":["",[],["main.rs"]],\ -"libstdbuf":["",[],["libstdbuf.rs"]],\ -"link":["",[],["main.rs"]],\ -"ln":["",[],["main.rs"]],\ -"logname":["",[],["main.rs"]],\ -"ls":["",[],["main.rs"]],\ -"mkdir":["",[],["main.rs"]],\ -"mkfifo":["",[],["main.rs"]],\ -"mknod":["",[],["main.rs"]],\ -"mktemp":["",[],["main.rs"]],\ -"more":["",[],["main.rs"]],\ -"mv":["",[],["main.rs"]],\ -"nice":["",[],["main.rs"]],\ -"nl":["",[],["main.rs"]],\ -"nohup":["",[],["main.rs"]],\ -"nproc":["",[],["main.rs"]],\ -"numfmt":["",[],["main.rs"]],\ -"od":["",[],["main.rs"]],\ -"paste":["",[],["main.rs"]],\ -"pathchk":["",[],["main.rs"]],\ -"pinky":["",[],["main.rs"]],\ -"pr":["",[],["main.rs"]],\ -"printenv":["",[],["main.rs"]],\ -"printf":["",[],["main.rs"]],\ -"ptx":["",[],["main.rs"]],\ -"pwd":["",[],["main.rs"]],\ -"readlink":["",[],["main.rs"]],\ -"realpath":["",[],["main.rs"]],\ -"relpath":["",[],["main.rs"]],\ -"rm":["",[],["main.rs"]],\ -"rmdir":["",[],["main.rs"]],\ -"runcon":["",[],["main.rs"]],\ -"seq":["",[],["main.rs"]],\ -"shred":["",[],["main.rs"]],\ -"shuf":["",[],["main.rs"]],\ -"sleep":["",[],["main.rs"]],\ -"sort":["",[],["main.rs"]],\ -"split":["",[],["main.rs"]],\ -"stat":["",[],["main.rs"]],\ -"stdbuf":["",[],["main.rs"]],\ -"stty":["",[],["main.rs"]],\ -"sum":["",[],["main.rs"]],\ -"sync":["",[],["main.rs"]],\ -"tac":["",[],["main.rs"]],\ -"tail":["",[],["main.rs"]],\ -"tee":["",[],["main.rs"]],\ -"test":["",[],["main.rs"]],\ -"timeout":["",[],["main.rs"]],\ -"touch":["",[],["main.rs"]],\ -"tr":["",[],["main.rs"]],\ -"true":["",[],["main.rs"]],\ -"truncate":["",[],["main.rs"]],\ -"tsort":["",[],["main.rs"]],\ -"tty":["",[],["main.rs"]],\ -"uname":["",[],["main.rs"]],\ -"unexpand":["",[],["main.rs"]],\ -"uniq":["",[],["main.rs"]],\ -"unlink":["",[],["main.rs"]],\ -"uptime":["",[],["main.rs"]],\ -"users":["",[],["main.rs"]],\ -"uu_arch":["",[],["arch.rs"]],\ -"uu_base32":["",[],["base32.rs","base_common.rs"]],\ -"uu_base64":["",[],["base64.rs"]],\ -"uu_basename":["",[],["basename.rs"]],\ -"uu_basenc":["",[],["basenc.rs"]],\ -"uu_cat":["",[],["cat.rs","splice.rs"]],\ -"uu_chcon":["",[],["chcon.rs","errors.rs","fts.rs"]],\ -"uu_chgrp":["",[],["chgrp.rs"]],\ -"uu_chmod":["",[],["chmod.rs"]],\ -"uu_chown":["",[],["chown.rs"]],\ -"uu_chroot":["",[],["chroot.rs","error.rs"]],\ -"uu_cksum":["",[],["cksum.rs"]],\ -"uu_comm":["",[],["comm.rs"]],\ -"uu_cp":["",[["platform",[],["linux.rs","mod.rs"]]],["copydir.rs","cp.rs"]],\ -"uu_csplit":["",[],["csplit.rs","csplit_error.rs","patterns.rs","split_name.rs"]],\ -"uu_cut":["",[],["cut.rs","matcher.rs","searcher.rs"]],\ -"uu_date":["",[],["date.rs"]],\ -"uu_dd":["",[],["blocks.rs","conversion_tables.rs","datastructures.rs","dd.rs","numbers.rs","parseargs.rs","progress.rs"]],\ -"uu_df":["",[],["blocks.rs","columns.rs","df.rs","filesystem.rs","table.rs"]],\ -"uu_dir":["",[],["dir.rs"]],\ -"uu_dircolors":["",[],["colors.rs","dircolors.rs"]],\ -"uu_dirname":["",[],["dirname.rs"]],\ -"uu_du":["",[],["du.rs"]],\ -"uu_echo":["",[],["echo.rs"]],\ -"uu_env":["",[],["env.rs"]],\ -"uu_expand":["",[],["expand.rs"]],\ -"uu_expr":["",[],["expr.rs","syntax_tree.rs","tokens.rs"]],\ -"uu_factor":["",[["numeric",[],["gcd.rs","mod.rs","modular_inverse.rs","montgomery.rs","traits.rs"]]],["cli.rs","factor.rs","miller_rabin.rs","rho.rs","table.rs"]],\ -"uu_false":["",[],["false.rs"]],\ -"uu_fmt":["",[],["fmt.rs","linebreak.rs","parasplit.rs"]],\ -"uu_fold":["",[],["fold.rs"]],\ -"uu_groups":["",[],["groups.rs"]],\ -"uu_hashsum":["",[],["hashsum.rs"]],\ -"uu_head":["",[],["head.rs","parse.rs","take.rs"]],\ -"uu_hostid":["",[],["hostid.rs"]],\ -"uu_hostname":["",[],["hostname.rs"]],\ -"uu_id":["",[],["id.rs"]],\ -"uu_install":["",[],["install.rs","mode.rs"]],\ -"uu_join":["",[],["join.rs"]],\ -"uu_kill":["",[],["kill.rs"]],\ -"uu_link":["",[],["link.rs"]],\ -"uu_ln":["",[],["ln.rs"]],\ -"uu_logname":["",[],["logname.rs"]],\ -"uu_ls":["",[],["ls.rs"]],\ -"uu_mkdir":["",[],["mkdir.rs"]],\ -"uu_mkfifo":["",[],["mkfifo.rs"]],\ -"uu_mknod":["",[],["mknod.rs"]],\ -"uu_mktemp":["",[],["mktemp.rs"]],\ -"uu_more":["",[],["more.rs"]],\ -"uu_mv":["",[],["error.rs","mv.rs"]],\ -"uu_nice":["",[],["nice.rs"]],\ -"uu_nl":["",[],["helper.rs","nl.rs"]],\ -"uu_nohup":["",[],["nohup.rs"]],\ -"uu_nproc":["",[],["nproc.rs"]],\ -"uu_numfmt":["",[],["errors.rs","format.rs","numfmt.rs","options.rs","units.rs"]],\ -"uu_od":["",[],["byteorder_io.rs","formatteriteminfo.rs","inputdecoder.rs","inputoffset.rs","multifilereader.rs","od.rs","output_info.rs","parse_formats.rs","parse_inputs.rs","parse_nrofbytes.rs","partialreader.rs","peekreader.rs","prn_char.rs","prn_float.rs","prn_int.rs"]],\ -"uu_paste":["",[],["paste.rs"]],\ -"uu_pathchk":["",[],["pathchk.rs"]],\ -"uu_pinky":["",[],["pinky.rs"]],\ -"uu_pr":["",[],["pr.rs"]],\ -"uu_printenv":["",[],["printenv.rs"]],\ -"uu_printf":["",[],["printf.rs"]],\ -"uu_ptx":["",[],["ptx.rs"]],\ -"uu_pwd":["",[],["pwd.rs"]],\ -"uu_readlink":["",[],["readlink.rs"]],\ -"uu_realpath":["",[],["realpath.rs"]],\ -"uu_relpath":["",[],["relpath.rs"]],\ -"uu_rm":["",[],["rm.rs"]],\ -"uu_rmdir":["",[],["rmdir.rs"]],\ -"uu_runcon":["",[],["errors.rs","runcon.rs"]],\ -"uu_seq":["",[],["error.rs","extendedbigdecimal.rs","extendedbigint.rs","number.rs","numberparse.rs","seq.rs"]],\ -"uu_shred":["",[],["shred.rs"]],\ -"uu_shuf":["",[],["rand_read_adapter.rs","shuf.rs"]],\ -"uu_sleep":["",[],["sleep.rs"]],\ -"uu_sort":["",[],["check.rs","chunks.rs","custom_str_cmp.rs","ext_sort.rs","merge.rs","numeric_str_cmp.rs","sort.rs","tmp_dir.rs"]],\ -"uu_split":["",[["platform",[],["mod.rs","unix.rs"]]],["filenames.rs","number.rs","split.rs"]],\ -"uu_stat":["",[],["stat.rs"]],\ -"uu_stdbuf":["",[],["stdbuf.rs"]],\ -"uu_stty":["",[],["flags.rs","stty.rs"]],\ -"uu_sum":["",[],["sum.rs"]],\ -"uu_sync":["",[],["sync.rs"]],\ -"uu_tac":["",[],["error.rs","tac.rs"]],\ -"uu_tail":["",[["follow",[],["files.rs","mod.rs","watch.rs"]],["platform",[],["mod.rs","unix.rs"]]],["args.rs","chunks.rs","parse.rs","paths.rs","tail.rs","text.rs"]],\ -"uu_tee":["",[],["tee.rs"]],\ -"uu_test":["",[],["error.rs","parser.rs","test.rs"]],\ -"uu_timeout":["",[],["status.rs","timeout.rs"]],\ -"uu_touch":["",[],["touch.rs"]],\ -"uu_tr":["",[],["convert.rs","operation.rs","tr.rs","unicode_table.rs"]],\ -"uu_true":["",[],["true.rs"]],\ -"uu_truncate":["",[],["truncate.rs"]],\ -"uu_tsort":["",[],["tsort.rs"]],\ -"uu_tty":["",[],["tty.rs"]],\ -"uu_uname":["",[],["uname.rs"]],\ -"uu_unexpand":["",[],["unexpand.rs"]],\ -"uu_uniq":["",[],["uniq.rs"]],\ -"uu_unlink":["",[],["unlink.rs"]],\ -"uu_uptime":["",[],["uptime.rs"]],\ -"uu_users":["",[],["users.rs"]],\ -"uu_vdir":["",[],["vdir.rs"]],\ -"uu_wc":["",[["utf8",[],["mod.rs","read.rs"]]],["count_fast.rs","countable.rs","wc.rs","word_count.rs"]],\ -"uu_who":["",[],["who.rs"]],\ -"uu_whoami":["",[["platform",[],["mod.rs","unix.rs"]]],["whoami.rs"]],\ -"uu_yes":["",[],["splice.rs","yes.rs"]],\ -"uucore":["",[["features",[["tokenize",[["num_format",[["formatters",[["base_conv",[],["mod.rs","tests.rs"]]],["cninetyninehexfloatf.rs","decf.rs","float_common.rs","floatf.rs","intf.rs","mod.rs","scif.rs"]]],["format_field.rs","formatter.rs","mod.rs","num_format.rs"]]],["mod.rs","sub.rs","token.rs","unescaped_text.rs"]]],["encoding.rs","entries.rs","fs.rs","fsext.rs","lines.rs","memo.rs","mode.rs","perms.rs","pipes.rs","process.rs","ringbuffer.rs","signals.rs","sum.rs","utmpx.rs"]],["mods",[],["backup_control.rs","display.rs","error.rs","line_ending.rs","os.rs","panic.rs","quoting_style.rs","ranges.rs","update_control.rs","version_cmp.rs"]],["parser",[],["parse_glob.rs","parse_size.rs","parse_time.rs","shortcut_value_parser.rs"]]],["features.rs","lib.rs","macros.rs","mods.rs","parser.rs"]],\ -"uucore_procs":["",[],["lib.rs"]],\ -"uudoc":["",[],["uudoc.rs"]],\ -"uuhelp_parser":["",[],["lib.rs"]],\ -"vdir":["",[],["main.rs"]],\ -"wc":["",[],["main.rs"]],\ -"who":["",[],["main.rs"]],\ -"whoami":["",[],["main.rs"]],\ -"yes":["",[],["main.rs"]]\ -}'); -createSourceSidebar(); diff --git a/coreutils/dev/split/all.html b/coreutils/dev/split/all.html deleted file mode 100644 index 2ccf12c7b..000000000 --- a/coreutils/dev/split/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/split/fn.main.html b/coreutils/dev/split/fn.main.html deleted file mode 100644 index bceef27d5..000000000 --- a/coreutils/dev/split/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in split - Rust

Function split::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/split/index.html b/coreutils/dev/split/index.html deleted file mode 100644 index 0a4ace999..000000000 --- a/coreutils/dev/split/index.html +++ /dev/null @@ -1 +0,0 @@ -split - Rust
\ No newline at end of file diff --git a/coreutils/dev/split/sidebar-items.js b/coreutils/dev/split/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/split/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/src/arch/main.rs.html b/coreutils/dev/src/arch/main.rs.html deleted file mode 100644 index 55c3aae4c..000000000 --- a/coreutils/dev/src/arch/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_arch);
-
\ No newline at end of file diff --git a/coreutils/dev/src/base32/main.rs.html b/coreutils/dev/src/base32/main.rs.html deleted file mode 100644 index 19ced3275..000000000 --- a/coreutils/dev/src/base32/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_base32);
-
\ No newline at end of file diff --git a/coreutils/dev/src/base64/main.rs.html b/coreutils/dev/src/base64/main.rs.html deleted file mode 100644 index 54a13aade..000000000 --- a/coreutils/dev/src/base64/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_base64);
-
\ No newline at end of file diff --git a/coreutils/dev/src/basename/main.rs.html b/coreutils/dev/src/basename/main.rs.html deleted file mode 100644 index 29975bfab..000000000 --- a/coreutils/dev/src/basename/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_basename);
-
\ No newline at end of file diff --git a/coreutils/dev/src/basenc/main.rs.html b/coreutils/dev/src/basenc/main.rs.html deleted file mode 100644 index ae3789a76..000000000 --- a/coreutils/dev/src/basenc/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_basenc);
-
\ No newline at end of file diff --git a/coreutils/dev/src/cat/main.rs.html b/coreutils/dev/src/cat/main.rs.html deleted file mode 100644 index 0fddeeb36..000000000 --- a/coreutils/dev/src/cat/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_cat);
-
\ No newline at end of file diff --git a/coreutils/dev/src/chcon/main.rs.html b/coreutils/dev/src/chcon/main.rs.html deleted file mode 100644 index 212005432..000000000 --- a/coreutils/dev/src/chcon/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_chcon);
-
\ No newline at end of file diff --git a/coreutils/dev/src/chgrp/main.rs.html b/coreutils/dev/src/chgrp/main.rs.html deleted file mode 100644 index cc2fd3187..000000000 --- a/coreutils/dev/src/chgrp/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_chgrp);
-
\ No newline at end of file diff --git a/coreutils/dev/src/chmod/main.rs.html b/coreutils/dev/src/chmod/main.rs.html deleted file mode 100644 index 1ec7af7a7..000000000 --- a/coreutils/dev/src/chmod/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_chmod);
-
\ No newline at end of file diff --git a/coreutils/dev/src/chown/main.rs.html b/coreutils/dev/src/chown/main.rs.html deleted file mode 100644 index 5f5e2294c..000000000 --- a/coreutils/dev/src/chown/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_chown);
-
\ No newline at end of file diff --git a/coreutils/dev/src/chroot/main.rs.html b/coreutils/dev/src/chroot/main.rs.html deleted file mode 100644 index f3aae793b..000000000 --- a/coreutils/dev/src/chroot/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_chroot);
-
\ No newline at end of file diff --git a/coreutils/dev/src/cksum/main.rs.html b/coreutils/dev/src/cksum/main.rs.html deleted file mode 100644 index ac29805f0..000000000 --- a/coreutils/dev/src/cksum/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_cksum);
-
\ No newline at end of file diff --git a/coreutils/dev/src/comm/main.rs.html b/coreutils/dev/src/comm/main.rs.html deleted file mode 100644 index cac68c1bf..000000000 --- a/coreutils/dev/src/comm/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_comm);
-
\ No newline at end of file diff --git a/coreutils/dev/src/coreutils/coreutils.rs.html b/coreutils/dev/src/coreutils/coreutils.rs.html deleted file mode 100644 index 65fa4bad2..000000000 --- a/coreutils/dev/src/coreutils/coreutils.rs.html +++ /dev/null @@ -1,453 +0,0 @@ -coreutils.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-
// This file is part of the uutils coreutils package.
-//
-// (c) Michael Gehring <mg@ebfe.org>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore manpages mangen
-
-use clap::{Arg, Command};
-use clap_complete::Shell;
-use std::cmp;
-use std::ffi::OsStr;
-use std::ffi::OsString;
-use std::io::{self, Write};
-use std::path::{Path, PathBuf};
-use std::process;
-use uucore::display::Quotable;
-
-const VERSION: &str = env!("CARGO_PKG_VERSION");
-
-include!(concat!(env!("OUT_DIR"), "/uutils_map.rs"));
-
-fn usage<T>(utils: &UtilityMap<T>, name: &str) {
-    println!("{name} {VERSION} (multi-call binary)\n");
-    println!("Usage: {name} [function [arguments...]]\n");
-    println!("Currently defined functions:\n");
-    #[allow(clippy::map_clone)]
-    let mut utils: Vec<&str> = utils.keys().map(|&s| s).collect();
-    utils.sort_unstable();
-    let display_list = utils.join(", ");
-    let width = cmp::min(textwrap::termwidth(), 100) - 4 * 2; // (opinion/heuristic) max 100 chars wide with 4 character side indentions
-    println!(
-        "{}",
-        textwrap::indent(&textwrap::fill(&display_list, width), "    ")
-    );
-}
-
-fn binary_path(args: &mut impl Iterator<Item = OsString>) -> PathBuf {
-    match args.next() {
-        Some(ref s) if !s.is_empty() => PathBuf::from(s),
-        _ => std::env::current_exe().unwrap(),
-    }
-}
-
-fn name(binary_path: &Path) -> Option<&str> {
-    binary_path.file_stem()?.to_str()
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn main() {
-    uucore::panic::mute_sigpipe_panic();
-
-    let utils = util_map();
-    let mut args = uucore::args_os();
-
-    let binary = binary_path(&mut args);
-    let binary_as_util = name(&binary).unwrap_or_else(|| {
-        usage(&utils, "<unknown binary name>");
-        process::exit(0);
-    });
-
-    // binary name equals util name?
-    if let Some(&(uumain, _)) = utils.get(binary_as_util) {
-        process::exit(uumain((vec![binary.into()].into_iter()).chain(args)));
-    }
-
-    // binary name equals prefixed util name?
-    // * prefix/stem may be any string ending in a non-alphanumeric character
-    let util_name = if let Some(util) = utils.keys().find(|util| {
-        binary_as_util.ends_with(*util)
-            && !binary_as_util[..binary_as_util.len() - (*util).len()]
-                .ends_with(char::is_alphanumeric)
-    }) {
-        // prefixed util => replace 0th (aka, executable name) argument
-        Some(OsString::from(*util))
-    } else {
-        // unmatched binary name => regard as multi-binary container and advance argument list
-        uucore::set_utility_is_second_arg();
-        args.next()
-    };
-
-    // 0th argument equals util name?
-    if let Some(util_os) = util_name {
-        fn not_found(util: &OsStr) -> ! {
-            println!("{}: function/utility not found", util.maybe_quote());
-            process::exit(1);
-        }
-
-        let util = match util_os.to_str() {
-            Some(util) => util,
-            None => not_found(&util_os),
-        };
-
-        if util == "completion" {
-            gen_completions(args, &utils);
-        }
-
-        if util == "manpage" {
-            gen_manpage(args, &utils);
-        }
-
-        match utils.get(util) {
-            Some(&(uumain, _)) => {
-                process::exit(uumain((vec![util_os].into_iter()).chain(args)));
-            }
-            None => {
-                if util == "--help" || util == "-h" {
-                    // see if they want help on a specific util
-                    if let Some(util_os) = args.next() {
-                        let util = match util_os.to_str() {
-                            Some(util) => util,
-                            None => not_found(&util_os),
-                        };
-
-                        match utils.get(util) {
-                            Some(&(uumain, _)) => {
-                                let code = uumain(
-                                    (vec![util_os, OsString::from("--help")].into_iter())
-                                        .chain(args),
-                                );
-                                io::stdout().flush().expect("could not flush stdout");
-                                process::exit(code);
-                            }
-                            None => not_found(&util_os),
-                        }
-                    }
-                    usage(&utils, binary_as_util);
-                    process::exit(0);
-                } else {
-                    not_found(&util_os);
-                }
-            }
-        }
-    } else {
-        // no arguments provided
-        usage(&utils, binary_as_util);
-        process::exit(0);
-    }
-}
-
-/// Prints completions for the utility in the first parameter for the shell in the second parameter to stdout
-fn gen_completions<T: uucore::Args>(
-    args: impl Iterator<Item = OsString>,
-    util_map: &UtilityMap<T>,
-) -> ! {
-    let all_utilities: Vec<_> = std::iter::once("coreutils")
-        .chain(util_map.keys().copied())
-        .collect();
-
-    let matches = Command::new("completion")
-        .about("Prints completions to stdout")
-        .arg(
-            Arg::new("utility")
-                .value_parser(clap::builder::PossibleValuesParser::new(all_utilities))
-                .required(true),
-        )
-        .arg(
-            Arg::new("shell")
-                .value_parser(clap::builder::EnumValueParser::<Shell>::new())
-                .required(true),
-        )
-        .get_matches_from(std::iter::once(OsString::from("completion")).chain(args));
-
-    let utility = matches.get_one::<String>("utility").unwrap();
-    let shell = *matches.get_one::<Shell>("shell").unwrap();
-
-    let mut command = if utility == "coreutils" {
-        gen_coreutils_app(util_map)
-    } else {
-        util_map.get(utility).unwrap().1()
-    };
-    let bin_name = std::env::var("PROG_PREFIX").unwrap_or_default() + utility;
-
-    clap_complete::generate(shell, &mut command, bin_name, &mut io::stdout());
-    io::stdout().flush().unwrap();
-    process::exit(0);
-}
-
-/// Generate the manpage for the utility in the first parameter
-fn gen_manpage<T: uucore::Args>(
-    args: impl Iterator<Item = OsString>,
-    util_map: &UtilityMap<T>,
-) -> ! {
-    let all_utilities: Vec<_> = std::iter::once("coreutils")
-        .chain(util_map.keys().copied())
-        .collect();
-
-    let matches = Command::new("manpage")
-        .about("Prints manpage to stdout")
-        .arg(
-            Arg::new("utility")
-                .value_parser(clap::builder::PossibleValuesParser::new(all_utilities))
-                .required(true),
-        )
-        .get_matches_from(std::iter::once(OsString::from("manpage")).chain(args));
-
-    let utility = matches.get_one::<String>("utility").unwrap();
-
-    let command = if utility == "coreutils" {
-        gen_coreutils_app(util_map)
-    } else {
-        util_map.get(utility).unwrap().1()
-    };
-
-    let man = clap_mangen::Man::new(command);
-    man.render(&mut io::stdout())
-        .expect("Man page generation failed");
-    io::stdout().flush().unwrap();
-    process::exit(0);
-}
-
-fn gen_coreutils_app<T: uucore::Args>(util_map: &UtilityMap<T>) -> Command {
-    let mut command = Command::new("coreutils");
-    for (name, (_, sub_app)) in util_map {
-        // Recreate a small subcommand with only the relevant info
-        // (name & short description)
-        let about = sub_app()
-            .get_about()
-            .expect("Could not get the 'about'")
-            .to_string();
-        let sub_app = Command::new(name).about(about);
-        command = command.subcommand(sub_app);
-    }
-    command
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/coreutils/home/runner/work/uutils.github.io/uutils.github.io/coreutils/target/debug/build/coreutils-26b04f519188b879/out/uutils_map.rs.html b/coreutils/dev/src/coreutils/home/runner/work/uutils.github.io/uutils.github.io/coreutils/target/debug/build/coreutils-26b04f519188b879/out/uutils_map.rs.html deleted file mode 100644 index 56d27d1ce..000000000 --- a/coreutils/dev/src/coreutils/home/runner/work/uutils.github.io/uutils.github.io/coreutils/target/debug/build/coreutils-26b04f519188b879/out/uutils_map.rs.html +++ /dev/null @@ -1,551 +0,0 @@ -uutils_map.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-
type UtilityMap<T> = phf::OrderedMap<&'static str, (fn(T) -> i32, fn() -> Command)>;
-
-fn util_map<T: uucore::Args>() -> UtilityMap<T> {
-::phf::OrderedMap {
-    key: 12913932095322966823,
-    disps: &[
-        (0, 115),
-        (0, 9),
-        (1, 0),
-        (0, 16),
-        (0, 23),
-        (11, 18),
-        (0, 3),
-        (7, 37),
-        (0, 114),
-        (0, 81),
-        (1, 35),
-        (0, 46),
-        (0, 61),
-        (1, 54),
-        (0, 2),
-        (3, 41),
-        (0, 2),
-        (1, 97),
-        (4, 50),
-        (2, 7),
-        (4, 12),
-        (2, 55),
-        (0, 100),
-        (27, 53),
-    ],
-    idxs: &[
-        75,
-        25,
-        118,
-        83,
-        61,
-        103,
-        73,
-        74,
-        110,
-        67,
-        1,
-        92,
-        7,
-        91,
-        49,
-        65,
-        64,
-        5,
-        29,
-        34,
-        13,
-        109,
-        63,
-        82,
-        36,
-        17,
-        101,
-        28,
-        70,
-        27,
-        55,
-        30,
-        100,
-        32,
-        57,
-        58,
-        116,
-        19,
-        11,
-        2,
-        106,
-        114,
-        90,
-        39,
-        85,
-        80,
-        54,
-        10,
-        107,
-        38,
-        9,
-        24,
-        81,
-        31,
-        35,
-        45,
-        111,
-        56,
-        117,
-        99,
-        84,
-        22,
-        51,
-        115,
-        93,
-        4,
-        94,
-        33,
-        43,
-        48,
-        15,
-        12,
-        79,
-        0,
-        77,
-        98,
-        50,
-        102,
-        78,
-        68,
-        97,
-        113,
-        6,
-        21,
-        20,
-        76,
-        86,
-        41,
-        87,
-        105,
-        26,
-        72,
-        3,
-        69,
-        18,
-        53,
-        66,
-        40,
-        60,
-        44,
-        46,
-        52,
-        8,
-        88,
-        16,
-        14,
-        59,
-        95,
-        47,
-        62,
-        104,
-        96,
-        112,
-        71,
-        89,
-        23,
-        37,
-        108,
-        42,
-    ],
-    entries: &[
-        ("arch", (arch::uumain, arch::uu_app)),
-        ("base32", (base32::uumain, base32::uu_app)),
-        ("base64", (base64::uumain, base64::uu_app)),
-        ("basename", (basename::uumain, basename::uu_app)),
-        ("basenc", (basenc::uumain, basenc::uu_app)),
-        ("cat", (cat::uumain, cat::uu_app)),
-        ("chcon", (chcon::uumain, chcon::uu_app)),
-        ("chgrp", (chgrp::uumain, chgrp::uu_app)),
-        ("chmod", (chmod::uumain, chmod::uu_app)),
-        ("chown", (chown::uumain, chown::uu_app)),
-        ("chroot", (chroot::uumain, chroot::uu_app)),
-        ("cksum", (cksum::uumain, cksum::uu_app)),
-        ("comm", (comm::uumain, comm::uu_app)),
-        ("cp", (cp::uumain, cp::uu_app)),
-        ("csplit", (csplit::uumain, csplit::uu_app)),
-        ("cut", (cut::uumain, cut::uu_app)),
-        ("date", (date::uumain, date::uu_app)),
-        ("dd", (dd::uumain, dd::uu_app)),
-        ("df", (df::uumain, df::uu_app)),
-        ("dir", (dir::uumain, dir::uu_app)),
-        ("dircolors", (dircolors::uumain, dircolors::uu_app)),
-        ("dirname", (dirname::uumain, dirname::uu_app)),
-        ("du", (du::uumain, du::uu_app)),
-        ("echo", (echo::uumain, echo::uu_app)),
-        ("env", (env::uumain, env::uu_app)),
-        ("expand", (expand::uumain, expand::uu_app)),
-        ("expr", (expr::uumain, expr::uu_app)),
-        ("factor", (factor::uumain, factor::uu_app)),
-        ("false", (r#false::uumain, r#false::uu_app)),
-        ("fmt", (fmt::uumain, fmt::uu_app)),
-        ("fold", (fold::uumain, fold::uu_app)),
-        ("groups", (groups::uumain, groups::uu_app)),
-        ("hashsum", (hashsum::uumain, hashsum::uu_app_custom)),
-        ("md5sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha1sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha224sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha256sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha384sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha512sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha3sum", (hashsum::uumain, hashsum::uu_app_bits)),
-        ("sha3-224sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha3-256sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha3-384sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha3-512sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("shake128sum", (hashsum::uumain, hashsum::uu_app_bits)),
-        ("shake256sum", (hashsum::uumain, hashsum::uu_app_bits)),
-        ("b2sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("b3sum", (hashsum::uumain, hashsum::uu_app_b3sum)),
-        ("head", (head::uumain, head::uu_app)),
-        ("hostid", (hostid::uumain, hostid::uu_app)),
-        ("hostname", (hostname::uumain, hostname::uu_app)),
-        ("id", (id::uumain, id::uu_app)),
-        ("install", (install::uumain, install::uu_app)),
-        ("join", (join::uumain, join::uu_app)),
-        ("kill", (kill::uumain, kill::uu_app)),
-        ("link", (link::uumain, link::uu_app)),
-        ("ln", (ln::uumain, ln::uu_app)),
-        ("logname", (logname::uumain, logname::uu_app)),
-        ("ls", (ls::uumain, ls::uu_app)),
-        ("mkdir", (mkdir::uumain, mkdir::uu_app)),
-        ("mkfifo", (mkfifo::uumain, mkfifo::uu_app)),
-        ("mknod", (mknod::uumain, mknod::uu_app)),
-        ("mktemp", (mktemp::uumain, mktemp::uu_app)),
-        ("more", (more::uumain, more::uu_app)),
-        ("mv", (mv::uumain, mv::uu_app)),
-        ("nice", (nice::uumain, nice::uu_app)),
-        ("nl", (nl::uumain, nl::uu_app)),
-        ("nohup", (nohup::uumain, nohup::uu_app)),
-        ("nproc", (nproc::uumain, nproc::uu_app)),
-        ("numfmt", (numfmt::uumain, numfmt::uu_app)),
-        ("od", (od::uumain, od::uu_app)),
-        ("paste", (paste::uumain, paste::uu_app)),
-        ("pathchk", (pathchk::uumain, pathchk::uu_app)),
-        ("pinky", (pinky::uumain, pinky::uu_app)),
-        ("pr", (pr::uumain, pr::uu_app)),
-        ("printenv", (printenv::uumain, printenv::uu_app)),
-        ("printf", (printf::uumain, printf::uu_app)),
-        ("ptx", (ptx::uumain, ptx::uu_app)),
-        ("pwd", (pwd::uumain, pwd::uu_app)),
-        ("readlink", (readlink::uumain, readlink::uu_app)),
-        ("realpath", (realpath::uumain, realpath::uu_app)),
-        ("relpath", (relpath::uumain, relpath::uu_app)),
-        ("rm", (rm::uumain, rm::uu_app)),
-        ("rmdir", (rmdir::uumain, rmdir::uu_app)),
-        ("runcon", (runcon::uumain, runcon::uu_app)),
-        ("seq", (seq::uumain, seq::uu_app)),
-        ("shred", (shred::uumain, shred::uu_app)),
-        ("shuf", (shuf::uumain, shuf::uu_app)),
-        ("sleep", (sleep::uumain, sleep::uu_app)),
-        ("sort", (sort::uumain, sort::uu_app)),
-        ("split", (split::uumain, split::uu_app)),
-        ("stat", (stat::uumain, stat::uu_app)),
-        ("stdbuf", (stdbuf::uumain, stdbuf::uu_app)),
-        ("stty", (stty::uumain, stty::uu_app)),
-        ("sum", (sum::uumain, sum::uu_app)),
-        ("sync", (sync::uumain, sync::uu_app)),
-        ("tac", (tac::uumain, tac::uu_app)),
-        ("tail", (tail::uumain, tail::uu_app)),
-        ("tee", (tee::uumain, tee::uu_app)),
-        ("timeout", (timeout::uumain, timeout::uu_app)),
-        ("touch", (touch::uumain, touch::uu_app)),
-        ("tr", (tr::uumain, tr::uu_app)),
-        ("true", (r#true::uumain, r#true::uu_app)),
-        ("truncate", (truncate::uumain, truncate::uu_app)),
-        ("tsort", (tsort::uumain, tsort::uu_app)),
-        ("tty", (tty::uumain, tty::uu_app)),
-        ("uname", (uname::uumain, uname::uu_app)),
-        ("unexpand", (unexpand::uumain, unexpand::uu_app)),
-        ("uniq", (uniq::uumain, uniq::uu_app)),
-        ("unlink", (unlink::uumain, unlink::uu_app)),
-        ("uptime", (uptime::uumain, uptime::uu_app)),
-        ("users", (users::uumain, users::uu_app)),
-        ("test", (uu_test::uumain, uu_test::uu_app)),
-        ("[", (uu_test::uumain, uu_test::uu_app)),
-        ("vdir", (vdir::uumain, vdir::uu_app)),
-        ("wc", (wc::uumain, wc::uu_app)),
-        ("who", (who::uumain, who::uu_app)),
-        ("whoami", (whoami::uumain, whoami::uu_app)),
-        ("yes", (yes::uumain, yes::uu_app)),
-    ],
-}
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/cp/main.rs.html b/coreutils/dev/src/cp/main.rs.html deleted file mode 100644 index aa5af865a..000000000 --- a/coreutils/dev/src/cp/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_cp);
-
\ No newline at end of file diff --git a/coreutils/dev/src/csplit/main.rs.html b/coreutils/dev/src/csplit/main.rs.html deleted file mode 100644 index 1007c7cb4..000000000 --- a/coreutils/dev/src/csplit/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_csplit);
-
\ No newline at end of file diff --git a/coreutils/dev/src/cut/main.rs.html b/coreutils/dev/src/cut/main.rs.html deleted file mode 100644 index b00aa51ce..000000000 --- a/coreutils/dev/src/cut/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_cut);
-
\ No newline at end of file diff --git a/coreutils/dev/src/date/main.rs.html b/coreutils/dev/src/date/main.rs.html deleted file mode 100644 index 8ab422ffc..000000000 --- a/coreutils/dev/src/date/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_date);
-
\ No newline at end of file diff --git a/coreutils/dev/src/dd/main.rs.html b/coreutils/dev/src/dd/main.rs.html deleted file mode 100644 index 964225242..000000000 --- a/coreutils/dev/src/dd/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_dd); // spell-checker:ignore procs uucore
-
\ No newline at end of file diff --git a/coreutils/dev/src/df/main.rs.html b/coreutils/dev/src/df/main.rs.html deleted file mode 100644 index 750ee1bdb..000000000 --- a/coreutils/dev/src/df/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_df);
-
\ No newline at end of file diff --git a/coreutils/dev/src/dir/main.rs.html b/coreutils/dev/src/dir/main.rs.html deleted file mode 100644 index 2aa70e1c4..000000000 --- a/coreutils/dev/src/dir/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_dir);
-
\ No newline at end of file diff --git a/coreutils/dev/src/dircolors/main.rs.html b/coreutils/dev/src/dircolors/main.rs.html deleted file mode 100644 index 41dec670a..000000000 --- a/coreutils/dev/src/dircolors/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_dircolors);
-
\ No newline at end of file diff --git a/coreutils/dev/src/dirname/main.rs.html b/coreutils/dev/src/dirname/main.rs.html deleted file mode 100644 index 1ec2918e1..000000000 --- a/coreutils/dev/src/dirname/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_dirname);
-
\ No newline at end of file diff --git a/coreutils/dev/src/du/main.rs.html b/coreutils/dev/src/du/main.rs.html deleted file mode 100644 index 57cc1dced..000000000 --- a/coreutils/dev/src/du/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_du);
-
\ No newline at end of file diff --git a/coreutils/dev/src/echo/main.rs.html b/coreutils/dev/src/echo/main.rs.html deleted file mode 100644 index b568fa2b1..000000000 --- a/coreutils/dev/src/echo/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_echo);
-
\ No newline at end of file diff --git a/coreutils/dev/src/env/main.rs.html b/coreutils/dev/src/env/main.rs.html deleted file mode 100644 index 2f1fb7e7d..000000000 --- a/coreutils/dev/src/env/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_env);
-
\ No newline at end of file diff --git a/coreutils/dev/src/expand/main.rs.html b/coreutils/dev/src/expand/main.rs.html deleted file mode 100644 index 5c549fd61..000000000 --- a/coreutils/dev/src/expand/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_expand);
-
\ No newline at end of file diff --git a/coreutils/dev/src/expr/main.rs.html b/coreutils/dev/src/expr/main.rs.html deleted file mode 100644 index fb49df875..000000000 --- a/coreutils/dev/src/expr/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_expr);
-
\ No newline at end of file diff --git a/coreutils/dev/src/factor/main.rs.html b/coreutils/dev/src/factor/main.rs.html deleted file mode 100644 index ee8f562fe..000000000 --- a/coreutils/dev/src/factor/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_factor);
-
\ No newline at end of file diff --git a/coreutils/dev/src/false/main.rs.html b/coreutils/dev/src/false/main.rs.html deleted file mode 100644 index 7fd2e442f..000000000 --- a/coreutils/dev/src/false/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_false);
-
\ No newline at end of file diff --git a/coreutils/dev/src/fmt/main.rs.html b/coreutils/dev/src/fmt/main.rs.html deleted file mode 100644 index c40c61f10..000000000 --- a/coreutils/dev/src/fmt/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_fmt);
-
\ No newline at end of file diff --git a/coreutils/dev/src/fold/main.rs.html b/coreutils/dev/src/fold/main.rs.html deleted file mode 100644 index 8e8684911..000000000 --- a/coreutils/dev/src/fold/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_fold);
-
\ No newline at end of file diff --git a/coreutils/dev/src/groups/main.rs.html b/coreutils/dev/src/groups/main.rs.html deleted file mode 100644 index c9f5c384c..000000000 --- a/coreutils/dev/src/groups/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_groups);
-
\ No newline at end of file diff --git a/coreutils/dev/src/hashsum/main.rs.html b/coreutils/dev/src/hashsum/main.rs.html deleted file mode 100644 index e79f89254..000000000 --- a/coreutils/dev/src/hashsum/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_hashsum);
-
\ No newline at end of file diff --git a/coreutils/dev/src/head/main.rs.html b/coreutils/dev/src/head/main.rs.html deleted file mode 100644 index 5d9344708..000000000 --- a/coreutils/dev/src/head/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_head);
-
\ No newline at end of file diff --git a/coreutils/dev/src/hostid/main.rs.html b/coreutils/dev/src/hostid/main.rs.html deleted file mode 100644 index 824b4c9e6..000000000 --- a/coreutils/dev/src/hostid/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_hostid);
-
\ No newline at end of file diff --git a/coreutils/dev/src/hostname/main.rs.html b/coreutils/dev/src/hostname/main.rs.html deleted file mode 100644 index 8b9bffeae..000000000 --- a/coreutils/dev/src/hostname/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_hostname);
-
\ No newline at end of file diff --git a/coreutils/dev/src/id/main.rs.html b/coreutils/dev/src/id/main.rs.html deleted file mode 100644 index ae7695ec1..000000000 --- a/coreutils/dev/src/id/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_id);
-
\ No newline at end of file diff --git a/coreutils/dev/src/install/main.rs.html b/coreutils/dev/src/install/main.rs.html deleted file mode 100644 index 3826e4ed9..000000000 --- a/coreutils/dev/src/install/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_install);
-
\ No newline at end of file diff --git a/coreutils/dev/src/join/main.rs.html b/coreutils/dev/src/join/main.rs.html deleted file mode 100644 index 548a446c2..000000000 --- a/coreutils/dev/src/join/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_join);
-
\ No newline at end of file diff --git a/coreutils/dev/src/kill/main.rs.html b/coreutils/dev/src/kill/main.rs.html deleted file mode 100644 index 08d8462ac..000000000 --- a/coreutils/dev/src/kill/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_kill);
-
\ No newline at end of file diff --git a/coreutils/dev/src/libstdbuf/libstdbuf.rs.html b/coreutils/dev/src/libstdbuf/libstdbuf.rs.html deleted file mode 100644 index e80e14aff..000000000 --- a/coreutils/dev/src/libstdbuf/libstdbuf.rs.html +++ /dev/null @@ -1,137 +0,0 @@ -libstdbuf.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-
// spell-checker:ignore (ToDO) IOFBF IOLBF IONBF cstdio setvbuf
-
-use cpp::cpp;
-use libc::{c_char, c_int, size_t, FILE, _IOFBF, _IOLBF, _IONBF};
-use std::env;
-use std::ptr;
-use uucore::crash;
-
-cpp! {{
-    #include <cstdio>
-
-    extern "C" {
-        void __stdbuf(void);
-
-        void __attribute((constructor))
-        __stdbuf_init(void) {
-            __stdbuf();
-        }
-
-        FILE *__stdbuf_get_stdin() { return stdin; }
-        FILE *__stdbuf_get_stdout() { return stdout; }
-        FILE *__stdbuf_get_stderr() { return stderr; }
-    }
-}}
-
-extern "C" {
-    fn __stdbuf_get_stdin() -> *mut FILE;
-    fn __stdbuf_get_stdout() -> *mut FILE;
-    fn __stdbuf_get_stderr() -> *mut FILE;
-}
-
-fn set_buffer(stream: *mut FILE, value: &str) {
-    let (mode, size): (c_int, size_t) = match value {
-        "0" => (_IONBF, 0_usize),
-        "L" => (_IOLBF, 0_usize),
-        input => {
-            let buff_size: usize = match input.parse() {
-                Ok(num) => num,
-                Err(e) => crash!(1, "incorrect size of buffer!: {}", e),
-            };
-            (_IOFBF, buff_size as size_t)
-        }
-    };
-    let res: c_int;
-    unsafe {
-        let buffer: *mut c_char = ptr::null_mut();
-        assert!(buffer.is_null());
-        res = libc::setvbuf(stream, buffer, mode, size);
-    }
-    if res != 0 {
-        crash!(res, "error while calling setvbuf!");
-    }
-}
-
-/// # Safety
-/// ToDO ... (safety note)
-#[no_mangle]
-pub unsafe extern "C" fn __stdbuf() {
-    if let Ok(val) = env::var("_STDBUF_E") {
-        set_buffer(__stdbuf_get_stderr(), &val);
-    }
-    if let Ok(val) = env::var("_STDBUF_I") {
-        set_buffer(__stdbuf_get_stdin(), &val);
-    }
-    if let Ok(val) = env::var("_STDBUF_O") {
-        set_buffer(__stdbuf_get_stdout(), &val);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/link/main.rs.html b/coreutils/dev/src/link/main.rs.html deleted file mode 100644 index 37ed1b03a..000000000 --- a/coreutils/dev/src/link/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_link);
-
\ No newline at end of file diff --git a/coreutils/dev/src/ln/main.rs.html b/coreutils/dev/src/ln/main.rs.html deleted file mode 100644 index 2827de62d..000000000 --- a/coreutils/dev/src/ln/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_ln);
-
\ No newline at end of file diff --git a/coreutils/dev/src/logname/main.rs.html b/coreutils/dev/src/logname/main.rs.html deleted file mode 100644 index 8a9dee90a..000000000 --- a/coreutils/dev/src/logname/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_logname);
-
\ No newline at end of file diff --git a/coreutils/dev/src/ls/main.rs.html b/coreutils/dev/src/ls/main.rs.html deleted file mode 100644 index 1f38807ae..000000000 --- a/coreutils/dev/src/ls/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_ls);
-
\ No newline at end of file diff --git a/coreutils/dev/src/mkdir/main.rs.html b/coreutils/dev/src/mkdir/main.rs.html deleted file mode 100644 index 0c6d52b1a..000000000 --- a/coreutils/dev/src/mkdir/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_mkdir);
-
\ No newline at end of file diff --git a/coreutils/dev/src/mkfifo/main.rs.html b/coreutils/dev/src/mkfifo/main.rs.html deleted file mode 100644 index 8a9da1a96..000000000 --- a/coreutils/dev/src/mkfifo/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_mkfifo);
-
\ No newline at end of file diff --git a/coreutils/dev/src/mknod/main.rs.html b/coreutils/dev/src/mknod/main.rs.html deleted file mode 100644 index 689081385..000000000 --- a/coreutils/dev/src/mknod/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_mknod);
-
\ No newline at end of file diff --git a/coreutils/dev/src/mktemp/main.rs.html b/coreutils/dev/src/mktemp/main.rs.html deleted file mode 100644 index 00568c0dc..000000000 --- a/coreutils/dev/src/mktemp/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_mktemp);
-
\ No newline at end of file diff --git a/coreutils/dev/src/more/main.rs.html b/coreutils/dev/src/more/main.rs.html deleted file mode 100644 index 7f11811ba..000000000 --- a/coreutils/dev/src/more/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_more);
-
\ No newline at end of file diff --git a/coreutils/dev/src/mv/main.rs.html b/coreutils/dev/src/mv/main.rs.html deleted file mode 100644 index ba44e4ec9..000000000 --- a/coreutils/dev/src/mv/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_mv);
-
\ No newline at end of file diff --git a/coreutils/dev/src/nice/main.rs.html b/coreutils/dev/src/nice/main.rs.html deleted file mode 100644 index 646bee363..000000000 --- a/coreutils/dev/src/nice/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_nice);
-
\ No newline at end of file diff --git a/coreutils/dev/src/nl/main.rs.html b/coreutils/dev/src/nl/main.rs.html deleted file mode 100644 index 8ff77f475..000000000 --- a/coreutils/dev/src/nl/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_nl);
-
\ No newline at end of file diff --git a/coreutils/dev/src/nohup/main.rs.html b/coreutils/dev/src/nohup/main.rs.html deleted file mode 100644 index fd320d8bd..000000000 --- a/coreutils/dev/src/nohup/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_nohup);
-
\ No newline at end of file diff --git a/coreutils/dev/src/nproc/main.rs.html b/coreutils/dev/src/nproc/main.rs.html deleted file mode 100644 index edbb70c83..000000000 --- a/coreutils/dev/src/nproc/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_nproc);
-
\ No newline at end of file diff --git a/coreutils/dev/src/numfmt/main.rs.html b/coreutils/dev/src/numfmt/main.rs.html deleted file mode 100644 index f0dbdc6ca..000000000 --- a/coreutils/dev/src/numfmt/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_numfmt);
-
\ No newline at end of file diff --git a/coreutils/dev/src/od/main.rs.html b/coreutils/dev/src/od/main.rs.html deleted file mode 100644 index 59c9ffbe3..000000000 --- a/coreutils/dev/src/od/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_od);
-
\ No newline at end of file diff --git a/coreutils/dev/src/paste/main.rs.html b/coreutils/dev/src/paste/main.rs.html deleted file mode 100644 index 978d4a82a..000000000 --- a/coreutils/dev/src/paste/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_paste);
-
\ No newline at end of file diff --git a/coreutils/dev/src/pathchk/main.rs.html b/coreutils/dev/src/pathchk/main.rs.html deleted file mode 100644 index c427afeb7..000000000 --- a/coreutils/dev/src/pathchk/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_pathchk);
-
\ No newline at end of file diff --git a/coreutils/dev/src/pinky/main.rs.html b/coreutils/dev/src/pinky/main.rs.html deleted file mode 100644 index 9b43d243f..000000000 --- a/coreutils/dev/src/pinky/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_pinky);
-
\ No newline at end of file diff --git a/coreutils/dev/src/pr/main.rs.html b/coreutils/dev/src/pr/main.rs.html deleted file mode 100644 index 37848f164..000000000 --- a/coreutils/dev/src/pr/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_pr); // spell-checker:ignore procs uucore
-
\ No newline at end of file diff --git a/coreutils/dev/src/printenv/main.rs.html b/coreutils/dev/src/printenv/main.rs.html deleted file mode 100644 index c49bf549c..000000000 --- a/coreutils/dev/src/printenv/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_printenv);
-
\ No newline at end of file diff --git a/coreutils/dev/src/printf/main.rs.html b/coreutils/dev/src/printf/main.rs.html deleted file mode 100644 index c54565f54..000000000 --- a/coreutils/dev/src/printf/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_printf);
-
\ No newline at end of file diff --git a/coreutils/dev/src/ptx/main.rs.html b/coreutils/dev/src/ptx/main.rs.html deleted file mode 100644 index 3b0c41867..000000000 --- a/coreutils/dev/src/ptx/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_ptx);
-
\ No newline at end of file diff --git a/coreutils/dev/src/pwd/main.rs.html b/coreutils/dev/src/pwd/main.rs.html deleted file mode 100644 index 342ff43b6..000000000 --- a/coreutils/dev/src/pwd/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_pwd);
-
\ No newline at end of file diff --git a/coreutils/dev/src/readlink/main.rs.html b/coreutils/dev/src/readlink/main.rs.html deleted file mode 100644 index 9a900eed4..000000000 --- a/coreutils/dev/src/readlink/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_readlink);
-
\ No newline at end of file diff --git a/coreutils/dev/src/realpath/main.rs.html b/coreutils/dev/src/realpath/main.rs.html deleted file mode 100644 index 4e303ebbc..000000000 --- a/coreutils/dev/src/realpath/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_realpath);
-
\ No newline at end of file diff --git a/coreutils/dev/src/relpath/main.rs.html b/coreutils/dev/src/relpath/main.rs.html deleted file mode 100644 index d2c0cb202..000000000 --- a/coreutils/dev/src/relpath/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_relpath);
-
\ No newline at end of file diff --git a/coreutils/dev/src/rm/main.rs.html b/coreutils/dev/src/rm/main.rs.html deleted file mode 100644 index 76538ec2f..000000000 --- a/coreutils/dev/src/rm/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_rm);
-
\ No newline at end of file diff --git a/coreutils/dev/src/rmdir/main.rs.html b/coreutils/dev/src/rmdir/main.rs.html deleted file mode 100644 index cbaa96d89..000000000 --- a/coreutils/dev/src/rmdir/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_rmdir);
-
\ No newline at end of file diff --git a/coreutils/dev/src/runcon/main.rs.html b/coreutils/dev/src/runcon/main.rs.html deleted file mode 100644 index 48ff4079e..000000000 --- a/coreutils/dev/src/runcon/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_runcon);
-
\ No newline at end of file diff --git a/coreutils/dev/src/seq/main.rs.html b/coreutils/dev/src/seq/main.rs.html deleted file mode 100644 index efdde7098..000000000 --- a/coreutils/dev/src/seq/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_seq);
-
\ No newline at end of file diff --git a/coreutils/dev/src/shred/main.rs.html b/coreutils/dev/src/shred/main.rs.html deleted file mode 100644 index f27980fce..000000000 --- a/coreutils/dev/src/shred/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_shred);
-
\ No newline at end of file diff --git a/coreutils/dev/src/shuf/main.rs.html b/coreutils/dev/src/shuf/main.rs.html deleted file mode 100644 index 6586e8e53..000000000 --- a/coreutils/dev/src/shuf/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_shuf);
-
\ No newline at end of file diff --git a/coreutils/dev/src/sleep/main.rs.html b/coreutils/dev/src/sleep/main.rs.html deleted file mode 100644 index f2dd325ec..000000000 --- a/coreutils/dev/src/sleep/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_sleep);
-
\ No newline at end of file diff --git a/coreutils/dev/src/sort/main.rs.html b/coreutils/dev/src/sort/main.rs.html deleted file mode 100644 index 9e39b2cc4..000000000 --- a/coreutils/dev/src/sort/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_sort);
-
\ No newline at end of file diff --git a/coreutils/dev/src/split/main.rs.html b/coreutils/dev/src/split/main.rs.html deleted file mode 100644 index 05f0e4946..000000000 --- a/coreutils/dev/src/split/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_split);
-
\ No newline at end of file diff --git a/coreutils/dev/src/stat/main.rs.html b/coreutils/dev/src/stat/main.rs.html deleted file mode 100644 index 16f1a50fd..000000000 --- a/coreutils/dev/src/stat/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_stat);
-
\ No newline at end of file diff --git a/coreutils/dev/src/stdbuf/main.rs.html b/coreutils/dev/src/stdbuf/main.rs.html deleted file mode 100644 index dc3bdb26d..000000000 --- a/coreutils/dev/src/stdbuf/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_stdbuf);
-
\ No newline at end of file diff --git a/coreutils/dev/src/stty/main.rs.html b/coreutils/dev/src/stty/main.rs.html deleted file mode 100644 index 551a4d3fe..000000000 --- a/coreutils/dev/src/stty/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_stty);
-
\ No newline at end of file diff --git a/coreutils/dev/src/sum/main.rs.html b/coreutils/dev/src/sum/main.rs.html deleted file mode 100644 index 9f40468b0..000000000 --- a/coreutils/dev/src/sum/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_sum);
-
\ No newline at end of file diff --git a/coreutils/dev/src/sync/main.rs.html b/coreutils/dev/src/sync/main.rs.html deleted file mode 100644 index fe67f13d6..000000000 --- a/coreutils/dev/src/sync/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_sync);
-
\ No newline at end of file diff --git a/coreutils/dev/src/tac/main.rs.html b/coreutils/dev/src/tac/main.rs.html deleted file mode 100644 index c503ba40b..000000000 --- a/coreutils/dev/src/tac/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_tac);
-
\ No newline at end of file diff --git a/coreutils/dev/src/tail/main.rs.html b/coreutils/dev/src/tail/main.rs.html deleted file mode 100644 index 337d02a49..000000000 --- a/coreutils/dev/src/tail/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_tail);
-
\ No newline at end of file diff --git a/coreutils/dev/src/tee/main.rs.html b/coreutils/dev/src/tee/main.rs.html deleted file mode 100644 index b56dfc045..000000000 --- a/coreutils/dev/src/tee/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_tee);
-
\ No newline at end of file diff --git a/coreutils/dev/src/test/main.rs.html b/coreutils/dev/src/test/main.rs.html deleted file mode 100644 index 9ef6d52fc..000000000 --- a/coreutils/dev/src/test/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_test);
-
\ No newline at end of file diff --git a/coreutils/dev/src/timeout/main.rs.html b/coreutils/dev/src/timeout/main.rs.html deleted file mode 100644 index 1d74b57c3..000000000 --- a/coreutils/dev/src/timeout/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_timeout);
-
\ No newline at end of file diff --git a/coreutils/dev/src/touch/main.rs.html b/coreutils/dev/src/touch/main.rs.html deleted file mode 100644 index 2a1198ec4..000000000 --- a/coreutils/dev/src/touch/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_touch);
-
\ No newline at end of file diff --git a/coreutils/dev/src/tr/main.rs.html b/coreutils/dev/src/tr/main.rs.html deleted file mode 100644 index e3c82e534..000000000 --- a/coreutils/dev/src/tr/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_tr);
-
\ No newline at end of file diff --git a/coreutils/dev/src/true/main.rs.html b/coreutils/dev/src/true/main.rs.html deleted file mode 100644 index e16cbf4e5..000000000 --- a/coreutils/dev/src/true/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_true);
-
\ No newline at end of file diff --git a/coreutils/dev/src/truncate/main.rs.html b/coreutils/dev/src/truncate/main.rs.html deleted file mode 100644 index 2fae453df..000000000 --- a/coreutils/dev/src/truncate/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_truncate);
-
\ No newline at end of file diff --git a/coreutils/dev/src/tsort/main.rs.html b/coreutils/dev/src/tsort/main.rs.html deleted file mode 100644 index a9804ab04..000000000 --- a/coreutils/dev/src/tsort/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_tsort);
-
\ No newline at end of file diff --git a/coreutils/dev/src/tty/main.rs.html b/coreutils/dev/src/tty/main.rs.html deleted file mode 100644 index bcc3d869d..000000000 --- a/coreutils/dev/src/tty/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_tty);
-
\ No newline at end of file diff --git a/coreutils/dev/src/uname/main.rs.html b/coreutils/dev/src/uname/main.rs.html deleted file mode 100644 index cddf81eca..000000000 --- a/coreutils/dev/src/uname/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_uname);
-
\ No newline at end of file diff --git a/coreutils/dev/src/unexpand/main.rs.html b/coreutils/dev/src/unexpand/main.rs.html deleted file mode 100644 index 1ccbb5533..000000000 --- a/coreutils/dev/src/unexpand/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_unexpand);
-
\ No newline at end of file diff --git a/coreutils/dev/src/uniq/main.rs.html b/coreutils/dev/src/uniq/main.rs.html deleted file mode 100644 index ebd7233e6..000000000 --- a/coreutils/dev/src/uniq/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_uniq);
-
\ No newline at end of file diff --git a/coreutils/dev/src/unlink/main.rs.html b/coreutils/dev/src/unlink/main.rs.html deleted file mode 100644 index 946fcb550..000000000 --- a/coreutils/dev/src/unlink/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_unlink);
-
\ No newline at end of file diff --git a/coreutils/dev/src/uptime/main.rs.html b/coreutils/dev/src/uptime/main.rs.html deleted file mode 100644 index 6bb324602..000000000 --- a/coreutils/dev/src/uptime/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_uptime);
-
\ No newline at end of file diff --git a/coreutils/dev/src/users/main.rs.html b/coreutils/dev/src/users/main.rs.html deleted file mode 100644 index edb39fde9..000000000 --- a/coreutils/dev/src/users/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_users);
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_arch/arch.rs.html b/coreutils/dev/src/uu_arch/arch.rs.html deleted file mode 100644 index 0e9f0dc06..000000000 --- a/coreutils/dev/src/uu_arch/arch.rs.html +++ /dev/null @@ -1,69 +0,0 @@ -arch.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-
// This file is part of the uutils coreutils package.
-//
-// (c) Smigle00 <smigle00@gmail.com>
-// (c) Jian Zeng <anonymousknight96 AT gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-use platform_info::*;
-
-use clap::{crate_version, Command};
-use uucore::error::{UResult, USimpleError};
-use uucore::{help_about, help_section};
-
-static ABOUT: &str = help_about!("arch.md");
-static SUMMARY: &str = help_section!("after help", "arch.md");
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    uu_app().try_get_matches_from(args)?;
-
-    let uts = PlatformInfo::new().map_err(|_e| USimpleError::new(1, "cannot get system name"))?;
-
-    println!("{}", uts.machine().to_string_lossy().trim());
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(SUMMARY)
-        .infer_long_args(true)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_base32/base32.rs.html b/coreutils/dev/src/uu_base32/base32.rs.html deleted file mode 100644 index b8fa2a85d..000000000 --- a/coreutils/dev/src/uu_base32/base32.rs.html +++ /dev/null @@ -1,81 +0,0 @@ -base32.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-use std::io::{stdin, Read};
-
-use clap::Command;
-use uucore::{encoding::Format, error::UResult, help_about, help_usage};
-
-pub mod base_common;
-
-const ABOUT: &str = help_about!("base32.md");
-const USAGE: &str = help_usage!("base32.md");
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let format = Format::Base32;
-
-    let config: base_common::Config = base_common::parse_base_cmd_args(args, ABOUT, USAGE)?;
-
-    // Create a reference to stdin so we can return a locked stdin from
-    // parse_base_cmd_args
-    let stdin_raw = stdin();
-    let mut input: Box<dyn Read> = base_common::get_input(&config, &stdin_raw)?;
-
-    base_common::handle_input(
-        &mut input,
-        format,
-        config.wrap_cols,
-        config.ignore_garbage,
-        config.decode,
-    )
-}
-
-pub fn uu_app() -> Command {
-    base_common::base_app(ABOUT, USAGE)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_base32/base_common.rs.html b/coreutils/dev/src/uu_base32/base_common.rs.html deleted file mode 100644 index 807e8bb0e..000000000 --- a/coreutils/dev/src/uu_base32/base_common.rs.html +++ /dev/null @@ -1,377 +0,0 @@ -base_common.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jordy Dickinson <jordy.dickinson@gmail.com>
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-// (c) Alex Lyon <arcterus@mail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-use std::io::{stdout, Read, Write};
-
-use uucore::display::Quotable;
-use uucore::encoding::{wrap_print, Data, Format};
-use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
-use uucore::format_usage;
-
-use std::fs::File;
-use std::io::{BufReader, Stdin};
-use std::path::Path;
-
-use clap::{crate_version, Arg, ArgAction, Command};
-
-pub static BASE_CMD_PARSE_ERROR: i32 = 1;
-
-// Config.
-pub struct Config {
-    pub decode: bool,
-    pub ignore_garbage: bool,
-    pub wrap_cols: Option<usize>,
-    pub to_read: Option<String>,
-}
-
-pub mod options {
-    pub static DECODE: &str = "decode";
-    pub static WRAP: &str = "wrap";
-    pub static IGNORE_GARBAGE: &str = "ignore-garbage";
-    pub static FILE: &str = "file";
-}
-
-impl Config {
-    pub fn from(options: &clap::ArgMatches) -> UResult<Self> {
-        let file: Option<String> = match options.get_many::<String>(options::FILE) {
-            Some(mut values) => {
-                let name = values.next().unwrap();
-                if let Some(extra_op) = values.next() {
-                    return Err(UUsageError::new(
-                        BASE_CMD_PARSE_ERROR,
-                        format!("extra operand {}", extra_op.quote(),),
-                    ));
-                }
-
-                if name == "-" {
-                    None
-                } else {
-                    if !Path::exists(Path::new(name)) {
-                        return Err(USimpleError::new(
-                            BASE_CMD_PARSE_ERROR,
-                            format!("{}: No such file or directory", name.maybe_quote()),
-                        ));
-                    }
-                    Some(name.to_owned())
-                }
-            }
-            None => None,
-        };
-
-        let cols = options
-            .get_one::<String>(options::WRAP)
-            .map(|num| {
-                num.parse::<usize>().map_err(|_| {
-                    USimpleError::new(
-                        BASE_CMD_PARSE_ERROR,
-                        format!("invalid wrap size: {}", num.quote()),
-                    )
-                })
-            })
-            .transpose()?;
-
-        Ok(Self {
-            decode: options.get_flag(options::DECODE),
-            ignore_garbage: options.get_flag(options::IGNORE_GARBAGE),
-            wrap_cols: cols,
-            to_read: file,
-        })
-    }
-}
-
-pub fn parse_base_cmd_args(
-    args: impl uucore::Args,
-    about: &'static str,
-    usage: &str,
-) -> UResult<Config> {
-    let command = base_app(about, usage);
-    let arg_list = args.collect_lossy();
-    Config::from(&command.try_get_matches_from(arg_list)?)
-}
-
-pub fn base_app(about: &'static str, usage: &str) -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(about)
-        .override_usage(format_usage(usage))
-        .infer_long_args(true)
-        // Format arguments.
-        .arg(
-            Arg::new(options::DECODE)
-                .short('d')
-                .long(options::DECODE)
-                .help("decode data")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::IGNORE_GARBAGE)
-                .short('i')
-                .long(options::IGNORE_GARBAGE)
-                .help("when decoding, ignore non-alphabetic characters")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::WRAP)
-                .short('w')
-                .long(options::WRAP)
-                .value_name("COLS")
-                .help(
-                    "wrap encoded lines after COLS character (default 76, 0 to disable wrapping)",
-                ),
-        )
-        // "multiple" arguments are used to check whether there is more than one
-        // file passed in.
-        .arg(
-            Arg::new(options::FILE)
-                .index(1)
-                .action(clap::ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-pub fn get_input<'a>(config: &Config, stdin_ref: &'a Stdin) -> UResult<Box<dyn Read + 'a>> {
-    match &config.to_read {
-        Some(name) => {
-            let file_buf =
-                File::open(Path::new(name)).map_err_context(|| name.maybe_quote().to_string())?;
-            Ok(Box::new(BufReader::new(file_buf))) // as Box<dyn Read>
-        }
-        None => {
-            Ok(Box::new(stdin_ref.lock())) // as Box<dyn Read>
-        }
-    }
-}
-
-pub fn handle_input<R: Read>(
-    input: &mut R,
-    format: Format,
-    line_wrap: Option<usize>,
-    ignore_garbage: bool,
-    decode: bool,
-) -> UResult<()> {
-    let mut data = Data::new(input, format).ignore_garbage(ignore_garbage);
-    if let Some(wrap) = line_wrap {
-        data = data.line_wrap(wrap);
-    }
-
-    if decode {
-        match data.decode() {
-            Ok(s) => {
-                // Silent the warning as we want to the error message
-                #[allow(clippy::question_mark)]
-                if stdout().write_all(&s).is_err() {
-                    // on windows console, writing invalid utf8 returns an error
-                    return Err(USimpleError::new(1, "error: cannot write non-utf8 data"));
-                }
-                Ok(())
-            }
-            Err(_) => Err(USimpleError::new(1, "error: invalid input")),
-        }
-    } else {
-        match data.encode() {
-            Ok(s) => {
-                wrap_print(&data, &s);
-                Ok(())
-            }
-            Err(_) => Err(USimpleError::new(
-                1,
-                "error: invalid input (length must be multiple of 4 characters)",
-            )),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_base64/base64.rs.html b/coreutils/dev/src/uu_base64/base64.rs.html deleted file mode 100644 index d1da04236..000000000 --- a/coreutils/dev/src/uu_base64/base64.rs.html +++ /dev/null @@ -1,75 +0,0 @@ -base64.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jordy Dickinson <jordy.dickinson@gmail.com>
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-use uu_base32::base_common;
-pub use uu_base32::uu_app;
-
-use uucore::{encoding::Format, error::UResult, help_about, help_usage};
-
-use std::io::{stdin, Read};
-
-const ABOUT: &str = help_about!("base64.md");
-const USAGE: &str = help_usage!("base64.md");
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let format = Format::Base64;
-
-    let config: base_common::Config = base_common::parse_base_cmd_args(args, ABOUT, USAGE)?;
-
-    // Create a reference to stdin so we can return a locked stdin from
-    // parse_base_cmd_args
-    let stdin_raw = stdin();
-    let mut input: Box<dyn Read> = base_common::get_input(&config, &stdin_raw)?;
-
-    base_common::handle_input(
-        &mut input,
-        format,
-        config.wrap_cols,
-        config.ignore_garbage,
-        config.decode,
-    )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_basename/basename.rs.html b/coreutils/dev/src/uu_basename/basename.rs.html deleted file mode 100644 index e0a71b805..000000000 --- a/coreutils/dev/src/uu_basename/basename.rs.html +++ /dev/null @@ -1,353 +0,0 @@ -basename.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jimmy Lu <jimmy.lu.2011@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) fullname
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::path::{is_separator, PathBuf};
-use uucore::display::Quotable;
-use uucore::error::{UResult, UUsageError};
-use uucore::line_ending::LineEnding;
-use uucore::{format_usage, help_about, help_usage};
-
-static ABOUT: &str = help_about!("basename.md");
-
-const USAGE: &str = help_usage!("basename.md");
-
-pub mod options {
-    pub static MULTIPLE: &str = "multiple";
-    pub static NAME: &str = "name";
-    pub static SUFFIX: &str = "suffix";
-    pub static ZERO: &str = "zero";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    // Since options have to go before names,
-    // if the first argument is not an option, then there is no option,
-    // and that implies there is exactly one name (no option => no -a option),
-    // so simple format is used
-    if args.len() > 1 && !args[1].starts_with('-') {
-        if args.len() > 3 {
-            return Err(UUsageError::new(
-                1,
-                format!("extra operand {}", args[3].to_string().quote()),
-            ));
-        }
-        let suffix = if args.len() > 2 { args[2].as_ref() } else { "" };
-        println!("{}", basename(&args[1], suffix));
-        return Ok(());
-    }
-
-    //
-    // Argument parsing
-    //
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    // too few arguments
-    if !matches.contains_id(options::NAME) {
-        return Err(UUsageError::new(1, "missing operand".to_string()));
-    }
-
-    let line_ending = LineEnding::from_zero_flag(matches.get_flag(options::ZERO));
-
-    let opt_suffix = matches.get_one::<String>(options::SUFFIX).is_some();
-    let opt_multiple = matches.get_flag(options::MULTIPLE);
-    let multiple_paths = opt_suffix || opt_multiple;
-    let name_args_count = matches
-        .get_many::<String>(options::NAME)
-        .map(|n| n.len())
-        .unwrap_or(0);
-
-    // too many arguments
-    if !multiple_paths && name_args_count > 2 {
-        return Err(UUsageError::new(
-            1,
-            format!(
-                "extra operand {}",
-                matches
-                    .get_many::<String>(options::NAME)
-                    .unwrap()
-                    .nth(2)
-                    .unwrap()
-                    .quote()
-            ),
-        ));
-    }
-
-    let suffix = if opt_suffix {
-        matches.get_one::<String>(options::SUFFIX).unwrap()
-    } else if !opt_multiple && name_args_count > 1 {
-        matches
-            .get_many::<String>(options::NAME)
-            .unwrap()
-            .nth(1)
-            .unwrap()
-    } else {
-        ""
-    };
-
-    //
-    // Main Program Processing
-    //
-
-    let paths: Vec<_> = if multiple_paths {
-        matches.get_many::<String>(options::NAME).unwrap().collect()
-    } else {
-        matches
-            .get_many::<String>(options::NAME)
-            .unwrap()
-            .take(1)
-            .collect()
-    };
-
-    for path in paths {
-        print!("{}{}", basename(path, suffix), line_ending);
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::MULTIPLE)
-                .short('a')
-                .long(options::MULTIPLE)
-                .help("support multiple arguments and treat each as a NAME")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NAME)
-                .action(clap::ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath)
-                .hide(true),
-        )
-        .arg(
-            Arg::new(options::SUFFIX)
-                .short('s')
-                .long(options::SUFFIX)
-                .value_name("SUFFIX")
-                .help("remove a trailing SUFFIX; implies -a"),
-        )
-        .arg(
-            Arg::new(options::ZERO)
-                .short('z')
-                .long(options::ZERO)
-                .help("end each output line with NUL, not newline")
-                .action(ArgAction::SetTrue),
-        )
-}
-
-fn basename(fullname: &str, suffix: &str) -> String {
-    // Remove all platform-specific path separators from the end.
-    let path = fullname.trim_end_matches(is_separator);
-
-    // If the path contained *only* suffix characters (for example, if
-    // `fullname` were "///" and `suffix` were "/"), then `path` would
-    // be left with the empty string. In that case, we set `path` to be
-    // the original `fullname` to avoid returning the empty path.
-    let path = if path.is_empty() { fullname } else { path };
-
-    // Convert to path buffer and get last path component
-    let pb = PathBuf::from(path);
-    match pb.components().last() {
-        Some(c) => {
-            let name = c.as_os_str().to_str().unwrap();
-            if name == suffix {
-                name.to_string()
-            } else {
-                name.strip_suffix(suffix).unwrap_or(name).to_string()
-            }
-        }
-
-        None => String::new(),
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_basenc/basenc.rs.html b/coreutils/dev/src/uu_basenc/basenc.rs.html deleted file mode 100644 index 42f02edc8..000000000 --- a/coreutils/dev/src/uu_basenc/basenc.rs.html +++ /dev/null @@ -1,195 +0,0 @@ -basenc.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jordy Dickinson <jordy.dickinson@gmail.com>
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-//spell-checker:ignore (args) lsbf msbf
-
-use clap::{Arg, ArgAction, Command};
-use uu_base32::base_common::{self, Config, BASE_CMD_PARSE_ERROR};
-
-use uucore::{
-    encoding::Format,
-    error::{UResult, UUsageError},
-};
-
-use std::io::{stdin, Read};
-use uucore::error::UClapError;
-
-use uucore::{help_about, help_usage};
-
-const ABOUT: &str = help_about!("basenc.md");
-const USAGE: &str = help_usage!("basenc.md");
-
-const ENCODINGS: &[(&str, Format, &str)] = &[
-    ("base64", Format::Base64, "same as 'base64' program"),
-    ("base64url", Format::Base64Url, "file- and url-safe base64"),
-    ("base32", Format::Base32, "same as 'base32' program"),
-    (
-        "base32hex",
-        Format::Base32Hex,
-        "extended hex alphabet base32",
-    ),
-    ("base16", Format::Base16, "hex encoding"),
-    (
-        "base2lsbf",
-        Format::Base2Lsbf,
-        "bit string with least significant bit (lsb) first",
-    ),
-    (
-        "base2msbf",
-        Format::Base2Msbf,
-        "bit string with most significant bit (msb) first",
-    ),
-    (
-        "z85",
-        Format::Z85,
-        "ascii85-like encoding;\n\
-        when encoding, input length must be a multiple of 4;\n\
-        when decoding, input length must be a multiple of 5",
-    ),
-];
-
-pub fn uu_app() -> Command {
-    let mut command = base_common::base_app(ABOUT, USAGE);
-    for encoding in ENCODINGS {
-        command = command.arg(
-            Arg::new(encoding.0)
-                .long(encoding.0)
-                .help(encoding.2)
-                .action(ArgAction::SetTrue),
-        );
-    }
-    command
-}
-
-fn parse_cmd_args(args: impl uucore::Args) -> UResult<(Config, Format)> {
-    let matches = uu_app()
-        .try_get_matches_from(args.collect_lossy())
-        .with_exit_code(1)?;
-    let format = ENCODINGS
-        .iter()
-        .find(|encoding| matches.get_flag(encoding.0))
-        .ok_or_else(|| UUsageError::new(BASE_CMD_PARSE_ERROR, "missing encoding type"))?
-        .1;
-    let config = Config::from(&matches)?;
-    Ok((config, format))
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let (config, format) = parse_cmd_args(args)?;
-    // Create a reference to stdin so we can return a locked stdin from
-    // parse_base_cmd_args
-    let stdin_raw = stdin();
-    let mut input: Box<dyn Read> = base_common::get_input(&config, &stdin_raw)?;
-
-    base_common::handle_input(
-        &mut input,
-        format,
-        config.wrap_cols,
-        config.ignore_garbage,
-        config.decode,
-    )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cat/cat.rs.html b/coreutils/dev/src/uu_cat/cat.rs.html deleted file mode 100644 index 5d58c5599..000000000 --- a/coreutils/dev/src/uu_cat/cat.rs.html +++ /dev/null @@ -1,1297 +0,0 @@ -cat.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jordi Boggiano <j.boggiano@seld.be>
-// (c) Evgeniy Klyuchikov <evgeniy.klyuchikov@gmail.com>
-// (c) Joshua S. Miller <jsmiller@uchicago.edu>
-// (c) Árni Dagur <arni@dagur.eu>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) nonprint nonblank nonprinting
-
-// last synced with: cat (GNU coreutils) 8.13
-use clap::{crate_version, Arg, ArgAction, Command};
-use is_terminal::IsTerminal;
-use std::fs::{metadata, File};
-use std::io::{self, Read, Write};
-use thiserror::Error;
-use uucore::display::Quotable;
-use uucore::error::UResult;
-use uucore::fs::FileInformation;
-
-#[cfg(unix)]
-use std::os::unix::io::AsRawFd;
-
-/// Linux splice support
-#[cfg(any(target_os = "linux", target_os = "android"))]
-mod splice;
-
-/// Unix domain socket support
-#[cfg(unix)]
-use std::net::Shutdown;
-#[cfg(unix)]
-use std::os::unix::fs::FileTypeExt;
-#[cfg(unix)]
-use std::os::unix::net::UnixStream;
-use uucore::{format_usage, help_about, help_usage};
-
-const USAGE: &str = help_usage!("cat.md");
-const ABOUT: &str = help_about!("cat.md");
-
-#[derive(Error, Debug)]
-enum CatError {
-    /// Wrapper around `io::Error`
-    #[error("{0}")]
-    Io(#[from] io::Error),
-    /// Wrapper around `nix::Error`
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    #[error("{0}")]
-    Nix(#[from] nix::Error),
-    /// Unknown file type; it's not a regular file, socket, etc.
-    #[error("unknown filetype: {}", ft_debug)]
-    UnknownFiletype {
-        /// A debug print of the file type
-        ft_debug: String,
-    },
-    #[error("Is a directory")]
-    IsDirectory,
-    #[error("input file is output file")]
-    OutputIsInput,
-}
-
-type CatResult<T> = Result<T, CatError>;
-
-#[derive(PartialEq)]
-enum NumberingMode {
-    None,
-    NonEmpty,
-    All,
-}
-
-struct OutputOptions {
-    /// Line numbering mode
-    number: NumberingMode,
-
-    /// Suppress repeated empty output lines
-    squeeze_blank: bool,
-
-    /// display TAB characters as `tab`
-    show_tabs: bool,
-
-    /// Show end of lines
-    show_ends: bool,
-
-    /// use ^ and M- notation, except for LF (\\n) and TAB (\\t)
-    show_nonprint: bool,
-}
-
-impl OutputOptions {
-    fn tab(&self) -> &'static str {
-        if self.show_tabs {
-            "^I"
-        } else {
-            "\t"
-        }
-    }
-
-    fn end_of_line(&self) -> &'static str {
-        if self.show_ends {
-            "$\n"
-        } else {
-            "\n"
-        }
-    }
-
-    /// We can write fast if we can simply copy the contents of the file to
-    /// stdout, without augmenting the output with e.g. line numbers.
-    fn can_write_fast(&self) -> bool {
-        !(self.show_tabs
-            || self.show_nonprint
-            || self.show_ends
-            || self.squeeze_blank
-            || self.number != NumberingMode::None)
-    }
-}
-
-/// State that persists between output of each file. This struct is only used
-/// when we can't write fast.
-struct OutputState {
-    /// The current line number
-    line_number: usize,
-
-    /// Whether the output cursor is at the beginning of a new line
-    at_line_start: bool,
-
-    /// Whether we skipped a \r, which still needs to be printed
-    skipped_carriage_return: bool,
-
-    /// Whether we have already printed a blank line
-    one_blank_kept: bool,
-}
-
-#[cfg(unix)]
-trait FdReadable: Read + AsRawFd {}
-#[cfg(not(unix))]
-trait FdReadable: Read {}
-
-#[cfg(unix)]
-impl<T> FdReadable for T where T: Read + AsRawFd {}
-#[cfg(not(unix))]
-impl<T> FdReadable for T where T: Read {}
-
-/// Represents an open file handle, stream, or other device
-struct InputHandle<R: FdReadable> {
-    reader: R,
-    is_interactive: bool,
-}
-
-/// Concrete enum of recognized file types.
-///
-/// *Note*: `cat`-ing a directory should result in an
-/// CatError::IsDirectory
-enum InputType {
-    Directory,
-    File,
-    StdIn,
-    SymLink,
-    #[cfg(unix)]
-    BlockDevice,
-    #[cfg(unix)]
-    CharacterDevice,
-    #[cfg(unix)]
-    Fifo,
-    #[cfg(unix)]
-    Socket,
-}
-
-mod options {
-    pub static FILE: &str = "file";
-    pub static SHOW_ALL: &str = "show-all";
-    pub static NUMBER_NONBLANK: &str = "number-nonblank";
-    pub static SHOW_NONPRINTING_ENDS: &str = "e";
-    pub static SHOW_ENDS: &str = "show-ends";
-    pub static NUMBER: &str = "number";
-    pub static SQUEEZE_BLANK: &str = "squeeze-blank";
-    pub static SHOW_NONPRINTING_TABS: &str = "t";
-    pub static SHOW_TABS: &str = "show-tabs";
-    pub static SHOW_NONPRINTING: &str = "show-nonprinting";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let number_mode = if matches.get_flag(options::NUMBER_NONBLANK) {
-        NumberingMode::NonEmpty
-    } else if matches.get_flag(options::NUMBER) {
-        NumberingMode::All
-    } else {
-        NumberingMode::None
-    };
-
-    let show_nonprint = vec![
-        options::SHOW_ALL.to_owned(),
-        options::SHOW_NONPRINTING_ENDS.to_owned(),
-        options::SHOW_NONPRINTING_TABS.to_owned(),
-        options::SHOW_NONPRINTING.to_owned(),
-    ]
-    .iter()
-    .any(|v| matches.get_flag(v));
-
-    let show_ends = vec![
-        options::SHOW_ENDS.to_owned(),
-        options::SHOW_ALL.to_owned(),
-        options::SHOW_NONPRINTING_ENDS.to_owned(),
-    ]
-    .iter()
-    .any(|v| matches.get_flag(v));
-
-    let show_tabs = vec![
-        options::SHOW_ALL.to_owned(),
-        options::SHOW_TABS.to_owned(),
-        options::SHOW_NONPRINTING_TABS.to_owned(),
-    ]
-    .iter()
-    .any(|v| matches.get_flag(v));
-
-    let squeeze_blank = matches.get_flag(options::SQUEEZE_BLANK);
-    let files: Vec<String> = match matches.get_many::<String>(options::FILE) {
-        Some(v) => v.clone().map(|v| v.to_owned()).collect(),
-        None => vec!["-".to_owned()],
-    };
-
-    let options = OutputOptions {
-        show_ends,
-        number: number_mode,
-        show_nonprint,
-        show_tabs,
-        squeeze_blank,
-    };
-    cat_files(&files, &options)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .action(clap::ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::SHOW_ALL)
-                .short('A')
-                .long(options::SHOW_ALL)
-                .help("equivalent to -vET")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NUMBER_NONBLANK)
-                .short('b')
-                .long(options::NUMBER_NONBLANK)
-                .help("number nonempty output lines, overrides -n")
-                .overrides_with(options::NUMBER)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SHOW_NONPRINTING_ENDS)
-                .short('e')
-                .help("equivalent to -vE")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SHOW_ENDS)
-                .short('E')
-                .long(options::SHOW_ENDS)
-                .help("display $ at end of each line")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NUMBER)
-                .short('n')
-                .long(options::NUMBER)
-                .help("number all output lines")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SQUEEZE_BLANK)
-                .short('s')
-                .long(options::SQUEEZE_BLANK)
-                .help("suppress repeated empty output lines")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SHOW_NONPRINTING_TABS)
-                .short('t')
-                .help("equivalent to -vT")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SHOW_TABS)
-                .short('T')
-                .long(options::SHOW_TABS)
-                .help("display TAB characters at ^I")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SHOW_NONPRINTING)
-                .short('v')
-                .long(options::SHOW_NONPRINTING)
-                .help("use ^ and M- notation, except for LF (\\n) and TAB (\\t)")
-                .action(ArgAction::SetTrue),
-        )
-}
-
-fn cat_handle<R: FdReadable>(
-    handle: &mut InputHandle<R>,
-    options: &OutputOptions,
-    state: &mut OutputState,
-) -> CatResult<()> {
-    if options.can_write_fast() {
-        write_fast(handle)
-    } else {
-        write_lines(handle, options, state)
-    }
-}
-
-fn cat_path(
-    path: &str,
-    options: &OutputOptions,
-    state: &mut OutputState,
-    out_info: Option<&FileInformation>,
-) -> CatResult<()> {
-    match get_input_type(path)? {
-        InputType::StdIn => {
-            let stdin = io::stdin();
-            let mut handle = InputHandle {
-                reader: stdin,
-                is_interactive: std::io::stdin().is_terminal(),
-            };
-            cat_handle(&mut handle, options, state)
-        }
-        InputType::Directory => Err(CatError::IsDirectory),
-        #[cfg(unix)]
-        InputType::Socket => {
-            let socket = UnixStream::connect(path)?;
-            socket.shutdown(Shutdown::Write)?;
-            let mut handle = InputHandle {
-                reader: socket,
-                is_interactive: false,
-            };
-            cat_handle(&mut handle, options, state)
-        }
-        _ => {
-            let file = File::open(path)?;
-
-            if let Some(out_info) = out_info {
-                if out_info.file_size() != 0
-                    && FileInformation::from_file(&file).ok().as_ref() == Some(out_info)
-                {
-                    return Err(CatError::OutputIsInput);
-                }
-            }
-
-            let mut handle = InputHandle {
-                reader: file,
-                is_interactive: false,
-            };
-            cat_handle(&mut handle, options, state)
-        }
-    }
-}
-
-fn cat_files(files: &[String], options: &OutputOptions) -> UResult<()> {
-    let out_info = FileInformation::from_file(&std::io::stdout()).ok();
-
-    let mut state = OutputState {
-        line_number: 1,
-        at_line_start: true,
-        skipped_carriage_return: false,
-        one_blank_kept: false,
-    };
-    let mut error_messages: Vec<String> = Vec::new();
-
-    for path in files {
-        if let Err(err) = cat_path(path, options, &mut state, out_info.as_ref()) {
-            error_messages.push(format!("{}: {}", path.maybe_quote(), err));
-        }
-    }
-    if state.skipped_carriage_return {
-        print!("\r");
-    }
-    if error_messages.is_empty() {
-        Ok(())
-    } else {
-        // each next line is expected to display "cat: …"
-        let line_joiner = format!("\n{}: ", uucore::util_name());
-
-        Err(uucore::error::USimpleError::new(
-            error_messages.len() as i32,
-            error_messages.join(&line_joiner),
-        ))
-    }
-}
-
-/// Classifies the `InputType` of file at `path` if possible
-///
-/// # Arguments
-///
-/// * `path` - Path on a file system to classify metadata
-fn get_input_type(path: &str) -> CatResult<InputType> {
-    if path == "-" {
-        return Ok(InputType::StdIn);
-    }
-
-    let ft = metadata(path)?.file_type();
-    match ft {
-        #[cfg(unix)]
-        ft if ft.is_block_device() => Ok(InputType::BlockDevice),
-        #[cfg(unix)]
-        ft if ft.is_char_device() => Ok(InputType::CharacterDevice),
-        #[cfg(unix)]
-        ft if ft.is_fifo() => Ok(InputType::Fifo),
-        #[cfg(unix)]
-        ft if ft.is_socket() => Ok(InputType::Socket),
-        ft if ft.is_dir() => Ok(InputType::Directory),
-        ft if ft.is_file() => Ok(InputType::File),
-        ft if ft.is_symlink() => Ok(InputType::SymLink),
-        _ => Err(CatError::UnknownFiletype {
-            ft_debug: format!("{ft:?}"),
-        }),
-    }
-}
-
-/// Writes handle to stdout with no configuration. This allows a
-/// simple memory copy.
-fn write_fast<R: FdReadable>(handle: &mut InputHandle<R>) -> CatResult<()> {
-    let stdout = io::stdout();
-    let mut stdout_lock = stdout.lock();
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    {
-        // If we're on Linux or Android, try to use the splice() system call
-        // for faster writing. If it works, we're done.
-        if !splice::write_fast_using_splice(handle, &stdout_lock)? {
-            return Ok(());
-        }
-    }
-    // If we're not on Linux or Android, or the splice() call failed,
-    // fall back on slower writing.
-    let mut buf = [0; 1024 * 64];
-    while let Ok(n) = handle.reader.read(&mut buf) {
-        if n == 0 {
-            break;
-        }
-        stdout_lock.write_all(&buf[..n])?;
-    }
-    Ok(())
-}
-
-/// Outputs file contents to stdout in a line-by-line fashion,
-/// propagating any errors that might occur.
-#[allow(clippy::cognitive_complexity)]
-fn write_lines<R: FdReadable>(
-    handle: &mut InputHandle<R>,
-    options: &OutputOptions,
-    state: &mut OutputState,
-) -> CatResult<()> {
-    let mut in_buf = [0; 1024 * 31];
-    let stdout = io::stdout();
-    let mut writer = stdout.lock();
-
-    while let Ok(n) = handle.reader.read(&mut in_buf) {
-        if n == 0 {
-            break;
-        }
-        let in_buf = &in_buf[..n];
-        let mut pos = 0;
-        while pos < n {
-            // skip empty line_number enumerating them if needed
-            if in_buf[pos] == b'\n' {
-                // \r followed by \n is printed as ^M when show_ends is enabled, so that \r\n prints as ^M$
-                if state.skipped_carriage_return && options.show_ends {
-                    writer.write_all(b"^M")?;
-                    state.skipped_carriage_return = false;
-                }
-                if !state.at_line_start || !options.squeeze_blank || !state.one_blank_kept {
-                    state.one_blank_kept = true;
-                    if state.at_line_start && options.number == NumberingMode::All {
-                        write!(writer, "{0:6}\t", state.line_number)?;
-                        state.line_number += 1;
-                    }
-                    writer.write_all(options.end_of_line().as_bytes())?;
-                    if handle.is_interactive {
-                        writer.flush()?;
-                    }
-                }
-                state.at_line_start = true;
-                pos += 1;
-                continue;
-            }
-            if state.skipped_carriage_return {
-                writer.write_all(b"\r")?;
-                state.skipped_carriage_return = false;
-                state.at_line_start = false;
-            }
-            state.one_blank_kept = false;
-            if state.at_line_start && options.number != NumberingMode::None {
-                write!(writer, "{0:6}\t", state.line_number)?;
-                state.line_number += 1;
-            }
-
-            // print to end of line or end of buffer
-            let offset = if options.show_nonprint {
-                write_nonprint_to_end(&in_buf[pos..], &mut writer, options.tab().as_bytes())
-            } else if options.show_tabs {
-                write_tab_to_end(&in_buf[pos..], &mut writer)
-            } else {
-                write_to_end(&in_buf[pos..], &mut writer)
-            };
-            // end of buffer?
-            if offset + pos == in_buf.len() {
-                state.at_line_start = false;
-                break;
-            }
-            if in_buf[pos + offset] == b'\r' {
-                state.skipped_carriage_return = true;
-            } else {
-                assert_eq!(in_buf[pos + offset], b'\n');
-                // print suitable end of line
-                writer.write_all(options.end_of_line().as_bytes())?;
-                if handle.is_interactive {
-                    writer.flush()?;
-                }
-                state.at_line_start = true;
-            }
-            pos += offset + 1;
-        }
-    }
-
-    Ok(())
-}
-
-// write***_to_end methods
-// Write all symbols till \n or \r or end of buffer is reached
-// We need to stop at \r because it may be written as ^M depending on the byte after and settings;
-// however, write_nonprint_to_end doesn't need to stop at \r because it will always write \r as ^M.
-// Return the number of written symbols
-fn write_to_end<W: Write>(in_buf: &[u8], writer: &mut W) -> usize {
-    match in_buf.iter().position(|c| *c == b'\n' || *c == b'\r') {
-        Some(p) => {
-            writer.write_all(&in_buf[..p]).unwrap();
-            p
-        }
-        None => {
-            writer.write_all(in_buf).unwrap();
-            in_buf.len()
-        }
-    }
-}
-
-fn write_tab_to_end<W: Write>(mut in_buf: &[u8], writer: &mut W) -> usize {
-    let mut count = 0;
-    loop {
-        match in_buf
-            .iter()
-            .position(|c| *c == b'\n' || *c == b'\t' || *c == b'\r')
-        {
-            Some(p) => {
-                writer.write_all(&in_buf[..p]).unwrap();
-                if in_buf[p] == b'\t' {
-                    writer.write_all(b"^I").unwrap();
-                    in_buf = &in_buf[p + 1..];
-                    count += p + 1;
-                } else {
-                    // b'\n' or b'\r'
-                    return count + p;
-                }
-            }
-            None => {
-                writer.write_all(in_buf).unwrap();
-                return in_buf.len();
-            }
-        };
-    }
-}
-
-fn write_nonprint_to_end<W: Write>(in_buf: &[u8], writer: &mut W, tab: &[u8]) -> usize {
-    let mut count = 0;
-
-    for byte in in_buf.iter().copied() {
-        if byte == b'\n' {
-            break;
-        }
-        match byte {
-            9 => writer.write_all(tab),
-            0..=8 | 10..=31 => writer.write_all(&[b'^', byte + 64]),
-            32..=126 => writer.write_all(&[byte]),
-            127 => writer.write_all(&[b'^', b'?']),
-            128..=159 => writer.write_all(&[b'M', b'-', b'^', byte - 64]),
-            160..=254 => writer.write_all(&[b'M', b'-', byte - 128]),
-            _ => writer.write_all(&[b'M', b'-', b'^', b'?']),
-        }
-        .unwrap();
-        count += 1;
-    }
-    count
-}
-
-#[cfg(test)]
-mod tests {
-    use std::io::{stdout, BufWriter};
-
-    #[test]
-    fn test_write_nonprint_to_end_new_line() {
-        let mut writer = BufWriter::with_capacity(1024 * 64, stdout());
-        let in_buf = b"\n";
-        let tab = b"";
-        super::write_nonprint_to_end(in_buf, &mut writer, tab);
-        assert_eq!(writer.buffer().len(), 0);
-    }
-
-    #[test]
-    fn test_write_nonprint_to_end_9() {
-        let mut writer = BufWriter::with_capacity(1024 * 64, stdout());
-        let in_buf = &[9u8];
-        let tab = b"tab";
-        super::write_nonprint_to_end(in_buf, &mut writer, tab);
-        assert_eq!(writer.buffer(), tab);
-    }
-
-    #[test]
-    fn test_write_nonprint_to_end_0_to_8() {
-        for byte in 0u8..=8u8 {
-            let mut writer = BufWriter::with_capacity(1024 * 64, stdout());
-            let in_buf = &[byte];
-            let tab = b"";
-            super::write_nonprint_to_end(in_buf, &mut writer, tab);
-            assert_eq!(writer.buffer(), [b'^', byte + 64]);
-        }
-    }
-
-    #[test]
-    fn test_write_nonprint_to_end_10_to_31() {
-        for byte in 11u8..=31u8 {
-            let mut writer = BufWriter::with_capacity(1024 * 64, stdout());
-            let in_buf = &[byte];
-            let tab = b"";
-            super::write_nonprint_to_end(in_buf, &mut writer, tab);
-            assert_eq!(writer.buffer(), [b'^', byte + 64]);
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cat/splice.rs.html b/coreutils/dev/src/uu_cat/splice.rs.html deleted file mode 100644 index 498ae8a33..000000000 --- a/coreutils/dev/src/uu_cat/splice.rs.html +++ /dev/null @@ -1,135 +0,0 @@ -splice.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-
use super::{CatResult, FdReadable, InputHandle};
-
-use nix::unistd;
-use std::os::unix::io::{AsRawFd, RawFd};
-
-use uucore::pipes::{pipe, splice, splice_exact};
-
-const SPLICE_SIZE: usize = 1024 * 128;
-const BUF_SIZE: usize = 1024 * 16;
-
-/// This function is called from `write_fast()` on Linux and Android. The
-/// function `splice()` is used to move data between two file descriptors
-/// without copying between kernel and user spaces. This results in a large
-/// speedup.
-///
-/// The `bool` in the result value indicates if we need to fall back to normal
-/// copying or not. False means we don't have to.
-#[inline]
-pub(super) fn write_fast_using_splice<R: FdReadable>(
-    handle: &mut InputHandle<R>,
-    write_fd: &impl AsRawFd,
-) -> CatResult<bool> {
-    let (pipe_rd, pipe_wr) = pipe()?;
-
-    loop {
-        match splice(&handle.reader, &pipe_wr, SPLICE_SIZE) {
-            Ok(n) => {
-                if n == 0 {
-                    return Ok(false);
-                }
-                if splice_exact(&pipe_rd, write_fd, n).is_err() {
-                    // If the first splice manages to copy to the intermediate
-                    // pipe, but the second splice to stdout fails for some reason
-                    // we can recover by copying the data that we have from the
-                    // intermediate pipe to stdout using normal read/write. Then
-                    // we tell the caller to fall back.
-                    copy_exact(pipe_rd.as_raw_fd(), write_fd.as_raw_fd(), n)?;
-                    return Ok(true);
-                }
-            }
-            Err(_) => {
-                return Ok(true);
-            }
-        }
-    }
-}
-
-/// Move exactly `num_bytes` bytes from `read_fd` to `write_fd`.
-///
-/// Panics if not enough bytes can be read.
-fn copy_exact(read_fd: RawFd, write_fd: RawFd, num_bytes: usize) -> nix::Result<()> {
-    let mut left = num_bytes;
-    let mut buf = [0; BUF_SIZE];
-    while left > 0 {
-        let read = unistd::read(read_fd, &mut buf)?;
-        assert_ne!(read, 0, "unexpected end of pipe");
-        let mut written = 0;
-        while written < read {
-            match unistd::write(write_fd, &buf[written..read])? {
-                0 => panic!(),
-                n => written += n,
-            }
-        }
-        left -= read;
-    }
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_chcon/chcon.rs.html b/coreutils/dev/src/uu_chcon/chcon.rs.html deleted file mode 100644 index e79334798..000000000 --- a/coreutils/dev/src/uu_chcon/chcon.rs.html +++ /dev/null @@ -1,1571 +0,0 @@ -chcon.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-
// spell-checker:ignore (vars) RFILE
-#![allow(clippy::upper_case_acronyms)]
-
-use clap::builder::ValueParser;
-use uucore::error::{UResult, USimpleError, UUsageError};
-use uucore::{display::Quotable, format_usage, help_about, help_usage, show_error, show_warning};
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use selinux::{OpaqueSecurityContext, SecurityContext};
-
-use std::borrow::Cow;
-use std::ffi::{CStr, CString, OsStr, OsString};
-use std::os::raw::c_int;
-use std::path::{Path, PathBuf};
-use std::{fs, io};
-
-mod errors;
-mod fts;
-
-use errors::*;
-
-const ABOUT: &str = help_about!("chcon.md");
-const USAGE: &str = help_usage!("chcon.md");
-
-pub mod options {
-    pub static HELP: &str = "help";
-    pub static VERBOSE: &str = "verbose";
-
-    pub static REFERENCE: &str = "reference";
-
-    pub static USER: &str = "user";
-    pub static ROLE: &str = "role";
-    pub static TYPE: &str = "type";
-    pub static RANGE: &str = "range";
-
-    pub static RECURSIVE: &str = "recursive";
-
-    pub mod sym_links {
-        pub static FOLLOW_ARG_DIR_SYM_LINK: &str = "follow-arg-dir-sym-link";
-        pub static FOLLOW_DIR_SYM_LINKS: &str = "follow-dir-sym-links";
-        pub static NO_FOLLOW_SYM_LINKS: &str = "no-follow-sym-links";
-    }
-
-    pub mod dereference {
-        pub static DEREFERENCE: &str = "dereference";
-        pub static NO_DEREFERENCE: &str = "no-dereference";
-    }
-
-    pub mod preserve_root {
-        pub static PRESERVE_ROOT: &str = "preserve-root";
-        pub static NO_PRESERVE_ROOT: &str = "no-preserve-root";
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let config = uu_app();
-
-    let options = match parse_command_line(config, args) {
-        Ok(r) => r,
-        Err(r) => {
-            if let Error::CommandLine(r) = r {
-                return Err(r.into());
-            }
-
-            return Err(UUsageError::new(libc::EXIT_FAILURE, format!("{r}.\n")));
-        }
-    };
-
-    let context = match &options.mode {
-        CommandLineMode::ReferenceBased { reference } => {
-            let result = match SecurityContext::of_path(reference, true, false) {
-                Ok(Some(context)) => Ok(context),
-
-                Ok(None) => {
-                    let err = io::Error::from_raw_os_error(libc::ENODATA);
-                    Err(Error::from_io1("Getting security context", reference, err))
-                }
-
-                Err(r) => Err(Error::from_selinux("Getting security context", r)),
-            };
-
-            match result {
-                Err(r) => {
-                    return Err(USimpleError::new(
-                        libc::EXIT_FAILURE,
-                        format!("{}.", report_full_error(&r)),
-                    ));
-                }
-
-                Ok(file_context) => SELinuxSecurityContext::File(file_context),
-            }
-        }
-
-        CommandLineMode::ContextBased { context } => {
-            let c_context = match os_str_to_c_string(context) {
-                Ok(context) => context,
-
-                Err(_r) => {
-                    return Err(USimpleError::new(
-                        libc::EXIT_FAILURE,
-                        format!("Invalid security context {}.", context.quote()),
-                    ));
-                }
-            };
-
-            if SecurityContext::from_c_str(&c_context, false).check() == Some(false) {
-                return Err(USimpleError::new(
-                    libc::EXIT_FAILURE,
-                    format!("Invalid security context {}.", context.quote()),
-                ));
-            }
-
-            SELinuxSecurityContext::String(Some(c_context))
-        }
-
-        CommandLineMode::Custom { .. } => SELinuxSecurityContext::String(None),
-    };
-
-    let root_dev_ino = if options.preserve_root && options.recursive_mode.is_recursive() {
-        match get_root_dev_ino() {
-            Ok(r) => Some(r),
-
-            Err(r) => {
-                return Err(USimpleError::new(
-                    libc::EXIT_FAILURE,
-                    format!("{}.", report_full_error(&r)),
-                ));
-            }
-        }
-    } else {
-        None
-    };
-
-    let results = process_files(&options, &context, root_dev_ino);
-    if results.is_empty() {
-        return Ok(());
-    }
-
-    for result in &results {
-        show_error!("{}.", report_full_error(result));
-    }
-    Err(libc::EXIT_FAILURE.into())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new(options::dereference::DEREFERENCE)
-                .long(options::dereference::DEREFERENCE)
-                .conflicts_with(options::dereference::NO_DEREFERENCE)
-                .help(
-                    "Affect the referent of each symbolic link (this is the default), \
-                     rather than the symbolic link itself.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::dereference::NO_DEREFERENCE)
-                .short('h')
-                .long(options::dereference::NO_DEREFERENCE)
-                .help("Affect symbolic links instead of any referenced file.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::preserve_root::PRESERVE_ROOT)
-                .long(options::preserve_root::PRESERVE_ROOT)
-                .conflicts_with(options::preserve_root::NO_PRESERVE_ROOT)
-                .help("Fail to operate recursively on '/'.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::preserve_root::NO_PRESERVE_ROOT)
-                .long(options::preserve_root::NO_PRESERVE_ROOT)
-                .help("Do not treat '/' specially (the default).")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::REFERENCE)
-                .long(options::REFERENCE)
-                .value_name("RFILE")
-                .value_hint(clap::ValueHint::FilePath)
-                .conflicts_with_all([options::USER, options::ROLE, options::TYPE, options::RANGE])
-                .help(
-                    "Use security context of RFILE, rather than specifying \
-                     a CONTEXT value.",
-                )
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(options::USER)
-                .short('u')
-                .long(options::USER)
-                .value_name("USER")
-                .value_hint(clap::ValueHint::Username)
-                .help("Set user USER in the target security context.")
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(options::ROLE)
-                .short('r')
-                .long(options::ROLE)
-                .value_name("ROLE")
-                .help("Set role ROLE in the target security context.")
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(options::TYPE)
-                .short('t')
-                .long(options::TYPE)
-                .value_name("TYPE")
-                .help("Set type TYPE in the target security context.")
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(options::RANGE)
-                .short('l')
-                .long(options::RANGE)
-                .value_name("RANGE")
-                .help("Set range RANGE in the target security context.")
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(options::RECURSIVE)
-                .short('R')
-                .long(options::RECURSIVE)
-                .help("Operate on files and directories recursively.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::sym_links::FOLLOW_ARG_DIR_SYM_LINK)
-                .short('H')
-                .requires(options::RECURSIVE)
-                .overrides_with_all([
-                    options::sym_links::FOLLOW_DIR_SYM_LINKS,
-                    options::sym_links::NO_FOLLOW_SYM_LINKS,
-                ])
-                .help(
-                    "If a command line argument is a symbolic link to a directory, \
-                     traverse it. Only valid when -R is specified.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::sym_links::FOLLOW_DIR_SYM_LINKS)
-                .short('L')
-                .requires(options::RECURSIVE)
-                .overrides_with_all([
-                    options::sym_links::FOLLOW_ARG_DIR_SYM_LINK,
-                    options::sym_links::NO_FOLLOW_SYM_LINKS,
-                ])
-                .help(
-                    "Traverse every symbolic link to a directory encountered. \
-                     Only valid when -R is specified.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::sym_links::NO_FOLLOW_SYM_LINKS)
-                .short('P')
-                .requires(options::RECURSIVE)
-                .overrides_with_all([
-                    options::sym_links::FOLLOW_ARG_DIR_SYM_LINK,
-                    options::sym_links::FOLLOW_DIR_SYM_LINKS,
-                ])
-                .help(
-                    "Do not traverse any symbolic links (default). \
-                     Only valid when -R is specified.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::VERBOSE)
-                .short('v')
-                .long(options::VERBOSE)
-                .help("Output a diagnostic for every file processed.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("FILE")
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath)
-                .num_args(1..)
-                .value_parser(ValueParser::os_string()),
-        )
-}
-
-#[derive(Debug)]
-struct Options {
-    verbose: bool,
-    preserve_root: bool,
-    recursive_mode: RecursiveMode,
-    affect_symlink_referent: bool,
-    mode: CommandLineMode,
-    files: Vec<PathBuf>,
-}
-
-fn parse_command_line(config: clap::Command, args: impl uucore::Args) -> Result<Options> {
-    let matches = config.try_get_matches_from(args)?;
-
-    let verbose = matches.get_flag(options::VERBOSE);
-
-    let (recursive_mode, affect_symlink_referent) = if matches.get_flag(options::RECURSIVE) {
-        if matches.get_flag(options::sym_links::FOLLOW_DIR_SYM_LINKS) {
-            if matches.get_flag(options::dereference::NO_DEREFERENCE) {
-                return Err(Error::ArgumentsMismatch(format!(
-                    "'--{}' with '--{}' require '-P'",
-                    options::RECURSIVE,
-                    options::dereference::NO_DEREFERENCE
-                )));
-            }
-
-            (RecursiveMode::RecursiveAndFollowAllDirSymLinks, true)
-        } else if matches.get_flag(options::sym_links::FOLLOW_ARG_DIR_SYM_LINK) {
-            if matches.get_flag(options::dereference::NO_DEREFERENCE) {
-                return Err(Error::ArgumentsMismatch(format!(
-                    "'--{}' with '--{}' require '-P'",
-                    options::RECURSIVE,
-                    options::dereference::NO_DEREFERENCE
-                )));
-            }
-
-            (RecursiveMode::RecursiveAndFollowArgDirSymLinks, true)
-        } else {
-            if matches.get_flag(options::dereference::DEREFERENCE) {
-                return Err(Error::ArgumentsMismatch(format!(
-                    "'--{}' with '--{}' require either '-H' or '-L'",
-                    options::RECURSIVE,
-                    options::dereference::DEREFERENCE
-                )));
-            }
-
-            (RecursiveMode::RecursiveButDoNotFollowSymLinks, false)
-        }
-    } else {
-        let no_dereference = matches.get_flag(options::dereference::NO_DEREFERENCE);
-        (RecursiveMode::NotRecursive, !no_dereference)
-    };
-
-    // By default, do not preserve root.
-    let preserve_root = matches.get_flag(options::preserve_root::PRESERVE_ROOT);
-
-    let mut files = matches.get_many::<OsString>("FILE").unwrap_or_default();
-
-    let mode = if let Some(path) = matches.get_one::<OsString>(options::REFERENCE) {
-        CommandLineMode::ReferenceBased {
-            reference: PathBuf::from(path),
-        }
-    } else if matches.contains_id(options::USER)
-        || matches.contains_id(options::ROLE)
-        || matches.contains_id(options::TYPE)
-        || matches.contains_id(options::RANGE)
-    {
-        CommandLineMode::Custom {
-            user: matches.get_one::<OsString>(options::USER).map(Into::into),
-            role: matches.get_one::<OsString>(options::ROLE).map(Into::into),
-            the_type: matches.get_one::<OsString>(options::TYPE).map(Into::into),
-            range: matches.get_one::<OsString>(options::RANGE).map(Into::into),
-        }
-    } else if let Some(context) = files.next() {
-        CommandLineMode::ContextBased {
-            context: context.into(),
-        }
-    } else {
-        return Err(Error::MissingContext);
-    };
-
-    let files: Vec<_> = files.map(PathBuf::from).collect();
-    if files.is_empty() {
-        return Err(Error::MissingFiles);
-    }
-
-    Ok(Options {
-        verbose,
-        preserve_root,
-        recursive_mode,
-        affect_symlink_referent,
-        mode,
-        files,
-    })
-}
-
-#[derive(Debug, Copy, Clone)]
-enum RecursiveMode {
-    NotRecursive,
-    /// Do not traverse any symbolic links.
-    RecursiveButDoNotFollowSymLinks,
-    /// Traverse every symbolic link to a directory encountered.
-    RecursiveAndFollowAllDirSymLinks,
-    /// If a command line argument is a symbolic link to a directory, traverse it.
-    RecursiveAndFollowArgDirSymLinks,
-}
-
-impl RecursiveMode {
-    fn is_recursive(self) -> bool {
-        match self {
-            Self::NotRecursive => false,
-
-            Self::RecursiveButDoNotFollowSymLinks
-            | Self::RecursiveAndFollowAllDirSymLinks
-            | Self::RecursiveAndFollowArgDirSymLinks => true,
-        }
-    }
-
-    fn fts_open_options(self) -> c_int {
-        match self {
-            Self::NotRecursive | Self::RecursiveButDoNotFollowSymLinks => fts_sys::FTS_PHYSICAL,
-
-            Self::RecursiveAndFollowAllDirSymLinks => fts_sys::FTS_LOGICAL,
-
-            Self::RecursiveAndFollowArgDirSymLinks => {
-                fts_sys::FTS_PHYSICAL | fts_sys::FTS_COMFOLLOW
-            }
-        }
-    }
-}
-
-#[derive(Debug)]
-enum CommandLineMode {
-    ReferenceBased {
-        reference: PathBuf,
-    },
-    ContextBased {
-        context: OsString,
-    },
-    Custom {
-        user: Option<OsString>,
-        role: Option<OsString>,
-        the_type: Option<OsString>,
-        range: Option<OsString>,
-    },
-}
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-struct DeviceAndINode {
-    device_id: u64,
-    inode: u64,
-}
-
-#[cfg(unix)]
-impl From<fs::Metadata> for DeviceAndINode {
-    fn from(md: fs::Metadata) -> Self {
-        use std::os::unix::fs::MetadataExt;
-
-        Self {
-            device_id: md.dev(),
-            inode: md.ino(),
-        }
-    }
-}
-
-impl TryFrom<&libc::stat> for DeviceAndINode {
-    type Error = Error;
-
-    #[allow(clippy::useless_conversion)]
-    fn try_from(st: &libc::stat) -> Result<Self> {
-        let device_id = u64::try_from(st.st_dev).map_err(|_r| Error::OutOfRange)?;
-        let inode = u64::try_from(st.st_ino).map_err(|_r| Error::OutOfRange)?;
-        Ok(Self { device_id, inode })
-    }
-}
-
-fn process_files(
-    options: &Options,
-    context: &SELinuxSecurityContext,
-    root_dev_ino: Option<DeviceAndINode>,
-) -> Vec<Error> {
-    let fts_options = options.recursive_mode.fts_open_options();
-    let mut fts = match fts::FTS::new(options.files.iter(), fts_options) {
-        Ok(fts) => fts,
-        Err(err) => return vec![err],
-    };
-
-    let mut errors = Vec::default();
-    loop {
-        match fts.read_next_entry() {
-            Ok(true) => {
-                if let Err(err) = process_file(options, context, &mut fts, root_dev_ino) {
-                    errors.push(err);
-                }
-            }
-
-            Ok(false) => break,
-
-            Err(err) => {
-                errors.push(err);
-                break;
-            }
-        }
-    }
-    errors
-}
-
-fn process_file(
-    options: &Options,
-    context: &SELinuxSecurityContext,
-    fts: &mut fts::FTS,
-    root_dev_ino: Option<DeviceAndINode>,
-) -> Result<()> {
-    let mut entry = fts.last_entry_ref().unwrap();
-
-    let file_full_name = entry.path().map(PathBuf::from).ok_or_else(|| {
-        Error::from_io("File name validation", io::ErrorKind::InvalidInput.into())
-    })?;
-
-    let fts_access_path = entry.access_path().ok_or_else(|| {
-        let err = io::ErrorKind::InvalidInput.into();
-        Error::from_io1("File name validation", &file_full_name, err)
-    })?;
-
-    let err = |s, k: io::ErrorKind| Error::from_io1(s, &file_full_name, k.into());
-
-    let fts_err = |s| {
-        let r = io::Error::from_raw_os_error(entry.errno());
-        Err(Error::from_io1(s, &file_full_name, r))
-    };
-
-    // SAFETY: If `entry.fts_statp` is not null, then is is assumed to be valid.
-    let file_dev_ino: DeviceAndINode = if let Some(st) = entry.stat() {
-        st.try_into()?
-    } else {
-        return Err(err("Getting meta data", io::ErrorKind::InvalidInput));
-    };
-
-    let mut result = Ok(());
-
-    match entry.flags() {
-        fts_sys::FTS_D => {
-            if options.recursive_mode.is_recursive() {
-                if root_dev_ino_check(root_dev_ino, file_dev_ino) {
-                    // This happens e.g., with "chcon -R --preserve-root ... /"
-                    // and with "chcon -RH --preserve-root ... symlink-to-root".
-                    root_dev_ino_warn(&file_full_name);
-
-                    // Tell fts not to traverse into this hierarchy.
-                    let _ignored = fts.set(fts_sys::FTS_SKIP);
-
-                    // Ensure that we do not process "/" on the second visit.
-                    let _ignored = fts.read_next_entry();
-
-                    return Err(err("Modifying root path", io::ErrorKind::PermissionDenied));
-                }
-
-                return Ok(());
-            }
-        }
-
-        fts_sys::FTS_DP => {
-            if !options.recursive_mode.is_recursive() {
-                return Ok(());
-            }
-        }
-
-        fts_sys::FTS_NS => {
-            // For a top-level file or directory, this FTS_NS (stat failed) indicator is determined
-            // at the time of the initial fts_open call. With programs like chmod, chown, and chgrp,
-            // that modify permissions, it is possible that the file in question is accessible when
-            // control reaches this point. So, if this is the first time we've seen the FTS_NS for
-            // this file, tell fts_read to stat it "again".
-            if entry.level() == 0 && entry.number() == 0 {
-                entry.set_number(1);
-                let _ignored = fts.set(fts_sys::FTS_AGAIN);
-                return Ok(());
-            }
-
-            result = fts_err("Accessing");
-        }
-
-        fts_sys::FTS_ERR => result = fts_err("Accessing"),
-
-        fts_sys::FTS_DNR => result = fts_err("Reading directory"),
-
-        fts_sys::FTS_DC => {
-            if cycle_warning_required(options.recursive_mode.fts_open_options(), &entry) {
-                emit_cycle_warning(&file_full_name);
-                return Err(err("Reading cyclic directory", io::ErrorKind::InvalidData));
-            }
-        }
-
-        _ => {}
-    }
-
-    if entry.flags() == fts_sys::FTS_DP
-        && result.is_ok()
-        && root_dev_ino_check(root_dev_ino, file_dev_ino)
-    {
-        root_dev_ino_warn(&file_full_name);
-        result = Err(err("Modifying root path", io::ErrorKind::PermissionDenied));
-    }
-
-    if result.is_ok() {
-        if options.verbose {
-            println!(
-                "{}: Changing security context of: {}",
-                uucore::util_name(),
-                file_full_name.quote()
-            );
-        }
-
-        result = change_file_context(options, context, fts_access_path);
-    }
-
-    if !options.recursive_mode.is_recursive() {
-        let _ignored = fts.set(fts_sys::FTS_SKIP);
-    }
-    result
-}
-
-fn change_file_context(
-    options: &Options,
-    context: &SELinuxSecurityContext,
-    path: &Path,
-) -> Result<()> {
-    match &options.mode {
-        CommandLineMode::Custom {
-            user,
-            role,
-            the_type,
-            range,
-        } => {
-            let err0 = || -> Result<()> {
-                // If the file doesn't have a context, and we're not setting all of the context
-                // components, there isn't really an obvious default. Thus, we just give up.
-                let op = "Applying partial security context to unlabeled file";
-                let err = io::ErrorKind::InvalidInput.into();
-                Err(Error::from_io1(op, path, err))
-            };
-
-            let file_context =
-                match SecurityContext::of_path(path, options.affect_symlink_referent, false) {
-                    Ok(Some(context)) => context,
-
-                    Ok(None) => return err0(),
-                    Err(r) => return Err(Error::from_selinux("Getting security context", r)),
-                };
-
-            let c_file_context = match file_context.to_c_string() {
-                Ok(Some(context)) => context,
-
-                Ok(None) => return err0(),
-                Err(r) => return Err(Error::from_selinux("Getting security context", r)),
-            };
-
-            let se_context =
-                OpaqueSecurityContext::from_c_str(c_file_context.as_ref()).map_err(|_r| {
-                    let err = io::ErrorKind::InvalidInput.into();
-                    Error::from_io1("Creating security context", path, err)
-                })?;
-
-            type SetValueProc = fn(&OpaqueSecurityContext, &CStr) -> selinux::errors::Result<()>;
-
-            let list: &[(&Option<OsString>, SetValueProc)] = &[
-                (user, OpaqueSecurityContext::set_user),
-                (role, OpaqueSecurityContext::set_role),
-                (the_type, OpaqueSecurityContext::set_type),
-                (range, OpaqueSecurityContext::set_range),
-            ];
-
-            for (new_value, set_value_proc) in list {
-                if let Some(new_value) = new_value {
-                    let c_new_value = os_str_to_c_string(new_value).map_err(|_r| {
-                        let err = io::ErrorKind::InvalidInput.into();
-                        Error::from_io1("Creating security context", path, err)
-                    })?;
-
-                    set_value_proc(&se_context, &c_new_value)
-                        .map_err(|r| Error::from_selinux("Setting security context user", r))?;
-                }
-            }
-
-            let context_string = se_context
-                .to_c_string()
-                .map_err(|r| Error::from_selinux("Getting security context", r))?;
-
-            if c_file_context.as_ref().to_bytes() == context_string.as_ref().to_bytes() {
-                Ok(()) // Nothing to change.
-            } else {
-                SecurityContext::from_c_str(&context_string, false)
-                    .set_for_path(path, options.affect_symlink_referent, false)
-                    .map_err(|r| Error::from_selinux("Setting security context", r))
-            }
-        }
-
-        CommandLineMode::ReferenceBased { .. } | CommandLineMode::ContextBased { .. } => {
-            if let Some(c_context) = context.to_c_string()? {
-                SecurityContext::from_c_str(c_context.as_ref(), false)
-                    .set_for_path(path, options.affect_symlink_referent, false)
-                    .map_err(|r| Error::from_selinux("Setting security context", r))
-            } else {
-                let err = io::ErrorKind::InvalidInput.into();
-                Err(Error::from_io1("Setting security context", path, err))
-            }
-        }
-    }
-}
-
-#[cfg(unix)]
-pub(crate) fn os_str_to_c_string(s: &OsStr) -> Result<CString> {
-    use std::os::unix::ffi::OsStrExt;
-
-    CString::new(s.as_bytes())
-        .map_err(|_r| Error::from_io("CString::new()", io::ErrorKind::InvalidInput.into()))
-}
-
-/// Call `lstat()` to get the device and inode numbers for `/`.
-#[cfg(unix)]
-fn get_root_dev_ino() -> Result<DeviceAndINode> {
-    fs::symlink_metadata("/")
-        .map(DeviceAndINode::from)
-        .map_err(|r| Error::from_io1("std::fs::symlink_metadata", "/", r))
-}
-
-fn root_dev_ino_check(root_dev_ino: Option<DeviceAndINode>, dir_dev_ino: DeviceAndINode) -> bool {
-    root_dev_ino.map_or(false, |root_dev_ino| root_dev_ino == dir_dev_ino)
-}
-
-fn root_dev_ino_warn(dir_name: &Path) {
-    if dir_name.as_os_str() == "/" {
-        show_warning!(
-            "It is dangerous to operate recursively on '/'. \
-             Use --{} to override this failsafe.",
-            options::preserve_root::NO_PRESERVE_ROOT,
-        );
-    } else {
-        show_warning!(
-            "It is dangerous to operate recursively on {} (same as '/'). \
-             Use --{} to override this failsafe.",
-            dir_name.quote(),
-            options::preserve_root::NO_PRESERVE_ROOT,
-        );
-    }
-}
-
-// When fts_read returns FTS_DC to indicate a directory cycle, it may or may not indicate
-// a real problem.
-// When a program like chgrp performs a recursive traversal that requires traversing symbolic links,
-// it is *not* a problem.
-// However, when invoked with "-P -R", it deserves a warning.
-// The fts_options parameter records the options that control this aspect of fts behavior,
-// so test that.
-fn cycle_warning_required(fts_options: c_int, entry: &fts::EntryRef) -> bool {
-    // When dereferencing no symlinks, or when dereferencing only those listed on the command line
-    // and we're not processing a command-line argument, then a cycle is a serious problem.
-    ((fts_options & fts_sys::FTS_PHYSICAL) != 0)
-        && (((fts_options & fts_sys::FTS_COMFOLLOW) == 0) || entry.level() != 0)
-}
-
-fn emit_cycle_warning(file_name: &Path) {
-    show_warning!(
-        "Circular directory structure.\n\
-This almost certainly means that you have a corrupted file system.\n\
-NOTIFY YOUR SYSTEM MANAGER.\n\
-The following directory is part of the cycle {}.",
-        file_name.quote()
-    );
-}
-
-#[derive(Debug)]
-enum SELinuxSecurityContext<'t> {
-    File(SecurityContext<'t>),
-    String(Option<CString>),
-}
-
-impl<'t> SELinuxSecurityContext<'t> {
-    fn to_c_string(&self) -> Result<Option<Cow<CStr>>> {
-        match self {
-            Self::File(context) => context
-                .to_c_string()
-                .map_err(|r| Error::from_selinux("SELinuxSecurityContext::to_c_string()", r)),
-
-            Self::String(context) => Ok(context.as_deref().map(Cow::Borrowed)),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_chcon/errors.rs.html b/coreutils/dev/src/uu_chcon/errors.rs.html deleted file mode 100644 index 4dd50fc42..000000000 --- a/coreutils/dev/src/uu_chcon/errors.rs.html +++ /dev/null @@ -1,153 +0,0 @@ -errors.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-
use std::ffi::OsString;
-use std::fmt::Write;
-use std::io;
-
-use uucore::display::Quotable;
-
-pub(crate) type Result<T> = std::result::Result<T, Error>;
-
-#[derive(thiserror::Error, Debug)]
-pub(crate) enum Error {
-    #[error("No context is specified")]
-    MissingContext,
-
-    #[error("No files are specified")]
-    MissingFiles,
-
-    #[error("Data is out of range")]
-    OutOfRange,
-
-    #[error("{0}")]
-    ArgumentsMismatch(String),
-
-    #[error(transparent)]
-    CommandLine(#[from] clap::Error),
-
-    #[error("{operation} failed")]
-    SELinux {
-        operation: &'static str,
-        source: selinux::errors::Error,
-    },
-
-    #[error("{operation} failed")]
-    Io {
-        operation: &'static str,
-        source: io::Error,
-    },
-
-    #[error("{operation} failed on {}", .operand1.quote())]
-    Io1 {
-        operation: &'static str,
-        operand1: OsString,
-        source: io::Error,
-    },
-}
-
-impl Error {
-    pub(crate) fn from_io(operation: &'static str, source: io::Error) -> Self {
-        Self::Io { operation, source }
-    }
-
-    pub(crate) fn from_io1(
-        operation: &'static str,
-        operand1: impl Into<OsString>,
-        source: io::Error,
-    ) -> Self {
-        Self::Io1 {
-            operation,
-            operand1: operand1.into(),
-            source,
-        }
-    }
-
-    pub(crate) fn from_selinux(operation: &'static str, source: selinux::errors::Error) -> Self {
-        Self::SELinux { operation, source }
-    }
-}
-
-pub(crate) fn report_full_error(mut err: &dyn std::error::Error) -> String {
-    let mut desc = String::with_capacity(256);
-    write!(desc, "{err}").unwrap();
-    while let Some(source) = err.source() {
-        err = source;
-        write!(desc, ". {err}").unwrap();
-    }
-    desc
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_chcon/fts.rs.html b/coreutils/dev/src/uu_chcon/fts.rs.html deleted file mode 100644 index 1377a7fe9..000000000 --- a/coreutils/dev/src/uu_chcon/fts.rs.html +++ /dev/null @@ -1,387 +0,0 @@ -fts.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-
use std::ffi::{CStr, CString, OsStr};
-use std::marker::PhantomData;
-use std::os::raw::{c_int, c_long, c_short};
-use std::path::Path;
-use std::ptr::NonNull;
-use std::{io, iter, ptr, slice};
-
-use crate::errors::{Error, Result};
-use crate::os_str_to_c_string;
-
-#[derive(Debug)]
-pub(crate) struct FTS {
-    fts: ptr::NonNull<fts_sys::FTS>,
-
-    entry: Option<ptr::NonNull<fts_sys::FTSENT>>,
-    _phantom_data: PhantomData<fts_sys::FTSENT>,
-}
-
-impl FTS {
-    pub(crate) fn new<I>(paths: I, options: c_int) -> Result<Self>
-    where
-        I: IntoIterator,
-        I::Item: AsRef<OsStr>,
-    {
-        let files_paths: Vec<CString> = paths
-            .into_iter()
-            .map(|s| os_str_to_c_string(s.as_ref()))
-            .collect::<Result<_>>()?;
-
-        if files_paths.is_empty() {
-            return Err(Error::from_io(
-                "FTS::new()",
-                io::ErrorKind::InvalidInput.into(),
-            ));
-        }
-
-        let path_argv: Vec<_> = files_paths
-            .iter()
-            .map(CString::as_ref)
-            .map(CStr::as_ptr)
-            .chain(iter::once(ptr::null()))
-            .collect();
-
-        // SAFETY: We assume calling fts_open() is safe:
-        // - `path_argv` is an array holding at least one path, and null-terminated.
-        // - `compar` is None.
-        let fts = unsafe { fts_sys::fts_open(path_argv.as_ptr().cast(), options, None) };
-
-        let fts = ptr::NonNull::new(fts)
-            .ok_or_else(|| Error::from_io("fts_open()", io::Error::last_os_error()))?;
-
-        Ok(Self {
-            fts,
-            entry: None,
-            _phantom_data: PhantomData,
-        })
-    }
-
-    pub(crate) fn last_entry_ref(&mut self) -> Option<EntryRef> {
-        self.entry.map(move |entry| EntryRef::new(self, entry))
-    }
-
-    pub(crate) fn read_next_entry(&mut self) -> Result<bool> {
-        // SAFETY: We assume calling fts_read() is safe with a non-null `fts`
-        // pointer assumed to be valid.
-        let new_entry = unsafe { fts_sys::fts_read(self.fts.as_ptr()) };
-
-        self.entry = NonNull::new(new_entry);
-        if self.entry.is_none() {
-            let r = io::Error::last_os_error();
-            if let Some(0) = r.raw_os_error() {
-                Ok(false)
-            } else {
-                Err(Error::from_io("fts_read()", r))
-            }
-        } else {
-            Ok(true)
-        }
-    }
-
-    pub(crate) fn set(&mut self, instr: c_int) -> Result<()> {
-        let fts = self.fts.as_ptr();
-        let entry = self
-            .entry
-            .ok_or_else(|| Error::from_io("FTS::set()", io::ErrorKind::UnexpectedEof.into()))?;
-
-        // SAFETY: We assume calling fts_set() is safe with non-null `fts`
-        // and `entry` pointers assumed to be valid.
-        if unsafe { fts_sys::fts_set(fts, entry.as_ptr(), instr) } == -1 {
-            Err(Error::from_io("fts_set()", io::Error::last_os_error()))
-        } else {
-            Ok(())
-        }
-    }
-}
-
-impl Drop for FTS {
-    fn drop(&mut self) {
-        // SAFETY: We assume calling fts_close() is safe with a non-null `fts`
-        // pointer assumed to be valid.
-        unsafe { fts_sys::fts_close(self.fts.as_ptr()) };
-    }
-}
-
-#[derive(Debug)]
-pub(crate) struct EntryRef<'fts> {
-    pub(crate) pointer: ptr::NonNull<fts_sys::FTSENT>,
-
-    _fts: PhantomData<&'fts FTS>,
-    _phantom_data: PhantomData<fts_sys::FTSENT>,
-}
-
-impl<'fts> EntryRef<'fts> {
-    fn new(_fts: &'fts FTS, entry: ptr::NonNull<fts_sys::FTSENT>) -> Self {
-        Self {
-            pointer: entry,
-            _fts: PhantomData,
-            _phantom_data: PhantomData,
-        }
-    }
-
-    fn as_ref(&self) -> &fts_sys::FTSENT {
-        // SAFETY: `self.pointer` is a non-null pointer that is assumed to be valid.
-        unsafe { self.pointer.as_ref() }
-    }
-
-    fn as_mut(&mut self) -> &mut fts_sys::FTSENT {
-        // SAFETY: `self.pointer` is a non-null pointer that is assumed to be valid.
-        unsafe { self.pointer.as_mut() }
-    }
-
-    pub(crate) fn flags(&self) -> c_int {
-        c_int::from(self.as_ref().fts_info)
-    }
-
-    pub(crate) fn errno(&self) -> c_int {
-        self.as_ref().fts_errno
-    }
-
-    pub(crate) fn level(&self) -> c_short {
-        self.as_ref().fts_level
-    }
-
-    pub(crate) fn number(&self) -> c_long {
-        self.as_ref().fts_number
-    }
-
-    pub(crate) fn set_number(&mut self, new_number: c_long) {
-        self.as_mut().fts_number = new_number;
-    }
-
-    pub(crate) fn path(&self) -> Option<&Path> {
-        let entry = self.as_ref();
-        if entry.fts_pathlen == 0 {
-            return None;
-        }
-
-        NonNull::new(entry.fts_path)
-            .map(|path_ptr| {
-                let path_size = usize::from(entry.fts_pathlen).saturating_add(1);
-
-                // SAFETY: `entry.fts_path` is a non-null pointer that is assumed to be valid.
-                unsafe { slice::from_raw_parts(path_ptr.as_ptr().cast(), path_size) }
-            })
-            .and_then(|bytes| CStr::from_bytes_with_nul(bytes).ok())
-            .map(c_str_to_os_str)
-            .map(Path::new)
-    }
-
-    pub(crate) fn access_path(&self) -> Option<&Path> {
-        ptr::NonNull::new(self.as_ref().fts_accpath)
-            .map(|path_ptr| {
-                // SAFETY: `entry.fts_accpath` is a non-null pointer that is assumed to be valid.
-                unsafe { CStr::from_ptr(path_ptr.as_ptr()) }
-            })
-            .map(c_str_to_os_str)
-            .map(Path::new)
-    }
-
-    pub(crate) fn stat(&self) -> Option<&libc::stat> {
-        ptr::NonNull::new(self.as_ref().fts_statp).map(|stat_ptr| {
-            // SAFETY: `entry.fts_statp` is a non-null pointer that is assumed to be valid.
-            unsafe { stat_ptr.as_ref() }
-        })
-    }
-}
-
-#[cfg(unix)]
-fn c_str_to_os_str(s: &CStr) -> &OsStr {
-    use std::os::unix::ffi::OsStrExt;
-
-    OsStr::from_bytes(s.to_bytes())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_chgrp/chgrp.rs.html b/coreutils/dev/src/uu_chgrp/chgrp.rs.html deleted file mode 100644 index 09d7ec004..000000000 --- a/coreutils/dev/src/uu_chgrp/chgrp.rs.html +++ /dev/null @@ -1,331 +0,0 @@ -chgrp.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) COMFOLLOW Chowner RFILE RFILE's derefer dgid nonblank nonprint nonprinting
-
-use uucore::display::Quotable;
-pub use uucore::entries;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::perms::{chown_base, options, GidUidOwnerFilter, IfFrom};
-use uucore::{format_usage, help_about, help_usage};
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-
-use std::fs;
-use std::os::unix::fs::MetadataExt;
-
-const ABOUT: &str = help_about!("chgrp.md");
-const USAGE: &str = help_usage!("chgrp.md");
-
-fn parse_gid_and_uid(matches: &ArgMatches) -> UResult<GidUidOwnerFilter> {
-    let mut raw_group: String = String::new();
-    let dest_gid = if let Some(file) = matches.get_one::<String>(options::REFERENCE) {
-        fs::metadata(file)
-            .map(|meta| {
-                let gid = meta.gid();
-                raw_group = entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string());
-                Some(gid)
-            })
-            .map_err_context(|| format!("failed to get attributes of {}", file.quote()))?
-    } else {
-        let group = matches
-            .get_one::<String>(options::ARG_GROUP)
-            .map(|s| s.as_str())
-            .unwrap_or_default();
-        raw_group = group.to_string();
-        if group.is_empty() {
-            None
-        } else {
-            match entries::grp2gid(group) {
-                Ok(g) => Some(g),
-                _ => {
-                    return Err(USimpleError::new(
-                        1,
-                        format!("invalid group: {}", group.quote()),
-                    ))
-                }
-            }
-        }
-    };
-    Ok(GidUidOwnerFilter {
-        dest_gid,
-        dest_uid: None,
-        raw_owner: raw_group,
-        filter: IfFrom::All,
-    })
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    chown_base(uu_app(), args, options::ARG_GROUP, parse_gid_and_uid, true)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help)
-        )
-        .arg(
-            Arg::new(options::verbosity::CHANGES)
-                .short('c')
-                .long(options::verbosity::CHANGES)
-                .help("like verbose but report only when a change is made")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::verbosity::SILENT)
-                .short('f')
-                .long(options::verbosity::SILENT)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::verbosity::QUIET)
-                .long(options::verbosity::QUIET)
-                .help("suppress most error messages")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::verbosity::VERBOSE)
-                .short('v')
-                .long(options::verbosity::VERBOSE)
-                .help("output a diagnostic for every file processed")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::dereference::DEREFERENCE)
-                .long(options::dereference::DEREFERENCE)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-           Arg::new(options::dereference::NO_DEREFERENCE)
-               .short('h')
-               .long(options::dereference::NO_DEREFERENCE)
-               .help(
-                   "affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)",
-               )
-               .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::preserve_root::PRESERVE)
-                .long(options::preserve_root::PRESERVE)
-                .help("fail to operate recursively on '/'")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::preserve_root::NO_PRESERVE)
-                .long(options::preserve_root::NO_PRESERVE)
-                .help("do not treat '/' specially (the default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::REFERENCE)
-                .long(options::REFERENCE)
-                .value_name("RFILE")
-                .value_hint(clap::ValueHint::FilePath)
-                .help("use RFILE's group rather than specifying GROUP values"),
-        )
-        .arg(
-            Arg::new(options::RECURSIVE)
-                .short('R')
-                .long(options::RECURSIVE)
-                .help("operate on files and directories recursively")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::traverse::TRAVERSE)
-                .short(options::traverse::TRAVERSE.chars().next().unwrap())
-                .help("if a command line argument is a symbolic link to a directory, traverse it")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::traverse::NO_TRAVERSE)
-                .short(options::traverse::NO_TRAVERSE.chars().next().unwrap())
-                .help("do not traverse any symbolic links (default)")
-                .overrides_with_all([options::traverse::TRAVERSE, options::traverse::EVERY])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::traverse::EVERY)
-                .short(options::traverse::EVERY.chars().next().unwrap())
-                .help("traverse every symbolic link to a directory encountered")
-                .action(ArgAction::SetTrue),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_chmod/chmod.rs.html b/coreutils/dev/src/uu_chmod/chmod.rs.html deleted file mode 100644 index 3d1cfa538..000000000 --- a/coreutils/dev/src/uu_chmod/chmod.rs.html +++ /dev/null @@ -1,925 +0,0 @@ -chmod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-
// This file is part of the uutils coreutils package.
-//
-// (c) Alex Lyon <arcterus@mail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) Chmoder cmode fmode fperm fref ugoa RFILE RFILE's
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::ffi::OsString;
-use std::fs;
-use std::os::unix::fs::{MetadataExt, PermissionsExt};
-use std::path::Path;
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, ExitCode, UResult, USimpleError, UUsageError};
-use uucore::fs::display_permissions_unix;
-use uucore::libc::mode_t;
-#[cfg(not(windows))]
-use uucore::mode;
-use uucore::{format_usage, help_about, help_section, help_usage, show, show_error};
-
-const ABOUT: &str = help_about!("chmod.md");
-const USAGE: &str = help_usage!("chmod.md");
-const LONG_USAGE: &str = help_section!("after help", "chmod.md");
-
-mod options {
-    pub const CHANGES: &str = "changes";
-    pub const QUIET: &str = "quiet"; // visible_alias("silent")
-    pub const VERBOSE: &str = "verbose";
-    pub const NO_PRESERVE_ROOT: &str = "no-preserve-root";
-    pub const PRESERVE_ROOT: &str = "preserve-root";
-    pub const REFERENCE: &str = "RFILE";
-    pub const RECURSIVE: &str = "recursive";
-    pub const MODE: &str = "MODE";
-    pub const FILE: &str = "FILE";
-}
-
-/// Extract negative modes (starting with '-') from the rest of the arguments.
-///
-/// This is mainly required for GNU compatibility, where "non-positional negative" modes are used
-/// as the actual positional MODE. Some examples of these cases are:
-/// * "chmod -w -r file", which is the same as "chmod -w,-r file"
-/// * "chmod -w file -r", which is the same as "chmod -w,-r file"
-///
-/// These can currently not be handled by clap.
-/// Therefore it might be possible that a pseudo MODE is inserted to pass clap parsing.
-/// The pseudo MODE is later replaced by the extracted (and joined) negative modes.
-fn extract_negative_modes(mut args: impl uucore::Args) -> (Option<String>, Vec<OsString>) {
-    // we look up the args until "--" is found
-    // "-mode" will be extracted into parsed_cmode_vec
-    let (parsed_cmode_vec, pre_double_hyphen_args): (Vec<OsString>, Vec<OsString>) =
-        args.by_ref().take_while(|a| a != "--").partition(|arg| {
-            let arg = if let Some(arg) = arg.to_str() {
-                arg.to_string()
-            } else {
-                return false;
-            };
-            arg.len() >= 2
-                && arg.starts_with('-')
-                && matches!(
-                    arg.chars().nth(1).unwrap(),
-                    'r' | 'w' | 'x' | 'X' | 's' | 't' | 'u' | 'g' | 'o' | '0'..='7'
-                )
-        });
-
-    let mut clean_args = Vec::new();
-    if !parsed_cmode_vec.is_empty() {
-        // we need a pseudo cmode for clap, which won't be used later.
-        // this is required because clap needs the default "chmod MODE FILE" scheme.
-        clean_args.push("w".into());
-    }
-    clean_args.extend(pre_double_hyphen_args);
-
-    if let Some(arg) = args.next() {
-        // as there is still something left in the iterator, we previously consumed the "--"
-        // -> add it to the args again
-        clean_args.push("--".into());
-        clean_args.push(arg);
-    }
-    clean_args.extend(args);
-
-    let parsed_cmode = Some(
-        parsed_cmode_vec
-            .iter()
-            .map(|s| s.to_str().unwrap())
-            .collect::<Vec<&str>>()
-            .join(","),
-    )
-    .filter(|s| !s.is_empty());
-    (parsed_cmode, clean_args)
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let (parsed_cmode, args) = extract_negative_modes(args.skip(1)); // skip binary name
-    let matches = uu_app().after_help(LONG_USAGE).try_get_matches_from(args)?;
-
-    let changes = matches.get_flag(options::CHANGES);
-    let quiet = matches.get_flag(options::QUIET);
-    let verbose = matches.get_flag(options::VERBOSE);
-    let preserve_root = matches.get_flag(options::PRESERVE_ROOT);
-    let recursive = matches.get_flag(options::RECURSIVE);
-    let fmode = match matches.get_one::<String>(options::REFERENCE) {
-        Some(fref) => match fs::metadata(fref) {
-            Ok(meta) => Some(meta.mode()),
-            Err(err) => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("cannot stat attributes of {}: {}", fref.quote(), err),
-                ))
-            }
-        },
-        None => None,
-    };
-
-    let modes = matches.get_one::<String>(options::MODE);
-    let cmode = if let Some(parsed_cmode) = parsed_cmode {
-        parsed_cmode
-    } else {
-        modes.unwrap().to_string() // modes is required
-    };
-    // FIXME: enable non-utf8 paths
-    let mut files: Vec<String> = matches
-        .get_many::<String>(options::FILE)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-    let cmode = if fmode.is_some() {
-        // "--reference" and MODE are mutually exclusive
-        // if "--reference" was used MODE needs to be interpreted as another FILE
-        // it wasn't possible to implement this behavior directly with clap
-        files.push(cmode);
-        None
-    } else {
-        Some(cmode)
-    };
-
-    if files.is_empty() {
-        return Err(UUsageError::new(1, "missing operand".to_string()));
-    }
-
-    let chmoder = Chmoder {
-        changes,
-        quiet,
-        verbose,
-        preserve_root,
-        recursive,
-        fmode,
-        cmode,
-    };
-
-    chmoder.chmod(&files)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .args_override_self(true)
-        .infer_long_args(true)
-        .no_binary_name(true)
-        .arg(
-            Arg::new(options::CHANGES)
-                .long(options::CHANGES)
-                .short('c')
-                .help("like verbose but report only when a change is made")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::QUIET)
-                .long(options::QUIET)
-                .visible_alias("silent")
-                .short('f')
-                .help("suppress most error messages")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::VERBOSE)
-                .long(options::VERBOSE)
-                .short('v')
-                .help("output a diagnostic for every file processed")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NO_PRESERVE_ROOT)
-                .long(options::NO_PRESERVE_ROOT)
-                .help("do not treat '/' specially (the default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PRESERVE_ROOT)
-                .long(options::PRESERVE_ROOT)
-                .help("fail to operate recursively on '/'")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::RECURSIVE)
-                .long(options::RECURSIVE)
-                .short('R')
-                .help("change files and directories recursively")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::REFERENCE)
-                .long("reference")
-                .value_hint(clap::ValueHint::FilePath)
-                .help("use RFILE's mode instead of MODE values"),
-        )
-        .arg(
-            Arg::new(options::MODE).required_unless_present(options::REFERENCE), // It would be nice if clap could parse with delimiter, e.g. "g-x,u+x",
-                                                                                 // however .multiple_occurrences(true) cannot be used here because FILE already needs that.
-                                                                                 // Only one positional argument with .multiple_occurrences(true) set is allowed per command
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .required_unless_present(options::MODE)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
-struct Chmoder {
-    changes: bool,
-    quiet: bool,
-    verbose: bool,
-    preserve_root: bool,
-    recursive: bool,
-    fmode: Option<u32>,
-    cmode: Option<String>,
-}
-
-impl Chmoder {
-    fn chmod(&self, files: &[String]) -> UResult<()> {
-        let mut r = Ok(());
-
-        for filename in files {
-            let filename = &filename[..];
-            let file = Path::new(filename);
-            if !file.exists() {
-                if file.is_symlink() {
-                    if !self.quiet {
-                        show!(USimpleError::new(
-                            1,
-                            format!("cannot operate on dangling symlink {}", filename.quote()),
-                        ));
-                    }
-                    if self.verbose {
-                        println!(
-                            "failed to change mode of {} from 0000 (---------) to 1500 (r-x-----T)",
-                            filename.quote()
-                        );
-                    }
-                } else if !self.quiet {
-                    show!(USimpleError::new(
-                        1,
-                        format!(
-                            "cannot access {}: No such file or directory",
-                            filename.quote()
-                        )
-                    ));
-                }
-                // GNU exits with exit code 1 even if -q or --quiet are passed
-                // So we set the exit code, because it hasn't been set yet if `self.quiet` is true.
-                set_exit_code(1);
-                continue;
-            }
-            if self.recursive && self.preserve_root && filename == "/" {
-                return Err(USimpleError::new(
-                    1,
-                    format!(
-                        "it is dangerous to operate recursively on {}\nuse --no-preserve-root to override this failsafe",
-                        filename.quote()
-                    )
-                ));
-            }
-            if self.recursive {
-                r = self.walk_dir(file);
-            } else {
-                r = self.chmod_file(file).and(r);
-            }
-        }
-        r
-    }
-
-    fn walk_dir(&self, file_path: &Path) -> UResult<()> {
-        let mut r = self.chmod_file(file_path);
-        if !file_path.is_symlink() && file_path.is_dir() {
-            for dir_entry in file_path.read_dir()? {
-                let path = dir_entry?.path();
-                if !path.is_symlink() {
-                    r = self.walk_dir(path.as_path());
-                }
-            }
-        }
-        r
-    }
-
-    #[cfg(windows)]
-    fn chmod_file(&self, file: &Path) -> UResult<()> {
-        // chmod is useless on Windows
-        // it doesn't set any permissions at all
-        // instead it just sets the readonly attribute on the file
-        Ok(())
-    }
-    #[cfg(unix)]
-    fn chmod_file(&self, file: &Path) -> UResult<()> {
-        use uucore::mode::get_umask;
-
-        let fperm = match fs::metadata(file) {
-            Ok(meta) => meta.mode() & 0o7777,
-            Err(err) => {
-                if file.is_symlink() {
-                    if self.verbose {
-                        println!(
-                            "neither symbolic link {} nor referent has been changed",
-                            file.quote()
-                        );
-                    }
-                    return Ok(());
-                } else if err.kind() == std::io::ErrorKind::PermissionDenied {
-                    // These two filenames would normally be conditionally
-                    // quoted, but GNU's tests expect them to always be quoted
-                    return Err(USimpleError::new(
-                        1,
-                        format!("{}: Permission denied", file.quote()),
-                    ));
-                } else {
-                    return Err(USimpleError::new(1, format!("{}: {}", file.quote(), err)));
-                }
-            }
-        };
-        match self.fmode {
-            Some(mode) => self.change_file(fperm, mode, file)?,
-            None => {
-                let cmode_unwrapped = self.cmode.clone().unwrap();
-                let mut new_mode = fperm;
-                let mut naively_expected_new_mode = new_mode;
-                for mode in cmode_unwrapped.split(',') {
-                    // cmode is guaranteed to be Some in this case
-                    let arr: &[char] = &['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
-                    let result = if mode.contains(arr) {
-                        mode::parse_numeric(new_mode, mode, file.is_dir()).map(|v| (v, v))
-                    } else {
-                        mode::parse_symbolic(new_mode, mode, get_umask(), file.is_dir()).map(|m| {
-                            // calculate the new mode as if umask was 0
-                            let naive_mode = mode::parse_symbolic(
-                                naively_expected_new_mode,
-                                mode,
-                                0,
-                                file.is_dir(),
-                            )
-                            .unwrap(); // we know that mode must be valid, so this cannot fail
-                            (m, naive_mode)
-                        })
-                    };
-                    match result {
-                        Ok((mode, naive_mode)) => {
-                            new_mode = mode;
-                            naively_expected_new_mode = naive_mode;
-                        }
-                        Err(f) => {
-                            if self.quiet {
-                                return Err(ExitCode::new(1));
-                            } else {
-                                return Err(USimpleError::new(1, f));
-                            }
-                        }
-                    }
-                }
-                self.change_file(fperm, new_mode, file)?;
-                // if a permission would have been removed if umask was 0, but it wasn't because umask was not 0, print an error and fail
-                if (new_mode & !naively_expected_new_mode) != 0 {
-                    return Err(USimpleError::new(
-                        1,
-                        format!(
-                            "{}: new permissions are {}, not {}",
-                            file.maybe_quote(),
-                            display_permissions_unix(new_mode as mode_t, false),
-                            display_permissions_unix(naively_expected_new_mode as mode_t, false)
-                        ),
-                    ));
-                }
-            }
-        }
-
-        Ok(())
-    }
-
-    #[cfg(unix)]
-    fn change_file(&self, fperm: u32, mode: u32, file: &Path) -> Result<(), i32> {
-        if fperm == mode {
-            if self.verbose && !self.changes {
-                println!(
-                    "mode of {} retained as {:04o} ({})",
-                    file.quote(),
-                    fperm,
-                    display_permissions_unix(fperm as mode_t, false),
-                );
-            }
-            Ok(())
-        } else if let Err(err) = fs::set_permissions(file, fs::Permissions::from_mode(mode)) {
-            if !self.quiet {
-                show_error!("{}", err);
-            }
-            if self.verbose {
-                println!(
-                    "failed to change mode of file {} from {:04o} ({}) to {:04o} ({})",
-                    file.quote(),
-                    fperm,
-                    display_permissions_unix(fperm as mode_t, false),
-                    mode,
-                    display_permissions_unix(mode as mode_t, false)
-                );
-            }
-            Err(1)
-        } else {
-            if self.verbose || self.changes {
-                println!(
-                    "mode of {} changed from {:04o} ({}) to {:04o} ({})",
-                    file.quote(),
-                    fperm,
-                    display_permissions_unix(fperm as mode_t, false),
-                    mode,
-                    display_permissions_unix(mode as mode_t, false)
-                );
-            }
-            Ok(())
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    fn test_extract_negative_modes() {
-        // "chmod -w -r file" becomes "chmod -w,-r file". clap does not accept "-w,-r" as MODE.
-        // Therefore, "w" is added as pseudo mode to pass clap.
-        let (c, a) = extract_negative_modes(vec!["-w", "-r", "file"].iter().map(OsString::from));
-        assert_eq!(c, Some("-w,-r".to_string()));
-        assert_eq!(a, vec!["w", "file"]);
-
-        // "chmod -w file -r" becomes "chmod -w,-r file". clap does not accept "-w,-r" as MODE.
-        // Therefore, "w" is added as pseudo mode to pass clap.
-        let (c, a) = extract_negative_modes(vec!["-w", "file", "-r"].iter().map(OsString::from));
-        assert_eq!(c, Some("-w,-r".to_string()));
-        assert_eq!(a, vec!["w", "file"]);
-
-        // "chmod -w -- -r file" becomes "chmod -w -r file", where "-r" is interpreted as file.
-        // Again, "w" is needed as pseudo mode.
-        let (c, a) = extract_negative_modes(vec!["-w", "--", "-r", "f"].iter().map(OsString::from));
-        assert_eq!(c, Some("-w".to_string()));
-        assert_eq!(a, vec!["w", "--", "-r", "f"]);
-
-        // "chmod -- -r file" becomes "chmod -r file".
-        let (c, a) = extract_negative_modes(vec!["--", "-r", "file"].iter().map(OsString::from));
-        assert_eq!(c, None);
-        assert_eq!(a, vec!["--", "-r", "file"]);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_chown/chown.rs.html b/coreutils/dev/src/uu_chown/chown.rs.html deleted file mode 100644 index 6e8ca6aef..000000000 --- a/coreutils/dev/src/uu_chown/chown.rs.html +++ /dev/null @@ -1,611 +0,0 @@ -chown.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) COMFOLLOW Passwd RFILE RFILE's derefer dgid duid groupname
-
-use uucore::display::Quotable;
-pub use uucore::entries::{self, Group, Locate, Passwd};
-use uucore::perms::{chown_base, options, GidUidOwnerFilter, IfFrom};
-use uucore::{format_usage, help_about, help_usage};
-
-use uucore::error::{FromIo, UResult, USimpleError};
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-
-use std::fs;
-use std::os::unix::fs::MetadataExt;
-
-static ABOUT: &str = help_about!("chown.md");
-
-const USAGE: &str = help_usage!("chown.md");
-
-fn parse_gid_uid_and_filter(matches: &ArgMatches) -> UResult<GidUidOwnerFilter> {
-    let filter = if let Some(spec) = matches.get_one::<String>(options::FROM) {
-        match parse_spec(spec, ':')? {
-            (Some(uid), None) => IfFrom::User(uid),
-            (None, Some(gid)) => IfFrom::Group(gid),
-            (Some(uid), Some(gid)) => IfFrom::UserGroup(uid, gid),
-            (None, None) => IfFrom::All,
-        }
-    } else {
-        IfFrom::All
-    };
-
-    let dest_uid: Option<u32>;
-    let dest_gid: Option<u32>;
-    let raw_owner: String;
-    if let Some(file) = matches.get_one::<String>(options::REFERENCE) {
-        let meta = fs::metadata(file)
-            .map_err_context(|| format!("failed to get attributes of {}", file.quote()))?;
-        let gid = meta.gid();
-        let uid = meta.uid();
-        dest_gid = Some(gid);
-        dest_uid = Some(uid);
-        raw_owner = format!(
-            "{}:{}",
-            entries::uid2usr(uid).unwrap_or_else(|_| uid.to_string()),
-            entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string())
-        );
-    } else {
-        raw_owner = matches
-            .get_one::<String>(options::ARG_OWNER)
-            .unwrap()
-            .into();
-        let (u, g) = parse_spec(&raw_owner, ':')?;
-        dest_uid = u;
-        dest_gid = g;
-    }
-    Ok(GidUidOwnerFilter {
-        dest_gid,
-        dest_uid,
-        raw_owner,
-        filter,
-    })
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    chown_base(
-        uu_app(),
-        args,
-        options::ARG_OWNER,
-        parse_gid_uid_and_filter,
-        false,
-    )
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new(options::verbosity::CHANGES)
-                .short('c')
-                .long(options::verbosity::CHANGES)
-                .help("like verbose but report only when a change is made")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::dereference::DEREFERENCE)
-                .long(options::dereference::DEREFERENCE)
-                .help(
-                    "affect the referent of each symbolic link (this is the default), \
-                    rather than the symbolic link itself",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::dereference::NO_DEREFERENCE)
-                .short('h')
-                .long(options::dereference::NO_DEREFERENCE)
-                .help(
-                    "affect symbolic links instead of any referenced file \
-                    (useful only on systems that can change the ownership of a symlink)",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FROM)
-                .long(options::FROM)
-                .help(
-                    "change the owner and/or group of each file only if its \
-                    current owner and/or group match those specified here. \
-                    Either may be omitted, in which case a match is not required \
-                    for the omitted attribute",
-                )
-                .value_name("CURRENT_OWNER:CURRENT_GROUP"),
-        )
-        .arg(
-            Arg::new(options::preserve_root::PRESERVE)
-                .long(options::preserve_root::PRESERVE)
-                .help("fail to operate recursively on '/'")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::preserve_root::NO_PRESERVE)
-                .long(options::preserve_root::NO_PRESERVE)
-                .help("do not treat '/' specially (the default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::verbosity::QUIET)
-                .long(options::verbosity::QUIET)
-                .help("suppress most error messages")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::RECURSIVE)
-                .short('R')
-                .long(options::RECURSIVE)
-                .help("operate on files and directories recursively")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::REFERENCE)
-                .long(options::REFERENCE)
-                .help("use RFILE's owner and group rather than specifying OWNER:GROUP values")
-                .value_name("RFILE")
-                .value_hint(clap::ValueHint::FilePath)
-                .num_args(1..),
-        )
-        .arg(
-            Arg::new(options::verbosity::SILENT)
-                .short('f')
-                .long(options::verbosity::SILENT)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::traverse::TRAVERSE)
-                .short(options::traverse::TRAVERSE.chars().next().unwrap())
-                .help("if a command line argument is a symbolic link to a directory, traverse it")
-                .overrides_with_all([options::traverse::EVERY, options::traverse::NO_TRAVERSE])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::traverse::EVERY)
-                .short(options::traverse::EVERY.chars().next().unwrap())
-                .help("traverse every symbolic link to a directory encountered")
-                .overrides_with_all([options::traverse::TRAVERSE, options::traverse::NO_TRAVERSE])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::traverse::NO_TRAVERSE)
-                .short(options::traverse::NO_TRAVERSE.chars().next().unwrap())
-                .help("do not traverse any symbolic links (default)")
-                .overrides_with_all([options::traverse::TRAVERSE, options::traverse::EVERY])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::verbosity::VERBOSE)
-                .long(options::verbosity::VERBOSE)
-                .short('v')
-                .help("output a diagnostic for every file processed")
-                .action(ArgAction::SetTrue),
-        )
-}
-
-/// Parse the owner/group specifier string into a user ID and a group ID.
-///
-/// The `spec` can be of the form:
-///
-/// * `"owner:group"`,
-/// * `"owner"`,
-/// * `":group"`,
-///
-/// and the owner or group can be specified either as an ID or a
-/// name. The `sep` argument specifies which character to use as a
-/// separator between the owner and group; calling code should set
-/// this to `':'`.
-fn parse_spec(spec: &str, sep: char) -> UResult<(Option<u32>, Option<u32>)> {
-    assert!(['.', ':'].contains(&sep));
-    let mut args = spec.splitn(2, sep);
-    let user = args.next().unwrap_or("");
-    let group = args.next().unwrap_or("");
-
-    let uid = if user.is_empty() {
-        None
-    } else {
-        Some(match Passwd::locate(user) {
-            Ok(u) => u.uid, // We have been able to get the uid
-            Err(_) =>
-            // we have NOT been able to find the uid
-            // but we could be in the case where we have user.group
-            {
-                if spec.contains('.') && !spec.contains(':') && sep == ':' {
-                    // but the input contains a '.' but not a ':'
-                    // we might have something like username.groupname
-                    // So, try to parse it this way
-                    return parse_spec(spec, '.');
-                } else {
-                    // It's possible that the `user` string contains a
-                    // numeric user ID, in which case, we respect that.
-                    match user.parse() {
-                        Ok(uid) => uid,
-                        Err(_) => {
-                            return Err(USimpleError::new(
-                                1,
-                                format!("invalid user: {}", spec.quote()),
-                            ))
-                        }
-                    }
-                }
-            }
-        })
-    };
-    let gid = if group.is_empty() {
-        None
-    } else {
-        Some(match Group::locate(group) {
-            Ok(g) => g.gid,
-            Err(_) => match group.parse() {
-                Ok(gid) => gid,
-                Err(_) => {
-                    return Err(USimpleError::new(
-                        1,
-                        format!("invalid group: {}", spec.quote()),
-                    ));
-                }
-            },
-        })
-    };
-
-    if user.chars().next().map(char::is_numeric).unwrap_or(false)
-        && group.is_empty()
-        && spec != user
-    {
-        // if the arg starts with an id numeric value, the group isn't set but the separator is provided,
-        // we should fail with an error
-        return Err(USimpleError::new(
-            1,
-            format!("invalid spec: {}", spec.quote()),
-        ));
-    }
-
-    Ok((uid, gid))
-}
-
-#[cfg(test)]
-mod test {
-    use super::*;
-
-    #[test]
-    fn test_parse_spec() {
-        assert!(matches!(parse_spec(":", ':'), Ok((None, None))));
-        assert!(matches!(parse_spec(".", ':'), Ok((None, None))));
-        assert!(matches!(parse_spec(".", '.'), Ok((None, None))));
-        assert!(format!("{}", parse_spec("::", ':').err().unwrap()).starts_with("invalid group: "));
-        assert!(format!("{}", parse_spec("..", ':').err().unwrap()).starts_with("invalid group: "));
-    }
-
-    /// Test for parsing IDs that don't correspond to a named user or group.
-    #[test]
-    fn test_parse_spec_nameless_ids() {
-        // This assumes that there is no named user with ID 12345.
-        assert!(matches!(parse_spec("12345", ':'), Ok((Some(12345), None))));
-        // This assumes that there is no named group with ID 54321.
-        assert!(matches!(parse_spec(":54321", ':'), Ok((None, Some(54321)))));
-        assert!(matches!(
-            parse_spec("12345:54321", ':'),
-            Ok((Some(12345), Some(54321)))
-        ));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_chroot/chroot.rs.html b/coreutils/dev/src/uu_chroot/chroot.rs.html deleted file mode 100644 index 61d846312..000000000 --- a/coreutils/dev/src/uu_chroot/chroot.rs.html +++ /dev/null @@ -1,597 +0,0 @@ -chroot.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-
// This file is part of the uutils coreutils package.
-//
-// (c) Vsevolod Velichko <torkvemada@sorokdva.net>
-// (c) Jian Zeng <anonymousknight96 AT gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) NEWROOT Userspec pstatus chdir
-mod error;
-
-use crate::error::ChrootError;
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::ffi::CString;
-use std::io::Error;
-use std::os::unix::prelude::OsStrExt;
-use std::path::Path;
-use std::process;
-use uucore::error::{set_exit_code, UClapError, UResult, UUsageError};
-use uucore::fs::{canonicalize, MissingHandling, ResolveMode};
-use uucore::libc::{self, chroot, setgid, setgroups, setuid};
-use uucore::{entries, format_usage, help_about, help_usage};
-
-static ABOUT: &str = help_about!("chroot.md");
-static USAGE: &str = help_usage!("chroot.md");
-
-mod options {
-    pub const NEWROOT: &str = "newroot";
-    pub const USER: &str = "user";
-    pub const GROUP: &str = "group";
-    pub const GROUPS: &str = "groups";
-    pub const USERSPEC: &str = "userspec";
-    pub const COMMAND: &str = "command";
-    pub const SKIP_CHDIR: &str = "skip-chdir";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args).with_exit_code(125)?;
-
-    let default_shell: &'static str = "/bin/sh";
-    let default_option: &'static str = "-i";
-    let user_shell = std::env::var("SHELL");
-
-    let newroot: &Path = match matches.get_one::<String>(options::NEWROOT) {
-        Some(v) => Path::new(v),
-        None => return Err(ChrootError::MissingNewRoot.into()),
-    };
-
-    let skip_chdir = matches.get_flag(options::SKIP_CHDIR);
-    // We are resolving the path in case it is a symlink or /. or /../
-    if skip_chdir
-        && canonicalize(newroot, MissingHandling::Normal, ResolveMode::Logical)
-            .unwrap()
-            .to_str()
-            != Some("/")
-    {
-        return Err(UUsageError::new(
-            125,
-            "option --skip-chdir only permitted if NEWROOT is old '/'",
-        ));
-    }
-
-    if !newroot.is_dir() {
-        return Err(ChrootError::NoSuchDirectory(format!("{}", newroot.display())).into());
-    }
-
-    let commands = match matches.get_many::<String>(options::COMMAND) {
-        Some(v) => v.map(|s| s.as_str()).collect(),
-        None => vec![],
-    };
-
-    // TODO: refactor the args and command matching
-    // See: https://github.com/uutils/coreutils/pull/2365#discussion_r647849967
-    let command: Vec<&str> = match commands.len() {
-        0 => {
-            let shell: &str = match user_shell {
-                Err(_) => default_shell,
-                Ok(ref s) => s.as_ref(),
-            };
-            vec![shell, default_option]
-        }
-        _ => commands,
-    };
-
-    assert!(!command.is_empty());
-    let chroot_command = command[0];
-    let chroot_args = &command[1..];
-
-    // NOTE: Tests can only trigger code beyond this point if they're invoked with root permissions
-    set_context(newroot, &matches)?;
-
-    let pstatus = match process::Command::new(chroot_command)
-        .args(chroot_args)
-        .status()
-    {
-        Ok(status) => status,
-        Err(e) => {
-            return Err(if e.kind() == std::io::ErrorKind::NotFound {
-                ChrootError::CommandNotFound(command[0].to_string(), e)
-            } else {
-                ChrootError::CommandFailed(command[0].to_string(), e)
-            }
-            .into())
-        }
-    };
-
-    let code = if pstatus.success() {
-        0
-    } else {
-        pstatus.code().unwrap_or(-1)
-    };
-    set_exit_code(code);
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .trailing_var_arg(true)
-        .arg(
-            Arg::new(options::NEWROOT)
-                .value_hint(clap::ValueHint::DirPath)
-                .hide(true)
-                .required(true)
-                .index(1),
-        )
-        .arg(
-            Arg::new(options::USER)
-                .short('u')
-                .long(options::USER)
-                .help("User (ID or name) to switch before running the program")
-                .value_name("USER"),
-        )
-        .arg(
-            Arg::new(options::GROUP)
-                .short('g')
-                .long(options::GROUP)
-                .help("Group (ID or name) to switch to")
-                .value_name("GROUP"),
-        )
-        .arg(
-            Arg::new(options::GROUPS)
-                .short('G')
-                .long(options::GROUPS)
-                .help("Comma-separated list of groups to switch to")
-                .value_name("GROUP1,GROUP2..."),
-        )
-        .arg(
-            Arg::new(options::USERSPEC)
-                .long(options::USERSPEC)
-                .help(
-                    "Colon-separated user and group to switch to. \
-                     Same as -u USER -g GROUP. \
-                     Userspec has higher preference than -u and/or -g",
-                )
-                .value_name("USER:GROUP"),
-        )
-        .arg(
-            Arg::new(options::SKIP_CHDIR)
-                .long(options::SKIP_CHDIR)
-                .help(
-                    "Use this option to not change the working directory \
-                    to / after changing the root directory to newroot, \
-                    i.e., inside the chroot.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::COMMAND)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::CommandName)
-                .hide(true)
-                .index(2),
-        )
-}
-
-fn set_context(root: &Path, options: &clap::ArgMatches) -> UResult<()> {
-    let userspec_str = options.get_one::<String>(options::USERSPEC);
-    let user_str = options
-        .get_one::<String>(options::USER)
-        .map(|s| s.as_str())
-        .unwrap_or_default();
-    let group_str = options
-        .get_one::<String>(options::GROUP)
-        .map(|s| s.as_str())
-        .unwrap_or_default();
-    let groups_str = options
-        .get_one::<String>(options::GROUPS)
-        .map(|s| s.as_str())
-        .unwrap_or_default();
-    let skip_chdir = options.contains_id(options::SKIP_CHDIR);
-    let userspec = match userspec_str {
-        Some(u) => {
-            let s: Vec<&str> = u.split(':').collect();
-            if s.len() != 2 || s.iter().any(|&spec| spec.is_empty()) {
-                return Err(ChrootError::InvalidUserspec(u.to_string()).into());
-            };
-            s
-        }
-        None => Vec::new(),
-    };
-
-    let (user, group) = if userspec.is_empty() {
-        (user_str, group_str)
-    } else {
-        (userspec[0], userspec[1])
-    };
-
-    enter_chroot(root, skip_chdir)?;
-
-    set_groups_from_str(groups_str)?;
-    set_main_group(group)?;
-    set_user(user)?;
-    Ok(())
-}
-
-fn enter_chroot(root: &Path, skip_chdir: bool) -> UResult<()> {
-    let err = unsafe {
-        chroot(
-            CString::new(root.as_os_str().as_bytes().to_vec())
-                .unwrap()
-                .as_bytes_with_nul()
-                .as_ptr() as *const libc::c_char,
-        )
-    };
-
-    if err == 0 {
-        if !skip_chdir {
-            std::env::set_current_dir(root).unwrap();
-        }
-        Ok(())
-    } else {
-        Err(ChrootError::CannotEnter(format!("{}", root.display()), Error::last_os_error()).into())
-    }
-}
-
-fn set_main_group(group: &str) -> UResult<()> {
-    if !group.is_empty() {
-        let group_id = match entries::grp2gid(group) {
-            Ok(g) => g,
-            _ => return Err(ChrootError::NoSuchGroup(group.to_string()).into()),
-        };
-        let err = unsafe { setgid(group_id) };
-        if err != 0 {
-            return Err(
-                ChrootError::SetGidFailed(group_id.to_string(), Error::last_os_error()).into(),
-            );
-        }
-    }
-    Ok(())
-}
-
-#[cfg(any(target_vendor = "apple", target_os = "freebsd"))]
-fn set_groups(groups: &[libc::gid_t]) -> libc::c_int {
-    unsafe { setgroups(groups.len() as libc::c_int, groups.as_ptr()) }
-}
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-fn set_groups(groups: &[libc::gid_t]) -> libc::c_int {
-    unsafe { setgroups(groups.len() as libc::size_t, groups.as_ptr()) }
-}
-
-fn set_groups_from_str(groups: &str) -> UResult<()> {
-    if !groups.is_empty() {
-        let mut groups_vec = vec![];
-        for group in groups.split(',') {
-            let gid = match entries::grp2gid(group) {
-                Ok(g) => g,
-                Err(_) => return Err(ChrootError::NoSuchGroup(group.to_string()).into()),
-            };
-            groups_vec.push(gid);
-        }
-        let err = set_groups(&groups_vec);
-        if err != 0 {
-            return Err(ChrootError::SetGroupsFailed(Error::last_os_error()).into());
-        }
-    }
-    Ok(())
-}
-
-fn set_user(user: &str) -> UResult<()> {
-    if !user.is_empty() {
-        let user_id = entries::usr2uid(user).unwrap();
-        let err = unsafe { setuid(user_id as libc::uid_t) };
-        if err != 0 {
-            return Err(
-                ChrootError::SetUserFailed(user.to_string(), Error::last_os_error()).into(),
-            );
-        }
-    }
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_chroot/error.rs.html b/coreutils/dev/src/uu_chroot/error.rs.html deleted file mode 100644 index 717464922..000000000 --- a/coreutils/dev/src/uu_chroot/error.rs.html +++ /dev/null @@ -1,175 +0,0 @@ -error.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore NEWROOT Userspec userspec
-//! Errors returned by chroot.
-use std::fmt::Display;
-use std::io::Error;
-use uucore::display::Quotable;
-use uucore::error::UError;
-
-/// Errors that can happen while executing chroot.
-#[derive(Debug)]
-pub enum ChrootError {
-    /// Failed to enter the specified directory.
-    CannotEnter(String, Error),
-
-    /// Failed to execute the specified command.
-    CommandFailed(String, Error),
-
-    /// Failed to find the specified command.
-    CommandNotFound(String, Error),
-
-    /// The given user and group specification was invalid.
-    InvalidUserspec(String),
-
-    /// The new root directory was not given.
-    MissingNewRoot,
-
-    /// Failed to find the specified group.
-    NoSuchGroup(String),
-
-    /// The given directory does not exist.
-    NoSuchDirectory(String),
-
-    /// The call to `setgid()` failed.
-    SetGidFailed(String, Error),
-
-    /// The call to `setgroups()` failed.
-    SetGroupsFailed(Error),
-
-    /// The call to `setuid()` failed.
-    SetUserFailed(String, Error),
-}
-
-impl std::error::Error for ChrootError {}
-
-impl UError for ChrootError {
-    // 125 if chroot itself fails
-    // 126 if command is found but cannot be invoked
-    // 127 if command cannot be found
-    fn code(&self) -> i32 {
-        match self {
-            Self::CommandFailed(_, _) => 126,
-            Self::CommandNotFound(_, _) => 127,
-            _ => 125,
-        }
-    }
-}
-
-impl Display for ChrootError {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
-        match self {
-            Self::CannotEnter(s, e) => write!(f, "cannot chroot to {}: {}", s.quote(), e,),
-            Self::CommandFailed(s, e) | Self::CommandNotFound(s, e) => {
-                write!(f, "failed to run command {}: {}", s.to_string().quote(), e,)
-            }
-            Self::InvalidUserspec(s) => write!(f, "invalid userspec: {}", s.quote(),),
-            Self::MissingNewRoot => write!(
-                f,
-                "Missing operand: NEWROOT\nTry '{} --help' for more information.",
-                uucore::execution_phrase(),
-            ),
-            Self::NoSuchGroup(s) => write!(f, "no such group: {}", s.maybe_quote(),),
-            Self::NoSuchDirectory(s) => write!(
-                f,
-                "cannot change root directory to {}: no such directory",
-                s.quote(),
-            ),
-            Self::SetGidFailed(s, e) => write!(f, "cannot set gid to {s}: {e}"),
-            Self::SetGroupsFailed(e) => write!(f, "cannot set groups: {e}"),
-            Self::SetUserFailed(s, e) => {
-                write!(f, "cannot set user to {}: {}", s.maybe_quote(), e)
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cksum/cksum.rs.html b/coreutils/dev/src/uu_cksum/cksum.rs.html deleted file mode 100644 index 792e6292c..000000000 --- a/coreutils/dev/src/uu_cksum/cksum.rs.html +++ /dev/null @@ -1,583 +0,0 @@ -cksum.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-
// This file is part of the uutils coreutils package.
-//
-// (c) Michael Gehring <mg@ebfe.org>
-//
-//  For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) fname, algo
-use clap::{crate_version, Arg, ArgAction, Command};
-use hex::encode;
-use std::ffi::OsStr;
-use std::fs::File;
-use std::io::{self, stdin, BufReader, Read};
-use std::iter;
-use std::path::Path;
-use uucore::{
-    error::{FromIo, UResult},
-    format_usage, help_about, help_section, help_usage,
-    sum::{
-        div_ceil, Blake2b, Digest, DigestWriter, Md5, Sha1, Sha224, Sha256, Sha384, Sha512, Sm3,
-        BSD, CRC, SYSV,
-    },
-};
-
-const USAGE: &str = help_usage!("cksum.md");
-const ABOUT: &str = help_about!("cksum.md");
-const AFTER_HELP: &str = help_section!("after help", "cksum.md");
-
-const ALGORITHM_OPTIONS_SYSV: &str = "sysv";
-const ALGORITHM_OPTIONS_BSD: &str = "bsd";
-const ALGORITHM_OPTIONS_CRC: &str = "crc";
-const ALGORITHM_OPTIONS_MD5: &str = "md5";
-const ALGORITHM_OPTIONS_SHA1: &str = "sha1";
-const ALGORITHM_OPTIONS_SHA224: &str = "sha224";
-const ALGORITHM_OPTIONS_SHA256: &str = "sha256";
-const ALGORITHM_OPTIONS_SHA384: &str = "sha384";
-const ALGORITHM_OPTIONS_SHA512: &str = "sha512";
-const ALGORITHM_OPTIONS_BLAKE2B: &str = "blake2b";
-const ALGORITHM_OPTIONS_SM3: &str = "sm3";
-
-fn detect_algo(program: &str) -> (&'static str, Box<dyn Digest + 'static>, usize) {
-    match program {
-        ALGORITHM_OPTIONS_SYSV => (
-            ALGORITHM_OPTIONS_SYSV,
-            Box::new(SYSV::new()) as Box<dyn Digest>,
-            512,
-        ),
-        ALGORITHM_OPTIONS_BSD => (
-            ALGORITHM_OPTIONS_BSD,
-            Box::new(BSD::new()) as Box<dyn Digest>,
-            1024,
-        ),
-        ALGORITHM_OPTIONS_CRC => (
-            ALGORITHM_OPTIONS_CRC,
-            Box::new(CRC::new()) as Box<dyn Digest>,
-            256,
-        ),
-        ALGORITHM_OPTIONS_MD5 => (
-            ALGORITHM_OPTIONS_MD5,
-            Box::new(Md5::new()) as Box<dyn Digest>,
-            128,
-        ),
-        ALGORITHM_OPTIONS_SHA1 => (
-            ALGORITHM_OPTIONS_SHA1,
-            Box::new(Sha1::new()) as Box<dyn Digest>,
-            160,
-        ),
-        ALGORITHM_OPTIONS_SHA224 => (
-            ALGORITHM_OPTIONS_SHA224,
-            Box::new(Sha224::new()) as Box<dyn Digest>,
-            224,
-        ),
-        ALGORITHM_OPTIONS_SHA256 => (
-            ALGORITHM_OPTIONS_SHA256,
-            Box::new(Sha256::new()) as Box<dyn Digest>,
-            256,
-        ),
-        ALGORITHM_OPTIONS_SHA384 => (
-            ALGORITHM_OPTIONS_SHA384,
-            Box::new(Sha384::new()) as Box<dyn Digest>,
-            384,
-        ),
-        ALGORITHM_OPTIONS_SHA512 => (
-            ALGORITHM_OPTIONS_SHA512,
-            Box::new(Sha512::new()) as Box<dyn Digest>,
-            512,
-        ),
-        ALGORITHM_OPTIONS_BLAKE2B => (
-            ALGORITHM_OPTIONS_BLAKE2B,
-            Box::new(Blake2b::new()) as Box<dyn Digest>,
-            512,
-        ),
-        ALGORITHM_OPTIONS_SM3 => (
-            ALGORITHM_OPTIONS_SM3,
-            Box::new(Sm3::new()) as Box<dyn Digest>,
-            512,
-        ),
-        _ => unreachable!("unknown algorithm: clap should have prevented this case"),
-    }
-}
-
-struct Options {
-    algo_name: &'static str,
-    digest: Box<dyn Digest + 'static>,
-    output_bits: usize,
-    untagged: bool,
-}
-
-/// Calculate checksum
-///
-/// # Arguments
-///
-/// * `options` - CLI options for the assigning checksum algorithm
-/// * `files` - A iterator of OsStr which is a bunch of files that are using for calculating checksum
-#[allow(clippy::cognitive_complexity)]
-fn cksum<'a, I>(mut options: Options, files: I) -> UResult<()>
-where
-    I: Iterator<Item = &'a OsStr>,
-{
-    for filename in files {
-        let filename = Path::new(filename);
-        let stdin_buf;
-        let file_buf;
-        let not_file = filename == OsStr::new("-");
-        let mut file = BufReader::new(if not_file {
-            stdin_buf = stdin();
-            Box::new(stdin_buf) as Box<dyn Read>
-        } else if filename.is_dir() {
-            Box::new(BufReader::new(io::empty())) as Box<dyn Read>
-        } else {
-            file_buf =
-                File::open(filename).map_err_context(|| filename.to_str().unwrap().to_string())?;
-            Box::new(file_buf) as Box<dyn Read>
-        });
-        let (sum, sz) = digest_read(&mut options.digest, &mut file, options.output_bits)
-            .map_err_context(|| "failed to read input".to_string())?;
-
-        // The BSD checksum output is 5 digit integer
-        let bsd_width = 5;
-        match (options.algo_name, not_file) {
-            (ALGORITHM_OPTIONS_SYSV, true) => println!(
-                "{} {}",
-                sum.parse::<u16>().unwrap(),
-                div_ceil(sz, options.output_bits)
-            ),
-            (ALGORITHM_OPTIONS_SYSV, false) => println!(
-                "{} {} {}",
-                sum.parse::<u16>().unwrap(),
-                div_ceil(sz, options.output_bits),
-                filename.display()
-            ),
-            (ALGORITHM_OPTIONS_BSD, true) => println!(
-                "{:0bsd_width$} {:bsd_width$}",
-                sum.parse::<u16>().unwrap(),
-                div_ceil(sz, options.output_bits)
-            ),
-            (ALGORITHM_OPTIONS_BSD, false) => println!(
-                "{:0bsd_width$} {:bsd_width$} {}",
-                sum.parse::<u16>().unwrap(),
-                div_ceil(sz, options.output_bits),
-                filename.display()
-            ),
-            (ALGORITHM_OPTIONS_CRC, true) => println!("{sum} {sz}"),
-            (ALGORITHM_OPTIONS_CRC, false) => println!("{sum} {sz} {}", filename.display()),
-            (ALGORITHM_OPTIONS_BLAKE2B, _) if !options.untagged => {
-                println!("BLAKE2b ({}) = {sum}", filename.display());
-            }
-            _ => {
-                if options.untagged {
-                    println!("{sum}  {}", filename.display());
-                } else {
-                    println!(
-                        "{} ({}) = {sum}",
-                        options.algo_name.to_ascii_uppercase(),
-                        filename.display()
-                    );
-                }
-            }
-        }
-    }
-
-    Ok(())
-}
-
-fn digest_read<T: Read>(
-    digest: &mut Box<dyn Digest>,
-    reader: &mut BufReader<T>,
-    output_bits: usize,
-) -> io::Result<(String, usize)> {
-    digest.reset();
-
-    // Read bytes from `reader` and write those bytes to `digest`.
-    //
-    // If `binary` is `false` and the operating system is Windows, then
-    // `DigestWriter` replaces "\r\n" with "\n" before it writes the
-    // bytes into `digest`. Otherwise, it just inserts the bytes as-is.
-    //
-    // In order to support replacing "\r\n", we must call `finalize()`
-    // in order to support the possibility that the last character read
-    // from the reader was "\r". (This character gets buffered by
-    // `DigestWriter` and only written if the following character is
-    // "\n". But when "\r" is the last character read, we need to force
-    // it to be written.)
-    let mut digest_writer = DigestWriter::new(digest, true);
-    let output_size = std::io::copy(reader, &mut digest_writer)? as usize;
-    digest_writer.finalize();
-
-    if digest.output_bits() > 0 {
-        Ok((digest.result_str(), output_size))
-    } else {
-        // Assume it's SHAKE.  result_str() doesn't work with shake (as of 8/30/2016)
-        let mut bytes = Vec::new();
-        bytes.resize((output_bits + 7) / 8, 0);
-        digest.hash_finalize(&mut bytes);
-        Ok((encode(bytes), output_size))
-    }
-}
-
-mod options {
-    pub const ALGORITHM: &str = "algorithm";
-    pub const FILE: &str = "file";
-    pub const UNTAGGED: &str = "untagged";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let algo_name: &str = match matches.get_one::<String>(options::ALGORITHM) {
-        Some(v) => v,
-        None => ALGORITHM_OPTIONS_CRC,
-    };
-
-    let (name, algo, bits) = detect_algo(algo_name);
-    let opts = Options {
-        algo_name: name,
-        digest: algo,
-        output_bits: bits,
-        untagged: matches.get_flag(options::UNTAGGED),
-    };
-
-    match matches.get_many::<String>(options::FILE) {
-        Some(files) => cksum(opts, files.map(OsStr::new))?,
-        None => cksum(opts, iter::once(OsStr::new("-")))?,
-    };
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .action(clap::ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::ALGORITHM)
-                .long(options::ALGORITHM)
-                .short('a')
-                .help("select the digest type to use. See DIGEST below")
-                .value_name("ALGORITHM")
-                .value_parser([
-                    ALGORITHM_OPTIONS_SYSV,
-                    ALGORITHM_OPTIONS_BSD,
-                    ALGORITHM_OPTIONS_CRC,
-                    ALGORITHM_OPTIONS_MD5,
-                    ALGORITHM_OPTIONS_SHA1,
-                    ALGORITHM_OPTIONS_SHA224,
-                    ALGORITHM_OPTIONS_SHA256,
-                    ALGORITHM_OPTIONS_SHA384,
-                    ALGORITHM_OPTIONS_SHA512,
-                    ALGORITHM_OPTIONS_BLAKE2B,
-                    ALGORITHM_OPTIONS_SM3,
-                ]),
-        )
-        .arg(
-            Arg::new(options::UNTAGGED)
-                .long(options::UNTAGGED)
-                .help("create a reversed style checksum, without digest type")
-                .action(ArgAction::SetTrue),
-        )
-        .after_help(AFTER_HELP)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_comm/comm.rs.html b/coreutils/dev/src/uu_comm/comm.rs.html deleted file mode 100644 index be1824ec5..000000000 --- a/coreutils/dev/src/uu_comm/comm.rs.html +++ /dev/null @@ -1,455 +0,0 @@ -comm.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-
// This file is part of the uutils coreutils package.
-//
-// (c) Michael Gehring <mg@ebfe.org>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) delim mkdelim
-
-use std::cmp::Ordering;
-use std::fs::File;
-use std::io::{self, stdin, BufRead, BufReader, Stdin};
-use std::path::Path;
-use uucore::error::{FromIo, UResult};
-use uucore::line_ending::LineEnding;
-use uucore::{format_usage, help_about, help_usage};
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-
-const ABOUT: &str = help_about!("comm.md");
-const USAGE: &str = help_usage!("comm.md");
-
-mod options {
-    pub const COLUMN_1: &str = "1";
-    pub const COLUMN_2: &str = "2";
-    pub const COLUMN_3: &str = "3";
-    pub const DELIMITER: &str = "output-delimiter";
-    pub const DELIMITER_DEFAULT: &str = "\t";
-    pub const FILE_1: &str = "FILE1";
-    pub const FILE_2: &str = "FILE2";
-    pub const TOTAL: &str = "total";
-    pub const ZERO_TERMINATED: &str = "zero-terminated";
-}
-
-fn column_width(col: &str, opts: &ArgMatches) -> usize {
-    if opts.get_flag(col) {
-        0
-    } else {
-        1
-    }
-}
-
-enum Input {
-    Stdin(Stdin),
-    FileIn(BufReader<File>),
-}
-
-struct LineReader {
-    line_ending: LineEnding,
-    input: Input,
-}
-
-impl LineReader {
-    fn new(input: Input, line_ending: LineEnding) -> Self {
-        Self { input, line_ending }
-    }
-
-    fn read_line(&mut self, buf: &mut Vec<u8>) -> io::Result<usize> {
-        let line_ending = self.line_ending.into();
-
-        let result = match &mut self.input {
-            Input::Stdin(r) => r.lock().read_until(line_ending, buf),
-            Input::FileIn(r) => r.read_until(line_ending, buf),
-        };
-
-        if !buf.ends_with(&[line_ending]) {
-            buf.push(line_ending);
-        }
-
-        result
-    }
-}
-
-fn comm(a: &mut LineReader, b: &mut LineReader, opts: &ArgMatches) {
-    let delim = match opts.get_one::<String>(options::DELIMITER).unwrap().as_str() {
-        "" => "\0",
-        delim => delim,
-    };
-
-    let width_col_1 = column_width(options::COLUMN_1, opts);
-    let width_col_2 = column_width(options::COLUMN_2, opts);
-
-    let delim_col_2 = delim.repeat(width_col_1);
-    let delim_col_3 = delim.repeat(width_col_1 + width_col_2);
-
-    let ra = &mut Vec::new();
-    let mut na = a.read_line(ra);
-    let rb = &mut Vec::new();
-    let mut nb = b.read_line(rb);
-
-    let mut total_col_1 = 0;
-    let mut total_col_2 = 0;
-    let mut total_col_3 = 0;
-
-    while na.is_ok() || nb.is_ok() {
-        let ord = match (na.is_ok(), nb.is_ok()) {
-            (false, true) => Ordering::Greater,
-            (true, false) => Ordering::Less,
-            (true, true) => match (&na, &nb) {
-                (&Ok(0), &Ok(0)) => break,
-                (&Ok(0), _) => Ordering::Greater,
-                (_, &Ok(0)) => Ordering::Less,
-                _ => ra.cmp(&rb),
-            },
-            _ => unreachable!(),
-        };
-
-        match ord {
-            Ordering::Less => {
-                if !opts.get_flag(options::COLUMN_1) {
-                    print!("{}", String::from_utf8_lossy(ra));
-                }
-                ra.clear();
-                na = a.read_line(ra);
-                total_col_1 += 1;
-            }
-            Ordering::Greater => {
-                if !opts.get_flag(options::COLUMN_2) {
-                    print!("{delim_col_2}{}", String::from_utf8_lossy(rb));
-                }
-                rb.clear();
-                nb = b.read_line(rb);
-                total_col_2 += 1;
-            }
-            Ordering::Equal => {
-                if !opts.get_flag(options::COLUMN_3) {
-                    print!("{delim_col_3}{}", String::from_utf8_lossy(ra));
-                }
-                ra.clear();
-                rb.clear();
-                na = a.read_line(ra);
-                nb = b.read_line(rb);
-                total_col_3 += 1;
-            }
-        }
-    }
-
-    if opts.get_flag(options::TOTAL) {
-        let line_ending = LineEnding::from_zero_flag(opts.get_flag(options::ZERO_TERMINATED));
-        print!("{total_col_1}{delim}{total_col_2}{delim}{total_col_3}{delim}total{line_ending}");
-    }
-}
-
-fn open_file(name: &str, line_ending: LineEnding) -> io::Result<LineReader> {
-    if name == "-" {
-        Ok(LineReader::new(Input::Stdin(stdin()), line_ending))
-    } else {
-        let f = File::open(Path::new(name))?;
-        Ok(LineReader::new(
-            Input::FileIn(BufReader::new(f)),
-            line_ending,
-        ))
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-    let line_ending = LineEnding::from_zero_flag(matches.get_flag(options::ZERO_TERMINATED));
-    let filename1 = matches.get_one::<String>(options::FILE_1).unwrap();
-    let filename2 = matches.get_one::<String>(options::FILE_2).unwrap();
-    let mut f1 = open_file(filename1, line_ending).map_err_context(|| filename1.to_string())?;
-    let mut f2 = open_file(filename2, line_ending).map_err_context(|| filename2.to_string())?;
-
-    comm(&mut f1, &mut f2, &matches);
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::COLUMN_1)
-                .short('1')
-                .help("suppress column 1 (lines unique to FILE1)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::COLUMN_2)
-                .short('2')
-                .help("suppress column 2 (lines unique to FILE2)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::COLUMN_3)
-                .short('3')
-                .help("suppress column 3 (lines that appear in both files)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DELIMITER)
-                .long(options::DELIMITER)
-                .help("separate columns with STR")
-                .value_name("STR")
-                .default_value(options::DELIMITER_DEFAULT)
-                .hide_default_value(true),
-        )
-        .arg(
-            Arg::new(options::ZERO_TERMINATED)
-                .long(options::ZERO_TERMINATED)
-                .short('z')
-                .overrides_with(options::ZERO_TERMINATED)
-                .help("line delimiter is NUL, not newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILE_1)
-                .required(true)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::FILE_2)
-                .required(true)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::TOTAL)
-                .long(options::TOTAL)
-                .help("output a summary")
-                .action(ArgAction::SetTrue),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cp/copydir.rs.html b/coreutils/dev/src/uu_cp/copydir.rs.html deleted file mode 100644 index 371793043..000000000 --- a/coreutils/dev/src/uu_cp/copydir.rs.html +++ /dev/null @@ -1,933 +0,0 @@ -copydir.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore TODO canonicalizes direntry pathbuf symlinked
-//! Recursively copy the contents of a directory.
-//!
-//! See the [`copy_directory`] function for more information.
-#[cfg(windows)]
-use std::borrow::Cow;
-use std::collections::HashSet;
-use std::env;
-use std::fs;
-use std::io;
-use std::path::{Path, PathBuf, StripPrefixError};
-
-use indicatif::ProgressBar;
-use uucore::display::Quotable;
-use uucore::error::UIoError;
-use uucore::fs::{canonicalize, FileInformation, MissingHandling, ResolveMode};
-use uucore::show;
-use uucore::show_error;
-use uucore::uio_error;
-use walkdir::{DirEntry, WalkDir};
-
-use crate::{
-    aligned_ancestors, context_for, copy_attributes, copy_file, copy_link, preserve_hardlinks,
-    CopyResult, Error, Options,
-};
-
-/// Ensure a Windows path starts with a `\\?`.
-#[cfg(target_os = "windows")]
-fn adjust_canonicalization(p: &Path) -> Cow<Path> {
-    // In some cases, \\? can be missing on some Windows paths.  Add it at the
-    // beginning unless the path is prefixed with a device namespace.
-    const VERBATIM_PREFIX: &str = r#"\\?"#;
-    const DEVICE_NS_PREFIX: &str = r#"\\."#;
-
-    let has_prefix = p
-        .components()
-        .next()
-        .and_then(|comp| comp.as_os_str().to_str())
-        .map(|p_str| p_str.starts_with(VERBATIM_PREFIX) || p_str.starts_with(DEVICE_NS_PREFIX))
-        .unwrap_or_default();
-
-    if has_prefix {
-        p.into()
-    } else {
-        Path::new(VERBATIM_PREFIX).join(p).into()
-    }
-}
-
-/// Get a descendant path relative to the given parent directory.
-///
-/// If `root_parent` is `None`, then this just returns the `path`
-/// itself. Otherwise, this function strips the parent prefix from the
-/// given `path`, leaving only the portion of the path relative to the
-/// parent.
-fn get_local_to_root_parent(
-    path: &Path,
-    root_parent: Option<&Path>,
-) -> Result<PathBuf, StripPrefixError> {
-    match root_parent {
-        Some(parent) => {
-            // On Windows, some paths are starting with \\?
-            // but not always, so, make sure that we are consistent for strip_prefix
-            // See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file for more info
-            #[cfg(windows)]
-            let (path, parent) = (
-                adjust_canonicalization(path),
-                adjust_canonicalization(parent),
-            );
-            let path = path.strip_prefix(parent)?;
-            Ok(path.to_path_buf())
-        }
-        None => Ok(path.to_path_buf()),
-    }
-}
-
-/// Paths that are invariant throughout the traversal when copying a directory.
-struct Context<'a> {
-    /// The current working directory at the time of starting the traversal.
-    current_dir: PathBuf,
-
-    /// The path to the parent of the source directory, if any.
-    root_parent: Option<PathBuf>,
-
-    /// The target path to which the directory will be copied.
-    target: &'a Path,
-}
-
-impl<'a> Context<'a> {
-    fn new(root: &'a Path, target: &'a Path) -> std::io::Result<Self> {
-        let current_dir = env::current_dir()?;
-        let root_path = current_dir.join(root);
-        let root_parent = if target.exists() && !root.to_str().unwrap().ends_with("/.") {
-            root_path.parent().map(|p| p.to_path_buf())
-        } else {
-            Some(root_path)
-        };
-        Ok(Self {
-            current_dir,
-            root_parent,
-            target,
-        })
-    }
-}
-
-/// Data needed to perform a single copy operation while traversing a directory.
-///
-/// For convenience while traversing a directory, the [`Entry::new`]
-/// function allows creating an entry from a [`Context`] and a
-/// [`walkdir::DirEntry`].
-///
-/// # Examples
-///
-/// For example, if the source directory structure is `a/b/c`, the
-/// target is `d/`, a directory that already exists, and the copy
-/// command is `cp -r a/b/c d`, then the overall set of copy
-/// operations could be represented as three entries,
-///
-/// ```rust,ignore
-/// let operations = [
-///     Entry {
-///         source_absolute: "/tmp/a".into(),
-///         source_relative: "a".into(),
-///         local_to_target: "d/a".into(),
-///         target_is_file: false,
-///     }
-///     Entry {
-///         source_absolute: "/tmp/a/b".into(),
-///         source_relative: "a/b".into(),
-///         local_to_target: "d/a/b".into(),
-///         target_is_file: false,
-///     }
-///     Entry {
-///         source_absolute: "/tmp/a/b/c".into(),
-///         source_relative: "a/b/c".into(),
-///         local_to_target: "d/a/b/c".into(),
-///         target_is_file: false,
-///     }
-/// ];
-/// ```
-struct Entry {
-    /// The absolute path to file or directory to copy.
-    source_absolute: PathBuf,
-
-    /// The relative path to file or directory to copy.
-    source_relative: PathBuf,
-
-    /// The path to the destination, relative to the target.
-    local_to_target: PathBuf,
-
-    /// Whether the destination is a file.
-    target_is_file: bool,
-}
-
-impl Entry {
-    fn new(context: &Context, direntry: &DirEntry) -> Result<Self, StripPrefixError> {
-        let source_relative = direntry.path().to_path_buf();
-        let source_absolute = context.current_dir.join(&source_relative);
-        let descendant =
-            get_local_to_root_parent(&source_absolute, context.root_parent.as_deref())?;
-        let local_to_target = context.target.join(descendant);
-        let target_is_file = context.target.is_file();
-        Ok(Self {
-            source_absolute,
-            source_relative,
-            local_to_target,
-            target_is_file,
-        })
-    }
-}
-
-/// Decide whether the given path ends with `/.`.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// assert!(ends_with_slash_dot("/."));
-/// assert!(ends_with_slash_dot("./."));
-/// assert!(ends_with_slash_dot("a/."));
-///
-/// assert!(!ends_with_slash_dot("."));
-/// assert!(!ends_with_slash_dot("./"));
-/// assert!(!ends_with_slash_dot("a/.."));
-/// ```
-fn ends_with_slash_dot<P>(path: P) -> bool
-where
-    P: AsRef<Path>,
-{
-    // `path.ends_with(".")` does not seem to work
-    path.as_ref().display().to_string().ends_with("/.")
-}
-
-/// Copy a single entry during a directory traversal.
-fn copy_direntry(
-    progress_bar: &Option<ProgressBar>,
-    entry: Entry,
-    options: &Options,
-    symlinked_files: &mut HashSet<FileInformation>,
-    preserve_hard_links: bool,
-    hard_links: &mut Vec<(String, u64)>,
-) -> CopyResult<()> {
-    let Entry {
-        source_absolute,
-        source_relative,
-        local_to_target,
-        target_is_file,
-    } = entry;
-
-    // If the source is a symbolic link and the options tell us not to
-    // dereference the link, then copy the link object itself.
-    if source_absolute.is_symlink() && !options.dereference {
-        return copy_link(&source_absolute, &local_to_target, symlinked_files);
-    }
-
-    // If the source is a directory and the destination does not
-    // exist, ...
-    if source_absolute.is_dir()
-        && !ends_with_slash_dot(&source_absolute)
-        && !local_to_target.exists()
-    {
-        if target_is_file {
-            return Err("cannot overwrite non-directory with directory".into());
-        } else {
-            // TODO Since the calling code is traversing from the root
-            // of the directory structure, I don't think
-            // `create_dir_all()` will have any benefit over
-            // `create_dir()`, since all the ancestor directories
-            // should have already been created.
-            fs::create_dir_all(&local_to_target)?;
-            if options.verbose {
-                println!("{}", context_for(&source_relative, &local_to_target));
-            }
-            return Ok(());
-        }
-    }
-
-    // If the source is not a directory, then we need to copy the file.
-    if !source_absolute.is_dir() {
-        if preserve_hard_links {
-            let dest = local_to_target.as_path().to_path_buf();
-            let found_hard_link = preserve_hardlinks(hard_links, &source_absolute, &dest)?;
-            if !found_hard_link {
-                match copy_file(
-                    progress_bar,
-                    &source_absolute,
-                    local_to_target.as_path(),
-                    options,
-                    symlinked_files,
-                    false,
-                ) {
-                    Ok(_) => Ok(()),
-                    Err(err) => {
-                        if source_absolute.is_symlink() {
-                            // silent the error with a symlink
-                            // In case we do --archive, we might copy the symlink
-                            // before the file itself
-                            Ok(())
-                        } else {
-                            Err(err)
-                        }
-                    }
-                }?;
-            }
-        } else {
-            // At this point, `path` is just a plain old file.
-            // Terminate this function immediately if there is any
-            // kind of error *except* a "permission denied" error.
-            //
-            // TODO What other kinds of errors, if any, should
-            // cause us to continue walking the directory?
-            match copy_file(
-                progress_bar,
-                &source_absolute,
-                local_to_target.as_path(),
-                options,
-                symlinked_files,
-                false,
-            ) {
-                Ok(_) => {}
-                Err(Error::IoErrContext(e, _))
-                    if e.kind() == std::io::ErrorKind::PermissionDenied =>
-                {
-                    show!(uio_error!(
-                        e,
-                        "cannot open {} for reading",
-                        source_relative.quote(),
-                    ));
-                }
-                Err(e) => return Err(e),
-            }
-        }
-    }
-
-    // In any other case, there is nothing to do, so we just return to
-    // continue the traversal.
-    Ok(())
-}
-
-/// Read the contents of the directory `root` and recursively copy the
-/// contents to `target`.
-///
-/// Any errors encountered copying files in the tree will be logged but
-/// will not cause a short-circuit.
-pub(crate) fn copy_directory(
-    progress_bar: &Option<ProgressBar>,
-    root: &Path,
-    target: &Path,
-    options: &Options,
-    symlinked_files: &mut HashSet<FileInformation>,
-    source_in_command_line: bool,
-) -> CopyResult<()> {
-    if !options.recursive {
-        return Err(format!("omitting directory {}", root.quote()).into());
-    }
-
-    // if no-dereference is enabled and this is a symlink, copy it as a file
-    if !options.dereference(source_in_command_line) && root.is_symlink() {
-        return copy_file(
-            progress_bar,
-            root,
-            target,
-            options,
-            symlinked_files,
-            source_in_command_line,
-        );
-    }
-
-    // check if root is a prefix of target
-    if path_has_prefix(target, root)? {
-        return Err(format!(
-            "cannot copy a directory, {}, into itself, {}",
-            root.quote(),
-            target.join(root.file_name().unwrap()).quote()
-        )
-        .into());
-    }
-
-    // If in `--parents` mode, create all the necessary ancestor directories.
-    //
-    // For example, if the command is `cp --parents a/b/c d`, that
-    // means we need to copy the two ancestor directories first:
-    //
-    // a -> d/a
-    // a/b -> d/a/b
-    //
-    let tmp = if options.parents {
-        if let Some(parent) = root.parent() {
-            let new_target = target.join(parent);
-            std::fs::create_dir_all(&new_target)?;
-
-            if options.verbose {
-                // For example, if copying file `a/b/c` and its parents
-                // to directory `d/`, then print
-                //
-                //     a -> d/a
-                //     a/b -> d/a/b
-                //
-                for (x, y) in aligned_ancestors(root, &target.join(root)) {
-                    println!("{} -> {}", x.display(), y.display());
-                }
-            }
-
-            new_target
-        } else {
-            target.to_path_buf()
-        }
-    } else {
-        target.to_path_buf()
-    };
-    let target = tmp.as_path();
-
-    let mut hard_links: Vec<(String, u64)> = vec![];
-    let preserve_hard_links = options.preserve_hard_links();
-
-    // Collect some paths here that are invariant during the traversal
-    // of the given directory, like the current working directory and
-    // the target directory.
-    let context = match Context::new(root, target) {
-        Ok(c) => c,
-        Err(e) => return Err(format!("failed to get current directory {e}").into()),
-    };
-
-    // Traverse the contents of the directory, copying each one.
-    for direntry_result in WalkDir::new(root)
-        .same_file_system(options.one_file_system)
-        .follow_links(options.dereference)
-    {
-        match direntry_result {
-            Ok(direntry) => {
-                let entry = Entry::new(&context, &direntry)?;
-                copy_direntry(
-                    progress_bar,
-                    entry,
-                    options,
-                    symlinked_files,
-                    preserve_hard_links,
-                    &mut hard_links,
-                )?;
-            }
-            // Print an error message, but continue traversing the directory.
-            Err(e) => show_error!("{}", e),
-        }
-    }
-
-    // Copy the attributes from the root directory to the target directory.
-    if options.parents {
-        let dest = target.join(root.file_name().unwrap());
-        copy_attributes(root, dest.as_path(), &options.attributes)?;
-        for (x, y) in aligned_ancestors(root, dest.as_path()) {
-            copy_attributes(x, y, &options.attributes)?;
-        }
-    } else {
-        copy_attributes(root, target, &options.attributes)?;
-    }
-
-    Ok(())
-}
-
-/// Decide whether the second path is a prefix of the first.
-///
-/// This function canonicalizes the paths via
-/// [`uucore::fs::canonicalize`] before comparing.
-///
-/// # Errors
-///
-/// If there is an error determining the canonical, absolute form of
-/// either path.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// assert!(path_has_prefix(Path::new("/usr/bin"), Path::new("/usr")))
-/// assert!(!path_has_prefix(Path::new("/usr"), Path::new("/usr/bin")))
-/// assert!(!path_has_prefix(Path::new("/usr/bin"), Path::new("/var/log")))
-/// ```
-pub fn path_has_prefix(p1: &Path, p2: &Path) -> io::Result<bool> {
-    let pathbuf1 = canonicalize(p1, MissingHandling::Normal, ResolveMode::Logical)?;
-    let pathbuf2 = canonicalize(p2, MissingHandling::Normal, ResolveMode::Logical)?;
-
-    Ok(pathbuf1.starts_with(pathbuf2))
-}
-
-#[cfg(test)]
-mod tests {
-    use super::ends_with_slash_dot;
-
-    #[test]
-    fn test_ends_with_slash_dot() {
-        assert!(ends_with_slash_dot("/."));
-        assert!(ends_with_slash_dot("./."));
-        assert!(ends_with_slash_dot("../."));
-        assert!(ends_with_slash_dot("a/."));
-        assert!(ends_with_slash_dot("/a/."));
-
-        assert!(!ends_with_slash_dot(""));
-        assert!(!ends_with_slash_dot("."));
-        assert!(!ends_with_slash_dot("./"));
-        assert!(!ends_with_slash_dot(".."));
-        assert!(!ends_with_slash_dot("/.."));
-        assert!(!ends_with_slash_dot("a/.."));
-        assert!(!ends_with_slash_dot("/a/.."));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cp/cp.rs.html b/coreutils/dev/src/uu_cp/cp.rs.html deleted file mode 100644 index 072b92073..000000000 --- a/coreutils/dev/src/uu_cp/cp.rs.html +++ /dev/null @@ -1,4117 +0,0 @@ -cp.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
-1143
-1144
-1145
-1146
-1147
-1148
-1149
-1150
-1151
-1152
-1153
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162
-1163
-1164
-1165
-1166
-1167
-1168
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179
-1180
-1181
-1182
-1183
-1184
-1185
-1186
-1187
-1188
-1189
-1190
-1191
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200
-1201
-1202
-1203
-1204
-1205
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214
-1215
-1216
-1217
-1218
-1219
-1220
-1221
-1222
-1223
-1224
-1225
-1226
-1227
-1228
-1229
-1230
-1231
-1232
-1233
-1234
-1235
-1236
-1237
-1238
-1239
-1240
-1241
-1242
-1243
-1244
-1245
-1246
-1247
-1248
-1249
-1250
-1251
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-1265
-1266
-1267
-1268
-1269
-1270
-1271
-1272
-1273
-1274
-1275
-1276
-1277
-1278
-1279
-1280
-1281
-1282
-1283
-1284
-1285
-1286
-1287
-1288
-1289
-1290
-1291
-1292
-1293
-1294
-1295
-1296
-1297
-1298
-1299
-1300
-1301
-1302
-1303
-1304
-1305
-1306
-1307
-1308
-1309
-1310
-1311
-1312
-1313
-1314
-1315
-1316
-1317
-1318
-1319
-1320
-1321
-1322
-1323
-1324
-1325
-1326
-1327
-1328
-1329
-1330
-1331
-1332
-1333
-1334
-1335
-1336
-1337
-1338
-1339
-1340
-1341
-1342
-1343
-1344
-1345
-1346
-1347
-1348
-1349
-1350
-1351
-1352
-1353
-1354
-1355
-1356
-1357
-1358
-1359
-1360
-1361
-1362
-1363
-1364
-1365
-1366
-1367
-1368
-1369
-1370
-1371
-1372
-1373
-1374
-1375
-1376
-1377
-1378
-1379
-1380
-1381
-1382
-1383
-1384
-1385
-1386
-1387
-1388
-1389
-1390
-1391
-1392
-1393
-1394
-1395
-1396
-1397
-1398
-1399
-1400
-1401
-1402
-1403
-1404
-1405
-1406
-1407
-1408
-1409
-1410
-1411
-1412
-1413
-1414
-1415
-1416
-1417
-1418
-1419
-1420
-1421
-1422
-1423
-1424
-1425
-1426
-1427
-1428
-1429
-1430
-1431
-1432
-1433
-1434
-1435
-1436
-1437
-1438
-1439
-1440
-1441
-1442
-1443
-1444
-1445
-1446
-1447
-1448
-1449
-1450
-1451
-1452
-1453
-1454
-1455
-1456
-1457
-1458
-1459
-1460
-1461
-1462
-1463
-1464
-1465
-1466
-1467
-1468
-1469
-1470
-1471
-1472
-1473
-1474
-1475
-1476
-1477
-1478
-1479
-1480
-1481
-1482
-1483
-1484
-1485
-1486
-1487
-1488
-1489
-1490
-1491
-1492
-1493
-1494
-1495
-1496
-1497
-1498
-1499
-1500
-1501
-1502
-1503
-1504
-1505
-1506
-1507
-1508
-1509
-1510
-1511
-1512
-1513
-1514
-1515
-1516
-1517
-1518
-1519
-1520
-1521
-1522
-1523
-1524
-1525
-1526
-1527
-1528
-1529
-1530
-1531
-1532
-1533
-1534
-1535
-1536
-1537
-1538
-1539
-1540
-1541
-1542
-1543
-1544
-1545
-1546
-1547
-1548
-1549
-1550
-1551
-1552
-1553
-1554
-1555
-1556
-1557
-1558
-1559
-1560
-1561
-1562
-1563
-1564
-1565
-1566
-1567
-1568
-1569
-1570
-1571
-1572
-1573
-1574
-1575
-1576
-1577
-1578
-1579
-1580
-1581
-1582
-1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590
-1591
-1592
-1593
-1594
-1595
-1596
-1597
-1598
-1599
-1600
-1601
-1602
-1603
-1604
-1605
-1606
-1607
-1608
-1609
-1610
-1611
-1612
-1613
-1614
-1615
-1616
-1617
-1618
-1619
-1620
-1621
-1622
-1623
-1624
-1625
-1626
-1627
-1628
-1629
-1630
-1631
-1632
-1633
-1634
-1635
-1636
-1637
-1638
-1639
-1640
-1641
-1642
-1643
-1644
-1645
-1646
-1647
-1648
-1649
-1650
-1651
-1652
-1653
-1654
-1655
-1656
-1657
-1658
-1659
-1660
-1661
-1662
-1663
-1664
-1665
-1666
-1667
-1668
-1669
-1670
-1671
-1672
-1673
-1674
-1675
-1676
-1677
-1678
-1679
-1680
-1681
-1682
-1683
-1684
-1685
-1686
-1687
-1688
-1689
-1690
-1691
-1692
-1693
-1694
-1695
-1696
-1697
-1698
-1699
-1700
-1701
-1702
-1703
-1704
-1705
-1706
-1707
-1708
-1709
-1710
-1711
-1712
-1713
-1714
-1715
-1716
-1717
-1718
-1719
-1720
-1721
-1722
-1723
-1724
-1725
-1726
-1727
-1728
-1729
-1730
-1731
-1732
-1733
-1734
-1735
-1736
-1737
-1738
-1739
-1740
-1741
-1742
-1743
-1744
-1745
-1746
-1747
-1748
-1749
-1750
-1751
-1752
-1753
-1754
-1755
-1756
-1757
-1758
-1759
-1760
-1761
-1762
-1763
-1764
-1765
-1766
-1767
-1768
-1769
-1770
-1771
-1772
-1773
-1774
-1775
-1776
-1777
-1778
-1779
-1780
-1781
-1782
-1783
-1784
-1785
-1786
-1787
-1788
-1789
-1790
-1791
-1792
-1793
-1794
-1795
-1796
-1797
-1798
-1799
-1800
-1801
-1802
-1803
-1804
-1805
-1806
-1807
-1808
-1809
-1810
-1811
-1812
-1813
-1814
-1815
-1816
-1817
-1818
-1819
-1820
-1821
-1822
-1823
-1824
-1825
-1826
-1827
-1828
-1829
-1830
-1831
-1832
-1833
-1834
-1835
-1836
-1837
-1838
-1839
-1840
-1841
-1842
-1843
-1844
-1845
-1846
-1847
-1848
-1849
-1850
-1851
-1852
-1853
-1854
-1855
-1856
-1857
-1858
-1859
-1860
-1861
-1862
-1863
-1864
-1865
-1866
-1867
-1868
-1869
-1870
-1871
-1872
-1873
-1874
-1875
-1876
-1877
-1878
-1879
-1880
-1881
-1882
-1883
-1884
-1885
-1886
-1887
-1888
-1889
-1890
-1891
-1892
-1893
-1894
-1895
-1896
-1897
-1898
-1899
-1900
-1901
-1902
-1903
-1904
-1905
-1906
-1907
-1908
-1909
-1910
-1911
-1912
-1913
-1914
-1915
-1916
-1917
-1918
-1919
-1920
-1921
-1922
-1923
-1924
-1925
-1926
-1927
-1928
-1929
-1930
-1931
-1932
-1933
-1934
-1935
-1936
-1937
-1938
-1939
-1940
-1941
-1942
-1943
-1944
-1945
-1946
-1947
-1948
-1949
-1950
-1951
-1952
-1953
-1954
-1955
-1956
-1957
-1958
-1959
-1960
-1961
-1962
-1963
-1964
-1965
-1966
-1967
-1968
-1969
-1970
-1971
-1972
-1973
-1974
-1975
-1976
-1977
-1978
-1979
-1980
-1981
-1982
-1983
-1984
-1985
-1986
-1987
-1988
-1989
-1990
-1991
-1992
-1993
-1994
-1995
-1996
-1997
-1998
-1999
-2000
-2001
-2002
-2003
-2004
-2005
-2006
-2007
-2008
-2009
-2010
-2011
-2012
-2013
-2014
-2015
-2016
-2017
-2018
-2019
-2020
-2021
-2022
-2023
-2024
-2025
-2026
-2027
-2028
-2029
-2030
-2031
-2032
-2033
-2034
-2035
-2036
-2037
-2038
-2039
-2040
-2041
-2042
-2043
-2044
-2045
-2046
-2047
-2048
-2049
-2050
-2051
-2052
-2053
-2054
-2055
-2056
-2057
-2058
-
#![allow(clippy::missing_safety_doc)]
-#![allow(clippy::extra_unused_lifetimes)]
-
-// This file is part of the uutils coreutils package.
-//
-// (c) Jordy Dickinson <jordy.dickinson@gmail.com>
-// (c) Joshua S. Miller <jsmiller@uchicago.edu>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) copydir ficlone fiemap ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs xattrs symlinked deduplicated advcpmv nushell
-
-use quick_error::quick_error;
-use std::borrow::Cow;
-use std::cmp::Ordering;
-use std::collections::HashSet;
-use std::env;
-#[cfg(not(windows))]
-use std::ffi::CString;
-use std::fs::{self, File, OpenOptions};
-use std::io;
-#[cfg(unix)]
-use std::os::unix::ffi::OsStrExt;
-#[cfg(unix)]
-use std::os::unix::fs::{FileTypeExt, PermissionsExt};
-use std::path::{Path, PathBuf, StripPrefixError};
-use std::string::ToString;
-
-use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command};
-use filetime::FileTime;
-use indicatif::{ProgressBar, ProgressStyle};
-#[cfg(unix)]
-use libc::mkfifo;
-use quick_error::ResultExt;
-
-use platform::copy_on_write;
-use uucore::backup_control::{self, BackupMode};
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, UClapError, UError, UResult, UUsageError};
-use uucore::fs::{
-    canonicalize, is_symlink_loop, paths_refer_to_same_file, FileInformation, MissingHandling,
-    ResolveMode,
-};
-use uucore::update_control::{self, UpdateMode};
-use uucore::{
-    crash, format_usage, help_about, help_section, help_usage, prompt_yes, show_error,
-    show_warning, util_name,
-};
-
-use crate::copydir::copy_directory;
-
-mod copydir;
-mod platform;
-
-quick_error! {
-    #[derive(Debug)]
-    pub enum Error {
-        /// Simple io::Error wrapper
-        IoErr(err: io::Error) { from() source(err) display("{}", err)}
-
-        /// Wrapper for io::Error with path context
-        IoErrContext(err: io::Error, path: String) {
-            display("{}: {}", path, err)
-            context(path: &'a str, err: io::Error) -> (err, path.to_owned())
-            context(context: String, err: io::Error) -> (err, context)
-            source(err)
-        }
-
-        /// General copy error
-        Error(err: String) {
-            display("{}", err)
-            from(err: String) -> (err)
-            from(err: &'static str) -> (err.to_string())
-        }
-
-        /// Represents the state when a non-fatal error has occurred
-        /// and not all files were copied.
-        NotAllFilesCopied {}
-
-        /// Simple walkdir::Error wrapper
-        WalkDirErr(err: walkdir::Error) { from() display("{}", err) source(err) }
-
-        /// Simple std::path::StripPrefixError wrapper
-        StripPrefixError(err: StripPrefixError) { from() }
-
-        /// Result of a skipped file
-        /// Currently happens when "no" is selected in interactive mode
-        Skipped { }
-
-        /// Result of a skipped file
-        InvalidArgument(description: String) { display("{}", description) }
-
-        /// All standard options are included as an an implementation
-        /// path, but those that are not implemented yet should return
-        /// a NotImplemented error.
-        NotImplemented(opt: String) { display("Option '{}' not yet implemented.", opt) }
-
-        /// Invalid arguments to backup
-        Backup(description: String) { display("{}\nTry '{} --help' for more information.", description, uucore::execution_phrase()) }
-
-        NotADirectory(path: PathBuf) { display("'{}' is not a directory", path.display()) }
-    }
-}
-
-impl UError for Error {
-    fn code(&self) -> i32 {
-        EXIT_ERR
-    }
-}
-
-pub type CopyResult<T> = Result<T, Error>;
-
-/// Specifies how to overwrite files.
-#[derive(Clone, Copy, Eq, PartialEq)]
-pub enum ClobberMode {
-    Force,
-    RemoveDestination,
-    Standard,
-}
-
-/// Specifies whether files should be overwritten.
-#[derive(Clone, Copy, Eq, PartialEq)]
-pub enum OverwriteMode {
-    /// [Default] Always overwrite existing files
-    Clobber(ClobberMode),
-    /// Prompt before overwriting a file
-    Interactive(ClobberMode),
-    /// Never overwrite a file
-    NoClobber,
-}
-
-/// Possible arguments for `--reflink`.
-#[derive(Copy, Clone, Eq, PartialEq)]
-pub enum ReflinkMode {
-    Always,
-    Auto,
-    Never,
-}
-
-/// Possible arguments for `--sparse`.
-#[derive(Copy, Clone, Eq, PartialEq)]
-pub enum SparseMode {
-    Always,
-    Auto,
-    Never,
-}
-
-/// The expected file type of copy target
-pub enum TargetType {
-    Directory,
-    File,
-}
-
-/// Copy action to perform
-pub enum CopyMode {
-    Link,
-    SymLink,
-    Copy,
-    Update,
-    AttrOnly,
-}
-
-/// Preservation settings for various attributes
-///
-/// It should be derived from options as follows:
-///
-///  - if there is a list of attributes to preserve (i.e. `--preserve=ATTR_LIST`) parse that list with [`Attributes::parse_iter`],
-///  - if `-p` or `--preserve` is given without arguments, use [`Attributes::DEFAULT`],
-///  - if `-a`/`--archive` is passed, use [`Attributes::ALL`],
-///  - if `-d` is passed use [`Attributes::LINKS`],
-///  - otherwise, use [`Attributes::NONE`].
-///
-/// For full compatibility with GNU, these options should also combine. We
-/// currently only do a best effort imitation of that behavior, because it is
-/// difficult to achieve in clap, especially with `--no-preserve`.
-#[derive(Debug)]
-pub struct Attributes {
-    #[cfg(unix)]
-    pub ownership: Preserve,
-    pub mode: Preserve,
-    pub timestamps: Preserve,
-    pub context: Preserve,
-    pub links: Preserve,
-    pub xattr: Preserve,
-}
-
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
-pub enum Preserve {
-    No,
-    Yes { required: bool },
-}
-
-impl PartialOrd for Preserve {
-    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-        Some(self.cmp(other))
-    }
-}
-
-impl Ord for Preserve {
-    fn cmp(&self, other: &Self) -> Ordering {
-        match (self, other) {
-            (Self::No, Self::No) => Ordering::Equal,
-            (Self::Yes { .. }, Self::No) => Ordering::Greater,
-            (Self::No, Self::Yes { .. }) => Ordering::Less,
-            (
-                Self::Yes { required: req_self },
-                Self::Yes {
-                    required: req_other,
-                },
-            ) => req_self.cmp(req_other),
-        }
-    }
-}
-
-/// Options for the `cp` command
-///
-/// All options are public so that the options can be programmatically
-/// constructed by other crates, such as nushell. That means that this struct
-/// is part of our public API. It should therefore not be changed without good
-/// reason.
-///
-/// The fields are documented with the arguments that determine their value.
-#[allow(dead_code)]
-pub struct Options {
-    /// `--attributes-only`
-    pub attributes_only: bool,
-    /// `--backup[=CONTROL]`, `-b`
-    pub backup: BackupMode,
-    /// `--copy-contents`
-    pub copy_contents: bool,
-    /// `-H`
-    pub cli_dereference: bool,
-    /// Determines the type of copying that should be done
-    ///
-    /// Set by the following arguments:
-    ///  - `-l`, `--link`: [`CopyMode::Link`]
-    ///  - `-s`, `--symbolic-link`: [`CopyMode::SymLink`]
-    ///  - `-u`, `--update[=WHEN]`: [`CopyMode::Update`]
-    ///  - `--attributes-only`: [`CopyMode::AttrOnly`]
-    ///  - otherwise: [`CopyMode::Copy`]
-    pub copy_mode: CopyMode,
-    /// `-L`, `--dereference`
-    pub dereference: bool,
-    /// `-T`, `--no-target-dir`
-    pub no_target_dir: bool,
-    /// `-x`, `--one-file-system`
-    pub one_file_system: bool,
-    /// Specifies what to do with an existing destination
-    ///
-    /// Set by the following arguments:
-    ///  - `-i`, `--interactive`: [`OverwriteMode::Interactive`]
-    ///  - `-n`, `--no-clobber`: [`OverwriteMode::NoClobber`]
-    ///  - otherwise: [`OverwriteMode::Clobber`]
-    ///
-    /// The `Interactive` and `Clobber` variants have a [`ClobberMode`] argument,
-    /// set by the following arguments:
-    ///  - `-f`, `--force`: [`ClobberMode::Force`]
-    ///  - `--remove-destination`: [`ClobberMode::RemoveDestination`]
-    ///  - otherwise: [`ClobberMode::Standard`]
-    pub overwrite: OverwriteMode,
-    /// `--parents`
-    pub parents: bool,
-    /// `--sparse[=WHEN]`
-    pub sparse_mode: SparseMode,
-    /// `--strip-trailing-slashes`
-    pub strip_trailing_slashes: bool,
-    /// `--reflink[=WHEN]`
-    pub reflink_mode: ReflinkMode,
-    /// `--preserve=[=ATTRIBUTE_LIST]` and `--no-preserve=ATTRIBUTE_LIST`
-    pub attributes: Attributes,
-    /// `-R`, `-r`, `--recursive`
-    pub recursive: bool,
-    /// `-S`, `--suffix`
-    pub backup_suffix: String,
-    /// `-t`, `--target-directory`
-    pub target_dir: Option<PathBuf>,
-    /// `--update[=UPDATE]`
-    pub update: UpdateMode,
-    /// `--debug`
-    pub debug: bool,
-    /// `-v`, `--verbose`
-    pub verbose: bool,
-    /// `-g`, `--progress`
-    pub progress_bar: bool,
-}
-
-/// Enum representing various debug states of the offload and reflink actions.
-#[derive(Debug)]
-#[allow(dead_code)] // All of them are used on Linux
-enum OffloadReflinkDebug {
-    Unknown,
-    No,
-    Yes,
-    Avoided,
-    Unsupported,
-}
-
-/// Enum representing various debug states of the sparse detection.
-#[derive(Debug)]
-#[allow(dead_code)] // silent for now until we use them
-enum SparseDebug {
-    Unknown,
-    No,
-    Zeros,
-    SeekHole,
-    SeekHoleZeros,
-    Unsupported,
-}
-
-/// Struct that contains the debug state for each action in a file copy operation.
-#[derive(Debug)]
-struct CopyDebug {
-    offload: OffloadReflinkDebug,
-    reflink: OffloadReflinkDebug,
-    sparse_detection: SparseDebug,
-}
-
-impl OffloadReflinkDebug {
-    fn to_string(&self) -> &'static str {
-        match self {
-            Self::No => "no",
-            Self::Yes => "yes",
-            Self::Avoided => "avoided",
-            Self::Unsupported => "unsupported",
-            Self::Unknown => "unknown",
-        }
-    }
-}
-
-impl SparseDebug {
-    fn to_string(&self) -> &'static str {
-        match self {
-            Self::No => "no",
-            Self::Zeros => "zeros",
-            Self::SeekHole => "SEEK_HOLE",
-            Self::SeekHoleZeros => "SEEK_HOLE + zeros",
-            Self::Unsupported => "unsupported",
-            Self::Unknown => "unknown",
-        }
-    }
-}
-
-/// This function prints the debug information of a file copy operation if
-/// no hard link or symbolic link is required, and data copy is required.
-/// It prints the debug information of the offload, reflink, and sparse detection actions.
-fn show_debug(copy_debug: &CopyDebug) {
-    println!(
-        "copy offload: {}, reflink: {}, sparse detection: {}",
-        copy_debug.offload.to_string(),
-        copy_debug.reflink.to_string(),
-        copy_debug.sparse_detection.to_string(),
-    );
-}
-
-const ABOUT: &str = help_about!("cp.md");
-const USAGE: &str = help_usage!("cp.md");
-const AFTER_HELP: &str = help_section!("after help", "cp.md");
-
-static EXIT_ERR: i32 = 1;
-
-// Argument constants
-mod options {
-    pub const ARCHIVE: &str = "archive";
-    pub const ATTRIBUTES_ONLY: &str = "attributes-only";
-    pub const CLI_SYMBOLIC_LINKS: &str = "cli-symbolic-links";
-    pub const CONTEXT: &str = "context";
-    pub const COPY_CONTENTS: &str = "copy-contents";
-    pub const DEREFERENCE: &str = "dereference";
-    pub const FORCE: &str = "force";
-    pub const INTERACTIVE: &str = "interactive";
-    pub const LINK: &str = "link";
-    pub const NO_CLOBBER: &str = "no-clobber";
-    pub const NO_DEREFERENCE: &str = "no-dereference";
-    pub const NO_DEREFERENCE_PRESERVE_LINKS: &str = "no-dereference-preserve-links";
-    pub const NO_PRESERVE: &str = "no-preserve";
-    pub const NO_TARGET_DIRECTORY: &str = "no-target-directory";
-    pub const ONE_FILE_SYSTEM: &str = "one-file-system";
-    pub const PARENT: &str = "parent";
-    pub const PARENTS: &str = "parents";
-    pub const PATHS: &str = "paths";
-    pub const PROGRESS_BAR: &str = "progress";
-    pub const PRESERVE: &str = "preserve";
-    pub const PRESERVE_DEFAULT_ATTRIBUTES: &str = "preserve-default-attributes";
-    pub const RECURSIVE: &str = "recursive";
-    pub const REFLINK: &str = "reflink";
-    pub const REMOVE_DESTINATION: &str = "remove-destination";
-    pub const SPARSE: &str = "sparse";
-    pub const STRIP_TRAILING_SLASHES: &str = "strip-trailing-slashes";
-    pub const SYMBOLIC_LINK: &str = "symbolic-link";
-    pub const TARGET_DIRECTORY: &str = "target-directory";
-    pub const DEBUG: &str = "debug";
-    pub const VERBOSE: &str = "verbose";
-}
-
-#[cfg(unix)]
-static PRESERVABLE_ATTRIBUTES: &[&str] = &[
-    "mode",
-    "ownership",
-    "timestamps",
-    "context",
-    "link",
-    "links",
-    "xattr",
-    "all",
-];
-
-#[cfg(not(unix))]
-static PRESERVABLE_ATTRIBUTES: &[&str] = &[
-    "mode",
-    "timestamps",
-    "context",
-    "link",
-    "links",
-    "xattr",
-    "all",
-];
-
-pub fn uu_app() -> Command {
-    const MODE_ARGS: &[&str] = &[
-        options::LINK,
-        options::REFLINK,
-        options::SYMBOLIC_LINK,
-        options::ATTRIBUTES_ONLY,
-        options::COPY_CONTENTS,
-    ];
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .after_help(format!(
-            "{AFTER_HELP}\n\n{}",
-            backup_control::BACKUP_CONTROL_LONG_HELP
-        ))
-        .infer_long_args(true)
-        .args_override_self(true)
-        .arg(
-            Arg::new(options::TARGET_DIRECTORY)
-                .short('t')
-                .conflicts_with(options::NO_TARGET_DIRECTORY)
-                .long(options::TARGET_DIRECTORY)
-                .value_name(options::TARGET_DIRECTORY)
-                .value_hint(clap::ValueHint::DirPath)
-                .value_parser(ValueParser::path_buf())
-                .help("copy all SOURCE arguments into target-directory"),
-        )
-        .arg(
-            Arg::new(options::NO_TARGET_DIRECTORY)
-                .short('T')
-                .long(options::NO_TARGET_DIRECTORY)
-                .conflicts_with(options::TARGET_DIRECTORY)
-                .help("Treat DEST as a regular file and not a directory")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::INTERACTIVE)
-                .short('i')
-                .long(options::INTERACTIVE)
-                .overrides_with(options::NO_CLOBBER)
-                .help("ask before overwriting files")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::LINK)
-                .short('l')
-                .long(options::LINK)
-                .overrides_with_all(MODE_ARGS)
-                .help("hard-link files instead of copying")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NO_CLOBBER)
-                .short('n')
-                .long(options::NO_CLOBBER)
-                .overrides_with(options::INTERACTIVE)
-                .help("don't overwrite a file that already exists")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::RECURSIVE)
-                .short('r')
-                .visible_short_alias('R')
-                .long(options::RECURSIVE)
-                // --archive sets this option
-                .help("copy directories recursively")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::STRIP_TRAILING_SLASHES)
-                .long(options::STRIP_TRAILING_SLASHES)
-                .help("remove any trailing slashes from each SOURCE argument")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DEBUG)
-                .long(options::DEBUG)
-                .help("explain how a file is copied. Implies -v")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::VERBOSE)
-                .short('v')
-                .long(options::VERBOSE)
-                .help("explicitly state what is being done")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SYMBOLIC_LINK)
-                .short('s')
-                .long(options::SYMBOLIC_LINK)
-                .overrides_with_all(MODE_ARGS)
-                .help("make symbolic links instead of copying")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FORCE)
-                .short('f')
-                .long(options::FORCE)
-                .help(
-                    "if an existing destination file cannot be opened, remove it and \
-                    try again (this option is ignored when the -n option is also used). \
-                    Currently not implemented for Windows.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::REMOVE_DESTINATION)
-                .long(options::REMOVE_DESTINATION)
-                .overrides_with(options::FORCE)
-                .help(
-                    "remove each existing destination file before attempting to open it \
-                    (contrast with --force). On Windows, currently only works for \
-                    writeable files.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(backup_control::arguments::backup())
-        .arg(backup_control::arguments::backup_no_args())
-        .arg(backup_control::arguments::suffix())
-        .arg(update_control::arguments::update())
-        .arg(update_control::arguments::update_no_args())
-        .arg(
-            Arg::new(options::REFLINK)
-                .long(options::REFLINK)
-                .value_name("WHEN")
-                .overrides_with_all(MODE_ARGS)
-                .require_equals(true)
-                .default_missing_value("always")
-                .value_parser(["auto", "always", "never"])
-                .num_args(0..=1)
-                .help("control clone/CoW copies. See below"),
-        )
-        .arg(
-            Arg::new(options::ATTRIBUTES_ONLY)
-                .long(options::ATTRIBUTES_ONLY)
-                .overrides_with_all(MODE_ARGS)
-                .help("Don't copy the file data, just the attributes")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PRESERVE)
-                .long(options::PRESERVE)
-                .action(ArgAction::Append)
-                .use_value_delimiter(true)
-                .value_parser(clap::builder::PossibleValuesParser::new(
-                    PRESERVABLE_ATTRIBUTES,
-                ))
-                .num_args(0..)
-                .require_equals(true)
-                .value_name("ATTR_LIST")
-                .overrides_with_all([
-                    options::ARCHIVE,
-                    options::PRESERVE_DEFAULT_ATTRIBUTES,
-                    options::NO_PRESERVE,
-                ])
-                // -d sets this option
-                // --archive sets this option
-                .help(
-                    "Preserve the specified attributes (default: mode, ownership (unix only), \
-                     timestamps), if possible additional attributes: context, links, xattr, all",
-                ),
-        )
-        .arg(
-            Arg::new(options::PRESERVE_DEFAULT_ATTRIBUTES)
-                .short('p')
-                .long(options::PRESERVE_DEFAULT_ATTRIBUTES)
-                .overrides_with_all([options::PRESERVE, options::NO_PRESERVE, options::ARCHIVE])
-                .help("same as --preserve=mode,ownership(unix only),timestamps")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NO_PRESERVE)
-                .long(options::NO_PRESERVE)
-                .value_name("ATTR_LIST")
-                .overrides_with_all([
-                    options::PRESERVE_DEFAULT_ATTRIBUTES,
-                    options::PRESERVE,
-                    options::ARCHIVE,
-                ])
-                .help("don't preserve the specified attributes"),
-        )
-        .arg(
-            Arg::new(options::PARENTS)
-                .long(options::PARENTS)
-                .alias(options::PARENT)
-                .help("use full source file name under DIRECTORY")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NO_DEREFERENCE)
-                .short('P')
-                .long(options::NO_DEREFERENCE)
-                .overrides_with(options::DEREFERENCE)
-                // -d sets this option
-                .help("never follow symbolic links in SOURCE")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DEREFERENCE)
-                .short('L')
-                .long(options::DEREFERENCE)
-                .overrides_with(options::NO_DEREFERENCE)
-                .help("always follow symbolic links in SOURCE")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::CLI_SYMBOLIC_LINKS)
-                .short('H')
-                .help("follow command-line symbolic links in SOURCE")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ARCHIVE)
-                .short('a')
-                .long(options::ARCHIVE)
-                .overrides_with_all([
-                    options::PRESERVE_DEFAULT_ATTRIBUTES,
-                    options::PRESERVE,
-                    options::NO_PRESERVE,
-                ])
-                .help("Same as -dR --preserve=all")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NO_DEREFERENCE_PRESERVE_LINKS)
-                .short('d')
-                .help("same as --no-dereference --preserve=links")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ONE_FILE_SYSTEM)
-                .short('x')
-                .long(options::ONE_FILE_SYSTEM)
-                .help("stay on this file system")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SPARSE)
-                .long(options::SPARSE)
-                .value_name("WHEN")
-                .value_parser(["never", "auto", "always"])
-                .help("control creation of sparse files. See below"),
-        )
-        // TODO: implement the following args
-        .arg(
-            Arg::new(options::COPY_CONTENTS)
-                .long(options::COPY_CONTENTS)
-                .overrides_with(options::ATTRIBUTES_ONLY)
-                .help("NotImplemented: copy contents of special files when recursive")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::CONTEXT)
-                .long(options::CONTEXT)
-                .value_name("CTX")
-                .help(
-                    "NotImplemented: set SELinux security context of destination file to \
-                    default type",
-                ),
-        )
-        // END TODO
-        .arg(
-            // The 'g' short flag is modeled after advcpmv
-            // See this repo: https://github.com/jarun/advcpmv
-            Arg::new(options::PROGRESS_BAR)
-                .long(options::PROGRESS_BAR)
-                .short('g')
-                .action(clap::ArgAction::SetTrue)
-                .help(
-                    "Display a progress bar. \n\
-                Note: this feature is not supported by GNU coreutils.",
-                ),
-        )
-        .arg(
-            Arg::new(options::PATHS)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath)
-                .value_parser(ValueParser::path_buf()),
-        )
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args);
-
-    // The error is parsed here because we do not want version or help being printed to stderr.
-    if let Err(e) = matches {
-        let mut app = uu_app();
-
-        match e.kind() {
-            clap::error::ErrorKind::DisplayHelp => {
-                app.print_help()?;
-            }
-            clap::error::ErrorKind::DisplayVersion => print!("{}", app.render_version()),
-            _ => return Err(Box::new(e.with_exit_code(1))),
-        };
-    } else if let Ok(mut matches) = matches {
-        let options = Options::from_matches(&matches)?;
-
-        if options.overwrite == OverwriteMode::NoClobber && options.backup != BackupMode::NoBackup {
-            return Err(UUsageError::new(
-                EXIT_ERR,
-                "options --backup and --no-clobber are mutually exclusive",
-            ));
-        }
-
-        let paths: Vec<PathBuf> = matches
-            .remove_many::<PathBuf>(options::PATHS)
-            .map(|v| v.collect())
-            .unwrap_or_default();
-
-        let (sources, target) = parse_path_args(paths, &options)?;
-
-        if let Err(error) = copy(&sources, &target, &options) {
-            match error {
-                // Error::NotAllFilesCopied is non-fatal, but the error
-                // code should still be EXIT_ERR as does GNU cp
-                Error::NotAllFilesCopied => {}
-                // Else we caught a fatal bubbled-up error, log it to stderr
-                _ => show_error!("{}", error),
-            };
-            set_exit_code(EXIT_ERR);
-        }
-    }
-
-    Ok(())
-}
-
-impl ClobberMode {
-    fn from_matches(matches: &ArgMatches) -> Self {
-        if matches.get_flag(options::FORCE) {
-            Self::Force
-        } else if matches.get_flag(options::REMOVE_DESTINATION) {
-            Self::RemoveDestination
-        } else {
-            Self::Standard
-        }
-    }
-}
-
-impl OverwriteMode {
-    fn from_matches(matches: &ArgMatches) -> Self {
-        if matches.get_flag(options::INTERACTIVE) {
-            Self::Interactive(ClobberMode::from_matches(matches))
-        } else if matches.get_flag(options::NO_CLOBBER) {
-            Self::NoClobber
-        } else {
-            Self::Clobber(ClobberMode::from_matches(matches))
-        }
-    }
-}
-
-impl CopyMode {
-    fn from_matches(matches: &ArgMatches) -> Self {
-        if matches.get_flag(options::LINK) {
-            Self::Link
-        } else if matches.get_flag(options::SYMBOLIC_LINK) {
-            Self::SymLink
-        } else if matches
-            .get_one::<String>(update_control::arguments::OPT_UPDATE)
-            .is_some()
-            || matches.get_flag(update_control::arguments::OPT_UPDATE_NO_ARG)
-        {
-            Self::Update
-        } else if matches.get_flag(options::ATTRIBUTES_ONLY) {
-            Self::AttrOnly
-        } else {
-            Self::Copy
-        }
-    }
-}
-
-impl Attributes {
-    pub const ALL: Self = Self {
-        #[cfg(unix)]
-        ownership: Preserve::Yes { required: true },
-        mode: Preserve::Yes { required: true },
-        timestamps: Preserve::Yes { required: true },
-        context: {
-            #[cfg(feature = "feat_selinux")]
-            {
-                Preserve::Yes { required: false }
-            }
-            #[cfg(not(feature = "feat_selinux"))]
-            {
-                Preserve::No
-            }
-        },
-        links: Preserve::Yes { required: true },
-        xattr: Preserve::Yes { required: false },
-    };
-
-    pub const NONE: Self = Self {
-        #[cfg(unix)]
-        ownership: Preserve::No,
-        mode: Preserve::No,
-        timestamps: Preserve::No,
-        context: Preserve::No,
-        links: Preserve::No,
-        xattr: Preserve::No,
-    };
-
-    // TODO: ownership is required if the user is root, for non-root users it's not required.
-    pub const DEFAULT: Self = Self {
-        #[cfg(unix)]
-        ownership: Preserve::Yes { required: true },
-        mode: Preserve::Yes { required: true },
-        timestamps: Preserve::Yes { required: true },
-        ..Self::NONE
-    };
-
-    pub const LINKS: Self = Self {
-        links: Preserve::Yes { required: true },
-        ..Self::NONE
-    };
-
-    pub fn union(self, other: &Self) -> Self {
-        Self {
-            #[cfg(unix)]
-            ownership: self.ownership.max(other.ownership),
-            context: self.context.max(other.context),
-            timestamps: self.timestamps.max(other.timestamps),
-            mode: self.mode.max(other.mode),
-            links: self.links.max(other.links),
-            xattr: self.xattr.max(other.xattr),
-        }
-    }
-
-    pub fn parse_iter<T>(values: impl Iterator<Item = T>) -> Result<Self, Error>
-    where
-        T: AsRef<str>,
-    {
-        let mut new = Self::NONE;
-        for value in values {
-            new = new.union(&Self::parse_single_string(value.as_ref())?);
-        }
-        Ok(new)
-    }
-
-    /// Tries to match string containing a parameter to preserve with the corresponding entry in the
-    /// Attributes struct.
-    fn parse_single_string(value: &str) -> Result<Self, Error> {
-        let value = value.to_lowercase();
-
-        if value == "all" {
-            return Ok(Self::ALL);
-        }
-
-        let mut new = Self::NONE;
-        let attribute = match value.as_ref() {
-            "mode" => &mut new.mode,
-            #[cfg(unix)]
-            "ownership" => &mut new.ownership,
-            "timestamps" => &mut new.timestamps,
-            "context" => &mut new.context,
-            "link" | "links" => &mut new.links,
-            "xattr" => &mut new.xattr,
-            _ => {
-                return Err(Error::InvalidArgument(format!(
-                    "invalid attribute {}",
-                    value.quote()
-                )));
-            }
-        };
-
-        *attribute = Preserve::Yes { required: true };
-
-        Ok(new)
-    }
-}
-
-impl Options {
-    #[allow(clippy::cognitive_complexity)]
-    fn from_matches(matches: &ArgMatches) -> CopyResult<Self> {
-        let not_implemented_opts = vec![
-            #[cfg(not(any(windows, unix)))]
-            options::ONE_FILE_SYSTEM,
-            options::CONTEXT,
-            #[cfg(windows)]
-            options::FORCE,
-        ];
-
-        for not_implemented_opt in not_implemented_opts {
-            if matches.contains_id(not_implemented_opt)
-                && matches.value_source(not_implemented_opt)
-                    == Some(clap::parser::ValueSource::CommandLine)
-            {
-                return Err(Error::NotImplemented(not_implemented_opt.to_string()));
-            }
-        }
-
-        let recursive = matches.get_flag(options::RECURSIVE) || matches.get_flag(options::ARCHIVE);
-
-        let backup_mode = match backup_control::determine_backup_mode(matches) {
-            Err(e) => return Err(Error::Backup(format!("{e}"))),
-            Ok(mode) => mode,
-        };
-        let update_mode = update_control::determine_update_mode(matches);
-
-        let backup_suffix = backup_control::determine_backup_suffix(matches);
-
-        let overwrite = OverwriteMode::from_matches(matches);
-
-        // Parse target directory options
-        let no_target_dir = matches.get_flag(options::NO_TARGET_DIRECTORY);
-        let target_dir = matches
-            .get_one::<PathBuf>(options::TARGET_DIRECTORY)
-            .cloned();
-
-        if let Some(dir) = &target_dir {
-            if !dir.is_dir() {
-                return Err(Error::NotADirectory(dir.clone()));
-            }
-        };
-
-        // Parse attributes to preserve
-        let attributes = if let Some(attribute_strs) = matches.get_many::<String>(options::PRESERVE)
-        {
-            if attribute_strs.len() == 0 {
-                Attributes::DEFAULT
-            } else {
-                Attributes::parse_iter(attribute_strs)?
-            }
-        } else if matches.get_flag(options::ARCHIVE) {
-            // --archive is used. Same as --preserve=all
-            Attributes::ALL
-        } else if matches.get_flag(options::NO_DEREFERENCE_PRESERVE_LINKS) {
-            Attributes::LINKS
-        } else if matches.get_flag(options::PRESERVE_DEFAULT_ATTRIBUTES) {
-            Attributes::DEFAULT
-        } else {
-            Attributes::NONE
-        };
-
-        #[cfg(not(feature = "feat_selinux"))]
-        if let Preserve::Yes { required } = attributes.context {
-            let selinux_disabled_error =
-                Error::Error("SELinux was not enabled during the compile time!".to_string());
-            if required {
-                return Err(selinux_disabled_error);
-            } else {
-                show_error_if_needed(&selinux_disabled_error);
-            }
-        }
-
-        let options = Self {
-            attributes_only: matches.get_flag(options::ATTRIBUTES_ONLY),
-            copy_contents: matches.get_flag(options::COPY_CONTENTS),
-            cli_dereference: matches.get_flag(options::CLI_SYMBOLIC_LINKS),
-            copy_mode: CopyMode::from_matches(matches),
-            // No dereference is set with -p, -d and --archive
-            dereference: !(matches.get_flag(options::NO_DEREFERENCE)
-                || matches.get_flag(options::NO_DEREFERENCE_PRESERVE_LINKS)
-                || matches.get_flag(options::ARCHIVE)
-                || recursive)
-                || matches.get_flag(options::DEREFERENCE),
-            one_file_system: matches.get_flag(options::ONE_FILE_SYSTEM),
-            parents: matches.get_flag(options::PARENTS),
-            update: update_mode,
-            debug: matches.get_flag(options::DEBUG),
-            verbose: matches.get_flag(options::VERBOSE) || matches.get_flag(options::DEBUG),
-            strip_trailing_slashes: matches.get_flag(options::STRIP_TRAILING_SLASHES),
-            reflink_mode: {
-                if let Some(reflink) = matches.get_one::<String>(options::REFLINK) {
-                    match reflink.as_str() {
-                        "always" => ReflinkMode::Always,
-                        "auto" => ReflinkMode::Auto,
-                        "never" => ReflinkMode::Never,
-                        value => {
-                            return Err(Error::InvalidArgument(format!(
-                                "invalid argument {} for \'reflink\'",
-                                value.quote()
-                            )));
-                        }
-                    }
-                } else {
-                    #[cfg(any(target_os = "linux", target_os = "android", target_os = "macos"))]
-                    {
-                        ReflinkMode::Auto
-                    }
-                    #[cfg(not(any(
-                        target_os = "linux",
-                        target_os = "android",
-                        target_os = "macos"
-                    )))]
-                    {
-                        ReflinkMode::Never
-                    }
-                }
-            },
-            sparse_mode: {
-                if let Some(val) = matches.get_one::<String>(options::SPARSE) {
-                    match val.as_str() {
-                        "always" => SparseMode::Always,
-                        "auto" => SparseMode::Auto,
-                        "never" => SparseMode::Never,
-                        _ => {
-                            return Err(Error::InvalidArgument(format!(
-                                "invalid argument {val} for \'sparse\'"
-                            )));
-                        }
-                    }
-                } else {
-                    SparseMode::Auto
-                }
-            },
-            backup: backup_mode,
-            backup_suffix,
-            overwrite,
-            no_target_dir,
-            attributes,
-            recursive,
-            target_dir,
-            progress_bar: matches.get_flag(options::PROGRESS_BAR),
-        };
-
-        Ok(options)
-    }
-
-    fn dereference(&self, in_command_line: bool) -> bool {
-        self.dereference || (in_command_line && self.cli_dereference)
-    }
-
-    fn preserve_hard_links(&self) -> bool {
-        match self.attributes.links {
-            Preserve::No => false,
-            Preserve::Yes { .. } => true,
-        }
-    }
-
-    /// Whether to force overwriting the destination file.
-    fn force(&self) -> bool {
-        matches!(self.overwrite, OverwriteMode::Clobber(ClobberMode::Force))
-    }
-}
-
-impl TargetType {
-    /// Return TargetType required for `target`.
-    ///
-    /// Treat target as a dir if we have multiple sources or the target
-    /// exists and already is a directory
-    fn determine(sources: &[PathBuf], target: &Path) -> Self {
-        if sources.len() > 1 || target.is_dir() {
-            Self::Directory
-        } else {
-            Self::File
-        }
-    }
-}
-
-/// Returns tuple of (Source paths, Target)
-fn parse_path_args(
-    mut paths: Vec<PathBuf>,
-    options: &Options,
-) -> CopyResult<(Vec<PathBuf>, PathBuf)> {
-    if paths.is_empty() {
-        // No files specified
-        return Err("missing file operand".into());
-    }
-
-    // Return an error if the user requested to copy more than one
-    // file source to a file target
-    if options.no_target_dir && options.target_dir.is_none() && paths.len() > 2 {
-        return Err(format!("extra operand {:?}", paths[2]).into());
-    }
-
-    let target = match options.target_dir {
-        Some(ref target) => {
-            // All path args are sources, and the target dir was
-            // specified separately
-            target.clone()
-        }
-        None => {
-            // If there was no explicit target-dir, then use the last
-            // path_arg
-            paths.pop().unwrap()
-        }
-    };
-
-    if options.strip_trailing_slashes {
-        for source in &mut paths {
-            *source = source.components().as_path().to_owned();
-        }
-    }
-
-    Ok((paths, target))
-}
-
-/// Get the inode information for a file.
-fn get_inode(file_info: &FileInformation) -> u64 {
-    #[cfg(unix)]
-    let result = file_info.inode();
-    #[cfg(windows)]
-    let result = file_info.file_index();
-    result
-}
-
-#[cfg(target_os = "redox")]
-fn preserve_hardlinks(
-    hard_links: &mut Vec<(String, u64)>,
-    source: &std::path::Path,
-    dest: &std::path::Path,
-    found_hard_link: &mut bool,
-) -> CopyResult<()> {
-    // Redox does not currently support hard links
-    Ok(())
-}
-
-/// Hard link a pair of files if needed _and_ record if this pair is a new hard link.
-#[cfg(not(target_os = "redox"))]
-fn preserve_hardlinks(
-    hard_links: &mut Vec<(String, u64)>,
-    source: &std::path::Path,
-    dest: &std::path::Path,
-) -> CopyResult<bool> {
-    let info = FileInformation::from_path(source, false)
-        .context(format!("cannot stat {}", source.quote()))?;
-    let inode = get_inode(&info);
-    let nlinks = info.number_of_links();
-    let mut found_hard_link = false;
-    for (link, link_inode) in hard_links.iter() {
-        if *link_inode == inode {
-            // Consider the following files:
-            //
-            // * `src/f` - a regular file
-            // * `src/link` - a hard link to `src/f`
-            // * `dest/src/f` - a different regular file
-            //
-            // In this scenario, if we do `cp -a src/ dest/`, it is
-            // possible that the order of traversal causes `src/link`
-            // to get copied first (to `dest/src/link`). In that case,
-            // in order to make sure `dest/src/link` is a hard link to
-            // `dest/src/f` and `dest/src/f` has the contents of
-            // `src/f`, we delete the existing file to allow the hard
-            // linking.
-            if file_or_link_exists(dest) && file_or_link_exists(Path::new(link)) {
-                std::fs::remove_file(dest)?;
-            }
-            std::fs::hard_link(link, dest).unwrap();
-            found_hard_link = true;
-        }
-    }
-    if !found_hard_link && nlinks > 1 {
-        hard_links.push((dest.to_str().unwrap().to_string(), inode));
-    }
-    Ok(found_hard_link)
-}
-
-/// When handling errors, we don't always want to show them to the user. This function handles that.
-fn show_error_if_needed(error: &Error) {
-    match error {
-        // When using --no-clobber, we don't want to show
-        // an error message
-        Error::NotAllFilesCopied => {
-            // Need to return an error code
-        }
-        Error::Skipped => {
-            // touch a b && echo "n"|cp -i a b && echo $?
-            // should return an error from GNU 9.2
-        }
-        _ => {
-            show_error!("{}", error);
-        }
-    }
-}
-
-/// Copy all `sources` to `target`.
-///
-/// Returns an `Err(Error::NotAllFilesCopied)` if at least one non-fatal error
-/// was encountered.
-///
-/// Behavior is determined by the `options` parameter, see [`Options`] for details.
-pub fn copy(sources: &[PathBuf], target: &Path, options: &Options) -> CopyResult<()> {
-    let target_type = TargetType::determine(sources, target);
-    verify_target_type(target, &target_type)?;
-
-    let preserve_hard_links = options.preserve_hard_links();
-
-    let mut hard_links: Vec<(String, u64)> = vec![];
-
-    let mut non_fatal_errors = false;
-    let mut seen_sources = HashSet::with_capacity(sources.len());
-    let mut symlinked_files = HashSet::new();
-
-    let progress_bar = if options.progress_bar {
-        let pb = ProgressBar::new(disk_usage(sources, options.recursive)?)
-            .with_style(
-                ProgressStyle::with_template(
-                    "{msg}: [{elapsed_precise}] {wide_bar} {bytes:>7}/{total_bytes:7}",
-                )
-                .unwrap(),
-            )
-            .with_message(uucore::util_name());
-        pb.tick();
-        Some(pb)
-    } else {
-        None
-    };
-
-    for source in sources.iter() {
-        if seen_sources.contains(source) {
-            // FIXME: compare sources by the actual file they point to, not their path. (e.g. dir/file == dir/../dir/file in most cases)
-            show_warning!("source {} specified more than once", source.quote());
-        } else {
-            let found_hard_link = if preserve_hard_links && !source.is_dir() {
-                let dest = construct_dest_path(source, target, &target_type, options)?;
-                preserve_hardlinks(&mut hard_links, source, &dest)?
-            } else {
-                false
-            };
-            if !found_hard_link {
-                if let Err(error) = copy_source(
-                    &progress_bar,
-                    source,
-                    target,
-                    &target_type,
-                    options,
-                    &mut symlinked_files,
-                ) {
-                    show_error_if_needed(&error);
-                    non_fatal_errors = true;
-                }
-            }
-            seen_sources.insert(source);
-        }
-    }
-    if non_fatal_errors {
-        Err(Error::NotAllFilesCopied)
-    } else {
-        Ok(())
-    }
-}
-
-fn construct_dest_path(
-    source_path: &Path,
-    target: &Path,
-    target_type: &TargetType,
-    options: &Options,
-) -> CopyResult<PathBuf> {
-    if options.no_target_dir && target.is_dir() {
-        return Err(format!(
-            "cannot overwrite directory {} with non-directory",
-            target.quote()
-        )
-        .into());
-    }
-
-    if options.parents && !target.is_dir() {
-        return Err("with --parents, the destination must be a directory".into());
-    }
-
-    Ok(match *target_type {
-        TargetType::Directory => {
-            let root = if options.parents {
-                Path::new("")
-            } else {
-                source_path.parent().unwrap_or(source_path)
-            };
-            localize_to_target(root, source_path, target)?
-        }
-        TargetType::File => target.to_path_buf(),
-    })
-}
-
-fn copy_source(
-    progress_bar: &Option<ProgressBar>,
-    source: &Path,
-    target: &Path,
-    target_type: &TargetType,
-    options: &Options,
-    symlinked_files: &mut HashSet<FileInformation>,
-) -> CopyResult<()> {
-    let source_path = Path::new(&source);
-    if source_path.is_dir() {
-        // Copy as directory
-        copy_directory(progress_bar, source, target, options, symlinked_files, true)
-    } else {
-        // Copy as file
-        let dest = construct_dest_path(source_path, target, target_type, options)?;
-        let res = copy_file(
-            progress_bar,
-            source_path,
-            dest.as_path(),
-            options,
-            symlinked_files,
-            true,
-        );
-        if options.parents {
-            for (x, y) in aligned_ancestors(source, dest.as_path()) {
-                copy_attributes(x, y, &options.attributes)?;
-            }
-        }
-        res
-    }
-}
-
-impl OverwriteMode {
-    fn verify(&self, path: &Path, verbose: bool) -> CopyResult<()> {
-        match *self {
-            Self::NoClobber => {
-                if verbose {
-                    println!("skipped {}", path.quote());
-                } else {
-                    eprintln!("{}: not replacing {}", util_name(), path.quote());
-                }
-                Err(Error::NotAllFilesCopied)
-            }
-            Self::Interactive(_) => {
-                if prompt_yes!("overwrite {}?", path.quote()) {
-                    Ok(())
-                } else {
-                    if verbose {
-                        println!("skipped {}", path.quote());
-                    }
-                    Err(Error::Skipped)
-                }
-            }
-            Self::Clobber(_) => Ok(()),
-        }
-    }
-}
-
-/// Handles errors for attributes preservation. If the attribute is not required, and
-/// errored, tries to show error (see `show_error_if_needed` for additional behavior details).
-/// If it's required, then the error is thrown.
-fn handle_preserve<F: Fn() -> CopyResult<()>>(p: &Preserve, f: F) -> CopyResult<()> {
-    match p {
-        Preserve::No => {}
-        Preserve::Yes { required } => {
-            let result = f();
-            if *required {
-                result?;
-            } else if let Err(error) = result {
-                show_error_if_needed(&error);
-            }
-        }
-    };
-    Ok(())
-}
-
-/// Copy the specified attributes from one path to another.
-pub(crate) fn copy_attributes(
-    source: &Path,
-    dest: &Path,
-    attributes: &Attributes,
-) -> CopyResult<()> {
-    let context = &*format!("{} -> {}", source.quote(), dest.quote());
-    let source_metadata = fs::symlink_metadata(source).context(context)?;
-
-    // Ownership must be changed first to avoid interfering with mode change.
-    #[cfg(unix)]
-    handle_preserve(&attributes.ownership, || -> CopyResult<()> {
-        use std::os::unix::prelude::MetadataExt;
-        use uucore::perms::wrap_chown;
-        use uucore::perms::Verbosity;
-        use uucore::perms::VerbosityLevel;
-
-        let dest_uid = source_metadata.uid();
-        let dest_gid = source_metadata.gid();
-
-        wrap_chown(
-            dest,
-            &dest.symlink_metadata().context(context)?,
-            Some(dest_uid),
-            Some(dest_gid),
-            false,
-            Verbosity {
-                groups_only: false,
-                level: VerbosityLevel::Normal,
-            },
-        )
-        .map_err(Error::Error)?;
-
-        Ok(())
-    })?;
-
-    handle_preserve(&attributes.mode, || -> CopyResult<()> {
-        // The `chmod()` system call that underlies the
-        // `fs::set_permissions()` call is unable to change the
-        // permissions of a symbolic link. In that case, we just
-        // do nothing, since every symbolic link has the same
-        // permissions.
-        if !dest.is_symlink() {
-            fs::set_permissions(dest, source_metadata.permissions()).context(context)?;
-            // FIXME: Implement this for windows as well
-            #[cfg(feature = "feat_acl")]
-            exacl::getfacl(source, None)
-                .and_then(|acl| exacl::setfacl(&[dest], &acl, None))
-                .map_err(|err| Error::Error(err.to_string()))?;
-        }
-
-        Ok(())
-    })?;
-
-    handle_preserve(&attributes.timestamps, || -> CopyResult<()> {
-        let atime = FileTime::from_last_access_time(&source_metadata);
-        let mtime = FileTime::from_last_modification_time(&source_metadata);
-        if dest.is_symlink() {
-            filetime::set_symlink_file_times(dest, atime, mtime)?;
-        } else {
-            filetime::set_file_times(dest, atime, mtime)?;
-        }
-
-        Ok(())
-    })?;
-
-    #[cfg(feature = "feat_selinux")]
-    handle_preserve(&attributes.context, || -> CopyResult<()> {
-        let context = selinux::SecurityContext::of_path(source, false, false).map_err(|e| {
-            format!(
-                "failed to get security context of {}: {}",
-                source.display(),
-                e
-            )
-        })?;
-        if let Some(context) = context {
-            context.set_for_path(dest, false, false).map_err(|e| {
-                format!(
-                    "failed to set security context for {}: {}",
-                    dest.display(),
-                    e
-                )
-            })?;
-        }
-
-        Ok(())
-    })?;
-
-    handle_preserve(&attributes.xattr, || -> CopyResult<()> {
-        #[cfg(unix)]
-        {
-            let xattrs = xattr::list(source)?;
-            for attr in xattrs {
-                if let Some(attr_value) = xattr::get(source, attr.clone())? {
-                    xattr::set(dest, attr, &attr_value[..])?;
-                }
-            }
-        }
-        #[cfg(not(unix))]
-        {
-            // The documentation for GNU cp states:
-            //
-            // > Try to preserve SELinux security context and
-            // > extended attributes (xattr), but ignore any failure
-            // > to do that and print no corresponding diagnostic.
-            //
-            // so we simply do nothing here.
-            //
-            // TODO Silently ignore failures in the `#[cfg(unix)]`
-            // block instead of terminating immediately on errors.
-        }
-
-        Ok(())
-    })?;
-
-    Ok(())
-}
-
-fn symlink_file(
-    source: &Path,
-    dest: &Path,
-    context: &str,
-    symlinked_files: &mut HashSet<FileInformation>,
-) -> CopyResult<()> {
-    #[cfg(not(windows))]
-    {
-        std::os::unix::fs::symlink(source, dest).context(context)?;
-    }
-    #[cfg(windows)]
-    {
-        std::os::windows::fs::symlink_file(source, dest).context(context)?;
-    }
-    if let Ok(file_info) = FileInformation::from_path(dest, false) {
-        symlinked_files.insert(file_info);
-    }
-    Ok(())
-}
-
-fn context_for(src: &Path, dest: &Path) -> String {
-    format!("{} -> {}", src.quote(), dest.quote())
-}
-
-/// Implements a simple backup copy for the destination file.
-/// TODO: for the backup, should this function be replaced by `copy_file(...)`?
-fn backup_dest(dest: &Path, backup_path: &Path) -> CopyResult<PathBuf> {
-    fs::copy(dest, backup_path)?;
-    Ok(backup_path.into())
-}
-
-/// Decide whether source and destination files are the same and
-/// copying is forbidden.
-///
-/// Copying to the same file is only allowed if both `--backup` and
-/// `--force` are specified and the file is a regular file.
-fn is_forbidden_copy_to_same_file(
-    source: &Path,
-    dest: &Path,
-    options: &Options,
-    source_in_command_line: bool,
-) -> bool {
-    // TODO To match the behavior of GNU cp, we also need to check
-    // that the file is a regular file.
-    let dereference_to_compare =
-        options.dereference(source_in_command_line) || !source.is_symlink();
-    paths_refer_to_same_file(source, dest, dereference_to_compare)
-        && !(options.force() && options.backup != BackupMode::NoBackup)
-}
-
-/// Back up, remove, or leave intact the destination file, depending on the options.
-fn handle_existing_dest(
-    source: &Path,
-    dest: &Path,
-    options: &Options,
-    source_in_command_line: bool,
-) -> CopyResult<()> {
-    // Disallow copying a file to itself, unless `--force` and
-    // `--backup` are both specified.
-    if is_forbidden_copy_to_same_file(source, dest, options, source_in_command_line) {
-        return Err(format!("{} and {} are the same file", source.quote(), dest.quote()).into());
-    }
-
-    options.overwrite.verify(dest, options.verbose)?;
-
-    let backup_path = backup_control::get_backup_path(options.backup, dest, &options.backup_suffix);
-    if let Some(backup_path) = backup_path {
-        if paths_refer_to_same_file(source, &backup_path, true) {
-            return Err(format!(
-                "backing up {} might destroy source;  {} not copied",
-                dest.quote(),
-                source.quote()
-            )
-            .into());
-        } else {
-            backup_dest(dest, &backup_path)?;
-        }
-    }
-    match options.overwrite {
-        // FIXME: print that the file was removed if --verbose is enabled
-        OverwriteMode::Clobber(ClobberMode::Force) => {
-            if is_symlink_loop(dest) || fs::metadata(dest)?.permissions().readonly() {
-                fs::remove_file(dest)?;
-            }
-        }
-        OverwriteMode::Clobber(ClobberMode::RemoveDestination) => {
-            fs::remove_file(dest)?;
-        }
-        _ => (),
-    };
-
-    Ok(())
-}
-
-/// Decide whether the given path exists.
-fn file_or_link_exists(path: &Path) -> bool {
-    // Using `Path.exists()` or `Path.try_exists()` is not sufficient,
-    // because if `path` is a symbolic link and there are too many
-    // levels of symbolic link, then those methods will return false
-    // or an OS error.
-    path.symlink_metadata().is_ok()
-}
-
-/// Zip the ancestors of a source path and destination path.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// let actual = aligned_ancestors(&Path::new("a/b/c"), &Path::new("d/a/b/c"));
-/// let expected = vec![
-///     (Path::new("a"), Path::new("d/a")),
-///     (Path::new("a/b"), Path::new("d/a/b")),
-/// ];
-/// assert_eq!(actual, expected);
-/// ```
-fn aligned_ancestors<'a>(source: &'a Path, dest: &'a Path) -> Vec<(&'a Path, &'a Path)> {
-    // Collect the ancestors of each. For example, if `source` is
-    // "a/b/c", then the ancestors are "a/b/c", "a/b", "a/", and "".
-    let source_ancestors: Vec<&Path> = source.ancestors().collect();
-    let dest_ancestors: Vec<&Path> = dest.ancestors().collect();
-
-    // For this particular application, we don't care about the null
-    // path "" and we don't care about the full path (e.g. "a/b/c"),
-    // so we exclude those.
-    let n = source_ancestors.len();
-    let source_ancestors = &source_ancestors[1..n - 1];
-
-    // Get the matching number of elements from the ancestors of the
-    // destination path (for example, get "d/a" and "d/a/b").
-    let k = source_ancestors.len();
-    let dest_ancestors = &dest_ancestors[1..1 + k];
-
-    // Now we have two slices of the same length, so we zip them.
-    let mut result = vec![];
-    for (x, y) in source_ancestors
-        .iter()
-        .rev()
-        .zip(dest_ancestors.iter().rev())
-    {
-        result.push((*x, *y));
-    }
-    result
-}
-
-/// Copy the a file from `source` to `dest`. `source` will be dereferenced if
-/// `options.dereference` is set to true. `dest` will be dereferenced only if
-/// the source was not a symlink.
-///
-/// Behavior when copying to existing files is contingent on the
-/// `options.overwrite` mode. If a file is skipped, the return type
-/// should be `Error:Skipped`
-///
-/// The original permissions of `source` will be copied to `dest`
-/// after a successful copy.
-#[allow(clippy::cognitive_complexity)]
-fn copy_file(
-    progress_bar: &Option<ProgressBar>,
-    source: &Path,
-    dest: &Path,
-    options: &Options,
-    symlinked_files: &mut HashSet<FileInformation>,
-    source_in_command_line: bool,
-) -> CopyResult<()> {
-    if (options.update == UpdateMode::ReplaceIfOlder || options.update == UpdateMode::ReplaceNone)
-        && options.overwrite == OverwriteMode::Interactive(ClobberMode::Standard)
-    {
-        // `cp -i --update old new` when `new` exists doesn't copy anything
-        // and exit with 0
-        return Ok(());
-    }
-
-    // Fail if dest is a dangling symlink or a symlink this program created previously
-    if dest.is_symlink() {
-        if FileInformation::from_path(dest, false)
-            .map(|info| symlinked_files.contains(&info))
-            .unwrap_or(false)
-        {
-            return Err(Error::Error(format!(
-                "will not copy '{}' through just-created symlink '{}'",
-                source.display(),
-                dest.display()
-            )));
-        }
-        let copy_contents = options.dereference(source_in_command_line) || !source.is_symlink();
-        if copy_contents
-            && !dest.exists()
-            && !matches!(
-                options.overwrite,
-                OverwriteMode::Clobber(ClobberMode::RemoveDestination)
-            )
-            && !is_symlink_loop(dest)
-            && std::env::var_os("POSIXLY_CORRECT").is_none()
-        {
-            return Err(Error::Error(format!(
-                "not writing through dangling symlink '{}'",
-                dest.display()
-            )));
-        }
-    }
-
-    if file_or_link_exists(dest) {
-        handle_existing_dest(source, dest, options, source_in_command_line)?;
-    }
-
-    if options.verbose {
-        if let Some(pb) = progress_bar {
-            // Suspend (hide) the progress bar so the println won't overlap with the progress bar.
-            pb.suspend(|| {
-                if options.parents {
-                    // For example, if copying file `a/b/c` and its parents
-                    // to directory `d/`, then print
-                    //
-                    //     a -> d/a
-                    //     a/b -> d/a/b
-                    //
-                    for (x, y) in aligned_ancestors(source, dest) {
-                        println!("{} -> {}", x.display(), y.display());
-                    }
-                }
-
-                println!("{}", context_for(source, dest));
-            });
-        } else {
-            if options.parents {
-                // For example, if copying file `a/b/c` and its parents
-                // to directory `d/`, then print
-                //
-                //     a -> d/a
-                //     a/b -> d/a/b
-                //
-                for (x, y) in aligned_ancestors(source, dest) {
-                    println!("{} -> {}", x.display(), y.display());
-                }
-            }
-
-            println!("{}", context_for(source, dest));
-        }
-    }
-
-    // Calculate the context upfront before canonicalizing the path
-    let context = context_for(source, dest);
-    let context = context.as_str();
-
-    let source_metadata = {
-        let result = if options.dereference(source_in_command_line) {
-            fs::metadata(source)
-        } else {
-            fs::symlink_metadata(source)
-        };
-        result.context(context)?
-    };
-    let source_file_type = source_metadata.file_type();
-    let source_is_symlink = source_file_type.is_symlink();
-
-    #[cfg(unix)]
-    let source_is_fifo = source_file_type.is_fifo();
-    #[cfg(not(unix))]
-    let source_is_fifo = false;
-
-    let dest_permissions = if dest.exists() {
-        dest.symlink_metadata().context(context)?.permissions()
-    } else {
-        #[allow(unused_mut)]
-        let mut permissions = source_metadata.permissions();
-        #[cfg(unix)]
-        {
-            use uucore::mode::get_umask;
-
-            let mut mode = permissions.mode();
-
-            // remove sticky bit, suid and gid bit
-            const SPECIAL_PERMS_MASK: u32 = 0o7000;
-            mode &= !SPECIAL_PERMS_MASK;
-
-            // apply umask
-            mode &= !get_umask();
-
-            permissions.set_mode(mode);
-        }
-        permissions
-    };
-
-    match options.copy_mode {
-        CopyMode::Link => {
-            if dest.exists() {
-                let backup_path =
-                    backup_control::get_backup_path(options.backup, dest, &options.backup_suffix);
-                if let Some(backup_path) = backup_path {
-                    backup_dest(dest, &backup_path)?;
-                    fs::remove_file(dest)?;
-                }
-                if options.overwrite == OverwriteMode::Clobber(ClobberMode::Force) {
-                    fs::remove_file(dest)?;
-                }
-            }
-            if options.dereference(source_in_command_line) && source.is_symlink() {
-                let resolved =
-                    canonicalize(source, MissingHandling::Missing, ResolveMode::Physical).unwrap();
-                fs::hard_link(resolved, dest)
-            } else {
-                fs::hard_link(source, dest)
-            }
-            .context(context)?;
-        }
-        CopyMode::Copy => {
-            copy_helper(
-                source,
-                dest,
-                options,
-                context,
-                source_is_symlink,
-                source_is_fifo,
-                symlinked_files,
-            )?;
-        }
-        CopyMode::SymLink => {
-            if dest.exists() && options.overwrite == OverwriteMode::Clobber(ClobberMode::Force) {
-                fs::remove_file(dest)?;
-            }
-            symlink_file(source, dest, context, symlinked_files)?;
-        }
-        CopyMode::Update => {
-            if dest.exists() {
-                match options.update {
-                    update_control::UpdateMode::ReplaceAll => {
-                        copy_helper(
-                            source,
-                            dest,
-                            options,
-                            context,
-                            source_is_symlink,
-                            source_is_fifo,
-                            symlinked_files,
-                        )?;
-                    }
-                    update_control::UpdateMode::ReplaceNone => return Ok(()),
-                    update_control::UpdateMode::ReplaceIfOlder => {
-                        let dest_metadata = fs::symlink_metadata(dest)?;
-
-                        let src_time = source_metadata.modified()?;
-                        let dest_time = dest_metadata.modified()?;
-                        if src_time <= dest_time {
-                            return Ok(());
-                        } else {
-                            copy_helper(
-                                source,
-                                dest,
-                                options,
-                                context,
-                                source_is_symlink,
-                                source_is_fifo,
-                                symlinked_files,
-                            )?;
-                        }
-                    }
-                }
-            } else {
-                copy_helper(
-                    source,
-                    dest,
-                    options,
-                    context,
-                    source_is_symlink,
-                    source_is_fifo,
-                    symlinked_files,
-                )?;
-            }
-        }
-        CopyMode::AttrOnly => {
-            OpenOptions::new()
-                .write(true)
-                .truncate(false)
-                .create(true)
-                .open(dest)
-                .unwrap();
-        }
-    };
-
-    // TODO: implement something similar to gnu's lchown
-    if !dest.is_symlink() {
-        // Here, to match GNU semantics, we quietly ignore an error
-        // if a user does not have the correct ownership to modify
-        // the permissions of a file.
-        //
-        // FWIW, the OS will throw an error later, on the write op, if
-        // the user does not have permission to write to the file.
-        fs::set_permissions(dest, dest_permissions).ok();
-    }
-
-    copy_attributes(source, dest, &options.attributes)?;
-
-    if let Some(progress_bar) = progress_bar {
-        progress_bar.inc(fs::metadata(source)?.len());
-    }
-
-    Ok(())
-}
-
-/// Copy the file from `source` to `dest` either using the normal `fs::copy` or a
-/// copy-on-write scheme if --reflink is specified and the filesystem supports it.
-fn copy_helper(
-    source: &Path,
-    dest: &Path,
-    options: &Options,
-    context: &str,
-    source_is_symlink: bool,
-    source_is_fifo: bool,
-    symlinked_files: &mut HashSet<FileInformation>,
-) -> CopyResult<()> {
-    if options.parents {
-        let parent = dest.parent().unwrap_or(dest);
-        fs::create_dir_all(parent)?;
-    }
-
-    if source.as_os_str() == "/dev/null" {
-        /* workaround a limitation of fs::copy
-         * https://github.com/rust-lang/rust/issues/79390
-         */
-        File::create(dest).context(dest.display().to_string())?;
-    } else if source_is_fifo && options.recursive && !options.copy_contents {
-        #[cfg(unix)]
-        copy_fifo(dest, options.overwrite, options.verbose)?;
-    } else if source_is_symlink {
-        copy_link(source, dest, symlinked_files)?;
-    } else {
-        let copy_debug = copy_on_write(
-            source,
-            dest,
-            options.reflink_mode,
-            options.sparse_mode,
-            context,
-            #[cfg(any(target_os = "linux", target_os = "android", target_os = "macos"))]
-            source_is_fifo,
-        )?;
-
-        if !options.attributes_only && options.debug {
-            show_debug(&copy_debug);
-        }
-    }
-
-    Ok(())
-}
-
-// "Copies" a FIFO by creating a new one. This workaround is because Rust's
-// built-in fs::copy does not handle FIFOs (see rust-lang/rust/issues/79390).
-#[cfg(unix)]
-fn copy_fifo(dest: &Path, overwrite: OverwriteMode, verbose: bool) -> CopyResult<()> {
-    if dest.exists() {
-        overwrite.verify(dest, verbose)?;
-        fs::remove_file(dest)?;
-    }
-
-    let name = CString::new(dest.as_os_str().as_bytes()).unwrap();
-    let err = unsafe { mkfifo(name.as_ptr(), 0o666) };
-    if err == -1 {
-        return Err(format!("cannot create fifo {}: File exists", dest.quote()).into());
-    }
-    Ok(())
-}
-
-fn copy_link(
-    source: &Path,
-    dest: &Path,
-    symlinked_files: &mut HashSet<FileInformation>,
-) -> CopyResult<()> {
-    // Here, we will copy the symlink itself (actually, just recreate it)
-    let link = fs::read_link(source)?;
-    let dest: Cow<'_, Path> = if dest.is_dir() {
-        match source.file_name() {
-            Some(name) => dest.join(name).into(),
-            None => crash!(
-                EXIT_ERR,
-                "cannot stat {}: No such file or directory",
-                source.quote()
-            ),
-        }
-    } else {
-        // we always need to remove the file to be able to create a symlink,
-        // even if it is writeable.
-        if dest.is_symlink() || dest.is_file() {
-            fs::remove_file(dest)?;
-        }
-        dest.into()
-    };
-    symlink_file(&link, &dest, &context_for(&link, &dest), symlinked_files)
-}
-
-/// Generate an error message if `target` is not the correct `target_type`
-pub fn verify_target_type(target: &Path, target_type: &TargetType) -> CopyResult<()> {
-    match (target_type, target.is_dir()) {
-        (&TargetType::Directory, false) => {
-            Err(format!("target: {} is not a directory", target.quote()).into())
-        }
-        (&TargetType::File, true) => Err(format!(
-            "cannot overwrite directory {} with non-directory",
-            target.quote()
-        )
-        .into()),
-        _ => Ok(()),
-    }
-}
-
-/// Remove the `root` prefix from `source` and prefix it with `target`
-/// to create a file that is local to `target`
-/// # Examples
-///
-/// ```ignore
-/// assert!(uu_cp::localize_to_target(
-///     &Path::new("a/source/"),
-///     &Path::new("a/source/c.txt"),
-///     &Path::new("target/"),
-/// ).unwrap() == Path::new("target/c.txt"))
-/// ```
-pub fn localize_to_target(root: &Path, source: &Path, target: &Path) -> CopyResult<PathBuf> {
-    let local_to_root = source.strip_prefix(root)?;
-    Ok(target.join(local_to_root))
-}
-
-/// Get the total size of a slice of files and directories.
-///
-/// This function is much like the `du` utility, by recursively getting the sizes of files in directories.
-/// Files are not deduplicated when appearing in multiple sources. If `recursive` is set to `false`, the
-/// directories in `paths` will be ignored.
-fn disk_usage(paths: &[PathBuf], recursive: bool) -> io::Result<u64> {
-    let mut total = 0;
-    for p in paths {
-        let md = fs::metadata(p)?;
-        if md.file_type().is_dir() {
-            if recursive {
-                total += disk_usage_directory(p)?;
-            }
-        } else {
-            total += md.len();
-        }
-    }
-    Ok(total)
-}
-
-/// A helper for `disk_usage` specialized for directories.
-fn disk_usage_directory(p: &Path) -> io::Result<u64> {
-    let mut total = 0;
-
-    for entry in fs::read_dir(p)? {
-        let entry = entry?;
-        if entry.file_type()?.is_dir() {
-            total += disk_usage_directory(&entry.path())?;
-        } else {
-            total += entry.metadata()?.len();
-        }
-    }
-
-    Ok(total)
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::{aligned_ancestors, localize_to_target};
-    use std::path::Path;
-
-    #[test]
-    fn test_cp_localize_to_target() {
-        let root = Path::new("a/source/");
-        let source = Path::new("a/source/c.txt");
-        let target = Path::new("target/");
-        let actual = localize_to_target(root, source, target).unwrap();
-        let expected = Path::new("target/c.txt");
-        assert_eq!(actual, expected);
-    }
-
-    #[test]
-    fn test_aligned_ancestors() {
-        let actual = aligned_ancestors(Path::new("a/b/c"), Path::new("d/a/b/c"));
-        let expected = vec![
-            (Path::new("a"), Path::new("d/a")),
-            (Path::new("a/b"), Path::new("d/a/b")),
-        ];
-        assert_eq!(actual, expected);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cp/platform/linux.rs.html b/coreutils/dev/src/uu_cp/platform/linux.rs.html deleted file mode 100644 index fc6f116b4..000000000 --- a/coreutils/dev/src/uu_cp/platform/linux.rs.html +++ /dev/null @@ -1,391 +0,0 @@ -linux.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore ficlone reflink ftruncate pwrite fiemap
-use std::fs::{File, OpenOptions};
-use std::io::Read;
-use std::os::unix::fs::OpenOptionsExt;
-use std::os::unix::io::AsRawFd;
-use std::path::Path;
-
-use quick_error::ResultExt;
-
-use uucore::mode::get_umask;
-
-use crate::{CopyDebug, CopyResult, OffloadReflinkDebug, ReflinkMode, SparseDebug, SparseMode};
-
-// From /usr/include/linux/fs.h:
-// #define FICLONE		_IOW(0x94, 9, int)
-// Use a macro as libc::ioctl expects u32 or u64 depending on the arch
-macro_rules! FICLONE {
-    () => {
-        0x40049409
-    };
-}
-
-/// The fallback behavior for [`clone`] on failed system call.
-#[derive(Clone, Copy)]
-enum CloneFallback {
-    /// Raise an error.
-    Error,
-
-    /// Use [`std::fs::copy`].
-    FSCopy,
-}
-
-/// Use the Linux `ioctl_ficlone` API to do a copy-on-write clone.
-///
-/// `fallback` controls what to do if the system call fails.
-#[cfg(any(target_os = "linux", target_os = "android"))]
-fn clone<P>(source: P, dest: P, fallback: CloneFallback) -> std::io::Result<()>
-where
-    P: AsRef<Path>,
-{
-    let src_file = File::open(&source)?;
-    let dst_file = File::create(&dest)?;
-    let src_fd = src_file.as_raw_fd();
-    let dst_fd = dst_file.as_raw_fd();
-    let result = unsafe { libc::ioctl(dst_fd, FICLONE!(), src_fd) };
-    if result == 0 {
-        return Ok(());
-    }
-    match fallback {
-        CloneFallback::Error => Err(std::io::Error::last_os_error()),
-        CloneFallback::FSCopy => std::fs::copy(source, dest).map(|_| ()),
-    }
-}
-
-/// Perform a sparse copy from one file to another.
-#[cfg(any(target_os = "linux", target_os = "android"))]
-fn sparse_copy<P>(source: P, dest: P) -> std::io::Result<()>
-where
-    P: AsRef<Path>,
-{
-    use std::os::unix::prelude::MetadataExt;
-
-    let mut src_file = File::open(source)?;
-    let dst_file = File::create(dest)?;
-    let dst_fd = dst_file.as_raw_fd();
-
-    let size: usize = src_file.metadata()?.size().try_into().unwrap();
-    if unsafe { libc::ftruncate(dst_fd, size.try_into().unwrap()) } < 0 {
-        return Err(std::io::Error::last_os_error());
-    }
-
-    let blksize = dst_file.metadata()?.blksize();
-    let mut buf: Vec<u8> = vec![0; blksize.try_into().unwrap()];
-    let mut current_offset: usize = 0;
-
-    // TODO Perhaps we can employ the "fiemap ioctl" API to get the
-    // file extent mappings:
-    // https://www.kernel.org/doc/html/latest/filesystems/fiemap.html
-    while current_offset < size {
-        let this_read = src_file.read(&mut buf)?;
-        if buf.iter().any(|&x| x != 0) {
-            unsafe {
-                libc::pwrite(
-                    dst_fd,
-                    buf.as_ptr() as *const libc::c_void,
-                    this_read,
-                    current_offset.try_into().unwrap(),
-                )
-            };
-        }
-        current_offset += this_read;
-    }
-    Ok(())
-}
-
-/// Copy the contents of the given source FIFO to the given file.
-fn copy_fifo_contents<P>(source: P, dest: P) -> std::io::Result<u64>
-where
-    P: AsRef<Path>,
-{
-    // For some reason,
-    //
-    //     cp --preserve=ownership --copy-contents fifo fifo2
-    //
-    // causes `fifo2` to be created with limited permissions (mode 622
-    // or maybe 600 it seems), and then after `fifo` is closed, the
-    // permissions get updated to match those of `fifo`. This doesn't
-    // make much sense to me but the behavior appears in
-    // `tests/cp/file-perm-race.sh`.
-    //
-    // So it seems that if `--preserve=ownership` is true then what we
-    // need to do is create the destination file with limited
-    // permissions, copy the contents, then update the permissions. If
-    // `--preserve=ownership` is not true, however, then we can just
-    // match the mode of the source file.
-    //
-    // TODO Update the code below to respect the case where
-    // `--preserve=ownership` is not true.
-    let mut src_file = File::open(&source)?;
-    let mode = 0o622 & !get_umask();
-    let mut dst_file = OpenOptions::new()
-        .create(true)
-        .write(true)
-        .mode(mode)
-        .open(&dest)?;
-    let num_bytes_copied = std::io::copy(&mut src_file, &mut dst_file)?;
-    dst_file.set_permissions(src_file.metadata()?.permissions())?;
-    Ok(num_bytes_copied)
-}
-
-/// Copies `source` to `dest` using copy-on-write if possible.
-///
-/// The `source_is_fifo` flag must be set to `true` if and only if
-/// `source` is a FIFO (also known as a named pipe). In this case,
-/// copy-on-write is not possible, so we copy the contents using
-/// [`std::io::copy`].
-pub(crate) fn copy_on_write(
-    source: &Path,
-    dest: &Path,
-    reflink_mode: ReflinkMode,
-    sparse_mode: SparseMode,
-    context: &str,
-    source_is_fifo: bool,
-) -> CopyResult<CopyDebug> {
-    let mut copy_debug = CopyDebug {
-        offload: OffloadReflinkDebug::Unknown,
-        reflink: OffloadReflinkDebug::Unsupported,
-        sparse_detection: SparseDebug::No,
-    };
-
-    let result = match (reflink_mode, sparse_mode) {
-        (ReflinkMode::Never, SparseMode::Always) => {
-            copy_debug.sparse_detection = SparseDebug::Zeros;
-            copy_debug.offload = OffloadReflinkDebug::Avoided;
-            copy_debug.reflink = OffloadReflinkDebug::No;
-            sparse_copy(source, dest)
-        }
-        (ReflinkMode::Never, _) => {
-            copy_debug.sparse_detection = SparseDebug::No;
-            copy_debug.reflink = OffloadReflinkDebug::No;
-            std::fs::copy(source, dest).map(|_| ())
-        }
-        (ReflinkMode::Auto, SparseMode::Always) => {
-            copy_debug.offload = OffloadReflinkDebug::Avoided;
-            copy_debug.sparse_detection = SparseDebug::Zeros;
-            copy_debug.reflink = OffloadReflinkDebug::Unsupported;
-            sparse_copy(source, dest)
-        }
-
-        (ReflinkMode::Auto, _) => {
-            copy_debug.sparse_detection = SparseDebug::No;
-            copy_debug.reflink = OffloadReflinkDebug::Unsupported;
-            if source_is_fifo {
-                copy_fifo_contents(source, dest).map(|_| ())
-            } else {
-                clone(source, dest, CloneFallback::FSCopy)
-            }
-        }
-        (ReflinkMode::Always, SparseMode::Auto) => {
-            copy_debug.sparse_detection = SparseDebug::No;
-            copy_debug.reflink = OffloadReflinkDebug::Yes;
-
-            clone(source, dest, CloneFallback::Error)
-        }
-        (ReflinkMode::Always, _) => {
-            return Err("`--reflink=always` can be used only with --sparse=auto".into())
-        }
-    };
-    result.context(context)?;
-    Ok(copy_debug)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cp/platform/mod.rs.html b/coreutils/dev/src/uu_cp/platform/mod.rs.html deleted file mode 100644 index 2e8243dfa..000000000 --- a/coreutils/dev/src/uu_cp/platform/mod.rs.html +++ /dev/null @@ -1,37 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-#[cfg(target_os = "macos")]
-mod macos;
-#[cfg(target_os = "macos")]
-pub(crate) use self::macos::copy_on_write;
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-mod linux;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-pub(crate) use self::linux::copy_on_write;
-
-#[cfg(not(any(target_os = "linux", target_os = "android", target_os = "macos")))]
-mod other;
-#[cfg(not(any(target_os = "linux", target_os = "android", target_os = "macos")))]
-pub(crate) use self::other::copy_on_write;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_csplit/csplit.rs.html b/coreutils/dev/src/uu_csplit/csplit.rs.html deleted file mode 100644 index b7e9527a3..000000000 --- a/coreutils/dev/src/uu_csplit/csplit.rs.html +++ /dev/null @@ -1,1639 +0,0 @@ -csplit.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-
#![crate_name = "uu_csplit"]
-// spell-checker:ignore rustdoc
-#![allow(rustdoc::private_intra_doc_links)]
-
-use std::cmp::Ordering;
-use std::io::{self, BufReader};
-use std::{
-    fs::{remove_file, File},
-    io::{BufRead, BufWriter, Write},
-};
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-use regex::Regex;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult};
-use uucore::{crash_if_err, format_usage, help_about, help_section, help_usage};
-
-mod csplit_error;
-mod patterns;
-mod split_name;
-
-use crate::csplit_error::CsplitError;
-use crate::split_name::SplitName;
-
-const ABOUT: &str = help_about!("csplit.md");
-const AFTER_HELP: &str = help_section!("after help", "csplit.md");
-const USAGE: &str = help_usage!("csplit.md");
-
-mod options {
-    pub const SUFFIX_FORMAT: &str = "suffix-format";
-    pub const SUPPRESS_MATCHED: &str = "suppress-matched";
-    pub const DIGITS: &str = "digits";
-    pub const PREFIX: &str = "prefix";
-    pub const KEEP_FILES: &str = "keep-files";
-    pub const QUIET: &str = "quiet";
-    pub const ELIDE_EMPTY_FILES: &str = "elide-empty-files";
-    pub const FILE: &str = "file";
-    pub const PATTERN: &str = "pattern";
-}
-
-/// Command line options for csplit.
-pub struct CsplitOptions {
-    split_name: crate::SplitName,
-    keep_files: bool,
-    quiet: bool,
-    elide_empty_files: bool,
-    suppress_matched: bool,
-}
-
-impl CsplitOptions {
-    fn new(matches: &ArgMatches) -> Self {
-        let keep_files = matches.get_flag(options::KEEP_FILES);
-        let quiet = matches.get_flag(options::QUIET);
-        let elide_empty_files = matches.get_flag(options::ELIDE_EMPTY_FILES);
-        let suppress_matched = matches.get_flag(options::SUPPRESS_MATCHED);
-
-        Self {
-            split_name: crash_if_err!(
-                1,
-                SplitName::new(
-                    matches
-                        .get_one::<String>(options::PREFIX)
-                        .map(|s| s.to_owned()),
-                    matches
-                        .get_one::<String>(options::SUFFIX_FORMAT)
-                        .map(|s| s.to_owned()),
-                    matches
-                        .get_one::<String>(options::DIGITS)
-                        .map(|s| s.to_owned())
-                )
-            ),
-            keep_files,
-            quiet,
-            elide_empty_files,
-            suppress_matched,
-        }
-    }
-}
-
-/// Splits a file into severals according to the command line patterns.
-///
-/// # Errors
-///
-/// - [`io::Error`] if there is some problem reading/writing from/to a file.
-/// - [`CsplitError::LineOutOfRange`] if the line number pattern is larger than the number of input
-///   lines.
-/// - [`CsplitError::LineOutOfRangeOnRepetition`], like previous but after applying the pattern
-///   more than once.
-/// - [`CsplitError::MatchNotFound`] if no line matched a regular expression.
-/// - [`CsplitError::MatchNotFoundOnRepetition`], like previous but after applying the pattern
-///   more than once.
-pub fn csplit<T>(
-    options: &CsplitOptions,
-    patterns: Vec<patterns::Pattern>,
-    input: T,
-) -> Result<(), CsplitError>
-where
-    T: BufRead,
-{
-    let mut input_iter = InputSplitter::new(input.lines().enumerate());
-    let mut split_writer = SplitWriter::new(options);
-    let ret = do_csplit(&mut split_writer, patterns, &mut input_iter);
-
-    // consume the rest
-    input_iter.rewind_buffer();
-    if let Some((_, line)) = input_iter.next() {
-        split_writer.new_writer()?;
-        split_writer.writeln(&line?)?;
-        for (_, line) in input_iter {
-            split_writer.writeln(&line?)?;
-        }
-        split_writer.finish_split();
-    }
-    // delete files on error by default
-    if ret.is_err() && !options.keep_files {
-        split_writer.delete_all_splits()?;
-    }
-    ret
-}
-
-fn do_csplit<I>(
-    split_writer: &mut SplitWriter,
-    patterns: Vec<patterns::Pattern>,
-    input_iter: &mut InputSplitter<I>,
-) -> Result<(), CsplitError>
-where
-    I: Iterator<Item = (usize, io::Result<String>)>,
-{
-    // split the file based on patterns
-    for pattern in patterns {
-        let pattern_as_str = pattern.to_string();
-        let is_skip = matches!(pattern, patterns::Pattern::SkipToMatch(_, _, _));
-        match pattern {
-            patterns::Pattern::UpToLine(n, ex) => {
-                let mut up_to_line = n;
-                for (_, ith) in ex.iter() {
-                    split_writer.new_writer()?;
-                    match split_writer.do_to_line(&pattern_as_str, up_to_line, input_iter) {
-                        // the error happened when applying the pattern more than once
-                        Err(CsplitError::LineOutOfRange(_)) if ith != 1 => {
-                            return Err(CsplitError::LineOutOfRangeOnRepetition(
-                                pattern_as_str.to_string(),
-                                ith - 1,
-                            ));
-                        }
-                        Err(err) => return Err(err),
-                        // continue the splitting process
-                        Ok(()) => (),
-                    }
-                    up_to_line += n;
-                }
-            }
-            patterns::Pattern::UpToMatch(regex, offset, ex)
-            | patterns::Pattern::SkipToMatch(regex, offset, ex) => {
-                for (max, ith) in ex.iter() {
-                    if is_skip {
-                        // when skipping a part of the input, no writer is created
-                        split_writer.as_dev_null();
-                    } else {
-                        split_writer.new_writer()?;
-                    }
-                    match (
-                        split_writer.do_to_match(&pattern_as_str, &regex, offset, input_iter),
-                        max,
-                    ) {
-                        // in case of ::pattern::ExecutePattern::Always, then it's fine not to find a
-                        // matching line
-                        (Err(CsplitError::MatchNotFound(_)), None) => {
-                            return Ok(());
-                        }
-                        // the error happened when applying the pattern more than once
-                        (Err(CsplitError::MatchNotFound(_)), Some(m)) if m != 1 && ith != 1 => {
-                            return Err(CsplitError::MatchNotFoundOnRepetition(
-                                pattern_as_str.to_string(),
-                                ith - 1,
-                            ));
-                        }
-                        (Err(err), _) => return Err(err),
-                        // continue the splitting process
-                        (Ok(()), _) => (),
-                    };
-                }
-            }
-        };
-    }
-    Ok(())
-}
-
-/// Write a portion of the input file into a split which filename is based on an incrementing
-/// counter.
-struct SplitWriter<'a> {
-    /// the options set through the command line
-    options: &'a CsplitOptions,
-    /// a split counter
-    counter: usize,
-    /// the writer to the current split
-    current_writer: Option<BufWriter<File>>,
-    /// the size in bytes of the current split
-    size: usize,
-    /// flag to indicate that no content should be written to a split
-    dev_null: bool,
-}
-
-impl<'a> Drop for SplitWriter<'a> {
-    fn drop(&mut self) {
-        if self.options.elide_empty_files && self.size == 0 {
-            let file_name = self.options.split_name.get(self.counter);
-            remove_file(file_name).expect("Failed to elide split");
-        }
-    }
-}
-
-impl<'a> SplitWriter<'a> {
-    fn new(options: &CsplitOptions) -> SplitWriter {
-        SplitWriter {
-            options,
-            counter: 0,
-            current_writer: None,
-            size: 0,
-            dev_null: false,
-        }
-    }
-
-    /// Creates a new split and returns its filename.
-    ///
-    /// # Errors
-    ///
-    /// The creation of the split file may fail with some [`io::Error`].
-    fn new_writer(&mut self) -> io::Result<()> {
-        let file_name = self.options.split_name.get(self.counter);
-        let file = File::create(file_name)?;
-        self.current_writer = Some(BufWriter::new(file));
-        self.counter += 1;
-        self.size = 0;
-        self.dev_null = false;
-        Ok(())
-    }
-
-    /// The current split will not keep any of the read input lines.
-    fn as_dev_null(&mut self) {
-        self.dev_null = true;
-    }
-
-    /// Writes the line to the current split, appending a newline character.
-    /// If [`self.dev_null`] is true, then the line is discarded.
-    ///
-    /// # Errors
-    ///
-    /// Some [`io::Error`] may occur when attempting to write the line.
-    fn writeln(&mut self, line: &str) -> io::Result<()> {
-        if !self.dev_null {
-            match self.current_writer {
-                Some(ref mut current_writer) => {
-                    let bytes = line.as_bytes();
-                    current_writer.write_all(bytes)?;
-                    current_writer.write_all(b"\n")?;
-                    self.size += bytes.len() + 1;
-                }
-                None => panic!("trying to write to a split that was not created"),
-            }
-        }
-        Ok(())
-    }
-
-    /// Perform some operations after completing a split, i.e., either remove it
-    /// if the [`options::ELIDE_EMPTY_FILES`] option is enabled, or print how much bytes were written
-    /// to it if [`options::QUIET`] is disabled.
-    ///
-    /// # Errors
-    ///
-    /// Some [`io::Error`] if the split could not be removed in case it should be elided.
-    fn finish_split(&mut self) {
-        if !self.dev_null {
-            if self.options.elide_empty_files && self.size == 0 {
-                self.counter -= 1;
-            } else if !self.options.quiet {
-                println!("{}", self.size);
-            }
-        }
-    }
-
-    /// Removes all the split files that were created.
-    ///
-    /// # Errors
-    ///
-    /// Returns an [`io::Error`] if there was a problem removing a split.
-    fn delete_all_splits(&self) -> io::Result<()> {
-        let mut ret = Ok(());
-        for ith in 0..self.counter {
-            let file_name = self.options.split_name.get(ith);
-            if let Err(err) = remove_file(file_name) {
-                ret = Err(err);
-            }
-        }
-        ret
-    }
-
-    /// Split the input stream up to the line number `n`.
-    ///
-    /// If the line number `n` is smaller than the current position in the input, then an empty
-    /// split is created.
-    ///
-    /// # Errors
-    ///
-    /// In addition to errors reading/writing from/to a file, if the line number
-    /// `n` is greater than the total available lines, then a
-    /// [`CsplitError::LineOutOfRange`] error is returned.
-    fn do_to_line<I>(
-        &mut self,
-        pattern_as_str: &str,
-        n: usize,
-        input_iter: &mut InputSplitter<I>,
-    ) -> Result<(), CsplitError>
-    where
-        I: Iterator<Item = (usize, io::Result<String>)>,
-    {
-        input_iter.rewind_buffer();
-        input_iter.set_size_of_buffer(1);
-
-        let mut ret = Err(CsplitError::LineOutOfRange(pattern_as_str.to_string()));
-        while let Some((ln, line)) = input_iter.next() {
-            let l = line?;
-            match n.cmp(&(&ln + 1)) {
-                Ordering::Less => {
-                    assert!(
-                        input_iter.add_line_to_buffer(ln, l).is_none(),
-                        "the buffer is big enough to contain 1 line"
-                    );
-                    ret = Ok(());
-                    break;
-                }
-                Ordering::Equal => {
-                    assert!(
-                        self.options.suppress_matched
-                            || input_iter.add_line_to_buffer(ln, l).is_none(),
-                        "the buffer is big enough to contain 1 line"
-                    );
-                    ret = Ok(());
-                    break;
-                }
-                Ordering::Greater => (),
-            }
-            self.writeln(&l)?;
-        }
-        self.finish_split();
-        ret
-    }
-
-    /// Read lines up to the line matching a [`Regex`]. With a non-zero offset,
-    /// the block of relevant lines can be extended (if positive), or reduced
-    /// (if negative).
-    ///
-    /// # Errors
-    ///
-    /// In addition to errors reading/writing from/to a file, the following errors may be returned:
-    /// - if no line matched, an [`CsplitError::MatchNotFound`].
-    /// - if there are not enough lines to accommodate the offset, an
-    /// [`CsplitError::LineOutOfRange`].
-    #[allow(clippy::cognitive_complexity)]
-    fn do_to_match<I>(
-        &mut self,
-        pattern_as_str: &str,
-        regex: &Regex,
-        mut offset: i32,
-        input_iter: &mut InputSplitter<I>,
-    ) -> Result<(), CsplitError>
-    where
-        I: Iterator<Item = (usize, io::Result<String>)>,
-    {
-        if offset >= 0 {
-            // The offset is zero or positive, no need for a buffer on the lines read.
-            // NOTE: drain the buffer of input_iter, no match should be done within.
-            for line in input_iter.drain_buffer() {
-                self.writeln(&line)?;
-            }
-            // retain the matching line
-            input_iter.set_size_of_buffer(1);
-
-            while let Some((ln, line)) = input_iter.next() {
-                let l = line?;
-                if regex.is_match(&l) {
-                    match (self.options.suppress_matched, offset) {
-                        // no offset, add the line to the next split
-                        (false, 0) => {
-                            assert!(
-                                input_iter.add_line_to_buffer(ln, l).is_none(),
-                                "the buffer is big enough to contain 1 line"
-                            );
-                        }
-                        // a positive offset, some more lines need to be added to the current split
-                        (false, _) => self.writeln(&l)?,
-                        _ => (),
-                    };
-                    offset -= 1;
-
-                    // write the extra lines required by the offset
-                    while offset > 0 {
-                        match input_iter.next() {
-                            Some((_, line)) => {
-                                self.writeln(&line?)?;
-                            }
-                            None => {
-                                self.finish_split();
-                                return Err(CsplitError::LineOutOfRange(
-                                    pattern_as_str.to_string(),
-                                ));
-                            }
-                        };
-                        offset -= 1;
-                    }
-                    self.finish_split();
-                    return Ok(());
-                }
-                self.writeln(&l)?;
-            }
-        } else {
-            // With a negative offset we use a buffer to keep the lines within the offset.
-            // NOTE: do not drain the buffer of input_iter, in case of an LineOutOfRange error
-            // but do not rewind it either since no match should be done within.
-            // The consequence is that the buffer may already be full with lines from a previous
-            // split, which is taken care of when calling `shrink_buffer_to_size`.
-            let offset_usize = -offset as usize;
-            input_iter.set_size_of_buffer(offset_usize);
-            while let Some((ln, line)) = input_iter.next() {
-                let l = line?;
-                if regex.is_match(&l) {
-                    for line in input_iter.shrink_buffer_to_size() {
-                        self.writeln(&line)?;
-                    }
-                    if !self.options.suppress_matched {
-                        // add 1 to the buffer size to make place for the matched line
-                        input_iter.set_size_of_buffer(offset_usize + 1);
-                        assert!(
-                            input_iter.add_line_to_buffer(ln, l).is_none(),
-                            "should be big enough to hold every lines"
-                        );
-                    }
-                    self.finish_split();
-                    if input_iter.buffer_len() < offset_usize {
-                        return Err(CsplitError::LineOutOfRange(pattern_as_str.to_string()));
-                    }
-                    return Ok(());
-                }
-                if let Some(line) = input_iter.add_line_to_buffer(ln, l) {
-                    self.writeln(&line)?;
-                }
-            }
-            // no match, drain the buffer into the current split
-            for line in input_iter.drain_buffer() {
-                self.writeln(&line)?;
-            }
-        }
-
-        self.finish_split();
-        Err(CsplitError::MatchNotFound(pattern_as_str.to_string()))
-    }
-}
-
-/// An iterator which can output items from a buffer filled externally.
-/// This is used to pass matching lines to the next split and to support patterns with a negative offset.
-struct InputSplitter<I>
-where
-    I: Iterator<Item = (usize, io::Result<String>)>,
-{
-    iter: I,
-    buffer: Vec<<I as Iterator>::Item>,
-    /// the number of elements the buffer may hold
-    size: usize,
-    /// flag to indicate content off the buffer should be returned instead of off the wrapped
-    /// iterator
-    rewind: bool,
-}
-
-impl<I> InputSplitter<I>
-where
-    I: Iterator<Item = (usize, io::Result<String>)>,
-{
-    fn new(iter: I) -> Self {
-        Self {
-            iter,
-            buffer: Vec::new(),
-            rewind: false,
-            size: 1,
-        }
-    }
-
-    /// Rewind the iteration by outputting the buffer's content.
-    fn rewind_buffer(&mut self) {
-        self.rewind = true;
-    }
-
-    /// Shrink the buffer so that its length is equal to the set size, returning an iterator for
-    /// the elements that were too much.
-    fn shrink_buffer_to_size(&mut self) -> impl Iterator<Item = String> + '_ {
-        let shrink_offset = if self.buffer.len() > self.size {
-            self.buffer.len() - self.size
-        } else {
-            0
-        };
-        self.buffer
-            .drain(..shrink_offset)
-            .map(|(_, line)| line.unwrap())
-    }
-
-    /// Drain the content of the buffer.
-    fn drain_buffer(&mut self) -> impl Iterator<Item = String> + '_ {
-        self.buffer.drain(..).map(|(_, line)| line.unwrap())
-    }
-
-    /// Set the maximum number of lines to keep.
-    fn set_size_of_buffer(&mut self, size: usize) {
-        self.size = size;
-    }
-
-    /// Add a line to the buffer. If the buffer has [`self.size`] elements, then its head is removed and
-    /// the new line is pushed to the buffer. The removed head is then available in the returned
-    /// option.
-    fn add_line_to_buffer(&mut self, ln: usize, line: String) -> Option<String> {
-        if self.rewind {
-            self.buffer.insert(0, (ln, Ok(line)));
-            None
-        } else if self.buffer.len() >= self.size {
-            let (_, head_line) = self.buffer.remove(0);
-            self.buffer.push((ln, Ok(line)));
-            Some(head_line.unwrap())
-        } else {
-            self.buffer.push((ln, Ok(line)));
-            None
-        }
-    }
-
-    /// Returns the number of lines stored in the buffer
-    fn buffer_len(&self) -> usize {
-        self.buffer.len()
-    }
-}
-
-impl<I> Iterator for InputSplitter<I>
-where
-    I: Iterator<Item = (usize, io::Result<String>)>,
-{
-    type Item = <I as Iterator>::Item;
-
-    fn next(&mut self) -> Option<Self::Item> {
-        if self.rewind {
-            if !self.buffer.is_empty() {
-                return Some(self.buffer.remove(0));
-            }
-            self.rewind = false;
-        }
-        self.iter.next()
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    // get the file to split
-    let file_name = matches.get_one::<String>(options::FILE).unwrap();
-
-    // get the patterns to split on
-    let patterns: Vec<String> = matches
-        .get_many::<String>(options::PATTERN)
-        .unwrap()
-        .map(|s| s.to_string())
-        .collect();
-    let patterns = patterns::get_patterns(&patterns[..])?;
-    let options = CsplitOptions::new(&matches);
-    if file_name == "-" {
-        let stdin = io::stdin();
-        Ok(csplit(&options, patterns, stdin.lock())?)
-    } else {
-        let file = File::open(file_name)
-            .map_err_context(|| format!("cannot access {}", file_name.quote()))?;
-        let file_metadata = file
-            .metadata()
-            .map_err_context(|| format!("cannot access {}", file_name.quote()))?;
-        if !file_metadata.is_file() {
-            return Err(CsplitError::NotRegularFile(file_name.to_string()).into());
-        }
-        Ok(csplit(&options, patterns, BufReader::new(file))?)
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::SUFFIX_FORMAT)
-                .short('b')
-                .long(options::SUFFIX_FORMAT)
-                .value_name("FORMAT")
-                .help("use sprintf FORMAT instead of %02d"),
-        )
-        .arg(
-            Arg::new(options::PREFIX)
-                .short('f')
-                .long(options::PREFIX)
-                .value_name("PREFIX")
-                .help("use PREFIX instead of 'xx'"),
-        )
-        .arg(
-            Arg::new(options::KEEP_FILES)
-                .short('k')
-                .long(options::KEEP_FILES)
-                .help("do not remove output files on errors")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SUPPRESS_MATCHED)
-                .long(options::SUPPRESS_MATCHED)
-                .help("suppress the lines matching PATTERN")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DIGITS)
-                .short('n')
-                .long(options::DIGITS)
-                .value_name("DIGITS")
-                .help("use specified number of digits instead of 2"),
-        )
-        .arg(
-            Arg::new(options::QUIET)
-                .short('s')
-                .long(options::QUIET)
-                .visible_alias("silent")
-                .help("do not print counts of output file sizes")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ELIDE_EMPTY_FILES)
-                .short('z')
-                .long(options::ELIDE_EMPTY_FILES)
-                .help("remove empty output files")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .required(true)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::PATTERN)
-                .hide(true)
-                .action(clap::ArgAction::Append)
-                .required(true),
-        )
-        .after_help(AFTER_HELP)
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    fn input_splitter() {
-        let input = vec![
-            Ok(String::from("aaa")),
-            Ok(String::from("bbb")),
-            Ok(String::from("ccc")),
-            Ok(String::from("ddd")),
-        ];
-        let mut input_splitter = InputSplitter::new(input.into_iter().enumerate());
-
-        input_splitter.set_size_of_buffer(2);
-        assert_eq!(input_splitter.buffer_len(), 0);
-
-        match input_splitter.next() {
-            Some((0, Ok(line))) => {
-                assert_eq!(line, String::from("aaa"));
-                assert_eq!(input_splitter.add_line_to_buffer(0, line), None);
-                assert_eq!(input_splitter.buffer_len(), 1);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((1, Ok(line))) => {
-                assert_eq!(line, String::from("bbb"));
-                assert_eq!(input_splitter.add_line_to_buffer(1, line), None);
-                assert_eq!(input_splitter.buffer_len(), 2);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((2, Ok(line))) => {
-                assert_eq!(line, String::from("ccc"));
-                assert_eq!(
-                    input_splitter.add_line_to_buffer(2, line),
-                    Some(String::from("aaa"))
-                );
-                assert_eq!(input_splitter.buffer_len(), 2);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        input_splitter.rewind_buffer();
-
-        match input_splitter.next() {
-            Some((1, Ok(line))) => {
-                assert_eq!(line, String::from("bbb"));
-                assert_eq!(input_splitter.buffer_len(), 1);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((2, Ok(line))) => {
-                assert_eq!(line, String::from("ccc"));
-                assert_eq!(input_splitter.buffer_len(), 0);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((3, Ok(line))) => {
-                assert_eq!(line, String::from("ddd"));
-                assert_eq!(input_splitter.buffer_len(), 0);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        assert!(input_splitter.next().is_none());
-    }
-
-    #[test]
-    fn input_splitter_interrupt_rewind() {
-        let input = vec![
-            Ok(String::from("aaa")),
-            Ok(String::from("bbb")),
-            Ok(String::from("ccc")),
-            Ok(String::from("ddd")),
-        ];
-        let mut input_splitter = InputSplitter::new(input.into_iter().enumerate());
-
-        input_splitter.set_size_of_buffer(3);
-        assert_eq!(input_splitter.buffer_len(), 0);
-
-        match input_splitter.next() {
-            Some((0, Ok(line))) => {
-                assert_eq!(line, String::from("aaa"));
-                assert_eq!(input_splitter.add_line_to_buffer(0, line), None);
-                assert_eq!(input_splitter.buffer_len(), 1);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((1, Ok(line))) => {
-                assert_eq!(line, String::from("bbb"));
-                assert_eq!(input_splitter.add_line_to_buffer(1, line), None);
-                assert_eq!(input_splitter.buffer_len(), 2);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((2, Ok(line))) => {
-                assert_eq!(line, String::from("ccc"));
-                assert_eq!(input_splitter.add_line_to_buffer(2, line), None);
-                assert_eq!(input_splitter.buffer_len(), 3);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        input_splitter.rewind_buffer();
-
-        match input_splitter.next() {
-            Some((0, Ok(line))) => {
-                assert_eq!(line, String::from("aaa"));
-                assert_eq!(input_splitter.add_line_to_buffer(0, line), None);
-                assert_eq!(input_splitter.buffer_len(), 3);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((0, Ok(line))) => {
-                assert_eq!(line, String::from("aaa"));
-                assert_eq!(input_splitter.buffer_len(), 2);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((1, Ok(line))) => {
-                assert_eq!(line, String::from("bbb"));
-                assert_eq!(input_splitter.buffer_len(), 1);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((2, Ok(line))) => {
-                assert_eq!(line, String::from("ccc"));
-                assert_eq!(input_splitter.buffer_len(), 0);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        match input_splitter.next() {
-            Some((3, Ok(line))) => {
-                assert_eq!(line, String::from("ddd"));
-                assert_eq!(input_splitter.buffer_len(), 0);
-            }
-            item => panic!("wrong item: {item:?}"),
-        };
-
-        assert!(input_splitter.next().is_none());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_csplit/csplit_error.rs.html b/coreutils/dev/src/uu_csplit/csplit_error.rs.html deleted file mode 100644 index 8976d5a37..000000000 --- a/coreutils/dev/src/uu_csplit/csplit_error.rs.html +++ /dev/null @@ -1,93 +0,0 @@ -csplit_error.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-
use std::io;
-use thiserror::Error;
-
-use uucore::display::Quotable;
-use uucore::error::UError;
-
-/// Errors thrown by the csplit command
-#[derive(Debug, Error)]
-pub enum CsplitError {
-    #[error("IO error: {}", _0)]
-    IoError(io::Error),
-    #[error("{}: line number out of range", ._0.quote())]
-    LineOutOfRange(String),
-    #[error("{}: line number out of range on repetition {}", ._0.quote(), _1)]
-    LineOutOfRangeOnRepetition(String, usize),
-    #[error("{}: match not found", ._0.quote())]
-    MatchNotFound(String),
-    #[error("{}: match not found on repetition {}", ._0.quote(), _1)]
-    MatchNotFoundOnRepetition(String, usize),
-    #[error("line number must be greater than zero")]
-    LineNumberIsZero,
-    #[error("line number '{}' is smaller than preceding line number, {}", _0, _1)]
-    LineNumberSmallerThanPrevious(usize, usize),
-    #[error("{}: invalid pattern", ._0.quote())]
-    InvalidPattern(String),
-    #[error("invalid number: {}", ._0.quote())]
-    InvalidNumber(String),
-    #[error("incorrect conversion specification in suffix")]
-    SuffixFormatIncorrect,
-    #[error("too many % conversion specifications in suffix")]
-    SuffixFormatTooManyPercents,
-    #[error("{} is not a regular file", ._0.quote())]
-    NotRegularFile(String),
-}
-
-impl From<io::Error> for CsplitError {
-    fn from(error: io::Error) -> Self {
-        Self::IoError(error)
-    }
-}
-
-impl UError for CsplitError {
-    fn code(&self) -> i32 {
-        1
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_csplit/patterns.rs.html b/coreutils/dev/src/uu_csplit/patterns.rs.html deleted file mode 100644 index 82be76e39..000000000 --- a/coreutils/dev/src/uu_csplit/patterns.rs.html +++ /dev/null @@ -1,701 +0,0 @@ -patterns.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-
// spell-checker:ignore (regex) SKIPTO UPTO ; (vars) ntimes
-
-use crate::csplit_error::CsplitError;
-use regex::Regex;
-use uucore::show_warning;
-
-/// The definition of a pattern to match on a line.
-#[derive(Debug)]
-pub enum Pattern {
-    /// Copy the file's content to a split up to, not including, the given line number. The number
-    /// of times the pattern is executed is detailed in [`ExecutePattern`].
-    UpToLine(usize, ExecutePattern),
-    /// Copy the file's content to a split up to, not including, the line matching the regex. The
-    /// integer is an offset relative to the matched line of what to include (if positive) or
-    /// to exclude (if negative). The number of times the pattern is executed is detailed in
-    /// [`ExecutePattern`].
-    UpToMatch(Regex, i32, ExecutePattern),
-    /// Skip the file's content up to, not including, the line matching the regex. The integer
-    /// is an offset relative to the matched line of what to include (if positive) or to exclude
-    /// (if negative). The number of times the pattern is executed is detailed in [`ExecutePattern`].
-    SkipToMatch(Regex, i32, ExecutePattern),
-}
-
-impl ToString for Pattern {
-    fn to_string(&self) -> String {
-        match self {
-            Self::UpToLine(n, _) => n.to_string(),
-            Self::UpToMatch(regex, 0, _) => format!("/{}/", regex.as_str()),
-            Self::UpToMatch(regex, offset, _) => format!("/{}/{:+}", regex.as_str(), offset),
-            Self::SkipToMatch(regex, 0, _) => format!("%{}%", regex.as_str()),
-            Self::SkipToMatch(regex, offset, _) => format!("%{}%{:+}", regex.as_str(), offset),
-        }
-    }
-}
-
-/// The number of times a pattern can be used.
-#[derive(Debug)]
-pub enum ExecutePattern {
-    /// Execute the pattern as many times as possible
-    Always,
-    /// Execute the pattern a fixed number of times
-    Times(usize),
-}
-
-impl ExecutePattern {
-    pub fn iter(&self) -> ExecutePatternIter {
-        match self {
-            Self::Times(n) => ExecutePatternIter::new(Some(*n)),
-            Self::Always => ExecutePatternIter::new(None),
-        }
-    }
-}
-
-pub struct ExecutePatternIter {
-    max: Option<usize>,
-    cur: usize,
-}
-
-impl ExecutePatternIter {
-    fn new(max: Option<usize>) -> Self {
-        Self { max, cur: 0 }
-    }
-}
-
-impl Iterator for ExecutePatternIter {
-    type Item = (Option<usize>, usize);
-
-    fn next(&mut self) -> Option<(Option<usize>, usize)> {
-        match self.max {
-            // iterate until m is reached
-            Some(m) => {
-                if self.cur == m {
-                    None
-                } else {
-                    self.cur += 1;
-                    Some((self.max, self.cur))
-                }
-            }
-            // no limit, just increment a counter
-            None => {
-                self.cur += 1;
-                Some((None, self.cur))
-            }
-        }
-    }
-}
-
-/// Parses the definitions of patterns given on the command line into a list of [`Pattern`]s.
-///
-/// # Errors
-///
-/// If a pattern is incorrect, a [`CsplitError::InvalidPattern`] error is returned, which may be
-/// due to, e.g.,:
-/// - an invalid regular expression;
-/// - an invalid number for, e.g., the offset.
-pub fn get_patterns(args: &[String]) -> Result<Vec<Pattern>, CsplitError> {
-    let patterns = extract_patterns(args)?;
-    validate_line_numbers(&patterns)?;
-    Ok(patterns)
-}
-
-fn extract_patterns(args: &[String]) -> Result<Vec<Pattern>, CsplitError> {
-    let mut patterns = Vec::with_capacity(args.len());
-    let to_match_reg =
-        Regex::new(r"^(/(?P<UPTO>.+)/|%(?P<SKIPTO>.+)%)(?P<OFFSET>[\+-]\d+)?$").unwrap();
-    let execute_ntimes_reg = Regex::new(r"^\{(?P<TIMES>\d+)|\*\}$").unwrap();
-    let mut iter = args.iter().peekable();
-
-    while let Some(arg) = iter.next() {
-        // get the number of times a pattern is repeated, which is at least once plus whatever is
-        // in the quantifier.
-        let execute_ntimes = match iter.peek() {
-            None => ExecutePattern::Times(1),
-            Some(&next_item) => {
-                match execute_ntimes_reg.captures(next_item) {
-                    None => ExecutePattern::Times(1),
-                    Some(r) => {
-                        // skip the next item
-                        iter.next();
-                        if let Some(times) = r.name("TIMES") {
-                            ExecutePattern::Times(times.as_str().parse::<usize>().unwrap() + 1)
-                        } else {
-                            ExecutePattern::Always
-                        }
-                    }
-                }
-            }
-        };
-
-        // get the pattern definition
-        if let Some(captures) = to_match_reg.captures(arg) {
-            let offset = match captures.name("OFFSET") {
-                None => 0,
-                Some(m) => m.as_str().parse().unwrap(),
-            };
-            if let Some(up_to_match) = captures.name("UPTO") {
-                let pattern = Regex::new(up_to_match.as_str())
-                    .map_err(|_| CsplitError::InvalidPattern(arg.to_string()))?;
-                patterns.push(Pattern::UpToMatch(pattern, offset, execute_ntimes));
-            } else if let Some(skip_to_match) = captures.name("SKIPTO") {
-                let pattern = Regex::new(skip_to_match.as_str())
-                    .map_err(|_| CsplitError::InvalidPattern(arg.to_string()))?;
-                patterns.push(Pattern::SkipToMatch(pattern, offset, execute_ntimes));
-            }
-        } else if let Ok(line_number) = arg.parse::<usize>() {
-            patterns.push(Pattern::UpToLine(line_number, execute_ntimes));
-        } else {
-            return Err(CsplitError::InvalidPattern(arg.to_string()));
-        }
-    }
-    Ok(patterns)
-}
-
-/// Asserts the line numbers are in increasing order, starting at 1.
-fn validate_line_numbers(patterns: &[Pattern]) -> Result<(), CsplitError> {
-    patterns
-        .iter()
-        .filter_map(|pattern| match pattern {
-            Pattern::UpToLine(line_number, _) => Some(line_number),
-            _ => None,
-        })
-        .try_fold(0, |prev_ln, &current_ln| match (prev_ln, current_ln) {
-            // a line number cannot be zero
-            (_, 0) => Err(CsplitError::LineNumberIsZero),
-            // two consecutive numbers should not be equal
-            (n, m) if n == m => {
-                show_warning!("line number '{}' is the same as preceding line number", n);
-                Ok(n)
-            }
-            // a number cannot be greater than the one that follows
-            (n, m) if n > m => Err(CsplitError::LineNumberSmallerThanPrevious(m, n)),
-            (_, m) => Ok(m),
-        })?;
-    Ok(())
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    fn bad_pattern() {
-        let input = vec!["bad".to_string()];
-        assert!(get_patterns(input.as_slice()).is_err());
-    }
-
-    #[test]
-    fn up_to_line_pattern() {
-        let input: Vec<String> = vec!["24", "42", "{*}", "50", "{4}"]
-            .into_iter()
-            .map(|v| v.to_string())
-            .collect();
-        let patterns = get_patterns(input.as_slice()).unwrap();
-        assert_eq!(patterns.len(), 3);
-        match patterns.get(0) {
-            Some(Pattern::UpToLine(24, ExecutePattern::Times(1))) => (),
-            _ => panic!("expected UpToLine pattern"),
-        };
-        match patterns.get(1) {
-            Some(Pattern::UpToLine(42, ExecutePattern::Always)) => (),
-            _ => panic!("expected UpToLine pattern"),
-        };
-        match patterns.get(2) {
-            Some(Pattern::UpToLine(50, ExecutePattern::Times(5))) => (),
-            _ => panic!("expected UpToLine pattern"),
-        };
-    }
-
-    #[test]
-    fn up_to_match_pattern() {
-        let input: Vec<String> = vec![
-            "/test1.*end$/",
-            "/test2.*end$/",
-            "{*}",
-            "/test3.*end$/",
-            "{4}",
-            "/test4.*end$/+3",
-            "/test5.*end$/-3",
-        ]
-        .into_iter()
-        .map(|v| v.to_string())
-        .collect();
-        let patterns = get_patterns(input.as_slice()).unwrap();
-        assert_eq!(patterns.len(), 5);
-        match patterns.get(0) {
-            Some(Pattern::UpToMatch(reg, 0, ExecutePattern::Times(1))) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test1.*end$");
-            }
-            _ => panic!("expected UpToMatch pattern"),
-        };
-        match patterns.get(1) {
-            Some(Pattern::UpToMatch(reg, 0, ExecutePattern::Always)) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test2.*end$");
-            }
-            _ => panic!("expected UpToMatch pattern"),
-        };
-        match patterns.get(2) {
-            Some(Pattern::UpToMatch(reg, 0, ExecutePattern::Times(5))) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test3.*end$");
-            }
-            _ => panic!("expected UpToMatch pattern"),
-        };
-        match patterns.get(3) {
-            Some(Pattern::UpToMatch(reg, 3, ExecutePattern::Times(1))) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test4.*end$");
-            }
-            _ => panic!("expected UpToMatch pattern"),
-        };
-        match patterns.get(4) {
-            Some(Pattern::UpToMatch(reg, -3, ExecutePattern::Times(1))) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test5.*end$");
-            }
-            _ => panic!("expected UpToMatch pattern"),
-        };
-    }
-
-    #[test]
-    fn skip_to_match_pattern() {
-        let input: Vec<String> = vec![
-            "%test1.*end$%",
-            "%test2.*end$%",
-            "{*}",
-            "%test3.*end$%",
-            "{4}",
-            "%test4.*end$%+3",
-            "%test5.*end$%-3",
-        ]
-        .into_iter()
-        .map(|v| v.to_string())
-        .collect();
-        let patterns = get_patterns(input.as_slice()).unwrap();
-        assert_eq!(patterns.len(), 5);
-        match patterns.get(0) {
-            Some(Pattern::SkipToMatch(reg, 0, ExecutePattern::Times(1))) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test1.*end$");
-            }
-            _ => panic!("expected SkipToMatch pattern"),
-        };
-        match patterns.get(1) {
-            Some(Pattern::SkipToMatch(reg, 0, ExecutePattern::Always)) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test2.*end$");
-            }
-            _ => panic!("expected SkipToMatch pattern"),
-        };
-        match patterns.get(2) {
-            Some(Pattern::SkipToMatch(reg, 0, ExecutePattern::Times(5))) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test3.*end$");
-            }
-            _ => panic!("expected SkipToMatch pattern"),
-        };
-        match patterns.get(3) {
-            Some(Pattern::SkipToMatch(reg, 3, ExecutePattern::Times(1))) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test4.*end$");
-            }
-            _ => panic!("expected SkipToMatch pattern"),
-        };
-        match patterns.get(4) {
-            Some(Pattern::SkipToMatch(reg, -3, ExecutePattern::Times(1))) => {
-                let parsed_reg = format!("{reg}");
-                assert_eq!(parsed_reg, "test5.*end$");
-            }
-            _ => panic!("expected SkipToMatch pattern"),
-        };
-    }
-
-    #[test]
-    fn line_number_zero() {
-        let patterns = vec![Pattern::UpToLine(0, ExecutePattern::Times(1))];
-        match validate_line_numbers(&patterns) {
-            Err(CsplitError::LineNumberIsZero) => (),
-            _ => panic!("expected LineNumberIsZero error"),
-        }
-    }
-
-    #[test]
-    fn line_number_smaller_than_previous() {
-        let input: Vec<String> = vec!["10".to_string(), "5".to_string()];
-        match get_patterns(input.as_slice()) {
-            Err(CsplitError::LineNumberSmallerThanPrevious(5, 10)) => (),
-            _ => panic!("expected LineNumberSmallerThanPrevious error"),
-        }
-    }
-
-    #[test]
-    fn line_number_smaller_than_previous_separate() {
-        let input: Vec<String> = vec!["10".to_string(), "/20/".to_string(), "5".to_string()];
-        match get_patterns(input.as_slice()) {
-            Err(CsplitError::LineNumberSmallerThanPrevious(5, 10)) => (),
-            _ => panic!("expected LineNumberSmallerThanPrevious error"),
-        }
-    }
-
-    #[test]
-    fn line_number_zero_separate() {
-        let input: Vec<String> = vec!["10".to_string(), "/20/".to_string(), "0".to_string()];
-        match get_patterns(input.as_slice()) {
-            Err(CsplitError::LineNumberIsZero) => (),
-            _ => panic!("expected LineNumberIsZero error"),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_csplit/split_name.rs.html b/coreutils/dev/src/uu_csplit/split_name.rs.html deleted file mode 100644 index 763082a1d..000000000 --- a/coreutils/dev/src/uu_csplit/split_name.rs.html +++ /dev/null @@ -1,675 +0,0 @@ -split_name.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-
// spell-checker:ignore (regex) diuox
-
-use regex::Regex;
-
-use crate::csplit_error::CsplitError;
-
-/// Computes the filename of a split, taking into consideration a possible user-defined suffix
-/// format.
-pub struct SplitName {
-    fn_split_name: Box<dyn Fn(usize) -> String>,
-}
-
-impl SplitName {
-    /// Creates a new SplitName with the given user-defined options:
-    /// - `prefix_opt` specifies a prefix for all splits.
-    /// - `format_opt` specifies a custom format for the suffix part of the filename, using the
-    /// `sprintf` format notation.
-    /// - `n_digits_opt` defines the width of the split number.
-    ///
-    /// # Caveats
-    ///
-    /// If `prefix_opt` and `format_opt` are defined, and the `format_opt` has some string appearing
-    /// before the conversion pattern (e.g., "here-%05d"), then it is appended to the passed prefix
-    /// via `prefix_opt`.
-    ///
-    /// If `n_digits_opt` and `format_opt` are defined, then width defined in `format_opt` is
-    /// taken.
-    pub fn new(
-        prefix_opt: Option<String>,
-        format_opt: Option<String>,
-        n_digits_opt: Option<String>,
-    ) -> Result<Self, CsplitError> {
-        // get the prefix
-        let prefix = prefix_opt.unwrap_or_else(|| "xx".to_string());
-        // the width for the split offset
-        let n_digits = n_digits_opt
-            .map(|opt| {
-                opt.parse::<usize>()
-                    .map_err(|_| CsplitError::InvalidNumber(opt))
-            })
-            .transpose()?
-            .unwrap_or(2);
-        // translate the custom format into a function
-        let fn_split_name: Box<dyn Fn(usize) -> String> = match format_opt {
-            None => Box::new(move |n: usize| -> String { format!("{prefix}{n:0n_digits$}") }),
-            Some(custom) => {
-                let spec =
-                    Regex::new(r"(?P<ALL>%((?P<FLAG>[0#-])(?P<WIDTH>\d+)?)?(?P<TYPE>[diuoxX]))")
-                        .unwrap();
-                let mut captures_iter = spec.captures_iter(&custom);
-                let custom_fn: Box<dyn Fn(usize) -> String> = match captures_iter.next() {
-                    Some(captures) => {
-                        let all = captures.name("ALL").unwrap();
-                        let before = custom[0..all.start()].to_owned();
-                        let after = custom[all.end()..].to_owned();
-                        let width = match captures.name("WIDTH") {
-                            None => 0,
-                            Some(m) => m.as_str().parse::<usize>().unwrap(),
-                        };
-                        match (captures.name("FLAG"), captures.name("TYPE")) {
-                            (None, Some(ref t)) => match t.as_str() {
-                                "d" | "i" | "u" => Box::new(move |n: usize| -> String {
-                                    format!("{prefix}{before}{n}{after}")
-                                }),
-                                "o" => Box::new(move |n: usize| -> String {
-                                    format!("{prefix}{before}{n:o}{after}")
-                                }),
-                                "x" => Box::new(move |n: usize| -> String {
-                                    format!("{prefix}{before}{n:x}{after}")
-                                }),
-                                "X" => Box::new(move |n: usize| -> String {
-                                    format!("{prefix}{before}{n:X}{after}")
-                                }),
-                                _ => return Err(CsplitError::SuffixFormatIncorrect),
-                            },
-                            (Some(ref f), Some(ref t)) => {
-                                match (f.as_str(), t.as_str()) {
-                                    /*
-                                     * zero padding
-                                     */
-                                    // decimal
-                                    ("0", "d" | "i" | "u") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:0width$}{after}")
-                                    }),
-                                    // octal
-                                    ("0", "o") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:0width$o}{after}")
-                                    }),
-                                    // lower hexadecimal
-                                    ("0", "x") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:0width$x}{after}")
-                                    }),
-                                    // upper hexadecimal
-                                    ("0", "X") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:0width$X}{after}")
-                                    }),
-
-                                    /*
-                                     * Alternate form
-                                     */
-                                    // octal
-                                    ("#", "o") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:>#width$o}{after}")
-                                    }),
-                                    // lower hexadecimal
-                                    ("#", "x") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:>#width$x}{after}")
-                                    }),
-                                    // upper hexadecimal
-                                    ("#", "X") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:>#width$X}{after}")
-                                    }),
-
-                                    /*
-                                     * Left adjusted
-                                     */
-                                    // decimal
-                                    ("-", "d" | "i" | "u") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:<#width$}{after}")
-                                    }),
-                                    // octal
-                                    ("-", "o") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:<#width$o}{after}")
-                                    }),
-                                    // lower hexadecimal
-                                    ("-", "x") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:<#width$x}{after}")
-                                    }),
-                                    // upper hexadecimal
-                                    ("-", "X") => Box::new(move |n: usize| -> String {
-                                        format!("{prefix}{before}{n:<#width$X}{after}")
-                                    }),
-
-                                    _ => return Err(CsplitError::SuffixFormatIncorrect),
-                                }
-                            }
-                            _ => return Err(CsplitError::SuffixFormatIncorrect),
-                        }
-                    }
-                    None => return Err(CsplitError::SuffixFormatIncorrect),
-                };
-
-                // there cannot be more than one format pattern
-                if captures_iter.next().is_some() {
-                    return Err(CsplitError::SuffixFormatTooManyPercents);
-                }
-                custom_fn
-            }
-        };
-
-        Ok(Self { fn_split_name })
-    }
-
-    /// Returns the filename of the i-th split.
-    pub fn get(&self, n: usize) -> String {
-        (self.fn_split_name)(n)
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    // spell-checker:ignore (path) xxcst
-
-    use super::*;
-
-    #[test]
-    fn invalid_number() {
-        let split_name = SplitName::new(None, None, Some(String::from("bad")));
-        match split_name {
-            Err(CsplitError::InvalidNumber(_)) => (),
-            _ => panic!("should fail with InvalidNumber"),
-        };
-    }
-
-    #[test]
-    fn invalid_suffix_format1() {
-        let split_name = SplitName::new(None, Some(String::from("no conversion string")), None);
-        match split_name {
-            Err(CsplitError::SuffixFormatIncorrect) => (),
-            _ => panic!("should fail with SuffixFormatIncorrect"),
-        };
-    }
-
-    #[test]
-    fn invalid_suffix_format2() {
-        let split_name = SplitName::new(None, Some(String::from("%042a")), None);
-        match split_name {
-            Err(CsplitError::SuffixFormatIncorrect) => (),
-            _ => panic!("should fail with SuffixFormatIncorrect"),
-        };
-    }
-
-    #[test]
-    fn default_formatter() {
-        let split_name = SplitName::new(None, None, None).unwrap();
-        assert_eq!(split_name.get(2), "xx02");
-    }
-
-    #[test]
-    fn default_formatter_with_prefix() {
-        let split_name = SplitName::new(Some(String::from("aaa")), None, None).unwrap();
-        assert_eq!(split_name.get(2), "aaa02");
-    }
-
-    #[test]
-    fn default_formatter_with_width() {
-        let split_name = SplitName::new(None, None, Some(String::from("5"))).unwrap();
-        assert_eq!(split_name.get(2), "xx00002");
-    }
-
-    #[test]
-    fn no_padding_decimal() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%d-")), None).unwrap();
-        assert_eq!(split_name.get(2), "xxcst-2-");
-    }
-
-    #[test]
-    fn zero_padding_decimal1() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%03d-")), None).unwrap();
-        assert_eq!(split_name.get(2), "xxcst-002-");
-    }
-
-    #[test]
-    fn zero_padding_decimal2() {
-        let split_name = SplitName::new(
-            Some(String::from("pre-")),
-            Some(String::from("cst-%03d-post")),
-            None,
-        )
-        .unwrap();
-        assert_eq!(split_name.get(2), "pre-cst-002-post");
-    }
-
-    #[test]
-    fn zero_padding_decimal3() {
-        let split_name = SplitName::new(
-            None,
-            Some(String::from("cst-%03d-")),
-            Some(String::from("42")),
-        )
-        .unwrap();
-        assert_eq!(split_name.get(2), "xxcst-002-");
-    }
-
-    #[test]
-    fn zero_padding_decimal4() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%03i-")), None).unwrap();
-        assert_eq!(split_name.get(2), "xxcst-002-");
-    }
-
-    #[test]
-    fn zero_padding_decimal5() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%03u-")), None).unwrap();
-        assert_eq!(split_name.get(2), "xxcst-002-");
-    }
-
-    #[test]
-    fn zero_padding_octal() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%03o-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-052-");
-    }
-
-    #[test]
-    fn zero_padding_lower_hex() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%03x-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-02a-");
-    }
-
-    #[test]
-    fn zero_padding_upper_hex() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%03X-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-02A-");
-    }
-
-    #[test]
-    fn alternate_form_octal() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%#10o-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-      0o52-");
-    }
-
-    #[test]
-    fn alternate_form_lower_hex() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%#10x-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-      0x2a-");
-    }
-
-    #[test]
-    fn alternate_form_upper_hex() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%#10X-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-      0x2A-");
-    }
-
-    #[test]
-    fn left_adjusted_decimal1() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%-10d-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-42        -");
-    }
-
-    #[test]
-    fn left_adjusted_decimal2() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%-10i-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-42        -");
-    }
-
-    #[test]
-    fn left_adjusted_decimal3() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%-10u-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-42        -");
-    }
-
-    #[test]
-    fn left_adjusted_octal() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%-10o-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-0o52      -");
-    }
-
-    #[test]
-    fn left_adjusted_lower_hex() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%-10x-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-0x2a      -");
-    }
-
-    #[test]
-    fn left_adjusted_upper_hex() {
-        let split_name = SplitName::new(None, Some(String::from("cst-%-10X-")), None).unwrap();
-        assert_eq!(split_name.get(42), "xxcst-0x2A      -");
-    }
-
-    #[test]
-    fn too_many_percent() {
-        let split_name = SplitName::new(None, Some(String::from("%02d-%-3x")), None);
-        match split_name {
-            Err(CsplitError::SuffixFormatTooManyPercents) => (),
-            _ => panic!("should fail with SuffixFormatTooManyPercents"),
-        };
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cut/cut.rs.html b/coreutils/dev/src/uu_cut/cut.rs.html deleted file mode 100644 index 9fd190aab..000000000 --- a/coreutils/dev/src/uu_cut/cut.rs.html +++ /dev/null @@ -1,1173 +0,0 @@ -cut.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-
// This file is part of the uutils coreutils package.
-//
-// (c) Rolf Morel <rolfmorel@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) delim sourcefiles
-
-use bstr::io::BufReadExt;
-use clap::{crate_version, Arg, ArgAction, Command};
-use is_terminal::IsTerminal;
-use std::fs::File;
-use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write};
-use std::path::Path;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::line_ending::LineEnding;
-
-use self::searcher::Searcher;
-use matcher::{ExactMatcher, Matcher, WhitespaceMatcher};
-use uucore::ranges::Range;
-use uucore::{format_usage, help_about, help_section, help_usage, show, show_error, show_if_err};
-
-mod matcher;
-mod searcher;
-
-const USAGE: &str = help_usage!("cut.md");
-const ABOUT: &str = help_about!("cut.md");
-const AFTER_HELP: &str = help_section!("after help", "cut.md");
-
-struct Options {
-    out_delim: Option<String>,
-    line_ending: LineEnding,
-}
-
-enum Delimiter {
-    Whitespace,
-    String(String), // FIXME: use char?
-}
-
-struct FieldOptions {
-    delimiter: Delimiter,
-    out_delimiter: Option<String>,
-    only_delimited: bool,
-    line_ending: LineEnding,
-}
-
-enum Mode {
-    Bytes(Vec<Range>, Options),
-    Characters(Vec<Range>, Options),
-    Fields(Vec<Range>, FieldOptions),
-}
-
-fn stdout_writer() -> Box<dyn Write> {
-    if std::io::stdout().is_terminal() {
-        Box::new(stdout())
-    } else {
-        Box::new(BufWriter::new(stdout())) as Box<dyn Write>
-    }
-}
-
-fn list_to_ranges(list: &str, complement: bool) -> Result<Vec<Range>, String> {
-    if complement {
-        Range::from_list(list).map(|r| uucore::ranges::complement(&r))
-    } else {
-        Range::from_list(list)
-    }
-}
-
-fn cut_bytes<R: Read>(reader: R, ranges: &[Range], opts: &Options) -> UResult<()> {
-    let newline_char = opts.line_ending.into();
-    let mut buf_in = BufReader::new(reader);
-    let mut out = stdout_writer();
-    let delim = opts
-        .out_delim
-        .as_ref()
-        .map_or("", String::as_str)
-        .as_bytes();
-
-    let result = buf_in.for_byte_record(newline_char, |line| {
-        let mut print_delim = false;
-        for &Range { low, high } in ranges {
-            if low > line.len() {
-                break;
-            }
-            if print_delim {
-                out.write_all(delim)?;
-            } else if opts.out_delim.is_some() {
-                print_delim = true;
-            }
-            // change `low` from 1-indexed value to 0-index value
-            let low = low - 1;
-            let high = high.min(line.len());
-            out.write_all(&line[low..high])?;
-        }
-        out.write_all(&[newline_char])?;
-        Ok(true)
-    });
-
-    if let Err(e) = result {
-        return Err(USimpleError::new(1, e.to_string()));
-    }
-
-    Ok(())
-}
-
-// Output delimiter is explicitly specified
-fn cut_fields_explicit_out_delim<R: Read, M: Matcher>(
-    reader: R,
-    matcher: &M,
-    ranges: &[Range],
-    only_delimited: bool,
-    newline_char: u8,
-    out_delim: &str,
-) -> UResult<()> {
-    let mut buf_in = BufReader::new(reader);
-    let mut out = stdout_writer();
-
-    let result = buf_in.for_byte_record_with_terminator(newline_char, |line| {
-        let mut fields_pos = 1;
-        let mut low_idx = 0;
-        let mut delim_search = Searcher::new(matcher, line).peekable();
-        let mut print_delim = false;
-
-        if delim_search.peek().is_none() {
-            if !only_delimited {
-                out.write_all(line)?;
-                if line[line.len() - 1] != newline_char {
-                    out.write_all(&[newline_char])?;
-                }
-            }
-
-            return Ok(true);
-        }
-
-        for &Range { low, high } in ranges {
-            if low - fields_pos > 0 {
-                // current field is not in the range, so jump to the field corresponding to the
-                // beginning of the range if any
-                low_idx = match delim_search.nth(low - fields_pos - 1) {
-                    Some((_, last)) => last,
-                    None => break,
-                };
-            }
-
-            // at this point, current field is the first in the range
-            for _ in 0..=high - low {
-                // skip printing delimiter if this is the first matching field for this line
-                if print_delim {
-                    out.write_all(out_delim.as_bytes())?;
-                } else {
-                    print_delim = true;
-                }
-
-                match delim_search.next() {
-                    // print the current field up to the next field delim
-                    Some((first, last)) => {
-                        let segment = &line[low_idx..first];
-
-                        out.write_all(segment)?;
-
-                        low_idx = last;
-                        fields_pos = high + 1;
-                    }
-                    None => {
-                        // this is the last field in the line, so print the rest
-                        let segment = &line[low_idx..];
-
-                        out.write_all(segment)?;
-
-                        if line[line.len() - 1] == newline_char {
-                            return Ok(true);
-                        }
-                        break;
-                    }
-                }
-            }
-        }
-
-        out.write_all(&[newline_char])?;
-        Ok(true)
-    });
-
-    if let Err(e) = result {
-        return Err(USimpleError::new(1, e.to_string()));
-    }
-
-    Ok(())
-}
-
-// Output delimiter is the same as input delimiter
-fn cut_fields_implicit_out_delim<R: Read, M: Matcher>(
-    reader: R,
-    matcher: &M,
-    ranges: &[Range],
-    only_delimited: bool,
-    newline_char: u8,
-) -> UResult<()> {
-    let mut buf_in = BufReader::new(reader);
-    let mut out = stdout_writer();
-
-    let result = buf_in.for_byte_record_with_terminator(newline_char, |line| {
-        let mut fields_pos = 1;
-        let mut low_idx = 0;
-        let mut delim_search = Searcher::new(matcher, line).peekable();
-        let mut print_delim = false;
-
-        if delim_search.peek().is_none() {
-            if !only_delimited {
-                out.write_all(line)?;
-                if line[line.len() - 1] != newline_char {
-                    out.write_all(&[newline_char])?;
-                }
-            }
-
-            return Ok(true);
-        }
-
-        for &Range { low, high } in ranges {
-            if low - fields_pos > 0 {
-                if let Some((first, last)) = delim_search.nth(low - fields_pos - 1) {
-                    low_idx = if print_delim { first } else { last }
-                } else {
-                    break;
-                }
-            }
-
-            match delim_search.nth(high - low) {
-                Some((first, _)) => {
-                    let segment = &line[low_idx..first];
-
-                    out.write_all(segment)?;
-
-                    print_delim = true;
-                    low_idx = first;
-                    fields_pos = high + 1;
-                }
-                None => {
-                    let segment = &line[low_idx..line.len()];
-
-                    out.write_all(segment)?;
-
-                    if line[line.len() - 1] == newline_char {
-                        return Ok(true);
-                    }
-                    break;
-                }
-            }
-        }
-        out.write_all(&[newline_char])?;
-        Ok(true)
-    });
-
-    if let Err(e) = result {
-        return Err(USimpleError::new(1, e.to_string()));
-    }
-
-    Ok(())
-}
-
-fn cut_fields<R: Read>(reader: R, ranges: &[Range], opts: &FieldOptions) -> UResult<()> {
-    let newline_char = opts.line_ending.into();
-    match opts.delimiter {
-        Delimiter::String(ref delim) => {
-            let matcher = ExactMatcher::new(delim.as_bytes());
-            match opts.out_delimiter {
-                Some(ref out_delim) => cut_fields_explicit_out_delim(
-                    reader,
-                    &matcher,
-                    ranges,
-                    opts.only_delimited,
-                    newline_char,
-                    out_delim,
-                ),
-                None => cut_fields_implicit_out_delim(
-                    reader,
-                    &matcher,
-                    ranges,
-                    opts.only_delimited,
-                    newline_char,
-                ),
-            }
-        }
-        Delimiter::Whitespace => {
-            let matcher = WhitespaceMatcher {};
-            let out_delim = opts.out_delimiter.as_deref().unwrap_or("\t");
-            cut_fields_explicit_out_delim(
-                reader,
-                &matcher,
-                ranges,
-                opts.only_delimited,
-                newline_char,
-                out_delim,
-            )
-        }
-    }
-}
-
-fn cut_files(mut filenames: Vec<String>, mode: &Mode) {
-    let mut stdin_read = false;
-
-    if filenames.is_empty() {
-        filenames.push("-".to_owned());
-    }
-
-    for filename in &filenames {
-        if filename == "-" {
-            if stdin_read {
-                continue;
-            }
-
-            show_if_err!(match mode {
-                Mode::Bytes(ref ranges, ref opts) => cut_bytes(stdin(), ranges, opts),
-                Mode::Characters(ref ranges, ref opts) => cut_bytes(stdin(), ranges, opts),
-                Mode::Fields(ref ranges, ref opts) => cut_fields(stdin(), ranges, opts),
-            });
-
-            stdin_read = true;
-        } else {
-            let path = Path::new(&filename[..]);
-
-            if path.is_dir() {
-                show_error!("{}: Is a directory", filename.maybe_quote());
-                continue;
-            }
-
-            show_if_err!(File::open(path)
-                .map_err_context(|| filename.maybe_quote().to_string())
-                .and_then(|file| {
-                    match &mode {
-                        Mode::Bytes(ranges, opts) | Mode::Characters(ranges, opts) => {
-                            cut_bytes(file, ranges, opts)
-                        }
-                        Mode::Fields(ranges, opts) => cut_fields(file, ranges, opts),
-                    }
-                }));
-        }
-    }
-}
-
-mod options {
-    pub const BYTES: &str = "bytes";
-    pub const CHARACTERS: &str = "characters";
-    pub const DELIMITER: &str = "delimiter";
-    pub const FIELDS: &str = "fields";
-    pub const ZERO_TERMINATED: &str = "zero-terminated";
-    pub const ONLY_DELIMITED: &str = "only-delimited";
-    pub const OUTPUT_DELIMITER: &str = "output-delimiter";
-    pub const WHITESPACE_DELIMITED: &str = "whitespace-delimited";
-    pub const COMPLEMENT: &str = "complement";
-    pub const FILE: &str = "file";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let delimiter_is_equal = args.contains(&"-d=".to_string()); // special case
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let complement = matches.get_flag(options::COMPLEMENT);
-
-    let mode_parse = match (
-        matches.get_one::<String>(options::BYTES),
-        matches.get_one::<String>(options::CHARACTERS),
-        matches.get_one::<String>(options::FIELDS),
-    ) {
-        (Some(byte_ranges), None, None) => list_to_ranges(byte_ranges, complement).map(|ranges| {
-            Mode::Bytes(
-                ranges,
-                Options {
-                    out_delim: Some(
-                        matches
-                            .get_one::<String>(options::OUTPUT_DELIMITER)
-                            .map(|s| s.as_str())
-                            .unwrap_or_default()
-                            .to_owned(),
-                    ),
-                    line_ending: LineEnding::from_zero_flag(matches.get_flag(options::ZERO_TERMINATED)),
-                },
-            )
-        }),
-        (None, Some(char_ranges), None) => list_to_ranges(char_ranges, complement).map(|ranges| {
-            Mode::Characters(
-                ranges,
-                Options {
-                    out_delim: Some(
-                        matches
-                            .get_one::<String>(options::OUTPUT_DELIMITER)
-                            .map(|s| s.as_str())
-                            .unwrap_or_default()
-                            .to_owned(),
-                    ),
-                    line_ending: LineEnding::from_zero_flag(matches.get_flag(options::ZERO_TERMINATED)),
-                },
-            )
-        }),
-        (None, None, Some(field_ranges)) => {
-            list_to_ranges(field_ranges, complement).and_then(|ranges| {
-                let out_delim = match matches.get_one::<String>(options::OUTPUT_DELIMITER) {
-                    Some(s) => {
-                        if s.is_empty() {
-                            Some("\0".to_owned())
-                        } else {
-                            Some(s.to_owned())
-                        }
-                    }
-                    None => None,
-                };
-
-                let only_delimited = matches.get_flag(options::ONLY_DELIMITED);
-                let whitespace_delimited = matches.get_flag(options::WHITESPACE_DELIMITED);
-                let zero_terminated = matches.get_flag(options::ZERO_TERMINATED);
-                let line_ending = LineEnding::from_zero_flag(zero_terminated);
-
-                match matches.get_one::<String>(options::DELIMITER).map(|s| s.as_str()) {
-                    Some(_) if whitespace_delimited => {
-                            Err("invalid input: Only one of --delimiter (-d) or -w option can be specified".into())
-                        }
-                    Some(mut delim) => {
-                        // GNU's `cut` supports `-d=` to set the delimiter to `=`.
-                        // Clap parsing is limited in this situation, see:
-                        // https://github.com/uutils/coreutils/issues/2424#issuecomment-863825242
-                        if delimiter_is_equal {
-                            delim = "=";
-                        } else if delim == "''" {
-                            // treat `''` as empty delimiter
-                            delim = "";
-                        }
-                        if delim.chars().count() > 1 {
-                            Err("invalid input: The '--delimiter' ('-d') option expects empty or 1 character long, but was provided a value 2 characters or longer".into())
-                        } else {
-                            let delim = if delim.is_empty() {
-                                "\0".to_owned()
-                            } else {
-                                delim.to_owned()
-                            };
-
-                            Ok(Mode::Fields(
-                                ranges,
-                                FieldOptions {
-                                    delimiter: Delimiter::String(delim),
-                                    out_delimiter: out_delim,
-                                    only_delimited,
-                                    line_ending,
-                                },
-                            ))
-                        }
-                    }
-                    None => Ok(Mode::Fields(
-                        ranges,
-                        FieldOptions {
-                            delimiter: match whitespace_delimited {
-                                true => Delimiter::Whitespace,
-                                false => Delimiter::String("\t".to_owned()),
-                            },
-                            out_delimiter: out_delim,
-                            only_delimited,
-                            line_ending,
-                        },
-                    )),
-                }
-            })
-        }
-        (ref b, ref c, ref f) if b.is_some() || c.is_some() || f.is_some() => Err(
-            "invalid usage: expects no more than one of --fields (-f), --chars (-c) or --bytes (-b)".into()
-        ),
-        _ => Err("invalid usage: expects one of --fields (-f), --chars (-c) or --bytes (-b)".into()),
-    };
-
-    let mode_parse = match mode_parse {
-        Err(_) => mode_parse,
-        Ok(mode) => match mode {
-            Mode::Bytes(_, _) | Mode::Characters(_, _)
-                if matches.contains_id(options::DELIMITER) =>
-            {
-                Err("invalid input: The '--delimiter' ('-d') option only usable if printing a sequence of fields".into())
-            }
-            Mode::Bytes(_, _) | Mode::Characters(_, _)
-                if matches.get_flag(options::WHITESPACE_DELIMITED) =>
-            {
-                Err("invalid input: The '-w' option only usable if printing a sequence of fields".into())
-            }
-            Mode::Bytes(_, _) | Mode::Characters(_, _)
-                if matches.get_flag(options::ONLY_DELIMITED) =>
-            {
-                Err("invalid input: The '--only-delimited' ('-s') option only usable if printing a sequence of fields".into())
-            }
-            _ => Ok(mode),
-        },
-    };
-
-    let files: Vec<String> = matches
-        .get_many::<String>(options::FILE)
-        .unwrap_or_default()
-        .map(|s| s.to_owned())
-        .collect();
-
-    match mode_parse {
-        Ok(mode) => {
-            cut_files(files, &mode);
-            Ok(())
-        }
-        Err(e) => Err(USimpleError::new(1, e)),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::BYTES)
-                .short('b')
-                .long(options::BYTES)
-                .help("filter byte columns from the input source")
-                .allow_hyphen_values(true)
-                .value_name("LIST"),
-        )
-        .arg(
-            Arg::new(options::CHARACTERS)
-                .short('c')
-                .long(options::CHARACTERS)
-                .help("alias for character mode")
-                .allow_hyphen_values(true)
-                .value_name("LIST"),
-        )
-        .arg(
-            Arg::new(options::DELIMITER)
-                .short('d')
-                .long(options::DELIMITER)
-                .help("specify the delimiter character that separates fields in the input source. Defaults to Tab.")
-                .value_name("DELIM"),
-        )
-        .arg(
-            Arg::new(options::WHITESPACE_DELIMITED)
-                .short('w')
-                .help("Use any number of whitespace (Space, Tab) to separate fields in the input source (FreeBSD extension).")
-                .value_name("WHITESPACE")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FIELDS)
-                .short('f')
-                .long(options::FIELDS)
-                .help("filter field columns from the input source")
-                .allow_hyphen_values(true)
-                .value_name("LIST"),
-        )
-        .arg(
-            Arg::new(options::COMPLEMENT)
-                .long(options::COMPLEMENT)
-                .help("invert the filter - instead of displaying only the filtered columns, display all but those columns")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ONLY_DELIMITED)
-                .short('s')
-                .long(options::ONLY_DELIMITED)
-                .help("in field mode, only print lines which contain the delimiter")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ZERO_TERMINATED)
-                .short('z')
-                .long(options::ZERO_TERMINATED)
-                .help("instead of filtering columns based on line, filter columns based on \\0 (NULL character)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OUTPUT_DELIMITER)
-                .long(options::OUTPUT_DELIMITER)
-                .help("in field mode, replace the delimiter in output lines with this option's argument")
-                .value_name("NEW_DELIM"),
-        )
-        .arg(
-            Arg::new(options::FILE)
-            .hide(true)
-            .action(ArgAction::Append)
-            .value_hint(clap::ValueHint::FilePath)
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cut/matcher.rs.html b/coreutils/dev/src/uu_cut/matcher.rs.html deleted file mode 100644 index 0b4177ed4..000000000 --- a/coreutils/dev/src/uu_cut/matcher.rs.html +++ /dev/null @@ -1,253 +0,0 @@ -matcher.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-
// This file is part of the uutils coreutils package.
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-use memchr::{memchr, memchr2};
-
-// Find the next matching byte sequence positions
-// Return (first, last) where haystack[first..last] corresponds to the matched pattern
-pub trait Matcher {
-    fn next_match(&self, haystack: &[u8]) -> Option<(usize, usize)>;
-}
-
-// Matches for the exact byte sequence pattern
-pub struct ExactMatcher<'a> {
-    needle: &'a [u8],
-}
-
-impl<'a> ExactMatcher<'a> {
-    pub fn new(needle: &'a [u8]) -> Self {
-        assert!(!needle.is_empty());
-        Self { needle }
-    }
-}
-
-impl<'a> Matcher for ExactMatcher<'a> {
-    fn next_match(&self, haystack: &[u8]) -> Option<(usize, usize)> {
-        let mut pos = 0usize;
-        loop {
-            match memchr(self.needle[0], &haystack[pos..]) {
-                Some(match_idx) => {
-                    let match_idx = match_idx + pos; // account for starting from pos
-                    if self.needle.len() == 1
-                        || haystack[match_idx + 1..].starts_with(&self.needle[1..])
-                    {
-                        return Some((match_idx, match_idx + self.needle.len()));
-                    } else {
-                        pos = match_idx + 1;
-                    }
-                }
-                None => {
-                    return None;
-                }
-            }
-        }
-    }
-}
-
-// Matches for any number of SPACE or TAB
-pub struct WhitespaceMatcher {}
-
-impl Matcher for WhitespaceMatcher {
-    fn next_match(&self, haystack: &[u8]) -> Option<(usize, usize)> {
-        match memchr2(b' ', b'\t', haystack) {
-            Some(match_idx) => {
-                let mut skip = match_idx + 1;
-                while skip < haystack.len() {
-                    match haystack[skip] {
-                        b' ' | b'\t' => skip += 1,
-                        _ => break,
-                    }
-                }
-                Some((match_idx, skip))
-            }
-            None => None,
-        }
-    }
-}
-
-#[cfg(test)]
-mod matcher_tests {
-
-    use super::*;
-
-    #[test]
-    fn test_exact_matcher_single_byte() {
-        let matcher = ExactMatcher::new(":".as_bytes());
-        // spell-checker:disable
-        assert_eq!(matcher.next_match("".as_bytes()), None);
-        assert_eq!(matcher.next_match(":".as_bytes()), Some((0, 1)));
-        assert_eq!(matcher.next_match(":abcxyz".as_bytes()), Some((0, 1)));
-        assert_eq!(matcher.next_match("abc:xyz".as_bytes()), Some((3, 4)));
-        assert_eq!(matcher.next_match("abcxyz:".as_bytes()), Some((6, 7)));
-        assert_eq!(matcher.next_match("abcxyz".as_bytes()), None);
-        // spell-checker:enable
-    }
-
-    #[test]
-    fn test_exact_matcher_multi_bytes() {
-        let matcher = ExactMatcher::new("<>".as_bytes());
-        // spell-checker:disable
-        assert_eq!(matcher.next_match("".as_bytes()), None);
-        assert_eq!(matcher.next_match("<>".as_bytes()), Some((0, 2)));
-        assert_eq!(matcher.next_match("<>abcxyz".as_bytes()), Some((0, 2)));
-        assert_eq!(matcher.next_match("abc<>xyz".as_bytes()), Some((3, 5)));
-        assert_eq!(matcher.next_match("abcxyz<>".as_bytes()), Some((6, 8)));
-        assert_eq!(matcher.next_match("abcxyz".as_bytes()), None);
-        // spell-checker:enable
-    }
-
-    #[test]
-    fn test_whitespace_matcher_single_space() {
-        let matcher = WhitespaceMatcher {};
-        // spell-checker:disable
-        assert_eq!(matcher.next_match("".as_bytes()), None);
-        assert_eq!(matcher.next_match(" ".as_bytes()), Some((0, 1)));
-        assert_eq!(matcher.next_match("\tabcxyz".as_bytes()), Some((0, 1)));
-        assert_eq!(matcher.next_match("abc\txyz".as_bytes()), Some((3, 4)));
-        assert_eq!(matcher.next_match("abcxyz ".as_bytes()), Some((6, 7)));
-        assert_eq!(matcher.next_match("abcxyz".as_bytes()), None);
-        // spell-checker:enable
-    }
-
-    #[test]
-    fn test_whitespace_matcher_multi_spaces() {
-        let matcher = WhitespaceMatcher {};
-        // spell-checker:disable
-        assert_eq!(matcher.next_match("".as_bytes()), None);
-        assert_eq!(matcher.next_match(" \t ".as_bytes()), Some((0, 3)));
-        assert_eq!(matcher.next_match("\t\tabcxyz".as_bytes()), Some((0, 2)));
-        assert_eq!(matcher.next_match("abc \txyz".as_bytes()), Some((3, 5)));
-        assert_eq!(matcher.next_match("abcxyz  ".as_bytes()), Some((6, 8)));
-        assert_eq!(matcher.next_match("abcxyz".as_bytes()), None);
-        // spell-checker:enable
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_cut/searcher.rs.html b/coreutils/dev/src/uu_cut/searcher.rs.html deleted file mode 100644 index c187b28d8..000000000 --- a/coreutils/dev/src/uu_cut/searcher.rs.html +++ /dev/null @@ -1,371 +0,0 @@ -searcher.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-
// This file is part of the uutils coreutils package.
-//
-// (c) Rolf Morel <rolfmorel@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore multispace
-
-use super::matcher::Matcher;
-
-// Generic searcher that relies on a specific matcher
-pub struct Searcher<'a, 'b, M: Matcher> {
-    matcher: &'a M,
-    haystack: &'b [u8],
-    position: usize,
-}
-
-impl<'a, 'b, M: Matcher> Searcher<'a, 'b, M> {
-    pub fn new(matcher: &'a M, haystack: &'b [u8]) -> Self {
-        Self {
-            matcher,
-            haystack,
-            position: 0,
-        }
-    }
-}
-
-// Iterate over field delimiters
-// Returns (first, last) positions of each sequence, where `haystack[first..last]`
-// corresponds to the delimiter.
-impl<'a, 'b, M: Matcher> Iterator for Searcher<'a, 'b, M> {
-    type Item = (usize, usize);
-
-    fn next(&mut self) -> Option<Self::Item> {
-        match self.matcher.next_match(&self.haystack[self.position..]) {
-            Some((first, last)) => {
-                let result = (first + self.position, last + self.position);
-                self.position += last;
-                Some(result)
-            }
-            None => None,
-        }
-    }
-}
-
-#[cfg(test)]
-mod exact_searcher_tests {
-
-    use super::super::matcher::ExactMatcher;
-    use super::*;
-
-    #[test]
-    fn test_normal() {
-        let matcher = ExactMatcher::new("a".as_bytes());
-        let iter = Searcher::new(&matcher, "a.a.a".as_bytes());
-        let items: Vec<(usize, usize)> = iter.collect();
-        assert_eq!(vec![(0, 1), (2, 3), (4, 5)], items);
-    }
-
-    #[test]
-    fn test_empty() {
-        let matcher = ExactMatcher::new("a".as_bytes());
-        let iter = Searcher::new(&matcher, "".as_bytes());
-        let items: Vec<(usize, usize)> = iter.collect();
-        assert_eq!(vec![] as Vec<(usize, usize)>, items);
-    }
-
-    fn test_multibyte(line: &[u8], expected: &[(usize, usize)]) {
-        let matcher = ExactMatcher::new("ab".as_bytes());
-        let iter = Searcher::new(&matcher, line);
-        let items: Vec<(usize, usize)> = iter.collect();
-        assert_eq!(expected, items);
-    }
-
-    #[test]
-    fn test_multibyte_normal() {
-        test_multibyte("...ab...ab...".as_bytes(), &[(3, 5), (8, 10)]);
-    }
-
-    #[test]
-    fn test_multibyte_needle_head_at_end() {
-        test_multibyte("a".as_bytes(), &[]);
-    }
-
-    #[test]
-    fn test_multibyte_starting_needle() {
-        test_multibyte("ab...ab...".as_bytes(), &[(0, 2), (5, 7)]);
-    }
-
-    #[test]
-    fn test_multibyte_trailing_needle() {
-        test_multibyte("...ab...ab".as_bytes(), &[(3, 5), (8, 10)]);
-    }
-
-    #[test]
-    fn test_multibyte_first_byte_false_match() {
-        test_multibyte("aA..aCaC..ab..aD".as_bytes(), &[(10, 12)]);
-    }
-
-    #[test]
-    fn test_searcher_with_exact_matcher() {
-        let matcher = ExactMatcher::new("<>".as_bytes());
-        let haystack = "<><>a<>b<><>cd<><>".as_bytes();
-        let mut searcher = Searcher::new(&matcher, haystack);
-        assert_eq!(searcher.next(), Some((0, 2)));
-        assert_eq!(searcher.next(), Some((2, 4)));
-        assert_eq!(searcher.next(), Some((5, 7)));
-        assert_eq!(searcher.next(), Some((8, 10)));
-        assert_eq!(searcher.next(), Some((10, 12)));
-        assert_eq!(searcher.next(), Some((14, 16)));
-        assert_eq!(searcher.next(), Some((16, 18)));
-        assert_eq!(searcher.next(), None);
-        assert_eq!(searcher.next(), None);
-    }
-}
-
-#[cfg(test)]
-mod whitespace_searcher_tests {
-
-    use super::super::matcher::WhitespaceMatcher;
-    use super::*;
-
-    #[test]
-    fn test_space() {
-        let matcher = WhitespaceMatcher {};
-        let iter = Searcher::new(&matcher, " . . ".as_bytes());
-        let items: Vec<(usize, usize)> = iter.collect();
-        assert_eq!(vec![(0, 1), (2, 3), (4, 5)], items);
-    }
-
-    #[test]
-    fn test_tab() {
-        let matcher = WhitespaceMatcher {};
-        let iter = Searcher::new(&matcher, "\t.\t.\t".as_bytes());
-        let items: Vec<(usize, usize)> = iter.collect();
-        assert_eq!(vec![(0, 1), (2, 3), (4, 5)], items);
-    }
-
-    #[test]
-    fn test_empty() {
-        let matcher = WhitespaceMatcher {};
-        let iter = Searcher::new(&matcher, "".as_bytes());
-        let items: Vec<(usize, usize)> = iter.collect();
-        assert_eq!(vec![] as Vec<(usize, usize)>, items);
-    }
-
-    fn test_multispace(line: &[u8], expected: &[(usize, usize)]) {
-        let matcher = WhitespaceMatcher {};
-        let iter = Searcher::new(&matcher, line);
-        let items: Vec<(usize, usize)> = iter.collect();
-        assert_eq!(expected, items);
-    }
-
-    #[test]
-    fn test_multispace_normal() {
-        test_multispace(
-            "...  ... \t...\t ... \t ...".as_bytes(),
-            &[(3, 5), (8, 10), (13, 15), (18, 21)],
-        );
-    }
-
-    #[test]
-    fn test_multispace_begin() {
-        test_multispace(" \t\t...".as_bytes(), &[(0, 3)]);
-    }
-
-    #[test]
-    fn test_multispace_end() {
-        test_multispace("...\t  ".as_bytes(), &[(3, 6)]);
-    }
-
-    #[test]
-    fn test_searcher_with_whitespace_matcher() {
-        let matcher = WhitespaceMatcher {};
-        let haystack = "\t a b \t cd\t\t".as_bytes();
-        let mut searcher = Searcher::new(&matcher, haystack);
-        assert_eq!(searcher.next(), Some((0, 2)));
-        assert_eq!(searcher.next(), Some((3, 4)));
-        assert_eq!(searcher.next(), Some((5, 8)));
-        assert_eq!(searcher.next(), Some((10, 12)));
-        assert_eq!(searcher.next(), None);
-        assert_eq!(searcher.next(), None);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_date/date.rs.html b/coreutils/dev/src/uu_date/date.rs.html deleted file mode 100644 index 8a21fc5c4..000000000 --- a/coreutils/dev/src/uu_date/date.rs.html +++ /dev/null @@ -1,941 +0,0 @@ -date.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-
// This file is part of the uutils coreutils package.
-//
-// (c) Anthony Deschamps <anthony.j.deschamps@gmail.com>
-// (c) Sylvestre Ledru <sylvestre@debian.org>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (chrono) Datelike Timelike ; (format) DATEFILE MMDDhhmm ; (vars) datetime datetimes
-
-use chrono::format::{Item, StrftimeItems};
-use chrono::{DateTime, Duration, FixedOffset, Local, Offset, Utc};
-#[cfg(windows)]
-use chrono::{Datelike, Timelike};
-use clap::{crate_version, Arg, ArgAction, Command};
-#[cfg(all(unix, not(target_os = "macos"), not(target_os = "redox")))]
-use libc::{clock_settime, timespec, CLOCK_REALTIME};
-use std::fs::File;
-use std::io::{BufRead, BufReader};
-use std::path::PathBuf;
-use uucore::display::Quotable;
-#[cfg(not(any(target_os = "redox")))]
-use uucore::error::FromIo;
-use uucore::error::{UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage, show};
-#[cfg(windows)]
-use windows_sys::Win32::{Foundation::SYSTEMTIME, System::SystemInformation::SetSystemTime};
-
-use uucore::shortcut_value_parser::ShortcutValueParser;
-
-// Options
-const DATE: &str = "date";
-const HOURS: &str = "hours";
-const MINUTES: &str = "minutes";
-const SECONDS: &str = "seconds";
-const NS: &str = "ns";
-
-const ABOUT: &str = help_about!("date.md");
-const USAGE: &str = help_usage!("date.md");
-
-const OPT_DATE: &str = "date";
-const OPT_FORMAT: &str = "format";
-const OPT_FILE: &str = "file";
-const OPT_DEBUG: &str = "debug";
-const OPT_ISO_8601: &str = "iso-8601";
-const OPT_RFC_EMAIL: &str = "rfc-email";
-const OPT_RFC_3339: &str = "rfc-3339";
-const OPT_SET: &str = "set";
-const OPT_REFERENCE: &str = "reference";
-const OPT_UNIVERSAL: &str = "universal";
-const OPT_UNIVERSAL_2: &str = "utc";
-
-// Help strings
-
-static ISO_8601_HELP_STRING: &str = "output date/time in ISO 8601 format.
- FMT='date' for date only (the default),
- 'hours', 'minutes', 'seconds', or 'ns'
- for date and time to the indicated precision.
- Example: 2006-08-14T02:34:56-06:00";
-
-static RFC_5322_HELP_STRING: &str = "output date and time in RFC 5322 format.
- Example: Mon, 14 Aug 2006 02:34:56 -0600";
-
-static RFC_3339_HELP_STRING: &str = "output date/time in RFC 3339 format.
- FMT='date', 'seconds', or 'ns'
- for date and time to the indicated precision.
- Example: 2006-08-14 02:34:56-06:00";
-
-#[cfg(not(any(target_os = "macos", target_os = "redox")))]
-static OPT_SET_HELP_STRING: &str = "set time described by STRING";
-#[cfg(target_os = "macos")]
-static OPT_SET_HELP_STRING: &str = "set time described by STRING (not available on mac yet)";
-#[cfg(target_os = "redox")]
-static OPT_SET_HELP_STRING: &str = "set time described by STRING (not available on redox yet)";
-
-/// Settings for this program, parsed from the command line
-struct Settings {
-    utc: bool,
-    format: Format,
-    date_source: DateSource,
-    set_to: Option<DateTime<FixedOffset>>,
-}
-
-/// Various ways of displaying the date
-enum Format {
-    Iso8601(Iso8601Format),
-    Rfc5322,
-    Rfc3339(Rfc3339Format),
-    Custom(String),
-    Default,
-}
-
-/// Various places that dates can come from
-enum DateSource {
-    Now,
-    Custom(String),
-    File(PathBuf),
-    Human(Duration),
-}
-
-enum Iso8601Format {
-    Date,
-    Hours,
-    Minutes,
-    Seconds,
-    Ns,
-}
-
-impl<'a> From<&'a str> for Iso8601Format {
-    fn from(s: &str) -> Self {
-        match s {
-            HOURS => Self::Hours,
-            MINUTES => Self::Minutes,
-            SECONDS => Self::Seconds,
-            NS => Self::Ns,
-            DATE => Self::Date,
-            // Note: This is caught by clap via `possible_values`
-            _ => unreachable!(),
-        }
-    }
-}
-
-enum Rfc3339Format {
-    Date,
-    Seconds,
-    Ns,
-}
-
-impl<'a> From<&'a str> for Rfc3339Format {
-    fn from(s: &str) -> Self {
-        match s {
-            DATE => Self::Date,
-            SECONDS => Self::Seconds,
-            NS => Self::Ns,
-            // Should be caught by clap
-            _ => panic!("Invalid format: {s}"),
-        }
-    }
-}
-
-#[uucore::main]
-#[allow(clippy::cognitive_complexity)]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let format = if let Some(form) = matches.get_one::<String>(OPT_FORMAT) {
-        if !form.starts_with('+') {
-            return Err(USimpleError::new(
-                1,
-                format!("invalid date {}", form.quote()),
-            ));
-        }
-        let form = form[1..].to_string();
-        Format::Custom(form)
-    } else if let Some(fmt) = matches
-        .get_many::<String>(OPT_ISO_8601)
-        .map(|mut iter| iter.next().unwrap_or(&DATE.to_string()).as_str().into())
-    {
-        Format::Iso8601(fmt)
-    } else if matches.get_flag(OPT_RFC_EMAIL) {
-        Format::Rfc5322
-    } else if let Some(fmt) = matches
-        .get_one::<String>(OPT_RFC_3339)
-        .map(|s| s.as_str().into())
-    {
-        Format::Rfc3339(fmt)
-    } else {
-        Format::Default
-    };
-
-    let date_source = if let Some(date) = matches.get_one::<String>(OPT_DATE) {
-        if let Ok(duration) = parse_datetime::from_str(date.as_str()) {
-            DateSource::Human(duration)
-        } else {
-            DateSource::Custom(date.into())
-        }
-    } else if let Some(file) = matches.get_one::<String>(OPT_FILE) {
-        DateSource::File(file.into())
-    } else {
-        DateSource::Now
-    };
-
-    let set_to = match matches.get_one::<String>(OPT_SET).map(parse_date) {
-        None => None,
-        Some(Err((input, _err))) => {
-            return Err(USimpleError::new(
-                1,
-                format!("invalid date {}", input.quote()),
-            ));
-        }
-        Some(Ok(date)) => Some(date),
-    };
-
-    let settings = Settings {
-        utc: matches.get_flag(OPT_UNIVERSAL),
-        format,
-        date_source,
-        set_to,
-    };
-
-    if let Some(date) = settings.set_to {
-        // All set time functions expect UTC datetimes.
-        let date: DateTime<Utc> = if settings.utc {
-            date.with_timezone(&Utc)
-        } else {
-            date.into()
-        };
-
-        return set_system_datetime(date);
-    } else {
-        // Get the current time, either in the local time zone or UTC.
-        let now: DateTime<FixedOffset> = if settings.utc {
-            let now = Utc::now();
-            now.with_timezone(&now.offset().fix())
-        } else {
-            let now = Local::now();
-            now.with_timezone(now.offset())
-        };
-
-        // Iterate over all dates - whether it's a single date or a file.
-        let dates: Box<dyn Iterator<Item = _>> = match settings.date_source {
-            DateSource::Custom(ref input) => {
-                let date = parse_date(input.clone());
-                let iter = std::iter::once(date);
-                Box::new(iter)
-            }
-            DateSource::Human(relative_time) => {
-                // Get the current DateTime<FixedOffset> for things like "1 year ago"
-                let current_time = DateTime::<FixedOffset>::from(Local::now());
-                let iter = std::iter::once(Ok(current_time + relative_time));
-                Box::new(iter)
-            }
-            DateSource::File(ref path) => {
-                if path.is_dir() {
-                    return Err(USimpleError::new(
-                        2,
-                        format!("expected file, got directory {}", path.quote()),
-                    ));
-                }
-                let file = File::open(path)
-                    .map_err_context(|| path.as_os_str().to_string_lossy().to_string())?;
-                let lines = BufReader::new(file).lines();
-                let iter = lines.map_while(Result::ok).map(parse_date);
-                Box::new(iter)
-            }
-            DateSource::Now => {
-                let iter = std::iter::once(Ok(now));
-                Box::new(iter)
-            }
-        };
-
-        let format_string = make_format_string(&settings);
-
-        // Format all the dates
-        for date in dates {
-            match date {
-                Ok(date) => {
-                    // GNU `date` uses `%N` for nano seconds, however crate::chrono uses `%f`
-                    let format_string = &format_string.replace("%N", "%f");
-                    // Refuse to pass this string to chrono as it is crashing in this crate
-                    if format_string.contains("%#z") {
-                        return Err(USimpleError::new(
-                            1,
-                            format!("invalid format {}", format_string.replace("%f", "%N")),
-                        ));
-                    }
-                    // Hack to work around panic in chrono,
-                    // TODO - remove when a fix for https://github.com/chronotope/chrono/issues/623 is released
-                    let format_items = StrftimeItems::new(format_string);
-                    if format_items.clone().any(|i| i == Item::Error) {
-                        return Err(USimpleError::new(
-                            1,
-                            format!("invalid format {}", format_string.replace("%f", "%N")),
-                        ));
-                    }
-                    let formatted = date
-                        .format_with_items(format_items)
-                        .to_string()
-                        .replace("%f", "%N");
-                    println!("{formatted}");
-                }
-                Err((input, _err)) => show!(USimpleError::new(
-                    1,
-                    format!("invalid date {}", input.quote())
-                )),
-            }
-        }
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_DATE)
-                .short('d')
-                .long(OPT_DATE)
-                .value_name("STRING")
-                .help("display time described by STRING, not 'now'"),
-        )
-        .arg(
-            Arg::new(OPT_FILE)
-                .short('f')
-                .long(OPT_FILE)
-                .value_name("DATEFILE")
-                .value_hint(clap::ValueHint::FilePath)
-                .help("like --date; once for each line of DATEFILE"),
-        )
-        .arg(
-            Arg::new(OPT_ISO_8601)
-                .short('I')
-                .long(OPT_ISO_8601)
-                .value_name("FMT")
-                .value_parser(ShortcutValueParser::new([
-                    DATE, HOURS, MINUTES, SECONDS, NS,
-                ]))
-                .num_args(0..=1)
-                .default_missing_value(OPT_DATE)
-                .help(ISO_8601_HELP_STRING),
-        )
-        .arg(
-            Arg::new(OPT_RFC_EMAIL)
-                .short('R')
-                .long(OPT_RFC_EMAIL)
-                .help(RFC_5322_HELP_STRING)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_RFC_3339)
-                .long(OPT_RFC_3339)
-                .value_name("FMT")
-                .value_parser(ShortcutValueParser::new([DATE, SECONDS, NS]))
-                .help(RFC_3339_HELP_STRING),
-        )
-        .arg(
-            Arg::new(OPT_DEBUG)
-                .long(OPT_DEBUG)
-                .help("annotate the parsed date, and warn about questionable usage to stderr")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_REFERENCE)
-                .short('r')
-                .long(OPT_REFERENCE)
-                .value_name("FILE")
-                .value_hint(clap::ValueHint::AnyPath)
-                .help("display the last modification time of FILE"),
-        )
-        .arg(
-            Arg::new(OPT_SET)
-                .short('s')
-                .long(OPT_SET)
-                .value_name("STRING")
-                .help(OPT_SET_HELP_STRING),
-        )
-        .arg(
-            Arg::new(OPT_UNIVERSAL)
-                .short('u')
-                .long(OPT_UNIVERSAL)
-                .alias(OPT_UNIVERSAL_2)
-                .help("print or set Coordinated Universal Time (UTC)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(Arg::new(OPT_FORMAT))
-}
-
-/// Return the appropriate format string for the given settings.
-fn make_format_string(settings: &Settings) -> &str {
-    match settings.format {
-        Format::Iso8601(ref fmt) => match *fmt {
-            Iso8601Format::Date => "%F",
-            Iso8601Format::Hours => "%FT%H%:z",
-            Iso8601Format::Minutes => "%FT%H:%M%:z",
-            Iso8601Format::Seconds => "%FT%T%:z",
-            Iso8601Format::Ns => "%FT%T,%f%:z",
-        },
-        Format::Rfc5322 => "%a, %d %h %Y %T %z",
-        Format::Rfc3339(ref fmt) => match *fmt {
-            Rfc3339Format::Date => "%F",
-            Rfc3339Format::Seconds => "%F %T%:z",
-            Rfc3339Format::Ns => "%F %T.%f%:z",
-        },
-        Format::Custom(ref fmt) => fmt,
-        Format::Default => "%c",
-    }
-}
-
-/// Parse a `String` into a `DateTime`.
-/// If it fails, return a tuple of the `String` along with its `ParseError`.
-fn parse_date<S: AsRef<str> + Clone>(
-    s: S,
-) -> Result<DateTime<FixedOffset>, (String, chrono::format::ParseError)> {
-    // TODO: The GNU date command can parse a wide variety of inputs.
-    s.as_ref().parse().map_err(|e| (s.as_ref().into(), e))
-}
-
-#[cfg(not(any(unix, windows)))]
-fn set_system_datetime(_date: DateTime<Utc>) -> UResult<()> {
-    unimplemented!("setting date not implemented (unsupported target)");
-}
-
-#[cfg(target_os = "macos")]
-fn set_system_datetime(_date: DateTime<Utc>) -> UResult<()> {
-    Err(USimpleError::new(
-        1,
-        "setting the date is not supported by macOS".to_string(),
-    ))
-}
-
-#[cfg(target_os = "redox")]
-fn set_system_datetime(_date: DateTime<Utc>) -> UResult<()> {
-    Err(USimpleError::new(
-        1,
-        "setting the date is not supported by Redox".to_string(),
-    ))
-}
-
-#[cfg(all(unix, not(target_os = "macos"), not(target_os = "redox")))]
-/// System call to set date (unix).
-/// See here for more:
-/// `<https://doc.rust-lang.org/libc/i686-unknown-linux-gnu/libc/fn.clock_settime.html>`
-/// `<https://linux.die.net/man/3/clock_settime>`
-/// `<https://www.gnu.org/software/libc/manual/html_node/Time-Types.html>`
-fn set_system_datetime(date: DateTime<Utc>) -> UResult<()> {
-    let timespec = timespec {
-        tv_sec: date.timestamp() as _,
-        tv_nsec: date.timestamp_subsec_nanos() as _,
-    };
-
-    let result = unsafe { clock_settime(CLOCK_REALTIME, &timespec) };
-
-    if result == 0 {
-        Ok(())
-    } else {
-        Err(std::io::Error::last_os_error().map_err_context(|| "cannot set date".to_string()))
-    }
-}
-
-#[cfg(windows)]
-/// System call to set date (Windows).
-/// See here for more:
-/// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-setsystemtime
-/// https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-systemtime
-fn set_system_datetime(date: DateTime<Utc>) -> UResult<()> {
-    let system_time = SYSTEMTIME {
-        wYear: date.year() as u16,
-        wMonth: date.month() as u16,
-        // Ignored
-        wDayOfWeek: 0,
-        wDay: date.day() as u16,
-        wHour: date.hour() as u16,
-        wMinute: date.minute() as u16,
-        wSecond: date.second() as u16,
-        // TODO: be careful of leap seconds - valid range is [0, 999] - how to handle?
-        wMilliseconds: ((date.nanosecond() / 1_000_000) % 1000) as u16,
-    };
-
-    let result = unsafe { SetSystemTime(&system_time) };
-
-    if result == 0 {
-        Err(std::io::Error::last_os_error().map_err_context(|| "cannot set date".to_string()))
-    } else {
-        Ok(())
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dd/blocks.rs.html b/coreutils/dev/src/uu_dd/blocks.rs.html deleted file mode 100644 index 88b4646ae..000000000 --- a/coreutils/dev/src/uu_dd/blocks.rs.html +++ /dev/null @@ -1,749 +0,0 @@ -blocks.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore datastructures rstat rposition cflags ctable
-
-use crate::conversion_tables::ConversionTable;
-use crate::datastructures::ConversionMode;
-use crate::progress::ReadStat;
-
-const NEWLINE: u8 = b'\n';
-const SPACE: u8 = b' ';
-
-/// Split a slice into chunks, padding or truncating as necessary.
-///
-/// The slice `buf` is split on newlines, then each block is resized
-/// to `cbs` bytes, padding with spaces if necessary. This function
-/// expects the input bytes to be ASCII-encoded.
-///
-/// If `sync` is true and there has been at least one partial record
-/// read from the input (as indicated in `rstat`), then leave an
-/// all-spaces block at the end. Otherwise, remove the last block if
-/// it is all spaces.
-fn block(buf: &[u8], cbs: usize, sync: bool, rstat: &mut ReadStat) -> Vec<Vec<u8>> {
-    let mut blocks = buf
-        .split(|&e| e == NEWLINE)
-        .map(|split| split.to_vec())
-        .fold(Vec::new(), |mut blocks, mut split| {
-            if split.len() > cbs {
-                rstat.records_truncated += 1;
-            }
-            split.resize(cbs, SPACE);
-            blocks.push(split);
-
-            blocks
-        });
-
-    // If `sync` is true and there has been at least one partial
-    // record read from the input, then leave the all-spaces block at
-    // the end. Otherwise, remove it.
-    if let Some(last) = blocks.last() {
-        if (!sync || rstat.reads_partial == 0) && last.iter().all(|&e| e == SPACE) {
-            blocks.pop();
-        }
-    }
-
-    blocks
-}
-
-/// Trims padding from each cbs-length partition of buf
-/// as specified by conv=unblock and cbs=N
-/// Expects ascii encoded data
-fn unblock(buf: &[u8], cbs: usize) -> Vec<u8> {
-    buf.chunks(cbs).fold(Vec::new(), |mut acc, block| {
-        if let Some(last_char_idx) = block.iter().rposition(|&e| e != SPACE) {
-            // Include text up to last space.
-            acc.extend(&block[..=last_char_idx]);
-        }
-
-        acc.push(NEWLINE);
-        acc
-    })
-}
-
-/// Apply the specified conversion, blocking, and/or unblocking in the right order.
-///
-/// The `mode` specifies the combination of conversion, blocking, and
-/// unblocking to apply and the order in which to apply it. This
-/// function is responsible only for applying the operations.
-///
-/// `buf` is the buffer of input bytes to transform. This function
-/// mutates this input and also returns a new buffer of bytes
-/// representing the result of the transformation.
-///
-/// `rstat` maintains a running total of the number of partial and
-/// complete blocks read before calling this function. In certain
-/// settings of `mode`, this function will update the number of
-/// records truncated; that's why `rstat` is borrowed mutably.
-pub(crate) fn conv_block_unblock_helper(
-    buf: Vec<u8>,
-    mode: &ConversionMode,
-    rstat: &mut ReadStat,
-) -> Vec<u8> {
-    fn apply_conversion(buf: Vec<u8>, ct: &ConversionTable) -> impl Iterator<Item = u8> + '_ {
-        buf.into_iter().map(|b| ct[b as usize])
-    }
-
-    match mode {
-        ConversionMode::ConvertOnly(ct) => apply_conversion(buf, ct).collect(),
-        ConversionMode::BlockThenConvert(ct, cbs, sync) => {
-            let blocks = block(&buf, *cbs, *sync, rstat);
-            blocks
-                .into_iter()
-                .flat_map(|block| apply_conversion(block, ct))
-                .collect()
-        }
-        ConversionMode::ConvertThenBlock(ct, cbs, sync) => {
-            let buf: Vec<_> = apply_conversion(buf, ct).collect();
-            block(&buf, *cbs, *sync, rstat)
-                .into_iter()
-                .flatten()
-                .collect()
-        }
-        ConversionMode::BlockOnly(cbs, sync) => block(&buf, *cbs, *sync, rstat)
-            .into_iter()
-            .flatten()
-            .collect(),
-        ConversionMode::UnblockThenConvert(ct, cbs) => {
-            let buf = unblock(&buf, *cbs);
-            apply_conversion(buf, ct).collect()
-        }
-        ConversionMode::ConvertThenUnblock(ct, cbs) => {
-            let buf: Vec<_> = apply_conversion(buf, ct).collect();
-            unblock(&buf, *cbs)
-        }
-        ConversionMode::UnblockOnly(cbs) => unblock(&buf, *cbs),
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::blocks::{block, unblock};
-    use crate::progress::ReadStat;
-
-    const NEWLINE: u8 = b'\n';
-    const SPACE: u8 = b' ';
-
-    #[test]
-    fn block_test_no_nl() {
-        let mut rs = ReadStat::default();
-        let buf = [0u8, 1u8, 2u8, 3u8];
-        let res = block(&buf, 4, false, &mut rs);
-
-        assert_eq!(res, vec![vec![0u8, 1u8, 2u8, 3u8],]);
-    }
-
-    #[test]
-    fn block_test_no_nl_short_record() {
-        let mut rs = ReadStat::default();
-        let buf = [0u8, 1u8, 2u8, 3u8];
-        let res = block(&buf, 8, false, &mut rs);
-
-        assert_eq!(
-            res,
-            vec![vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],]
-        );
-    }
-
-    #[test]
-    fn block_test_no_nl_trunc() {
-        let mut rs = ReadStat::default();
-        let buf = [0u8, 1u8, 2u8, 3u8, 4u8];
-        let res = block(&buf, 4, false, &mut rs);
-
-        // Commented section(s) should be truncated and appear for reference only.
-        assert_eq!(res, vec![vec![0u8, 1u8, 2u8, 3u8 /*, 4u8*/],]);
-        assert_eq!(rs.records_truncated, 1);
-    }
-
-    #[test]
-    fn block_test_nl_gt_cbs_trunc() {
-        let mut rs = ReadStat::default();
-        let buf = [
-            0u8, 1u8, 2u8, 3u8, 4u8, NEWLINE, 0u8, 1u8, 2u8, 3u8, 4u8, NEWLINE, 5u8, 6u8, 7u8, 8u8,
-        ];
-        let res = block(&buf, 4, false, &mut rs);
-
-        assert_eq!(
-            res,
-            vec![
-                // Commented section(s) should be truncated and appear for reference only.
-                vec![0u8, 1u8, 2u8, 3u8],
-                // vec![4u8, SPACE, SPACE, SPACE],
-                vec![0u8, 1u8, 2u8, 3u8],
-                // vec![4u8, SPACE, SPACE, SPACE],
-                vec![5u8, 6u8, 7u8, 8u8],
-            ]
-        );
-        assert_eq!(rs.records_truncated, 2);
-    }
-
-    #[test]
-    fn block_test_surrounded_nl() {
-        let mut rs = ReadStat::default();
-        let buf = [0u8, 1u8, 2u8, 3u8, NEWLINE, 4u8, 5u8, 6u8, 7u8, 8u8];
-        let res = block(&buf, 8, false, &mut rs);
-
-        assert_eq!(
-            res,
-            vec![
-                vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
-                vec![4u8, 5u8, 6u8, 7u8, 8u8, SPACE, SPACE, SPACE],
-            ]
-        );
-    }
-
-    #[test]
-    fn block_test_multiple_nl_same_cbs_block() {
-        let mut rs = ReadStat::default();
-        let buf = [
-            0u8, 1u8, 2u8, 3u8, NEWLINE, 4u8, NEWLINE, 5u8, 6u8, 7u8, 8u8, 9u8,
-        ];
-        let res = block(&buf, 8, false, &mut rs);
-
-        assert_eq!(
-            res,
-            vec![
-                vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
-                vec![4u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
-                vec![5u8, 6u8, 7u8, 8u8, 9u8, SPACE, SPACE, SPACE],
-            ]
-        );
-    }
-
-    #[test]
-    fn block_test_multiple_nl_diff_cbs_block() {
-        let mut rs = ReadStat::default();
-        let buf = [
-            0u8, 1u8, 2u8, 3u8, NEWLINE, 4u8, 5u8, 6u8, 7u8, NEWLINE, 8u8, 9u8,
-        ];
-        let res = block(&buf, 8, false, &mut rs);
-
-        assert_eq!(
-            res,
-            vec![
-                vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
-                vec![4u8, 5u8, 6u8, 7u8, SPACE, SPACE, SPACE, SPACE],
-                vec![8u8, 9u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
-            ]
-        );
-    }
-
-    #[test]
-    fn block_test_end_nl_diff_cbs_block() {
-        let mut rs = ReadStat::default();
-        let buf = [0u8, 1u8, 2u8, 3u8, NEWLINE];
-        let res = block(&buf, 4, false, &mut rs);
-
-        assert_eq!(res, vec![vec![0u8, 1u8, 2u8, 3u8],]);
-    }
-
-    #[test]
-    fn block_test_end_nl_same_cbs_block() {
-        let mut rs = ReadStat::default();
-        let buf = [0u8, 1u8, 2u8, NEWLINE];
-        let res = block(&buf, 4, false, &mut rs);
-
-        assert_eq!(res, vec![vec![0u8, 1u8, 2u8, SPACE]]);
-    }
-
-    #[test]
-    fn block_test_double_end_nl() {
-        let mut rs = ReadStat::default();
-        let buf = [0u8, 1u8, 2u8, NEWLINE, NEWLINE];
-        let res = block(&buf, 4, false, &mut rs);
-
-        assert_eq!(
-            res,
-            vec![vec![0u8, 1u8, 2u8, SPACE], vec![SPACE, SPACE, SPACE, SPACE],]
-        );
-    }
-
-    #[test]
-    fn block_test_start_nl() {
-        let mut rs = ReadStat::default();
-        let buf = [NEWLINE, 0u8, 1u8, 2u8, 3u8];
-        let res = block(&buf, 4, false, &mut rs);
-
-        assert_eq!(
-            res,
-            vec![vec![SPACE, SPACE, SPACE, SPACE], vec![0u8, 1u8, 2u8, 3u8],]
-        );
-    }
-
-    #[test]
-    fn block_test_double_surrounded_nl_no_trunc() {
-        let mut rs = ReadStat::default();
-        let buf = [0u8, 1u8, 2u8, 3u8, NEWLINE, NEWLINE, 4u8, 5u8, 6u8, 7u8];
-        let res = block(&buf, 8, false, &mut rs);
-
-        assert_eq!(
-            res,
-            vec![
-                vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
-                vec![SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
-                vec![4u8, 5u8, 6u8, 7u8, SPACE, SPACE, SPACE, SPACE],
-            ]
-        );
-    }
-
-    #[test]
-    fn block_test_double_surrounded_nl_double_trunc() {
-        let mut rs = ReadStat::default();
-        let buf = [
-            0u8, 1u8, 2u8, 3u8, NEWLINE, NEWLINE, 4u8, 5u8, 6u8, 7u8, 8u8,
-        ];
-        let res = block(&buf, 4, false, &mut rs);
-
-        assert_eq!(
-            res,
-            vec![
-                // Commented section(s) should be truncated and appear for reference only.
-                vec![0u8, 1u8, 2u8, 3u8],
-                vec![SPACE, SPACE, SPACE, SPACE],
-                vec![4u8, 5u8, 6u8, 7u8 /*, 8u8*/],
-            ]
-        );
-        assert_eq!(rs.records_truncated, 1);
-    }
-
-    #[test]
-    fn unblock_test_full_cbs() {
-        let buf = [0u8, 1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8];
-        let res = unblock(&buf, 8);
-
-        assert_eq!(res, vec![0u8, 1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8, NEWLINE],);
-    }
-
-    #[test]
-    fn unblock_test_all_space() {
-        let buf = [SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE];
-        let res = unblock(&buf, 8);
-
-        assert_eq!(res, vec![NEWLINE],);
-    }
-
-    #[test]
-    fn unblock_test_decoy_spaces() {
-        let buf = [0u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, 7u8];
-        let res = unblock(&buf, 8);
-
-        assert_eq!(
-            res,
-            vec![0u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, 7u8, NEWLINE],
-        );
-    }
-
-    #[test]
-    fn unblock_test_strip_single_cbs() {
-        let buf = [0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE];
-        let res = unblock(&buf, 8);
-
-        assert_eq!(res, vec![0u8, 1u8, 2u8, 3u8, NEWLINE],);
-    }
-
-    #[test]
-    fn unblock_test_strip_multi_cbs() {
-        let buf = vec![
-            vec![0u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
-            vec![0u8, 1u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
-            vec![0u8, 1u8, 2u8, SPACE, SPACE, SPACE, SPACE, SPACE],
-            vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
-        ]
-        .into_iter()
-        .flatten()
-        .collect::<Vec<_>>();
-
-        let res = unblock(&buf, 8);
-
-        let exp = vec![
-            vec![0u8, NEWLINE],
-            vec![0u8, 1u8, NEWLINE],
-            vec![0u8, 1u8, 2u8, NEWLINE],
-            vec![0u8, 1u8, 2u8, 3u8, NEWLINE],
-        ]
-        .into_iter()
-        .flatten()
-        .collect::<Vec<_>>();
-
-        assert_eq!(res, exp);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dd/conversion_tables.rs.html b/coreutils/dev/src/uu_dd/conversion_tables.rs.html deleted file mode 100644 index 61d79e817..000000000 --- a/coreutils/dev/src/uu_dd/conversion_tables.rs.html +++ /dev/null @@ -1,443 +0,0 @@ -conversion_tables.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-
// This file is part of the uutils coreutils package.
-//
-// (c) Tyler Steele <tyler.steele@protonmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// Note: Conversion tables are just lookup tables.
-// eg. The ASCII->EBCDIC table stores the EBCDIC code at the index
-// obtained by treating the ASCII representation as a number.
-
-pub type ConversionTable = [u8; 256];
-
-pub const ASCII_UCASE_TO_LCASE: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
-    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
-    0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
-    0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
-    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
-    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
-    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
-    0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
-    0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
-    0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
-    0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const ASCII_LCASE_TO_UCASE: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
-    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
-    0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
-    0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
-    0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
-    0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
-    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
-    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
-    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
-    0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
-    0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
-    0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
-    0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const ASCII_TO_EBCDIC: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
-    0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
-    0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x9a, 0x6d,
-    0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
-    0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0x5f, 0x07,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
-    0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
-    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-    0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
-    0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x6a, 0x9b, 0x9c, 0x9d, 0x9e,
-    0x9f, 0xa0, 0xaa, 0xab, 0xac, 0x4a, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xa1, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
-    0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const ASCII_TO_EBCDIC_UCASE_TO_LCASE: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
-    0x7c, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
-    0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xad, 0xe0, 0xbd, 0x9a, 0x6d,
-    0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
-    0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0x5f, 0x07,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
-    0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
-    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-    0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
-    0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x6a, 0x9b, 0x9c, 0x9d, 0x9e,
-    0x9f, 0xa0, 0xaa, 0xab, 0xac, 0x4a, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xa1, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
-    0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const ASCII_TO_EBCDIC_LCASE_TO_UCASE: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
-    0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
-    0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x9a, 0x6d,
-    0x79, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
-    0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xc0, 0x4f, 0xd0, 0x5f, 0x07,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
-    0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
-    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-    0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
-    0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x6a, 0x9b, 0x9c, 0x9d, 0x9e,
-    0x9f, 0xa0, 0xaa, 0xab, 0xac, 0x4a, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xa1, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
-    0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const ASCII_TO_IBM: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
-    0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
-    0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
-    0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
-    0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
-    0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
-    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-    0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
-    0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
-    0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
-    0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const ASCII_TO_IBM_UCASE_TO_LCASE: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
-    0x7c, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
-    0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
-    0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
-    0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
-    0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
-    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-    0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
-    0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
-    0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
-    0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const ASCII_TO_IBM_LCASE_TO_UCASE: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
-    0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
-    0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
-    0x79, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
-    0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
-    0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
-    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-    0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
-    0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
-    0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
-    0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const EBCDIC_TO_ASCII: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f, 0x97, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x9d, 0x85, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x80, 0x81, 0x82, 0x83, 0x84, 0x0a, 0x17, 0x1b, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07,
-    0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a,
-    0x20, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xd5, 0x2e, 0x3c, 0x28, 0x2b, 0x7c,
-    0x26, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x7e,
-    0x2d, 0x2f, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xcb, 0x2c, 0x25, 0x5f, 0x3e, 0x3f,
-    0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22,
-    0xc3, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
-    0xca, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x5e, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
-    0xd1, 0xe5, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0xd2, 0xd3, 0xd4, 0x5b, 0xd6, 0xd7,
-    0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0x5d, 0xe6, 0xe7,
-    0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed,
-    0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3,
-    0x5c, 0x9f, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
-    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const EBCDIC_TO_ASCII_UCASE_TO_LCASE: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
-    0x7c, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
-    0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
-    0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
-    0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
-    0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
-    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-    0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
-    0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
-    0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
-    0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
-pub const EBCDIC_TO_ASCII_LCASE_TO_UCASE: ConversionTable = [
-    0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
-    0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
-    0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
-    0x79, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
-    0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
-    0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
-    0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-    0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
-    0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
-    0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-    0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
-    0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
-];
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dd/datastructures.rs.html b/coreutils/dev/src/uu_dd/datastructures.rs.html deleted file mode 100644 index a61296061..000000000 --- a/coreutils/dev/src/uu_dd/datastructures.rs.html +++ /dev/null @@ -1,187 +0,0 @@ -datastructures.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-
// This file is part of the uutils coreutils package.
-//
-// (c) Tyler Steele <tyler.steele@protonmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-// spell-checker:ignore ctable, outfile, iseek, oseek
-
-use crate::conversion_tables::*;
-
-type Cbs = usize;
-
-/// How to apply conversion, blocking, and/or unblocking.
-///
-/// Certain settings of the `conv` parameter to `dd` require a
-/// combination of conversion, blocking, or unblocking, applied in a
-/// certain order. The variants of this enumeration give the different
-/// ways of combining those three operations.
-#[derive(Debug, PartialEq)]
-pub(crate) enum ConversionMode {
-    ConvertOnly(&'static ConversionTable),
-    BlockOnly(Cbs, bool),
-    UnblockOnly(Cbs),
-    BlockThenConvert(&'static ConversionTable, Cbs, bool),
-    ConvertThenBlock(&'static ConversionTable, Cbs, bool),
-    UnblockThenConvert(&'static ConversionTable, Cbs),
-    ConvertThenUnblock(&'static ConversionTable, Cbs),
-}
-
-/// Stores all Conv Flags that apply to the input
-#[derive(Debug, Default, PartialEq)]
-pub(crate) struct IConvFlags {
-    pub mode: Option<ConversionMode>,
-    pub swab: bool,
-    pub sync: Option<u8>,
-    pub noerror: bool,
-}
-
-/// Stores all Conv Flags that apply to the output
-#[derive(Debug, Default, PartialEq, Eq)]
-pub struct OConvFlags {
-    pub sparse: bool,
-    pub excl: bool,
-    pub nocreat: bool,
-    pub notrunc: bool,
-    pub fdatasync: bool,
-    pub fsync: bool,
-}
-
-/// Stores all Flags that apply to the input
-#[derive(Debug, Default, PartialEq, Eq)]
-pub struct IFlags {
-    pub cio: bool,
-    pub direct: bool,
-    pub directory: bool,
-    pub dsync: bool,
-    pub sync: bool,
-    pub nocache: bool,
-    pub nonblock: bool,
-    pub noatime: bool,
-    pub noctty: bool,
-    pub nofollow: bool,
-    pub nolinks: bool,
-    pub binary: bool,
-    pub text: bool,
-    pub fullblock: bool,
-    pub count_bytes: bool,
-    pub skip_bytes: bool,
-}
-
-/// Stores all Flags that apply to the output
-#[derive(Debug, Default, PartialEq, Eq)]
-pub struct OFlags {
-    pub append: bool,
-    pub cio: bool,
-    pub direct: bool,
-    pub directory: bool,
-    pub dsync: bool,
-    pub sync: bool,
-    pub nocache: bool,
-    pub nonblock: bool,
-    pub noatime: bool,
-    pub noctty: bool,
-    pub nofollow: bool,
-    pub nolinks: bool,
-    pub binary: bool,
-    pub text: bool,
-    pub seek_bytes: bool,
-}
-
-pub mod options {
-    pub const OPERANDS: &str = "operands";
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dd/dd.rs.html b/coreutils/dev/src/uu_dd/dd.rs.html deleted file mode 100644 index 376ec8e70..000000000 --- a/coreutils/dev/src/uu_dd/dd.rs.html +++ /dev/null @@ -1,2551 +0,0 @@ -dd.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
-1143
-1144
-1145
-1146
-1147
-1148
-1149
-1150
-1151
-1152
-1153
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162
-1163
-1164
-1165
-1166
-1167
-1168
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179
-1180
-1181
-1182
-1183
-1184
-1185
-1186
-1187
-1188
-1189
-1190
-1191
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200
-1201
-1202
-1203
-1204
-1205
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214
-1215
-1216
-1217
-1218
-1219
-1220
-1221
-1222
-1223
-1224
-1225
-1226
-1227
-1228
-1229
-1230
-1231
-1232
-1233
-1234
-1235
-1236
-1237
-1238
-1239
-1240
-1241
-1242
-1243
-1244
-1245
-1246
-1247
-1248
-1249
-1250
-1251
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-1265
-1266
-1267
-1268
-1269
-1270
-1271
-1272
-1273
-1274
-1275
-
// This file is part of the uutils coreutils package.
-//
-// (c) Tyler Steele <tyler.steele@protonmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, iseek, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, oseek, outfile, parseargs, rlen, rmax, rremain, rsofar, rstat, sigusr, wlen, wstat seekable oconv canonicalized fadvise Fadvise FADV DONTNEED ESPIPE
-
-mod datastructures;
-use datastructures::*;
-
-mod parseargs;
-use parseargs::Parser;
-
-mod conversion_tables;
-
-mod progress;
-use progress::{gen_prog_updater, ProgUpdate, ReadStat, StatusLevel, WriteStat};
-
-mod blocks;
-use blocks::conv_block_unblock_helper;
-
-mod numbers;
-
-use std::cmp;
-use std::env;
-use std::ffi::OsString;
-use std::fs::{File, OpenOptions};
-use std::io::{self, Read, Seek, SeekFrom, Stdout, Write};
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use std::os::unix::fs::OpenOptionsExt;
-#[cfg(unix)]
-use std::os::unix::{
-    fs::FileTypeExt,
-    io::{AsRawFd, FromRawFd},
-};
-use std::path::Path;
-use std::sync::{
-    atomic::{AtomicBool, Ordering::Relaxed},
-    mpsc, Arc,
-};
-use std::thread;
-use std::time::{Duration, Instant};
-
-use clap::{crate_version, Arg, Command};
-use gcd::Gcd;
-#[cfg(target_os = "linux")]
-use nix::{
-    errno::Errno,
-    fcntl::{posix_fadvise, PosixFadviseAdvice},
-};
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult};
-use uucore::{format_usage, help_about, help_section, help_usage, show_error};
-#[cfg(target_os = "linux")]
-use uucore::{show, show_if_err};
-
-const ABOUT: &str = help_about!("dd.md");
-const AFTER_HELP: &str = help_section!("after help", "dd.md");
-const USAGE: &str = help_usage!("dd.md");
-const BUF_INIT_BYTE: u8 = 0xDD;
-
-/// Final settings after parsing
-#[derive(Default)]
-struct Settings {
-    infile: Option<String>,
-    outfile: Option<String>,
-    ibs: usize,
-    obs: usize,
-    skip: u64,
-    seek: u64,
-    count: Option<Num>,
-    iconv: IConvFlags,
-    iflags: IFlags,
-    oconv: OConvFlags,
-    oflags: OFlags,
-    status: Option<StatusLevel>,
-}
-
-/// A timer which triggers on a given interval
-///
-/// After being constructed with [`Alarm::with_interval`], [`Alarm::is_triggered`]
-/// will return true once per the given [`Duration`].
-///
-/// Can be cloned, but the trigger status is shared across all instances so only
-/// the first caller each interval will yield true.
-///
-/// When all instances are dropped the background thread will exit on the next interval.
-#[derive(Debug, Clone)]
-pub struct Alarm {
-    interval: Duration,
-    trigger: Arc<AtomicBool>,
-}
-
-impl Alarm {
-    pub fn with_interval(interval: Duration) -> Self {
-        let trigger = Arc::new(AtomicBool::default());
-
-        let weak_trigger = Arc::downgrade(&trigger);
-        thread::spawn(move || {
-            while let Some(trigger) = weak_trigger.upgrade() {
-                thread::sleep(interval);
-                trigger.store(true, Relaxed);
-            }
-        });
-
-        Self { interval, trigger }
-    }
-
-    pub fn is_triggered(&self) -> bool {
-        self.trigger.swap(false, Relaxed)
-    }
-
-    pub fn get_interval(&self) -> Duration {
-        self.interval
-    }
-}
-
-/// A number in blocks or bytes
-///
-/// Some values (seek, skip, iseek, oseek) can have values either in blocks or in bytes.
-/// We need to remember this because the size of the blocks (ibs) is only known after parsing
-/// all the arguments.
-#[derive(Clone, Copy, Debug, PartialEq)]
-enum Num {
-    Blocks(u64),
-    Bytes(u64),
-}
-
-impl Num {
-    fn force_bytes_if(self, force: bool) -> Self {
-        match self {
-            Self::Blocks(n) if force => Self::Bytes(n),
-            count => count,
-        }
-    }
-
-    fn to_bytes(self, block_size: u64) -> u64 {
-        match self {
-            Self::Blocks(n) => n * block_size,
-            Self::Bytes(n) => n,
-        }
-    }
-}
-
-/// Data sources.
-///
-/// Use [`Source::stdin_as_file`] if available to enable more
-/// fine-grained access to reading from stdin.
-enum Source {
-    /// Input from stdin.
-    #[cfg(not(unix))]
-    Stdin(io::Stdin),
-
-    /// Input from a file.
-    File(File),
-
-    /// Input from stdin, opened from its file descriptor.
-    #[cfg(unix)]
-    StdinFile(File),
-
-    /// Input from a named pipe, also known as a FIFO.
-    #[cfg(unix)]
-    Fifo(File),
-}
-
-impl Source {
-    /// Create a source from stdin using its raw file descriptor.
-    ///
-    /// This returns an instance of the `Source::StdinFile` variant,
-    /// using the raw file descriptor of [`std::io::Stdin`] to create
-    /// the [`std::fs::File`] parameter. You can use this instead of
-    /// `Source::Stdin` to allow reading from stdin without consuming
-    /// the entire contents of stdin when this process terminates.
-    #[cfg(unix)]
-    fn stdin_as_file() -> Self {
-        let fd = io::stdin().as_raw_fd();
-        let f = unsafe { File::from_raw_fd(fd) };
-        Self::StdinFile(f)
-    }
-
-    /// The length of the data source in number of bytes.
-    ///
-    /// If it cannot be determined, then this function returns 0.
-    fn len(&self) -> std::io::Result<i64> {
-        match self {
-            Self::File(f) => Ok(f.metadata()?.len().try_into().unwrap_or(i64::MAX)),
-            _ => Ok(0),
-        }
-    }
-
-    fn skip(&mut self, n: u64) -> io::Result<u64> {
-        match self {
-            #[cfg(not(unix))]
-            Self::Stdin(stdin) => match io::copy(&mut stdin.take(n), &mut io::sink()) {
-                Ok(m) if m < n => {
-                    show_error!("'standard input': cannot skip to specified offset");
-                    Ok(m)
-                }
-                Ok(m) => Ok(m),
-                Err(e) => Err(e),
-            },
-            #[cfg(unix)]
-            Self::StdinFile(f) => match io::copy(&mut f.take(n), &mut io::sink()) {
-                Ok(m) if m < n => {
-                    show_error!("'standard input': cannot skip to specified offset");
-                    Ok(m)
-                }
-                Ok(m) => Ok(m),
-                Err(e) => Err(e),
-            },
-            Self::File(f) => f.seek(io::SeekFrom::Start(n)),
-            #[cfg(unix)]
-            Self::Fifo(f) => io::copy(&mut f.take(n), &mut io::sink()),
-        }
-    }
-
-    /// Discard the system file cache for the given portion of the data source.
-    ///
-    /// `offset` and `len` specify a contiguous portion of the data
-    /// source. This function informs the kernel that the specified
-    /// portion of the source is no longer needed. If not possible,
-    /// then this function returns an error.
-    #[cfg(target_os = "linux")]
-    fn discard_cache(&self, offset: libc::off_t, len: libc::off_t) -> nix::Result<()> {
-        match self {
-            Self::File(f) => {
-                let advice = PosixFadviseAdvice::POSIX_FADV_DONTNEED;
-                posix_fadvise(f.as_raw_fd(), offset, len, advice)
-            }
-            _ => Err(Errno::ESPIPE), // "Illegal seek"
-        }
-    }
-}
-
-impl Read for Source {
-    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
-        match self {
-            #[cfg(not(unix))]
-            Self::Stdin(stdin) => stdin.read(buf),
-            Self::File(f) => f.read(buf),
-            #[cfg(unix)]
-            Self::StdinFile(f) => f.read(buf),
-            #[cfg(unix)]
-            Self::Fifo(f) => f.read(buf),
-        }
-    }
-}
-
-/// The source of the data, configured with the given settings.
-///
-/// Use the [`Input::new_stdin`] or [`Input::new_file`] functions to
-/// construct a new instance of this struct. Then pass the instance to
-/// the [`dd_copy`] function to execute the main copy operation
-/// for `dd`.
-struct Input<'a> {
-    /// The source from which bytes will be read.
-    src: Source,
-
-    /// Configuration settings for how to read the data.
-    settings: &'a Settings,
-}
-
-impl<'a> Input<'a> {
-    /// Instantiate this struct with stdin as a source.
-    fn new_stdin(settings: &'a Settings) -> UResult<Self> {
-        #[cfg(not(unix))]
-        let mut src = Source::Stdin(io::stdin());
-        #[cfg(unix)]
-        let mut src = Source::stdin_as_file();
-        if settings.skip > 0 {
-            src.skip(settings.skip)?;
-        }
-        Ok(Self { src, settings })
-    }
-
-    /// Instantiate this struct with the named file as a source.
-    fn new_file(filename: &Path, settings: &'a Settings) -> UResult<Self> {
-        let src = {
-            let mut opts = OpenOptions::new();
-            opts.read(true);
-
-            #[cfg(any(target_os = "linux", target_os = "android"))]
-            if let Some(libc_flags) = make_linux_iflags(&settings.iflags) {
-                opts.custom_flags(libc_flags);
-            }
-
-            opts.open(filename)
-                .map_err_context(|| format!("failed to open {}", filename.quote()))?
-        };
-
-        let mut src = Source::File(src);
-        if settings.skip > 0 {
-            src.skip(settings.skip)?;
-        }
-        Ok(Self { src, settings })
-    }
-
-    /// Instantiate this struct with the named pipe as a source.
-    #[cfg(unix)]
-    fn new_fifo(filename: &Path, settings: &'a Settings) -> UResult<Self> {
-        let mut opts = OpenOptions::new();
-        opts.read(true);
-        #[cfg(any(target_os = "linux", target_os = "android"))]
-        opts.custom_flags(make_linux_iflags(&settings.iflags).unwrap_or(0));
-        let mut src = Source::Fifo(opts.open(filename)?);
-        if settings.skip > 0 {
-            src.skip(settings.skip)?;
-        }
-        Ok(Self { src, settings })
-    }
-}
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-fn make_linux_iflags(iflags: &IFlags) -> Option<libc::c_int> {
-    let mut flag = 0;
-
-    if iflags.direct {
-        flag |= libc::O_DIRECT;
-    }
-    if iflags.directory {
-        flag |= libc::O_DIRECTORY;
-    }
-    if iflags.dsync {
-        flag |= libc::O_DSYNC;
-    }
-    if iflags.noatime {
-        flag |= libc::O_NOATIME;
-    }
-    if iflags.noctty {
-        flag |= libc::O_NOCTTY;
-    }
-    if iflags.nofollow {
-        flag |= libc::O_NOFOLLOW;
-    }
-    if iflags.nonblock {
-        flag |= libc::O_NONBLOCK;
-    }
-    if iflags.sync {
-        flag |= libc::O_SYNC;
-    }
-
-    if flag == 0 {
-        None
-    } else {
-        Some(flag)
-    }
-}
-
-impl<'a> Read for Input<'a> {
-    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
-        let mut base_idx = 0;
-        let target_len = buf.len();
-        loop {
-            match self.src.read(&mut buf[base_idx..]) {
-                Ok(0) => return Ok(base_idx),
-                Ok(rlen) if self.settings.iflags.fullblock => {
-                    base_idx += rlen;
-
-                    if base_idx >= target_len {
-                        return Ok(target_len);
-                    }
-                }
-                Ok(len) => return Ok(len),
-                Err(e) if e.kind() == io::ErrorKind::Interrupted => continue,
-                Err(_) if self.settings.iconv.noerror => return Ok(base_idx),
-                Err(e) => return Err(e),
-            }
-        }
-    }
-}
-
-impl<'a> Input<'a> {
-    /// Discard the system file cache for the given portion of the input.
-    ///
-    /// `offset` and `len` specify a contiguous portion of the input.
-    /// This function informs the kernel that the specified portion of
-    /// the input file is no longer needed. If not possible, then this
-    /// function prints an error message to stderr and sets the exit
-    /// status code to 1.
-    #[allow(unused_variables)]
-    fn discard_cache(&self, offset: libc::off_t, len: libc::off_t) {
-        #[cfg(target_os = "linux")]
-        {
-            show_if_err!(self
-                .src
-                .discard_cache(offset, len)
-                .map_err_context(|| "failed to discard cache for: 'standard input'".to_string()));
-        }
-        #[cfg(not(target_os = "linux"))]
-        {
-            // TODO Is there a way to discard filesystem cache on
-            // these other operating systems?
-        }
-    }
-
-    /// Fills a given buffer.
-    /// Reads in increments of 'self.ibs'.
-    /// The start of each ibs-sized read follows the previous one.
-    fn fill_consecutive(&mut self, buf: &mut Vec<u8>) -> std::io::Result<ReadStat> {
-        let mut reads_complete = 0;
-        let mut reads_partial = 0;
-        let mut bytes_total = 0;
-
-        for chunk in buf.chunks_mut(self.settings.ibs) {
-            match self.read(chunk)? {
-                rlen if rlen == self.settings.ibs => {
-                    bytes_total += rlen;
-                    reads_complete += 1;
-                }
-                rlen if rlen > 0 => {
-                    bytes_total += rlen;
-                    reads_partial += 1;
-                }
-                _ => break,
-            }
-        }
-        buf.truncate(bytes_total);
-        Ok(ReadStat {
-            reads_complete,
-            reads_partial,
-            // Records are not truncated when filling.
-            records_truncated: 0,
-            bytes_total: bytes_total.try_into().unwrap(),
-        })
-    }
-
-    /// Fills a given buffer.
-    /// Reads in increments of 'self.ibs'.
-    /// The start of each ibs-sized read is aligned to multiples of ibs; remaining space is filled with the 'pad' byte.
-    fn fill_blocks(&mut self, buf: &mut Vec<u8>, pad: u8) -> std::io::Result<ReadStat> {
-        let mut reads_complete = 0;
-        let mut reads_partial = 0;
-        let mut base_idx = 0;
-        let mut bytes_total = 0;
-
-        while base_idx < buf.len() {
-            let next_blk = cmp::min(base_idx + self.settings.ibs, buf.len());
-            let target_len = next_blk - base_idx;
-
-            match self.read(&mut buf[base_idx..next_blk])? {
-                0 => break,
-                rlen if rlen < target_len => {
-                    bytes_total += rlen;
-                    reads_partial += 1;
-                    let padding = vec![pad; target_len - rlen];
-                    buf.splice(base_idx + rlen..next_blk, padding.into_iter());
-                }
-                rlen => {
-                    bytes_total += rlen;
-                    reads_complete += 1;
-                }
-            }
-
-            base_idx += self.settings.ibs;
-        }
-
-        buf.truncate(base_idx);
-        Ok(ReadStat {
-            reads_complete,
-            reads_partial,
-            records_truncated: 0,
-            bytes_total: bytes_total.try_into().unwrap(),
-        })
-    }
-}
-
-enum Density {
-    Sparse,
-    Dense,
-}
-
-/// Data destinations.
-enum Dest {
-    /// Output to stdout.
-    Stdout(Stdout),
-
-    /// Output to a file.
-    ///
-    /// The [`Density`] component indicates whether to attempt to
-    /// write a sparse file when all-zero blocks are encountered.
-    File(File, Density),
-
-    /// Output to a named pipe, also known as a FIFO.
-    #[cfg(unix)]
-    Fifo(File),
-
-    /// Output to nothing, dropping each byte written to the output.
-    #[cfg(unix)]
-    Sink,
-}
-
-impl Dest {
-    fn fsync(&mut self) -> io::Result<()> {
-        match self {
-            Self::Stdout(stdout) => stdout.flush(),
-            Self::File(f, _) => {
-                f.flush()?;
-                f.sync_all()
-            }
-            #[cfg(unix)]
-            Self::Fifo(f) => {
-                f.flush()?;
-                f.sync_all()
-            }
-            #[cfg(unix)]
-            Self::Sink => Ok(()),
-        }
-    }
-
-    fn fdatasync(&mut self) -> io::Result<()> {
-        match self {
-            Self::Stdout(stdout) => stdout.flush(),
-            Self::File(f, _) => {
-                f.flush()?;
-                f.sync_data()
-            }
-            #[cfg(unix)]
-            Self::Fifo(f) => {
-                f.flush()?;
-                f.sync_data()
-            }
-            #[cfg(unix)]
-            Self::Sink => Ok(()),
-        }
-    }
-
-    fn seek(&mut self, n: u64) -> io::Result<u64> {
-        match self {
-            Self::Stdout(stdout) => io::copy(&mut io::repeat(0).take(n), stdout),
-            Self::File(f, _) => f.seek(io::SeekFrom::Start(n)),
-            #[cfg(unix)]
-            Self::Fifo(f) => {
-                // Seeking in a named pipe means *reading* from the pipe.
-                io::copy(&mut f.take(n), &mut io::sink())
-            }
-            #[cfg(unix)]
-            Self::Sink => Ok(0),
-        }
-    }
-
-    /// Truncate the underlying file to the current stream position, if possible.
-    fn truncate(&mut self) -> io::Result<()> {
-        match self {
-            Self::File(f, _) => {
-                let pos = f.stream_position()?;
-                f.set_len(pos)
-            }
-            _ => Ok(()),
-        }
-    }
-
-    /// Discard the system file cache for the given portion of the destination.
-    ///
-    /// `offset` and `len` specify a contiguous portion of the
-    /// destination. This function informs the kernel that the
-    /// specified portion of the destination is no longer needed. If
-    /// not possible, then this function returns an error.
-    #[cfg(target_os = "linux")]
-    fn discard_cache(&self, offset: libc::off_t, len: libc::off_t) -> nix::Result<()> {
-        match self {
-            Self::File(f, _) => {
-                let advice = PosixFadviseAdvice::POSIX_FADV_DONTNEED;
-                posix_fadvise(f.as_raw_fd(), offset, len, advice)
-            }
-            _ => Err(Errno::ESPIPE), // "Illegal seek"
-        }
-    }
-
-    /// The length of the data destination in number of bytes.
-    ///
-    /// If it cannot be determined, then this function returns 0.
-    fn len(&self) -> std::io::Result<i64> {
-        match self {
-            Self::File(f, _) => Ok(f.metadata()?.len().try_into().unwrap_or(i64::MAX)),
-            _ => Ok(0),
-        }
-    }
-}
-
-/// Decide whether the given buffer is all zeros.
-fn is_sparse(buf: &[u8]) -> bool {
-    buf.iter().all(|&e| e == 0u8)
-}
-
-impl Write for Dest {
-    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
-        match self {
-            Self::File(f, Density::Sparse) if is_sparse(buf) => {
-                let seek_amt: i64 = buf
-                    .len()
-                    .try_into()
-                    .expect("Internal dd Error: Seek amount greater than signed 64-bit integer");
-                f.seek(io::SeekFrom::Current(seek_amt))?;
-                Ok(buf.len())
-            }
-            Self::File(f, _) => f.write(buf),
-            Self::Stdout(stdout) => stdout.write(buf),
-            #[cfg(unix)]
-            Self::Fifo(f) => f.write(buf),
-            #[cfg(unix)]
-            Self::Sink => Ok(buf.len()),
-        }
-    }
-
-    fn flush(&mut self) -> io::Result<()> {
-        match self {
-            Self::Stdout(stdout) => stdout.flush(),
-            Self::File(f, _) => f.flush(),
-            #[cfg(unix)]
-            Self::Fifo(f) => f.flush(),
-            #[cfg(unix)]
-            Self::Sink => Ok(()),
-        }
-    }
-}
-
-/// The destination of the data, configured with the given settings.
-///
-/// Use the [`Output::new_stdout`] or [`Output::new_file`] functions
-/// to construct a new instance of this struct. Then use the
-/// [`dd_copy`] function to execute the main copy operation for
-/// `dd`.
-struct Output<'a> {
-    /// The destination to which bytes will be written.
-    dst: Dest,
-
-    /// Configuration settings for how to read and write the data.
-    settings: &'a Settings,
-}
-
-impl<'a> Output<'a> {
-    /// Instantiate this struct with stdout as a destination.
-    fn new_stdout(settings: &'a Settings) -> UResult<Self> {
-        let mut dst = Dest::Stdout(io::stdout());
-        dst.seek(settings.seek)
-            .map_err_context(|| "write error".to_string())?;
-        Ok(Self { dst, settings })
-    }
-
-    /// Instantiate this struct with the named file as a destination.
-    fn new_file(filename: &Path, settings: &'a Settings) -> UResult<Self> {
-        fn open_dst(path: &Path, cflags: &OConvFlags, oflags: &OFlags) -> Result<File, io::Error> {
-            let mut opts = OpenOptions::new();
-            opts.write(true)
-                .create(!cflags.nocreat)
-                .create_new(cflags.excl)
-                .append(oflags.append);
-
-            #[cfg(any(target_os = "linux", target_os = "android"))]
-            if let Some(libc_flags) = make_linux_oflags(oflags) {
-                opts.custom_flags(libc_flags);
-            }
-
-            opts.open(path)
-        }
-
-        let dst = open_dst(filename, &settings.oconv, &settings.oflags)
-            .map_err_context(|| format!("failed to open {}", filename.quote()))?;
-
-        // Seek to the index in the output file, truncating if requested.
-        //
-        // Calling `set_len()` may result in an error (for example,
-        // when calling it on `/dev/null`), but we don't want to
-        // terminate the process when that happens.  Instead, we
-        // suppress the error by calling `Result::ok()`. This matches
-        // the behavior of GNU `dd` when given the command-line
-        // argument `of=/dev/null`.
-        if !settings.oconv.notrunc {
-            dst.set_len(settings.seek).ok();
-        }
-        let density = if settings.oconv.sparse {
-            Density::Sparse
-        } else {
-            Density::Dense
-        };
-        let mut dst = Dest::File(dst, density);
-        dst.seek(settings.seek)
-            .map_err_context(|| "failed to seek in output file".to_string())?;
-        Ok(Self { dst, settings })
-    }
-
-    /// Instantiate this struct with the given named pipe as a destination.
-    #[cfg(unix)]
-    fn new_fifo(filename: &Path, settings: &'a Settings) -> UResult<Self> {
-        // We simulate seeking in a FIFO by *reading*, so we open the
-        // file for reading. But then we need to close the file and
-        // re-open it for writing.
-        if settings.seek > 0 {
-            Dest::Fifo(File::open(filename)?).seek(settings.seek)?;
-        }
-        // If `count=0`, then we don't bother opening the file for
-        // writing because that would cause this process to block
-        // indefinitely.
-        if let Some(Num::Blocks(0) | Num::Bytes(0)) = settings.count {
-            let dst = Dest::Sink;
-            return Ok(Self { dst, settings });
-        }
-        // At this point, we know there is at least one block to write
-        // to the output, so we open the file for writing.
-        let mut opts = OpenOptions::new();
-        opts.write(true)
-            .create(!settings.oconv.nocreat)
-            .create_new(settings.oconv.excl)
-            .append(settings.oflags.append);
-        #[cfg(any(target_os = "linux", target_os = "android"))]
-        opts.custom_flags(make_linux_oflags(&settings.oflags).unwrap_or(0));
-        let dst = Dest::Fifo(opts.open(filename)?);
-        Ok(Self { dst, settings })
-    }
-
-    /// Discard the system file cache for the given portion of the output.
-    ///
-    /// `offset` and `len` specify a contiguous portion of the output.
-    /// This function informs the kernel that the specified portion of
-    /// the output file is no longer needed. If not possible, then
-    /// this function prints an error message to stderr and sets the
-    /// exit status code to 1.
-    #[allow(unused_variables)]
-    fn discard_cache(&self, offset: libc::off_t, len: libc::off_t) {
-        #[cfg(target_os = "linux")]
-        {
-            show_if_err!(self
-                .dst
-                .discard_cache(offset, len)
-                .map_err_context(|| "failed to discard cache for: 'standard output'".to_string()));
-        }
-        #[cfg(target_os = "linux")]
-        {
-            // TODO Is there a way to discard filesystem cache on
-            // these other operating systems?
-        }
-    }
-
-    /// Write the given bytes one block at a time.
-    ///
-    /// This may write partial blocks (for example, if the underlying
-    /// call to [`Write::write`] writes fewer than `buf.len()`
-    /// bytes). The returned [`WriteStat`] object will include the
-    /// number of partial and complete blocks written during execution
-    /// of this function.
-    fn write_blocks(&mut self, buf: &[u8]) -> io::Result<WriteStat> {
-        let mut writes_complete = 0;
-        let mut writes_partial = 0;
-        let mut bytes_total = 0;
-
-        for chunk in buf.chunks(self.settings.obs) {
-            let wlen = self.dst.write(chunk)?;
-            if wlen < self.settings.obs {
-                writes_partial += 1;
-            } else {
-                writes_complete += 1;
-            }
-            bytes_total += wlen;
-        }
-
-        Ok(WriteStat {
-            writes_complete,
-            writes_partial,
-            bytes_total: bytes_total.try_into().unwrap_or(0u128),
-        })
-    }
-
-    /// Flush the output to disk, if configured to do so.
-    fn sync(&mut self) -> std::io::Result<()> {
-        if self.settings.oconv.fsync {
-            self.dst.fsync()
-        } else if self.settings.oconv.fdatasync {
-            self.dst.fdatasync()
-        } else {
-            // Intentionally do nothing in this case.
-            Ok(())
-        }
-    }
-}
-
-/// Copy the given input data to this output, consuming both.
-///
-/// This method contains the main loop for the `dd` program. Bytes
-/// are read in blocks from `i` and written in blocks to this
-/// output. Read/write statistics are reported to stderr as
-/// configured by the `status` command-line argument.
-///
-/// # Errors
-///
-/// If there is a problem reading from the input or writing to
-/// this output.
-fn dd_copy(mut i: Input, mut o: Output) -> std::io::Result<()> {
-    // The read and write statistics.
-    //
-    // These objects are counters, initialized to zero. After each
-    // iteration of the main loop, each will be incremented by the
-    // number of blocks read and written, respectively.
-    let mut rstat = ReadStat::default();
-    let mut wstat = WriteStat::default();
-
-    // The time at which the main loop starts executing.
-    //
-    // When `status=progress` is given on the command-line, the
-    // `dd` program reports its progress every second or so. Part
-    // of its report includes the throughput in bytes per second,
-    // which requires knowing how long the process has been
-    // running.
-    let start = Instant::now();
-
-    // A good buffer size for reading.
-    //
-    // This is an educated guess about a good buffer size based on
-    // the input and output block sizes.
-    let bsize = calc_bsize(i.settings.ibs, o.settings.obs);
-
-    // Start a thread that reports transfer progress.
-    //
-    // The `dd` program reports its progress after every block is written,
-    // at most every 1 second, and only if `status=progress` is given on
-    // the command-line or a SIGUSR1 signal is received. We
-    // perform this reporting in a new thread so as not to take
-    // any CPU time away from the actual reading and writing of
-    // data. We send a `ProgUpdate` from the transmitter `prog_tx`
-    // to the receives `rx`, and the receiver prints the transfer
-    // information.
-    let (prog_tx, rx) = mpsc::channel();
-    let output_thread = thread::spawn(gen_prog_updater(rx, i.settings.status));
-
-    // Optimization: if no blocks are to be written, then don't
-    // bother allocating any buffers.
-    if let Some(Num::Blocks(0) | Num::Bytes(0)) = i.settings.count {
-        // Even though we are not reading anything from the input
-        // file, we still need to honor the `nocache` flag, which
-        // requests that we inform the system that we no longer
-        // need the contents of the input file in a system cache.
-        //
-        // TODO Better error handling for overflowing `len`.
-        if i.settings.iflags.nocache {
-            let offset = 0;
-            #[allow(clippy::useless_conversion)]
-            let len = i.src.len()?.try_into().unwrap();
-            i.discard_cache(offset, len);
-        }
-        // Similarly, discard the system cache for the output file.
-        //
-        // TODO Better error handling for overflowing `len`.
-        if i.settings.oflags.nocache {
-            let offset = 0;
-            #[allow(clippy::useless_conversion)]
-            let len = o.dst.len()?.try_into().unwrap();
-            o.discard_cache(offset, len);
-        }
-        return finalize(&mut o, rstat, wstat, start, &prog_tx, output_thread);
-    };
-
-    // Create a common buffer with a capacity of the block size.
-    // This is the max size needed.
-    let mut buf = vec![BUF_INIT_BYTE; bsize];
-
-    // Spawn a timer thread to provide a scheduled signal indicating when we
-    // should send an update of our progress to the reporting thread.
-    //
-    // This avoids the need to query the OS monotonic clock for every block.
-    let alarm = Alarm::with_interval(Duration::from_secs(1));
-
-    // Index in the input file where we are reading bytes and in
-    // the output file where we are writing bytes.
-    //
-    // These are updated on each iteration of the main loop.
-    let mut read_offset = 0;
-    let mut write_offset = 0;
-
-    // The main read/write loop.
-    //
-    // Each iteration reads blocks from the input and writes
-    // blocks to this output. Read/write statistics are updated on
-    // each iteration and cumulative statistics are reported to
-    // the progress reporting thread.
-    while below_count_limit(&i.settings.count, &rstat, &wstat) {
-        // Read a block from the input then write the block to the output.
-        //
-        // As an optimization, make an educated guess about the
-        // best buffer size for reading based on the number of
-        // blocks already read and the number of blocks remaining.
-        let loop_bsize = calc_loop_bsize(&i.settings.count, &rstat, &wstat, i.settings.ibs, bsize);
-        let rstat_update = read_helper(&mut i, &mut buf, loop_bsize)?;
-        if rstat_update.is_empty() {
-            break;
-        }
-        let wstat_update = o.write_blocks(&buf)?;
-
-        // Discard the system file cache for the read portion of
-        // the input file.
-        //
-        // TODO Better error handling for overflowing `offset` and `len`.
-        let read_len = rstat_update.bytes_total;
-        if i.settings.iflags.nocache {
-            let offset = read_offset.try_into().unwrap();
-            let len = read_len.try_into().unwrap();
-            i.discard_cache(offset, len);
-        }
-        read_offset += read_len;
-
-        // Discard the system file cache for the written portion
-        // of the output file.
-        //
-        // TODO Better error handling for overflowing `offset` and `len`.
-        let write_len = wstat_update.bytes_total;
-        if o.settings.oflags.nocache {
-            let offset = write_offset.try_into().unwrap();
-            let len = write_len.try_into().unwrap();
-            o.discard_cache(offset, len);
-        }
-        write_offset += write_len;
-
-        // Update the read/write stats and inform the progress thread once per second.
-        //
-        // If the receiver is disconnected, `send()` returns an
-        // error. Since it is just reporting progress and is not
-        // crucial to the operation of `dd`, let's just ignore the
-        // error.
-        rstat += rstat_update;
-        wstat += wstat_update;
-        if alarm.is_triggered() {
-            let prog_update = ProgUpdate::new(rstat, wstat, start.elapsed(), false);
-            prog_tx.send(prog_update).unwrap_or(());
-        }
-    }
-    finalize(&mut o, rstat, wstat, start, &prog_tx, output_thread)
-}
-
-/// Flush output, print final stats, and join with the progress thread.
-fn finalize<T>(
-    output: &mut Output,
-    rstat: ReadStat,
-    wstat: WriteStat,
-    start: Instant,
-    prog_tx: &mpsc::Sender<ProgUpdate>,
-    output_thread: thread::JoinHandle<T>,
-) -> std::io::Result<()> {
-    // Flush the output, if configured to do so.
-    output.sync()?;
-
-    // Truncate the file to the final cursor location.
-    //
-    // Calling `set_len()` may result in an error (for example,
-    // when calling it on `/dev/null`), but we don't want to
-    // terminate the process when that happens. Instead, we
-    // suppress the error by calling `Result::ok()`. This matches
-    // the behavior of GNU `dd` when given the command-line
-    // argument `of=/dev/null`.
-    if !output.settings.oconv.notrunc {
-        output.dst.truncate().ok();
-    }
-
-    // Print the final read/write statistics.
-    let prog_update = ProgUpdate::new(rstat, wstat, start.elapsed(), true);
-    prog_tx.send(prog_update).unwrap_or(());
-    // Wait for the output thread to finish
-    output_thread
-        .join()
-        .expect("Failed to join with the output thread.");
-    Ok(())
-}
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-#[allow(clippy::cognitive_complexity)]
-fn make_linux_oflags(oflags: &OFlags) -> Option<libc::c_int> {
-    let mut flag = 0;
-
-    // oflag=FLAG
-    if oflags.append {
-        flag |= libc::O_APPEND;
-    }
-    if oflags.direct {
-        flag |= libc::O_DIRECT;
-    }
-    if oflags.directory {
-        flag |= libc::O_DIRECTORY;
-    }
-    if oflags.dsync {
-        flag |= libc::O_DSYNC;
-    }
-    if oflags.noatime {
-        flag |= libc::O_NOATIME;
-    }
-    if oflags.noctty {
-        flag |= libc::O_NOCTTY;
-    }
-    if oflags.nofollow {
-        flag |= libc::O_NOFOLLOW;
-    }
-    if oflags.nonblock {
-        flag |= libc::O_NONBLOCK;
-    }
-    if oflags.sync {
-        flag |= libc::O_SYNC;
-    }
-
-    if flag == 0 {
-        None
-    } else {
-        Some(flag)
-    }
-}
-
-/// Read from an input (that is, a source of bytes) into the given buffer.
-///
-/// This function also performs any conversions as specified by
-/// `conv=swab` or `conv=block` command-line arguments. This function
-/// mutates the `buf` argument in-place. The returned [`ReadStat`]
-/// indicates how many blocks were read.
-fn read_helper(i: &mut Input, buf: &mut Vec<u8>, bsize: usize) -> std::io::Result<ReadStat> {
-    // Local Helper Fns -------------------------------------------------
-    fn perform_swab(buf: &mut [u8]) {
-        for base in (1..buf.len()).step_by(2) {
-            buf.swap(base, base - 1);
-        }
-    }
-    // ------------------------------------------------------------------
-    // Read
-    // Resize the buffer to the bsize. Any garbage data in the buffer is overwritten or truncated, so there is no need to fill with BUF_INIT_BYTE first.
-    buf.resize(bsize, BUF_INIT_BYTE);
-
-    let mut rstat = match i.settings.iconv.sync {
-        Some(ch) => i.fill_blocks(buf, ch)?,
-        _ => i.fill_consecutive(buf)?,
-    };
-    // Return early if no data
-    if rstat.reads_complete == 0 && rstat.reads_partial == 0 {
-        return Ok(rstat);
-    }
-
-    // Perform any conv=x[,x...] options
-    if i.settings.iconv.swab {
-        perform_swab(buf);
-    }
-
-    match i.settings.iconv.mode {
-        Some(ref mode) => {
-            *buf = conv_block_unblock_helper(buf.clone(), mode, &mut rstat);
-            Ok(rstat)
-        }
-        None => Ok(rstat),
-    }
-}
-
-// Calculate a 'good' internal buffer size.
-// For performance of the read/write functions, the buffer should hold
-// both an integral number of reads and an integral number of writes. For
-// sane real-world memory use, it should not be too large. I believe
-// the least common multiple is a good representation of these interests.
-// https://en.wikipedia.org/wiki/Least_common_multiple#Using_the_greatest_common_divisor
-fn calc_bsize(ibs: usize, obs: usize) -> usize {
-    let gcd = Gcd::gcd(ibs, obs);
-    // calculate the lcm from gcd
-    (ibs / gcd) * obs
-}
-
-// Calculate the buffer size appropriate for this loop iteration, respecting
-// a count=N if present.
-fn calc_loop_bsize(
-    count: &Option<Num>,
-    rstat: &ReadStat,
-    wstat: &WriteStat,
-    ibs: usize,
-    ideal_bsize: usize,
-) -> usize {
-    match count {
-        Some(Num::Blocks(rmax)) => {
-            let rsofar = rstat.reads_complete + rstat.reads_partial;
-            let rremain = rmax - rsofar;
-            cmp::min(ideal_bsize as u64, rremain * ibs as u64) as usize
-        }
-        Some(Num::Bytes(bmax)) => {
-            let bmax: u128 = (*bmax).try_into().unwrap();
-            let bremain: u128 = bmax - wstat.bytes_total;
-            cmp::min(ideal_bsize as u128, bremain) as usize
-        }
-        None => ideal_bsize,
-    }
-}
-
-// Decide if the current progress is below a count=N limit or return
-// true if no such limit is set.
-fn below_count_limit(count: &Option<Num>, rstat: &ReadStat, wstat: &WriteStat) -> bool {
-    match count {
-        Some(Num::Blocks(n)) => {
-            let n = *n;
-            rstat.reads_complete + rstat.reads_partial <= n
-        }
-        Some(Num::Bytes(n)) => {
-            let n = (*n).try_into().unwrap();
-            wstat.bytes_total <= n
-        }
-        None => true,
-    }
-}
-
-/// Canonicalized file name of `/dev/stdout`.
-///
-/// For example, if this process were invoked from the command line as
-/// `dd`, then this function returns the [`OsString`] form of
-/// `"/dev/stdout"`. However, if this process were invoked as `dd >
-/// outfile`, then this function returns the canonicalized path to
-/// `outfile`, something like `"/path/to/outfile"`.
-fn stdout_canonicalized() -> OsString {
-    match Path::new("/dev/stdout").canonicalize() {
-        Ok(p) => p.into_os_string(),
-        Err(_) => OsString::from("/dev/stdout"),
-    }
-}
-
-/// Decide whether stdout is being redirected to a seekable file.
-///
-/// For example, if this process were invoked from the command line as
-///
-/// ```sh
-/// dd if=/dev/zero bs=1 count=10 seek=5 > /dev/sda1
-/// ```
-///
-/// where `/dev/sda1` is a seekable block device then this function
-/// would return true. If invoked as
-///
-/// ```sh
-/// dd if=/dev/zero bs=1 count=10 seek=5
-/// ```
-///
-/// then this function would return false.
-fn is_stdout_redirected_to_seekable_file() -> bool {
-    let s = stdout_canonicalized();
-    let p = Path::new(&s);
-    match File::open(p) {
-        Ok(mut f) => {
-            f.stream_position().is_ok() && f.seek(SeekFrom::End(0)).is_ok() && f.rewind().is_ok()
-        }
-        Err(_) => false,
-    }
-}
-
-/// Decide whether the named file is a named pipe, also known as a FIFO.
-#[cfg(unix)]
-fn is_fifo(filename: &str) -> bool {
-    if let Ok(metadata) = std::fs::metadata(filename) {
-        if metadata.file_type().is_fifo() {
-            return true;
-        }
-    }
-    false
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let settings: Settings = Parser::new().parse(
-        &matches
-            .get_many::<String>(options::OPERANDS)
-            .unwrap_or_default()
-            .map(|s| s.as_ref())
-            .collect::<Vec<_>>()[..],
-    )?;
-
-    let i = match settings.infile {
-        #[cfg(unix)]
-        Some(ref infile) if is_fifo(infile) => Input::new_fifo(Path::new(&infile), &settings)?,
-        Some(ref infile) => Input::new_file(Path::new(&infile), &settings)?,
-        None => Input::new_stdin(&settings)?,
-    };
-    let o = match settings.outfile {
-        #[cfg(unix)]
-        Some(ref outfile) if is_fifo(outfile) => Output::new_fifo(Path::new(&outfile), &settings)?,
-        Some(ref outfile) => Output::new_file(Path::new(&outfile), &settings)?,
-        None if is_stdout_redirected_to_seekable_file() => {
-            Output::new_file(Path::new(&stdout_canonicalized()), &settings)?
-        }
-        None => Output::new_stdout(&settings)?,
-    };
-    dd_copy(i, o).map_err_context(|| "IO error".to_string())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .after_help(AFTER_HELP)
-        .infer_long_args(true)
-        .arg(Arg::new(options::OPERANDS).num_args(1..))
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::{calc_bsize, Output, Parser};
-
-    use std::path::Path;
-
-    #[test]
-    fn bsize_test_primes() {
-        let (n, m) = (7901, 7919);
-        let res = calc_bsize(n, m);
-        assert!(res % n == 0);
-        assert!(res % m == 0);
-
-        assert_eq!(res, n * m);
-    }
-
-    #[test]
-    fn bsize_test_rel_prime_obs_greater() {
-        let (n, m) = (7 * 5119, 13 * 5119);
-        let res = calc_bsize(n, m);
-        assert!(res % n == 0);
-        assert!(res % m == 0);
-
-        assert_eq!(res, 7 * 13 * 5119);
-    }
-
-    #[test]
-    fn bsize_test_rel_prime_ibs_greater() {
-        let (n, m) = (13 * 5119, 7 * 5119);
-        let res = calc_bsize(n, m);
-        assert!(res % n == 0);
-        assert!(res % m == 0);
-
-        assert_eq!(res, 7 * 13 * 5119);
-    }
-
-    #[test]
-    fn bsize_test_3fac_rel_prime() {
-        let (n, m) = (11 * 13 * 5119, 7 * 11 * 5119);
-        let res = calc_bsize(n, m);
-        assert!(res % n == 0);
-        assert!(res % m == 0);
-
-        assert_eq!(res, 7 * 11 * 13 * 5119);
-    }
-
-    #[test]
-    fn bsize_test_ibs_greater() {
-        let (n, m) = (512 * 1024, 256 * 1024);
-        let res = calc_bsize(n, m);
-        assert!(res % n == 0);
-        assert!(res % m == 0);
-
-        assert_eq!(res, n);
-    }
-
-    #[test]
-    fn bsize_test_obs_greater() {
-        let (n, m) = (256 * 1024, 512 * 1024);
-        let res = calc_bsize(n, m);
-        assert!(res % n == 0);
-        assert!(res % m == 0);
-
-        assert_eq!(res, m);
-    }
-
-    #[test]
-    fn bsize_test_bs_eq() {
-        let (n, m) = (1024, 1024);
-        let res = calc_bsize(n, m);
-        assert!(res % n == 0);
-        assert!(res % m == 0);
-
-        assert_eq!(res, m);
-    }
-
-    #[test]
-    fn test_nocreat_causes_failure_when_ofile_doesnt_exist() {
-        let args = &["conv=nocreat", "of=not-a-real.file"];
-        let settings = Parser::new().parse(args).unwrap();
-        assert!(
-            Output::new_file(Path::new(settings.outfile.as_ref().unwrap()), &settings).is_err()
-        );
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dd/numbers.rs.html b/coreutils/dev/src/uu_dd/numbers.rs.html deleted file mode 100644 index 94b81009c..000000000 --- a/coreutils/dev/src/uu_dd/numbers.rs.html +++ /dev/null @@ -1,315 +0,0 @@ -numbers.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-/// Functions for formatting a number as a magnitude and a unit suffix.
-
-/// The first ten powers of 1024.
-const IEC_BASES: [u128; 10] = [
-    1,
-    1_024,
-    1_048_576,
-    1_073_741_824,
-    1_099_511_627_776,
-    1_125_899_906_842_624,
-    1_152_921_504_606_846_976,
-    1_180_591_620_717_411_303_424,
-    1_208_925_819_614_629_174_706_176,
-    1_237_940_039_285_380_274_899_124_224,
-];
-
-const IEC_SUFFIXES: [&str; 9] = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"];
-
-/// The first ten powers of 1000.
-const SI_BASES: [u128; 10] = [
-    1,
-    1_000,
-    1_000_000,
-    1_000_000_000,
-    1_000_000_000_000,
-    1_000_000_000_000_000,
-    1_000_000_000_000_000_000,
-    1_000_000_000_000_000_000_000,
-    1_000_000_000_000_000_000_000_000,
-    1_000_000_000_000_000_000_000_000_000,
-];
-
-const SI_SUFFIXES: [&str; 9] = ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
-
-/// A SuffixType determines whether the suffixes are 1000 or 1024 based.
-#[derive(Clone, Copy)]
-pub(crate) enum SuffixType {
-    Iec,
-    Si,
-}
-
-impl SuffixType {
-    fn base_and_suffix(&self, n: u128) -> (u128, &'static str) {
-        let (bases, suffixes) = match self {
-            Self::Iec => (IEC_BASES, IEC_SUFFIXES),
-            Self::Si => (SI_BASES, SI_SUFFIXES),
-        };
-        let mut i = 0;
-        while bases[i + 1] - bases[i] < n && i < suffixes.len() {
-            i += 1;
-        }
-        (bases[i], suffixes[i])
-    }
-}
-
-/// Convert a number into a magnitude and a multi-byte unit suffix.
-///
-/// The returned string has a maximum length of 5 chars, for example: "1.1kB", "999kB", "1MB".
-pub(crate) fn to_magnitude_and_suffix(n: u128, suffix_type: SuffixType) -> String {
-    let (base, suffix) = suffix_type.base_and_suffix(n);
-    // TODO To match dd on my machine, we would need to round like
-    // this:
-    //
-    // 1049 => 1.0 kB
-    // 1050 => 1.0 kB  # why is this different?
-    // 1051 => 1.1 kB
-    // ...
-    // 1149 => 1.1 kB
-    // 1150 => 1.2 kB
-    // ...
-    // 1250 => 1.2 kB
-    // 1251 => 1.3 kB
-    // ..
-    // 10500 => 10 kB
-    // 10501 => 11 kB
-    //
-    let quotient = (n as f64) / (base as f64);
-    if quotient < 10.0 {
-        format!("{quotient:.1} {suffix}")
-    } else {
-        format!("{} {}", quotient.round(), suffix)
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::numbers::{to_magnitude_and_suffix, SuffixType};
-
-    #[test]
-    fn test_to_magnitude_and_suffix_powers_of_1024() {
-        assert_eq!(to_magnitude_and_suffix(1024, SuffixType::Iec), "1.0 KiB");
-        assert_eq!(to_magnitude_and_suffix(2048, SuffixType::Iec), "2.0 KiB");
-        assert_eq!(to_magnitude_and_suffix(4096, SuffixType::Iec), "4.0 KiB");
-        assert_eq!(
-            to_magnitude_and_suffix(1024 * 1024, SuffixType::Iec),
-            "1.0 MiB"
-        );
-        assert_eq!(
-            to_magnitude_and_suffix(2 * 1024 * 1024, SuffixType::Iec),
-            "2.0 MiB"
-        );
-        assert_eq!(
-            to_magnitude_and_suffix(1024 * 1024 * 1024, SuffixType::Iec),
-            "1.0 GiB"
-        );
-        assert_eq!(
-            to_magnitude_and_suffix(34 * 1024 * 1024 * 1024, SuffixType::Iec),
-            "34 GiB"
-        );
-    }
-
-    #[test]
-    fn test_to_magnitude_and_suffix_not_powers_of_1024() {
-        assert_eq!(to_magnitude_and_suffix(1, SuffixType::Si), "1.0 B");
-        assert_eq!(to_magnitude_and_suffix(999, SuffixType::Si), "999 B");
-
-        assert_eq!(to_magnitude_and_suffix(1000, SuffixType::Si), "1.0 kB");
-        assert_eq!(to_magnitude_and_suffix(1001, SuffixType::Si), "1.0 kB");
-        assert_eq!(to_magnitude_and_suffix(1023, SuffixType::Si), "1.0 kB");
-        assert_eq!(to_magnitude_and_suffix(1025, SuffixType::Si), "1.0 kB");
-        assert_eq!(to_magnitude_and_suffix(10_001, SuffixType::Si), "10 kB");
-        assert_eq!(to_magnitude_and_suffix(999_000, SuffixType::Si), "999 kB");
-
-        assert_eq!(to_magnitude_and_suffix(999_001, SuffixType::Si), "1.0 MB");
-        assert_eq!(to_magnitude_and_suffix(999_999, SuffixType::Si), "1.0 MB");
-        assert_eq!(to_magnitude_and_suffix(1_000_000, SuffixType::Si), "1.0 MB");
-        assert_eq!(to_magnitude_and_suffix(1_000_001, SuffixType::Si), "1.0 MB");
-        assert_eq!(to_magnitude_and_suffix(1_100_000, SuffixType::Si), "1.1 MB");
-        assert_eq!(to_magnitude_and_suffix(1_100_001, SuffixType::Si), "1.1 MB");
-        assert_eq!(to_magnitude_and_suffix(1_900_000, SuffixType::Si), "1.9 MB");
-        assert_eq!(to_magnitude_and_suffix(1_900_001, SuffixType::Si), "1.9 MB");
-        assert_eq!(to_magnitude_and_suffix(9_900_000, SuffixType::Si), "9.9 MB");
-        assert_eq!(to_magnitude_and_suffix(9_900_001, SuffixType::Si), "9.9 MB");
-        assert_eq!(
-            to_magnitude_and_suffix(999_000_000, SuffixType::Si),
-            "999 MB"
-        );
-
-        assert_eq!(
-            to_magnitude_and_suffix(999_000_001, SuffixType::Si),
-            "1.0 GB"
-        );
-        assert_eq!(
-            to_magnitude_and_suffix(1_000_000_000, SuffixType::Si),
-            "1.0 GB"
-        );
-        assert_eq!(
-            to_magnitude_and_suffix(1_000_000_001, SuffixType::Si),
-            "1.0 GB"
-        );
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dd/parseargs.rs.html b/coreutils/dev/src/uu_dd/parseargs.rs.html deleted file mode 100644 index 04b64c230..000000000 --- a/coreutils/dev/src/uu_dd/parseargs.rs.html +++ /dev/null @@ -1,1295 +0,0 @@ -parseargs.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-
// This file is part of the uutils coreutils package.
-//
-// (c) Tyler Steele <tyler.steele@protonmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-// spell-checker:ignore ctty, ctable, iseek, oseek, iconvflags, oconvflags parseargs outfile oconv
-
-#[cfg(test)]
-mod unit_tests;
-
-use super::{ConversionMode, IConvFlags, IFlags, Num, OConvFlags, OFlags, Settings, StatusLevel};
-use crate::conversion_tables::ConversionTable;
-use std::error::Error;
-use uucore::display::Quotable;
-use uucore::error::UError;
-use uucore::parse_size::{ParseSizeError, Parser as SizeParser};
-use uucore::show_warning;
-
-/// Parser Errors describe errors with parser input
-#[derive(Debug, PartialEq, Eq)]
-pub enum ParseError {
-    UnrecognizedOperand(String),
-    MultipleFmtTable,
-    MultipleUCaseLCase,
-    MultipleBlockUnblock,
-    MultipleExclNoCreate,
-    FlagNoMatch(String),
-    ConvFlagNoMatch(String),
-    MultiplierStringParseFailure(String),
-    MultiplierStringOverflow(String),
-    BlockUnblockWithoutCBS,
-    StatusLevelNotRecognized(String),
-    Unimplemented(String),
-    BsOutOfRange(String),
-    InvalidNumber(String),
-}
-
-/// Contains a temporary state during parsing of the arguments
-#[derive(Debug, PartialEq)]
-pub struct Parser {
-    infile: Option<String>,
-    outfile: Option<String>,
-    ibs: usize,
-    obs: usize,
-    cbs: Option<usize>,
-    skip: Num,
-    seek: Num,
-    count: Option<Num>,
-    conv: ConvFlags,
-    iflag: IFlags,
-    oflag: OFlags,
-    status: Option<StatusLevel>,
-}
-
-impl Default for Parser {
-    fn default() -> Self {
-        Self {
-            ibs: 512,
-            obs: 512,
-            cbs: None,
-            infile: None,
-            outfile: None,
-            skip: Num::Blocks(0),
-            seek: Num::Blocks(0),
-            count: None,
-            conv: ConvFlags::default(),
-            iflag: IFlags::default(),
-            oflag: OFlags::default(),
-            status: None,
-        }
-    }
-}
-
-#[derive(Debug, Default, PartialEq, Eq)]
-pub struct ConvFlags {
-    ascii: bool,
-    ebcdic: bool,
-    ibm: bool,
-    ucase: bool,
-    lcase: bool,
-    block: bool,
-    unblock: bool,
-    swab: bool,
-    sync: bool,
-    noerror: bool,
-    sparse: bool,
-    excl: bool,
-    nocreat: bool,
-    notrunc: bool,
-    fdatasync: bool,
-    fsync: bool,
-}
-
-#[derive(Clone, Copy, PartialEq)]
-enum Conversion {
-    Ascii,
-    Ebcdic,
-    Ibm,
-}
-
-#[derive(Clone, Copy)]
-enum Case {
-    Lower,
-    Upper,
-}
-
-#[derive(Clone, Copy)]
-enum Block {
-    Block(usize),
-    Unblock(usize),
-}
-
-/// Return an Unimplemented error when the target is not Linux or Android
-macro_rules! linux_only {
-    ($s: expr, $val: expr) => {
-        if cfg!(any(target_os = "linux", target_os = "android")) {
-            $val
-        } else {
-            return Err(ParseError::Unimplemented($s.to_string()).into());
-        }
-    };
-}
-
-impl Parser {
-    pub(crate) fn new() -> Self {
-        Self::default()
-    }
-
-    pub(crate) fn parse(self, operands: &[&str]) -> Result<Settings, ParseError> {
-        self.read(operands)?.validate()
-    }
-
-    pub(crate) fn read(mut self, operands: &[&str]) -> Result<Self, ParseError> {
-        for operand in operands {
-            self.parse_operand(operand)?;
-        }
-
-        Ok(self)
-    }
-
-    pub(crate) fn validate(self) -> Result<Settings, ParseError> {
-        let conv = self.conv;
-        let conversion = match (conv.ascii, conv.ebcdic, conv.ibm) {
-            (false, false, false) => None,
-            (true, false, false) => Some(Conversion::Ascii),
-            (false, true, false) => Some(Conversion::Ebcdic),
-            (false, false, true) => Some(Conversion::Ibm),
-            _ => return Err(ParseError::MultipleFmtTable),
-        };
-
-        let case = match (conv.ucase, conv.lcase) {
-            (false, false) => None,
-            (true, false) => Some(Case::Upper),
-            (false, true) => Some(Case::Lower),
-            (true, true) => return Err(ParseError::MultipleUCaseLCase),
-        };
-
-        let non_ascii = matches!(conversion, Some(Conversion::Ascii));
-        let conversion_table = get_ctable(conversion, case);
-
-        if conv.nocreat && conv.excl {
-            return Err(ParseError::MultipleExclNoCreate);
-        }
-
-        // The GNU docs state that
-        // - ascii implies unblock
-        // - ebcdic and ibm imply block
-        // This has a side effect in how it's implemented in GNU, because this errors:
-        //     conv=block,unblock
-        // but these don't:
-        //     conv=ascii,block,unblock
-        //     conv=block,ascii,unblock
-        //     conv=block,unblock,ascii
-        //     conv=block conv=unblock conv=ascii
-        let block = if let Some(cbs) = self.cbs {
-            match conversion {
-                Some(Conversion::Ascii) => Some(Block::Unblock(cbs)),
-                Some(_) => Some(Block::Block(cbs)),
-                None => match (conv.block, conv.unblock) {
-                    (false, false) => None,
-                    (true, false) => Some(Block::Block(cbs)),
-                    (false, true) => Some(Block::Unblock(cbs)),
-                    (true, true) => return Err(ParseError::MultipleBlockUnblock),
-                },
-            }
-        } else if conv.block || conv.unblock {
-            return Err(ParseError::BlockUnblockWithoutCBS);
-        } else {
-            None
-        };
-
-        let iconv = IConvFlags {
-            mode: conversion_mode(conversion_table, block, non_ascii, conv.sync),
-            swab: conv.swab,
-            sync: if conv.sync {
-                if block.is_some() {
-                    Some(b' ')
-                } else {
-                    Some(0u8)
-                }
-            } else {
-                None
-            },
-            noerror: conv.noerror,
-        };
-
-        let oconv = OConvFlags {
-            sparse: conv.sparse,
-            excl: conv.excl,
-            nocreat: conv.nocreat,
-            notrunc: conv.notrunc,
-            fdatasync: conv.fdatasync,
-            fsync: conv.fsync,
-        };
-
-        let skip = self
-            .skip
-            .force_bytes_if(self.iflag.skip_bytes)
-            .to_bytes(self.ibs as u64);
-
-        let seek = self
-            .seek
-            .force_bytes_if(self.oflag.seek_bytes)
-            .to_bytes(self.obs as u64);
-
-        let count = self.count.map(|c| c.force_bytes_if(self.iflag.count_bytes));
-
-        Ok(Settings {
-            skip,
-            seek,
-            count,
-            iconv,
-            oconv,
-            ibs: self.ibs,
-            obs: self.obs,
-            infile: self.infile,
-            outfile: self.outfile,
-            iflags: self.iflag,
-            oflags: self.oflag,
-            status: self.status,
-        })
-    }
-
-    fn parse_operand(&mut self, operand: &str) -> Result<(), ParseError> {
-        match operand.split_once('=') {
-            None => return Err(ParseError::UnrecognizedOperand(operand.to_string())),
-            Some((k, v)) => match k {
-                "bs" => {
-                    let bs = self.parse_bytes(k, v)?;
-                    self.ibs = bs;
-                    self.obs = bs;
-                }
-                "cbs" => self.cbs = Some(self.parse_bytes(k, v)?),
-                "conv" => self.parse_conv_flags(v)?,
-                "count" => self.count = Some(self.parse_n(v)?),
-                "ibs" => self.ibs = self.parse_bytes(k, v)?,
-                "if" => self.infile = Some(v.to_string()),
-                "iflag" => self.parse_input_flags(v)?,
-                "obs" => self.obs = self.parse_bytes(k, v)?,
-                "of" => self.outfile = Some(v.to_string()),
-                "oflag" => self.parse_output_flags(v)?,
-                "seek" | "oseek" => self.seek = self.parse_n(v)?,
-                "skip" | "iseek" => self.skip = self.parse_n(v)?,
-                "status" => self.status = Some(self.parse_status_level(v)?),
-                _ => return Err(ParseError::UnrecognizedOperand(operand.to_string())),
-            },
-        }
-        Ok(())
-    }
-
-    fn parse_n(&self, val: &str) -> Result<Num, ParseError> {
-        let n = parse_bytes_with_opt_multiplier(val)?;
-        Ok(if val.ends_with('B') {
-            Num::Bytes(n)
-        } else {
-            Num::Blocks(n)
-        })
-    }
-
-    fn parse_bytes(&self, arg: &str, val: &str) -> Result<usize, ParseError> {
-        parse_bytes_with_opt_multiplier(val)?
-            .try_into()
-            .map_err(|_| ParseError::BsOutOfRange(arg.to_string()))
-    }
-
-    fn parse_status_level(&self, val: &str) -> Result<StatusLevel, ParseError> {
-        match val {
-            "none" => Ok(StatusLevel::None),
-            "noxfer" => Ok(StatusLevel::Noxfer),
-            "progress" => Ok(StatusLevel::Progress),
-            _ => Err(ParseError::StatusLevelNotRecognized(val.to_string())),
-        }
-    }
-
-    #[allow(clippy::cognitive_complexity)]
-    fn parse_input_flags(&mut self, val: &str) -> Result<(), ParseError> {
-        let i = &mut self.iflag;
-        for f in val.split(',') {
-            match f {
-                // Common flags
-                "cio" => return Err(ParseError::Unimplemented(f.to_string())),
-                "direct" => linux_only!(f, i.direct = true),
-                "directory" => linux_only!(f, i.directory = true),
-                "dsync" => linux_only!(f, i.dsync = true),
-                "sync" => linux_only!(f, i.sync = true),
-                "nocache" => linux_only!(f, i.nocache = true),
-                "nonblock" => linux_only!(f, i.nonblock = true),
-                "noatime" => linux_only!(f, i.noatime = true),
-                "noctty" => linux_only!(f, i.noctty = true),
-                "nofollow" => linux_only!(f, i.nofollow = true),
-                "nolinks" => return Err(ParseError::Unimplemented(f.to_string())),
-                "binary" => return Err(ParseError::Unimplemented(f.to_string())),
-                "text" => return Err(ParseError::Unimplemented(f.to_string())),
-
-                // Input-only flags
-                "fullblock" => i.fullblock = true,
-                "count_bytes" => i.count_bytes = true,
-                "skip_bytes" => i.skip_bytes = true,
-                // GNU silently ignores oflags given as iflag.
-                "append" | "seek_bytes" => {}
-                _ => return Err(ParseError::FlagNoMatch(f.to_string())),
-            }
-        }
-        Ok(())
-    }
-
-    #[allow(clippy::cognitive_complexity)]
-    fn parse_output_flags(&mut self, val: &str) -> Result<(), ParseError> {
-        let o = &mut self.oflag;
-        for f in val.split(',') {
-            match f {
-                // Common flags
-                "cio" => return Err(ParseError::Unimplemented(val.to_string())),
-                "direct" => linux_only!(f, o.direct = true),
-                "directory" => linux_only!(f, o.directory = true),
-                "dsync" => linux_only!(f, o.dsync = true),
-                "sync" => linux_only!(f, o.sync = true),
-                "nocache" => linux_only!(f, o.nocache = true),
-                "nonblock" => linux_only!(f, o.nonblock = true),
-                "noatime" => linux_only!(f, o.noatime = true),
-                "noctty" => linux_only!(f, o.noctty = true),
-                "nofollow" => linux_only!(f, o.nofollow = true),
-                "nolinks" => return Err(ParseError::Unimplemented(f.to_string())),
-                "binary" => return Err(ParseError::Unimplemented(f.to_string())),
-                "text" => return Err(ParseError::Unimplemented(f.to_string())),
-
-                // Output-only flags
-                "append" => o.append = true,
-                "seek_bytes" => o.seek_bytes = true,
-                // GNU silently ignores iflags given as oflag.
-                "fullblock" | "count_bytes" | "skip_bytes" => {}
-                _ => return Err(ParseError::FlagNoMatch(f.to_string())),
-            }
-        }
-        Ok(())
-    }
-
-    fn parse_conv_flags(&mut self, val: &str) -> Result<(), ParseError> {
-        let c = &mut self.conv;
-        for f in val.split(',') {
-            match f {
-                // Conversion
-                "ascii" => c.ascii = true,
-                "ebcdic" => c.ebcdic = true,
-                "ibm" => c.ibm = true,
-
-                // Case
-                "lcase" => c.lcase = true,
-                "ucase" => c.ucase = true,
-
-                // Block
-                "block" => c.block = true,
-                "unblock" => c.unblock = true,
-
-                // Other input
-                "swab" => c.swab = true,
-                "sync" => c.sync = true,
-                "noerror" => c.noerror = true,
-
-                // Output
-                "sparse" => c.sparse = true,
-                "excl" => c.excl = true,
-                "nocreat" => c.nocreat = true,
-                "notrunc" => c.notrunc = true,
-                "fdatasync" => c.fdatasync = true,
-                "fsync" => c.fsync = true,
-                _ => return Err(ParseError::ConvFlagNoMatch(f.to_string())),
-            }
-        }
-        Ok(())
-    }
-}
-
-impl std::fmt::Display for ParseError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::UnrecognizedOperand(arg) => {
-                write!(f, "Unrecognized operand '{arg}'")
-            }
-            Self::MultipleFmtTable => {
-                write!(
-                    f,
-                    "Only one of conv=ascii conv=ebcdic or conv=ibm may be specified"
-                )
-            }
-            Self::MultipleUCaseLCase => {
-                write!(f, "Only one of conv=lcase or conv=ucase may be specified")
-            }
-            Self::MultipleBlockUnblock => {
-                write!(f, "Only one of conv=block or conv=unblock may be specified")
-            }
-            Self::MultipleExclNoCreate => {
-                write!(f, "Only one ov conv=excl or conv=nocreat may be specified")
-            }
-            Self::FlagNoMatch(arg) => {
-                // Additional message about 'dd --help' is displayed only in this situation.
-                write!(
-                    f,
-                    "invalid input flag: ‘{}’\nTry '{} --help' for more information.",
-                    arg,
-                    uucore::execution_phrase()
-                )
-            }
-            Self::ConvFlagNoMatch(arg) => {
-                write!(f, "Unrecognized conv=CONV -> {arg}")
-            }
-            Self::MultiplierStringParseFailure(arg) => {
-                write!(f, "Unrecognized byte multiplier -> {arg}")
-            }
-            Self::MultiplierStringOverflow(arg) => {
-                write!(
-                    f,
-                    "Multiplier string would overflow on current system -> {arg}"
-                )
-            }
-            Self::BlockUnblockWithoutCBS => {
-                write!(f, "conv=block or conv=unblock specified without cbs=N")
-            }
-            Self::StatusLevelNotRecognized(arg) => {
-                write!(f, "status=LEVEL not recognized -> {arg}")
-            }
-            Self::BsOutOfRange(arg) => {
-                write!(f, "{arg}=N cannot fit into memory")
-            }
-            Self::Unimplemented(arg) => {
-                write!(f, "feature not implemented on this system -> {arg}")
-            }
-            Self::InvalidNumber(arg) => {
-                write!(f, "invalid number: ‘{arg}’")
-            }
-        }
-    }
-}
-
-impl Error for ParseError {}
-
-impl UError for ParseError {
-    fn code(&self) -> i32 {
-        1
-    }
-}
-
-fn show_zero_multiplier_warning() {
-    show_warning!(
-        "{} is a zero multiplier; use {} if that is intended",
-        "0x".quote(),
-        "00x".quote()
-    );
-}
-
-/// Parse bytes using str::parse, then map error if needed.
-fn parse_bytes_only(s: &str) -> Result<u64, ParseError> {
-    s.parse()
-        .map_err(|_| ParseError::MultiplierStringParseFailure(s.to_string()))
-}
-
-/// Parse a number of bytes from the given string, assuming no `'x'` characters.
-///
-/// The `'x'` character means "multiply the number before the `'x'` by
-/// the number after the `'x'`". In order to compute the numbers
-/// before and after the `'x'`, use this function, which assumes there
-/// are no `'x'` characters in the string.
-///
-/// A suffix `'c'` means multiply by 1, `'w'` by 2, and `'b'` by
-/// 512. You can also use standard block size suffixes like `'k'` for
-/// 1024.
-///
-/// # Errors
-///
-/// If a number cannot be parsed or if the multiplication would cause
-/// an overflow.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// assert_eq!(parse_bytes_no_x("123", "123").unwrap(), 123);
-/// assert_eq!(parse_bytes_no_x("2c", "2c").unwrap(), 2 * 1);
-/// assert_eq!(parse_bytes_no_x("3w", "3w").unwrap(), 3 * 2);
-/// assert_eq!(parse_bytes_no_x("2b", "2b").unwrap(), 2 * 512);
-/// assert_eq!(parse_bytes_no_x("2k", "2k").unwrap(), 2 * 1024);
-/// ```
-fn parse_bytes_no_x(full: &str, s: &str) -> Result<u64, ParseError> {
-    let parser = SizeParser {
-        capital_b_bytes: true,
-        ..Default::default()
-    };
-    let (num, multiplier) = match (s.find('c'), s.rfind('w'), s.rfind('b')) {
-        (None, None, None) => match parser.parse(s) {
-            Ok(n) => (n, 1),
-            Err(ParseSizeError::InvalidSuffix(_) | ParseSizeError::ParseFailure(_)) => {
-                return Err(ParseError::InvalidNumber(full.to_string()))
-            }
-            Err(ParseSizeError::SizeTooBig(_)) => {
-                return Err(ParseError::MultiplierStringOverflow(full.to_string()))
-            }
-        },
-        (Some(i), None, None) => (parse_bytes_only(&s[..i])?, 1),
-        (None, Some(i), None) => (parse_bytes_only(&s[..i])?, 2),
-        (None, None, Some(i)) => (parse_bytes_only(&s[..i])?, 512),
-        _ => return Err(ParseError::MultiplierStringParseFailure(full.to_string())),
-    };
-    num.checked_mul(multiplier)
-        .ok_or_else(|| ParseError::MultiplierStringOverflow(full.to_string()))
-}
-
-/// Parse byte and multiplier like 512, 5KiB, or 1G.
-/// Uses uucore::parse_size, and adds the 'w' and 'c' suffixes which are mentioned
-/// in dd's info page.
-pub fn parse_bytes_with_opt_multiplier(s: &str) -> Result<u64, ParseError> {
-    // TODO On my Linux system, there seems to be a maximum block size of 4096 bytes:
-    //
-    //     $ printf "%0.sa" {1..10000} | dd bs=4095 count=1 status=none | wc -c
-    //     4095
-    //     $ printf "%0.sa" {1..10000} | dd bs=4k count=1 status=none | wc -c
-    //     4096
-    //     $ printf "%0.sa" {1..10000} | dd bs=4097 count=1 status=none | wc -c
-    //     4096
-    //     $ printf "%0.sa" {1..10000} | dd bs=5k count=1 status=none | wc -c
-    //     4096
-    //
-
-    // Split on the 'x' characters. Each component will be parsed
-    // individually, then multiplied together.
-    let parts: Vec<&str> = s.split('x').collect();
-    if parts.len() == 1 {
-        parse_bytes_no_x(s, parts[0])
-    } else {
-        let mut total: u64 = 1;
-        for part in parts {
-            if part == "0" {
-                show_zero_multiplier_warning();
-            }
-            let num = parse_bytes_no_x(s, part)?;
-            total = total
-                .checked_mul(num)
-                .ok_or_else(|| ParseError::InvalidNumber(s.to_string()))?;
-        }
-        Ok(total)
-    }
-}
-
-fn get_ctable(
-    conversion: Option<Conversion>,
-    case: Option<Case>,
-) -> Option<&'static ConversionTable> {
-    use crate::conversion_tables::*;
-    Some(match (conversion, case) {
-        (None, None) => return None,
-        (Some(conv), None) => match conv {
-            Conversion::Ascii => &EBCDIC_TO_ASCII,
-            Conversion::Ebcdic => &ASCII_TO_EBCDIC,
-            Conversion::Ibm => &ASCII_TO_IBM,
-        },
-        (None, Some(case)) => match case {
-            Case::Lower => &ASCII_UCASE_TO_LCASE,
-            Case::Upper => &ASCII_LCASE_TO_UCASE,
-        },
-        (Some(conv), Some(case)) => match (conv, case) {
-            (Conversion::Ascii, Case::Upper) => &EBCDIC_TO_ASCII_LCASE_TO_UCASE,
-            (Conversion::Ascii, Case::Lower) => &EBCDIC_TO_ASCII_UCASE_TO_LCASE,
-            (Conversion::Ebcdic, Case::Upper) => &ASCII_TO_EBCDIC_LCASE_TO_UCASE,
-            (Conversion::Ebcdic, Case::Lower) => &ASCII_TO_EBCDIC_UCASE_TO_LCASE,
-            (Conversion::Ibm, Case::Upper) => &ASCII_TO_IBM_UCASE_TO_LCASE,
-            (Conversion::Ibm, Case::Lower) => &ASCII_TO_IBM_LCASE_TO_UCASE,
-        },
-    })
-}
-
-/// Given the various command-line parameters, determine the conversion mode.
-///
-/// The `conv` command-line option can take many different values,
-/// each of which may combine with others. For example, `conv=ascii`,
-/// `conv=lcase`, `conv=sync`, and so on. The arguments to this
-/// function represent the settings of those various command-line
-/// parameters. This function translates those settings to a
-/// [`ConversionMode`].
-fn conversion_mode(
-    ctable: Option<&'static ConversionTable>,
-    block: Option<Block>,
-    is_ascii: bool,
-    is_sync: bool,
-) -> Option<ConversionMode> {
-    match (ctable, block) {
-        (Some(ct), None) => Some(ConversionMode::ConvertOnly(ct)),
-        (Some(ct), Some(Block::Block(cbs))) => {
-            if is_ascii {
-                Some(ConversionMode::ConvertThenBlock(ct, cbs, is_sync))
-            } else {
-                Some(ConversionMode::BlockThenConvert(ct, cbs, is_sync))
-            }
-        }
-        (Some(ct), Some(Block::Unblock(cbs))) => {
-            if is_ascii {
-                Some(ConversionMode::ConvertThenUnblock(ct, cbs))
-            } else {
-                Some(ConversionMode::UnblockThenConvert(ct, cbs))
-            }
-        }
-        (None, Some(Block::Block(cbs))) => Some(ConversionMode::BlockOnly(cbs, is_sync)),
-        (None, Some(Block::Unblock(cbs))) => Some(ConversionMode::UnblockOnly(cbs)),
-        (None, None) => None,
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::parseargs::parse_bytes_with_opt_multiplier;
-
-    #[test]
-    fn test_parse_bytes_with_opt_multiplier() {
-        assert_eq!(parse_bytes_with_opt_multiplier("123").unwrap(), 123);
-        assert_eq!(parse_bytes_with_opt_multiplier("123c").unwrap(), 123); // 123 * 1
-        assert_eq!(parse_bytes_with_opt_multiplier("123w").unwrap(), 123 * 2);
-        assert_eq!(parse_bytes_with_opt_multiplier("123b").unwrap(), 123 * 512);
-        assert_eq!(parse_bytes_with_opt_multiplier("123x3").unwrap(), 123 * 3);
-        assert_eq!(parse_bytes_with_opt_multiplier("123k").unwrap(), 123 * 1024);
-        assert_eq!(parse_bytes_with_opt_multiplier("1x2x3").unwrap(), 6); // 1 * 2 * 3
-
-        assert_eq!(
-            parse_bytes_with_opt_multiplier("1wx2cx3w").unwrap(),
-            2 * 2 * (3 * 2) // (1 * 2) * (2 * 1) * (3 * 2)
-        );
-        assert!(parse_bytes_with_opt_multiplier("123asdf").is_err());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dd/progress.rs.html b/coreutils/dev/src/uu_dd/progress.rs.html deleted file mode 100644 index a9a3bc400..000000000 --- a/coreutils/dev/src/uu_dd/progress.rs.html +++ /dev/null @@ -1,1327 +0,0 @@ -progress.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore btotal sigval
-//! Read and write progress tracking for dd.
-//!
-//! The [`ProgUpdate`] struct represents summary statistics for the
-//! read and write progress of a running `dd` process. The
-//! [`gen_prog_updater`] function can be used to implement a progress
-//! updater that runs in its own thread.
-use std::io::Write;
-use std::sync::mpsc;
-use std::time::Duration;
-
-use uucore::error::UResult;
-use uucore::memo::sprintf;
-
-use crate::numbers::{to_magnitude_and_suffix, SuffixType};
-
-// On Linux, we register a signal handler that prints progress updates.
-#[cfg(target_os = "linux")]
-use signal_hook::consts::signal;
-#[cfg(target_os = "linux")]
-use std::{
-    env,
-    error::Error,
-    sync::{
-        atomic::{AtomicUsize, Ordering},
-        Arc,
-    },
-};
-
-/// Summary statistics for read and write progress of dd for a given duration.
-pub(crate) struct ProgUpdate {
-    /// Read statistics.
-    ///
-    /// This contains information about the number of blocks read from
-    /// the data source.
-    pub(crate) read_stat: ReadStat,
-
-    /// Write statistics.
-    ///
-    /// This contains information about the number of blocks and
-    /// number of bytes written to the data sink.
-    pub(crate) write_stat: WriteStat,
-
-    /// The time period over which the reads and writes were measured.
-    pub(crate) duration: Duration,
-
-    /// The status of the write.
-    ///
-    /// True if the write is completed, false if still in-progress.
-    pub(crate) complete: bool,
-}
-
-impl ProgUpdate {
-    /// Instantiate this struct.
-    pub(crate) fn new(
-        read_stat: ReadStat,
-        write_stat: WriteStat,
-        duration: Duration,
-        complete: bool,
-    ) -> Self {
-        Self {
-            read_stat,
-            write_stat,
-            duration,
-            complete,
-        }
-    }
-
-    /// Write the number of complete and partial records both read and written.
-    ///
-    /// The information is written to `w`.
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// use std::io::Cursor;
-    /// use std::time::Duration;
-    /// use crate::progress::{ProgUpdate, ReadStat, WriteStat};
-    ///
-    /// let read_stat = ReadStat::new(1, 2, 3, 999);
-    /// let write_stat = WriteStat::new(4, 5, 6);
-    /// let duration = Duration::new(789, 0);
-    /// let prog_update = ProgUpdate {
-    ///     read_stat,
-    ///     write_stat,
-    ///     duration,
-    /// };
-    ///
-    /// let mut cursor = Cursor::new(vec![]);
-    /// prog_update.write_io_lines(&mut cursor).unwrap();
-    /// assert_eq!(
-    ///     cursor.get_ref(),
-    ///     b"1+2 records in\n3 truncated records\n4+5 records out\n"
-    /// );
-    /// ```
-    fn write_io_lines(&self, w: &mut impl Write) -> std::io::Result<()> {
-        self.read_stat.report(w)?;
-        self.write_stat.report(w)?;
-        match self.read_stat.records_truncated {
-            0 => {}
-            1 => writeln!(w, "1 truncated record")?,
-            n => writeln!(w, "{n} truncated records")?,
-        }
-        Ok(())
-    }
-
-    /// Write the number of bytes written, duration, and throughput.
-    ///
-    /// The information is written to `w`. If `rewrite` is `true`,
-    /// then a `\r` character is written first and no newline is
-    /// written at the end. When writing to `stderr`, this has the
-    /// visual effect of overwriting the previous characters on the
-    /// line.
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// use std::io::Cursor;
-    /// use std::time::Duration;
-    /// use crate::progress::ProgUpdate;
-    ///
-    /// let prog_update = ProgUpdate {
-    ///     read_stat: Default::default(),
-    ///     write_stat: Default::default(),
-    ///     duration: Duration::new(1, 0),  // one second
-    /// };
-    ///
-    /// let mut cursor = Cursor::new(vec![]);
-    /// let rewrite = false;
-    /// prog_update.write_prog_line(&mut cursor, rewrite).unwrap();
-    /// assert_eq!(cursor.get_ref(), b"0 bytes copied, 1.0 s, 0.0 B/s\n");
-    /// ```
-    fn write_prog_line(&self, w: &mut impl Write, rewrite: bool) -> UResult<()> {
-        // The total number of bytes written as a string, in SI and IEC format.
-        let btotal = self.write_stat.bytes_total;
-        let btotal_metric = to_magnitude_and_suffix(btotal, SuffixType::Si);
-        let btotal_bin = to_magnitude_and_suffix(btotal, SuffixType::Iec);
-
-        // Compute the throughput (bytes per second) as a string.
-        let duration = self.duration.as_secs_f64();
-        let safe_millis = std::cmp::max(1, self.duration.as_millis());
-        let rate = 1000 * (btotal / safe_millis);
-        let transfer_rate = to_magnitude_and_suffix(rate, SuffixType::Si);
-
-        // If we are rewriting the progress line, do write a carriage
-        // return (`\r`) at the beginning and don't write a newline
-        // (`\n`) at the end.
-        let (carriage_return, newline) = if rewrite { ("\r", "") } else { ("", "\n") };
-
-        // The duration should be formatted as in `printf %g`.
-        let duration_str = sprintf("%g", &[duration.to_string()])?;
-
-        // If the number of bytes written is sufficiently large, then
-        // print a more concise representation of the number, like
-        // "1.2 kB" and "1.0 KiB".
-        match btotal {
-            1 => write!(
-                w,
-                "{carriage_return}{btotal} byte copied, {duration_str} s, {transfer_rate}/s{newline}",
-            )?,
-            0..=999 => write!(
-                w,
-                "{carriage_return}{btotal} bytes copied, {duration_str} s, {transfer_rate}/s{newline}",
-            )?,
-            1000..=1023 => write!(
-                w,
-                "{carriage_return}{btotal} bytes ({btotal_metric}) copied, {duration_str} s, {transfer_rate}/s{newline}",
-            )?,
-            _ => write!(
-                w,
-                "{carriage_return}{btotal} bytes ({btotal_metric}, {btotal_bin}) copied, {duration_str} s, {transfer_rate}/s{newline}",
-            )?,
-        };
-        Ok(())
-    }
-
-    /// Write all summary statistics.
-    ///
-    /// This is a convenience method that calls
-    /// [`ProgUpdate::write_io_lines`] and
-    /// [`ProgUpdate::write_prog_line`] in that order. The information
-    /// is written to `w`. It optionally begins by writing a new line,
-    /// intended to handle the case of an existing progress line.
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// use std::io::Cursor;
-    /// use std::time::Duration;
-    /// use crate::progress::ProgUpdate;
-    ///
-    /// let prog_update = ProgUpdate {
-    ///     read_stat: Default::default(),
-    ///     write_stat: Default::default(),
-    ///     duration: Duration::new(1, 0), // one second
-    /// };
-    /// let mut cursor = Cursor::new(vec![]);
-    /// prog_update.write_transfer_stats(&mut cursor, false).unwrap();
-    /// let mut iter = cursor.get_ref().split(|v| *v == b'\n');
-    /// assert_eq!(iter.next().unwrap(), b"0+0 records in");
-    /// assert_eq!(iter.next().unwrap(), b"0+0 records out");
-    /// assert_eq!(iter.next().unwrap(), b"0 bytes copied, 1.0 s, 0.0 B/s");
-    /// assert_eq!(iter.next().unwrap(), b"");
-    /// assert!(iter.next().is_none());
-    /// ```
-    fn write_transfer_stats(&self, w: &mut impl Write, new_line: bool) -> UResult<()> {
-        if new_line {
-            writeln!(w)?;
-        }
-        self.write_io_lines(w)?;
-        let rewrite = false;
-        self.write_prog_line(w, rewrite)?;
-        Ok(())
-    }
-
-    /// Print number of complete and partial records read and written to stderr.
-    ///
-    /// See [`ProgUpdate::write_io_lines`] for more information.
-    pub(crate) fn print_io_lines(&self) {
-        let mut stderr = std::io::stderr();
-        self.write_io_lines(&mut stderr).unwrap();
-    }
-
-    /// Re-print the number of bytes written, duration, and throughput.
-    ///
-    /// See [`ProgUpdate::write_prog_line`] for more information.
-    pub(crate) fn reprint_prog_line(&self) {
-        let mut stderr = std::io::stderr();
-        let rewrite = true;
-        self.write_prog_line(&mut stderr, rewrite).unwrap();
-    }
-
-    /// Write all summary statistics.
-    ///
-    /// See [`ProgUpdate::write_transfer_stats`] for more information.
-    pub(crate) fn print_transfer_stats(&self, new_line: bool) {
-        let mut stderr = std::io::stderr();
-        self.write_transfer_stats(&mut stderr, new_line).unwrap();
-    }
-
-    /// Write all the final statistics.
-    pub(crate) fn print_final_stats(
-        &self,
-        print_level: Option<StatusLevel>,
-        progress_printed: bool,
-    ) {
-        match print_level {
-            Some(StatusLevel::None) => {}
-            Some(StatusLevel::Noxfer) => self.print_io_lines(),
-            Some(StatusLevel::Progress) | None => self.print_transfer_stats(progress_printed),
-        }
-    }
-}
-
-/// Read statistics.
-///
-/// This contains information about the number of blocks read from the
-/// input file. A block is sometimes referred to as a "record".
-#[derive(Clone, Copy, Default)]
-pub(crate) struct ReadStat {
-    /// The number of complete blocks that have been read.
-    pub(crate) reads_complete: u64,
-
-    /// The number of partial blocks that have been read.
-    ///
-    /// A partial block read can happen if, for example, there are
-    /// fewer bytes in the input file than the specified input block
-    /// size.
-    pub(crate) reads_partial: u64,
-
-    /// The number of truncated records.
-    ///
-    /// A truncated record can only occur in `conv=block` mode.
-    pub(crate) records_truncated: u32,
-
-    /// The total number of bytes read.
-    pub(crate) bytes_total: u64,
-}
-
-impl ReadStat {
-    /// Create a new instance.
-    #[allow(dead_code)]
-    fn new(complete: u64, partial: u64, truncated: u32, bytes_total: u64) -> Self {
-        Self {
-            reads_complete: complete,
-            reads_partial: partial,
-            records_truncated: truncated,
-            bytes_total,
-        }
-    }
-
-    /// Whether this counter has zero complete reads and zero partial reads.
-    pub(crate) fn is_empty(&self) -> bool {
-        self.reads_complete == 0 && self.reads_partial == 0
-    }
-
-    /// Write the counts in the format required by `dd`.
-    ///
-    /// # Errors
-    ///
-    /// If there is a problem writing to `w`.
-    fn report(&self, w: &mut impl Write) -> std::io::Result<()> {
-        writeln!(
-            w,
-            "{}+{} records in",
-            self.reads_complete, self.reads_partial
-        )?;
-        Ok(())
-    }
-}
-
-impl std::ops::AddAssign for ReadStat {
-    fn add_assign(&mut self, other: Self) {
-        *self = Self {
-            reads_complete: self.reads_complete + other.reads_complete,
-            reads_partial: self.reads_partial + other.reads_partial,
-            records_truncated: self.records_truncated + other.records_truncated,
-            bytes_total: self.bytes_total + other.bytes_total,
-        }
-    }
-}
-
-/// Write statistics.
-///
-/// This contains information about the number of blocks written to
-/// the output file and the total number of bytes written.
-#[derive(Clone, Copy, Default)]
-pub(crate) struct WriteStat {
-    /// The number of complete blocks that have been written.
-    pub(crate) writes_complete: u64,
-
-    /// The number of partial blocks that have been written.
-    ///
-    /// A partial block write can happen if, for example, there are
-    /// fewer bytes in the input file than the specified output block
-    /// size.
-    pub(crate) writes_partial: u64,
-
-    /// The total number of bytes written.
-    pub(crate) bytes_total: u128,
-}
-
-impl WriteStat {
-    /// Create a new instance.
-    #[allow(dead_code)]
-    fn new(complete: u64, partial: u64, bytes_total: u128) -> Self {
-        Self {
-            writes_complete: complete,
-            writes_partial: partial,
-            bytes_total,
-        }
-    }
-
-    /// Write the counts in the format required by `dd`.
-    ///
-    /// # Errors
-    ///
-    /// If there is a problem writing to `w`.
-    fn report(&self, w: &mut impl Write) -> std::io::Result<()> {
-        writeln!(
-            w,
-            "{}+{} records out",
-            self.writes_complete, self.writes_partial
-        )
-    }
-}
-
-impl std::ops::AddAssign for WriteStat {
-    fn add_assign(&mut self, other: Self) {
-        *self = Self {
-            writes_complete: self.writes_complete + other.writes_complete,
-            writes_partial: self.writes_partial + other.writes_partial,
-            bytes_total: self.bytes_total + other.bytes_total,
-        }
-    }
-}
-
-/// How much detail to report when printing transfer statistics.
-///
-/// This corresponds to the available settings of the `status`
-/// command-line argument.
-#[derive(Copy, Clone, Debug, PartialEq)]
-pub(crate) enum StatusLevel {
-    /// Report number of blocks read and written, throughput, and volume.
-    ///
-    /// This corresponds to `status=progress`.
-    Progress,
-
-    /// Report number of blocks read and written, but no throughput and volume.
-    ///
-    /// This corresponds to `status=noxfer`.
-    Noxfer,
-
-    /// Print no status information.
-    None,
-}
-
-/// Return a closure that can be used in its own thread to print progress info.
-///
-/// This function returns a closure that receives [`ProgUpdate`]
-/// instances sent through `rx`. When a [`ProgUpdate`] instance is
-/// received, the transfer statistics are re-printed to stderr.
-#[cfg(not(target_os = "linux"))]
-pub(crate) fn gen_prog_updater(
-    rx: mpsc::Receiver<ProgUpdate>,
-    print_level: Option<StatusLevel>,
-) -> impl Fn() {
-    move || {
-        let mut progress_printed = false;
-        while let Ok(update) = rx.recv() {
-            // Print the final read/write statistics.
-            if update.complete {
-                update.print_final_stats(print_level, progress_printed);
-                return;
-            }
-            if Some(StatusLevel::Progress) == print_level {
-                update.reprint_prog_line();
-                progress_printed = true;
-            }
-        }
-    }
-}
-
-/// Return a closure that can be used in its own thread to print progress info.
-///
-/// This function returns a closure that receives [`ProgUpdate`]
-/// instances sent through `rx`. When a [`ProgUpdate`] instance is
-/// received, the transfer statistics are re-printed to stderr.
-///
-/// The closure also registers a signal handler for `SIGUSR1`. When
-/// the `SIGUSR1` signal is sent to this process, the transfer
-/// statistics are printed to stderr.
-#[cfg(target_os = "linux")]
-pub(crate) fn gen_prog_updater(
-    rx: mpsc::Receiver<ProgUpdate>,
-    print_level: Option<StatusLevel>,
-) -> impl Fn() {
-    // TODO: SIGINFO: Trigger progress line reprint. BSD-style Linux only.
-    const SIGUSR1_USIZE: usize = signal::SIGUSR1 as usize;
-    fn posixly_correct() -> bool {
-        env::var("POSIXLY_CORRECT").is_ok()
-    }
-    fn register_linux_signal_handler(sigval: Arc<AtomicUsize>) -> Result<(), Box<dyn Error>> {
-        if !posixly_correct() {
-            signal_hook::flag::register_usize(signal::SIGUSR1, sigval, SIGUSR1_USIZE)?;
-        }
-
-        Ok(())
-    }
-    // --------------------------------------------------------------
-    move || {
-        let sigval = Arc::new(AtomicUsize::new(0));
-
-        register_linux_signal_handler(sigval.clone()).unwrap_or_else(|e| {
-            if Some(StatusLevel::None) != print_level {
-                eprintln!("Internal dd Warning: Unable to register signal handler \n\t{e}");
-            }
-        });
-
-        // Holds the state of whether we have printed the current progress.
-        // This is needed so that we know whether or not to print a newline
-        // character before outputting non-progress data.
-        let mut progress_printed = false;
-        while let Ok(update) = rx.recv() {
-            // Print the final read/write statistics.
-            if update.complete {
-                update.print_final_stats(print_level, progress_printed);
-                return;
-            }
-            // (Re)print status line if progress is requested.
-            if Some(StatusLevel::Progress) == print_level && !update.complete {
-                update.reprint_prog_line();
-                progress_printed = true;
-            }
-            // Handle signals and set the signal to un-seen.
-            // This will print a maximum of 1 time per second, even though it
-            // should be printing on every SIGUSR1.
-            if let SIGUSR1_USIZE = sigval.swap(0, Ordering::Relaxed) {
-                update.print_transfer_stats(progress_printed);
-                // Reset the progress printed, since print_transfer_stats always prints a newline.
-                progress_printed = false;
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use std::io::Cursor;
-    use std::time::Duration;
-
-    use super::{ProgUpdate, ReadStat, WriteStat};
-
-    fn prog_update_write(n: u128) -> ProgUpdate {
-        ProgUpdate {
-            read_stat: ReadStat::default(),
-            write_stat: WriteStat {
-                bytes_total: n,
-                ..Default::default()
-            },
-            duration: Duration::new(1, 0), // one second
-            complete: false,
-        }
-    }
-
-    fn prog_update_duration(duration: Duration) -> ProgUpdate {
-        ProgUpdate {
-            read_stat: ReadStat::default(),
-            write_stat: WriteStat::default(),
-            duration,
-            complete: false,
-        }
-    }
-
-    #[test]
-    fn test_read_stat_report() {
-        let read_stat = ReadStat::new(1, 2, 3, 4);
-        let mut cursor = Cursor::new(vec![]);
-        read_stat.report(&mut cursor).unwrap();
-        assert_eq!(cursor.get_ref(), b"1+2 records in\n");
-    }
-
-    #[test]
-    fn test_write_stat_report() {
-        let write_stat = WriteStat::new(1, 2, 3);
-        let mut cursor = Cursor::new(vec![]);
-        write_stat.report(&mut cursor).unwrap();
-        assert_eq!(cursor.get_ref(), b"1+2 records out\n");
-    }
-
-    #[test]
-    fn test_prog_update_write_io_lines() {
-        let read_stat = ReadStat::new(1, 2, 3, 4);
-        let write_stat = WriteStat::new(4, 5, 6);
-        let duration = Duration::new(789, 0);
-        let complete = false;
-        let prog_update = ProgUpdate {
-            read_stat,
-            write_stat,
-            duration,
-            complete,
-        };
-
-        let mut cursor = Cursor::new(vec![]);
-        prog_update.write_io_lines(&mut cursor).unwrap();
-        assert_eq!(
-            cursor.get_ref(),
-            b"1+2 records in\n4+5 records out\n3 truncated records\n"
-        );
-    }
-
-    #[test]
-    fn test_prog_update_write_prog_line() {
-        let prog_update = ProgUpdate {
-            read_stat: ReadStat::default(),
-            write_stat: WriteStat::default(),
-            duration: Duration::new(1, 0), // one second
-            complete: false,
-        };
-
-        let mut cursor = Cursor::new(vec![]);
-        let rewrite = false;
-        prog_update.write_prog_line(&mut cursor, rewrite).unwrap();
-        // TODO The expected output string below is what our code
-        // produces today, but it does not match GNU dd:
-        //
-        //     $ : | dd
-        //     0 bytes copied, 7.9151e-05 s, 0.0 kB/s
-        //
-        // The throughput still does not match GNU dd.
-        assert_eq!(cursor.get_ref(), b"0 bytes copied, 1 s, 0.0 B/s\n");
-
-        let prog_update = prog_update_write(1);
-        let mut cursor = Cursor::new(vec![]);
-        prog_update.write_prog_line(&mut cursor, rewrite).unwrap();
-        assert_eq!(cursor.get_ref(), b"1 byte copied, 1 s, 0.0 B/s\n");
-
-        let prog_update = prog_update_write(999);
-        let mut cursor = Cursor::new(vec![]);
-        prog_update.write_prog_line(&mut cursor, rewrite).unwrap();
-        assert_eq!(cursor.get_ref(), b"999 bytes copied, 1 s, 0.0 B/s\n");
-
-        let prog_update = prog_update_write(1000);
-        let mut cursor = Cursor::new(vec![]);
-        prog_update.write_prog_line(&mut cursor, rewrite).unwrap();
-        assert_eq!(
-            cursor.get_ref(),
-            b"1000 bytes (1.0 kB) copied, 1 s, 1.0 kB/s\n"
-        );
-
-        let prog_update = prog_update_write(1023);
-        let mut cursor = Cursor::new(vec![]);
-        prog_update.write_prog_line(&mut cursor, rewrite).unwrap();
-        assert_eq!(
-            cursor.get_ref(),
-            b"1023 bytes (1.0 kB) copied, 1 s, 1.0 kB/s\n"
-        );
-
-        let prog_update = prog_update_write(1024);
-        let mut cursor = Cursor::new(vec![]);
-        prog_update.write_prog_line(&mut cursor, rewrite).unwrap();
-        assert_eq!(
-            cursor.get_ref(),
-            b"1024 bytes (1.0 kB, 1.0 KiB) copied, 1 s, 1.0 kB/s\n"
-        );
-    }
-
-    #[test]
-    fn write_transfer_stats() {
-        let prog_update = ProgUpdate {
-            read_stat: ReadStat::default(),
-            write_stat: WriteStat::default(),
-            duration: Duration::new(1, 0), // one second
-            complete: false,
-        };
-        let mut cursor = Cursor::new(vec![]);
-        prog_update
-            .write_transfer_stats(&mut cursor, false)
-            .unwrap();
-        let mut iter = cursor.get_ref().split(|v| *v == b'\n');
-        assert_eq!(iter.next().unwrap(), b"0+0 records in");
-        assert_eq!(iter.next().unwrap(), b"0+0 records out");
-        assert_eq!(iter.next().unwrap(), b"0 bytes copied, 1 s, 0.0 B/s");
-        assert_eq!(iter.next().unwrap(), b"");
-        assert!(iter.next().is_none());
-    }
-
-    #[test]
-    fn write_final_transfer_stats() {
-        // Tests the formatting of the final statistics written after a progress line.
-        let prog_update = ProgUpdate {
-            read_stat: ReadStat::default(),
-            write_stat: WriteStat::default(),
-            duration: Duration::new(1, 0), // one second
-            complete: false,
-        };
-        let mut cursor = Cursor::new(vec![]);
-        let rewrite = true;
-        prog_update.write_prog_line(&mut cursor, rewrite).unwrap();
-        prog_update.write_transfer_stats(&mut cursor, true).unwrap();
-        let mut iter = cursor.get_ref().split(|v| *v == b'\n');
-        assert_eq!(iter.next().unwrap(), b"\r0 bytes copied, 1 s, 0.0 B/s");
-        assert_eq!(iter.next().unwrap(), b"0+0 records in");
-        assert_eq!(iter.next().unwrap(), b"0+0 records out");
-        assert_eq!(iter.next().unwrap(), b"0 bytes copied, 1 s, 0.0 B/s");
-        assert_eq!(iter.next().unwrap(), b"");
-        assert!(iter.next().is_none());
-    }
-
-    #[test]
-    fn test_duration_precision() {
-        let prog_update = prog_update_duration(Duration::from_nanos(123));
-        let mut cursor = Cursor::new(vec![]);
-        let rewrite = false;
-        prog_update.write_prog_line(&mut cursor, rewrite).unwrap();
-        assert_eq!(cursor.get_ref(), b"0 bytes copied, 1.23e-07 s, 0.0 B/s\n");
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_df/blocks.rs.html b/coreutils/dev/src/uu_df/blocks.rs.html deleted file mode 100644 index 0c491ebfc..000000000 --- a/coreutils/dev/src/uu_df/blocks.rs.html +++ /dev/null @@ -1,601 +0,0 @@ -blocks.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-//! Types for representing and displaying block sizes.
-use crate::{OPT_BLOCKSIZE, OPT_PORTABILITY};
-use clap::ArgMatches;
-use std::{env, fmt};
-
-use uucore::{
-    display::Quotable,
-    parse_size::{parse_size, ParseSizeError},
-};
-
-/// The first ten powers of 1024.
-const IEC_BASES: [u128; 10] = [
-    1,
-    1_024,
-    1_048_576,
-    1_073_741_824,
-    1_099_511_627_776,
-    1_125_899_906_842_624,
-    1_152_921_504_606_846_976,
-    1_180_591_620_717_411_303_424,
-    1_208_925_819_614_629_174_706_176,
-    1_237_940_039_285_380_274_899_124_224,
-];
-
-/// The first ten powers of 1000.
-const SI_BASES: [u128; 10] = [
-    1,
-    1_000,
-    1_000_000,
-    1_000_000_000,
-    1_000_000_000_000,
-    1_000_000_000_000_000,
-    1_000_000_000_000_000_000,
-    1_000_000_000_000_000_000_000,
-    1_000_000_000_000_000_000_000_000,
-    1_000_000_000_000_000_000_000_000_000,
-];
-
-/// A SuffixType determines whether the suffixes are 1000 or 1024 based, and whether they are
-/// intended for HumanReadable mode or not.
-#[derive(Clone, Copy)]
-pub(crate) enum SuffixType {
-    Iec,
-    Si,
-    HumanReadable(HumanReadable),
-}
-
-impl SuffixType {
-    /// The first ten powers of 1024 and 1000, respectively.
-    fn bases(&self) -> [u128; 10] {
-        match self {
-            Self::Iec | Self::HumanReadable(HumanReadable::Binary) => IEC_BASES,
-            Self::Si | Self::HumanReadable(HumanReadable::Decimal) => SI_BASES,
-        }
-    }
-
-    /// Suffixes for the first nine multi-byte unit suffixes.
-    fn suffixes(&self) -> [&'static str; 9] {
-        match self {
-            // we use "kB" instead of "KB", same as GNU df
-            Self::Si => ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
-            Self::Iec => ["B", "K", "M", "G", "T", "P", "E", "Z", "Y"],
-            Self::HumanReadable(HumanReadable::Binary) => {
-                ["", "K", "M", "G", "T", "P", "E", "Z", "Y"]
-            }
-            Self::HumanReadable(HumanReadable::Decimal) => {
-                ["", "k", "M", "G", "T", "P", "E", "Z", "Y"]
-            }
-        }
-    }
-}
-
-/// Convert a number into a magnitude and a multi-byte unit suffix.
-///
-/// The returned string has a maximum length of 5 chars, for example: "1.1kB", "999kB", "1MB".
-pub(crate) fn to_magnitude_and_suffix(n: u128, suffix_type: SuffixType) -> String {
-    let bases = suffix_type.bases();
-    let suffixes = suffix_type.suffixes();
-    let mut i = 0;
-
-    while bases[i + 1] - bases[i] < n && i < suffixes.len() {
-        i += 1;
-    }
-
-    let quot = n / bases[i];
-    let rem = n % bases[i];
-    let suffix = suffixes[i];
-
-    if rem == 0 {
-        format!("{quot}{suffix}")
-    } else {
-        let tenths_place = rem / (bases[i] / 10);
-
-        if rem % (bases[i] / 10) == 0 {
-            format!("{quot}.{tenths_place}{suffix}")
-        } else if tenths_place + 1 == 10 || quot >= 10 {
-            format!("{}{}", quot + 1, suffix)
-        } else {
-            format!("{}.{}{}", quot, tenths_place + 1, suffix)
-        }
-    }
-}
-
-/// A mode to use in condensing the human readable display of a large number
-/// of bytes.
-///
-/// The [`HumanReadable::Decimal`] and[`HumanReadable::Binary`] variants
-/// represent dynamic block sizes: as the number of bytes increases, the
-/// divisor increases as well (for example, from 1 to 1,000 to 1,000,000
-/// and so on in the case of [`HumanReadable::Decimal`]).
-#[derive(Clone, Copy)]
-pub(crate) enum HumanReadable {
-    /// Use the largest divisor corresponding to a unit, like B, K, M, G, etc.
-    ///
-    /// This variant represents powers of 1,000. Contrast with
-    /// [`HumanReadable::Binary`], which represents powers of
-    /// 1,024.
-    Decimal,
-
-    /// Use the largest divisor corresponding to a unit, like B, K, M, G, etc.
-    ///
-    /// This variant represents powers of 1,024. Contrast with
-    /// [`HumanReadable::Decimal`], which represents powers
-    /// of 1,000.
-    Binary,
-}
-
-/// A block size to use in condensing the display of a large number of bytes.
-///
-/// The [`BlockSize::Bytes`] variant represents a static block
-/// size.
-///
-/// The default variant is `Bytes(1024)`.
-#[derive(Debug, PartialEq)]
-pub(crate) enum BlockSize {
-    /// A fixed number of bytes.
-    ///
-    /// The number must be positive.
-    Bytes(u64),
-}
-
-impl BlockSize {
-    /// Returns the associated value
-    pub(crate) fn as_u64(&self) -> u64 {
-        match *self {
-            Self::Bytes(n) => n,
-        }
-    }
-}
-
-impl Default for BlockSize {
-    fn default() -> Self {
-        if env::var("POSIXLY_CORRECT").is_ok() {
-            Self::Bytes(512)
-        } else {
-            Self::Bytes(1024)
-        }
-    }
-}
-
-pub(crate) fn read_block_size(matches: &ArgMatches) -> Result<BlockSize, ParseSizeError> {
-    if matches.contains_id(OPT_BLOCKSIZE) {
-        let s = matches.get_one::<String>(OPT_BLOCKSIZE).unwrap();
-        let bytes = parse_size(s)?;
-
-        if bytes > 0 {
-            Ok(BlockSize::Bytes(bytes))
-        } else {
-            Err(ParseSizeError::ParseFailure(format!("{}", s.quote())))
-        }
-    } else if matches.get_flag(OPT_PORTABILITY) {
-        Ok(BlockSize::default())
-    } else if let Some(bytes) = block_size_from_env() {
-        Ok(BlockSize::Bytes(bytes))
-    } else {
-        Ok(BlockSize::default())
-    }
-}
-
-fn block_size_from_env() -> Option<u64> {
-    for env_var in ["DF_BLOCK_SIZE", "BLOCK_SIZE", "BLOCKSIZE"] {
-        if let Ok(env_size) = env::var(env_var) {
-            if let Ok(size) = parse_size(&env_size) {
-                return Some(size);
-            } else {
-                return None;
-            }
-        }
-    }
-
-    None
-}
-
-impl fmt::Display for BlockSize {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match self {
-            Self::Bytes(n) => {
-                let s = if n % 1024 == 0 && n % 1000 != 0 {
-                    to_magnitude_and_suffix(*n as u128, SuffixType::Iec)
-                } else {
-                    to_magnitude_and_suffix(*n as u128, SuffixType::Si)
-                };
-
-                write!(f, "{s}")
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use std::env;
-
-    use crate::blocks::{to_magnitude_and_suffix, BlockSize, SuffixType};
-
-    #[test]
-    fn test_to_magnitude_and_suffix_powers_of_1024() {
-        assert_eq!(to_magnitude_and_suffix(1024, SuffixType::Iec), "1K");
-        assert_eq!(to_magnitude_and_suffix(2048, SuffixType::Iec), "2K");
-        assert_eq!(to_magnitude_and_suffix(4096, SuffixType::Iec), "4K");
-        assert_eq!(to_magnitude_and_suffix(1024 * 1024, SuffixType::Iec), "1M");
-        assert_eq!(
-            to_magnitude_and_suffix(2 * 1024 * 1024, SuffixType::Iec),
-            "2M"
-        );
-        assert_eq!(
-            to_magnitude_and_suffix(1024 * 1024 * 1024, SuffixType::Iec),
-            "1G"
-        );
-        assert_eq!(
-            to_magnitude_and_suffix(34 * 1024 * 1024 * 1024, SuffixType::Iec),
-            "34G"
-        );
-    }
-
-    #[test]
-    fn test_to_magnitude_and_suffix_not_powers_of_1024() {
-        assert_eq!(to_magnitude_and_suffix(1, SuffixType::Si), "1B");
-        assert_eq!(to_magnitude_and_suffix(999, SuffixType::Si), "999B");
-
-        assert_eq!(to_magnitude_and_suffix(1000, SuffixType::Si), "1kB");
-        assert_eq!(to_magnitude_and_suffix(1001, SuffixType::Si), "1.1kB");
-        assert_eq!(to_magnitude_and_suffix(1023, SuffixType::Si), "1.1kB");
-        assert_eq!(to_magnitude_and_suffix(1025, SuffixType::Si), "1.1kB");
-        assert_eq!(to_magnitude_and_suffix(10_001, SuffixType::Si), "11kB");
-        assert_eq!(to_magnitude_and_suffix(999_000, SuffixType::Si), "999kB");
-
-        assert_eq!(to_magnitude_and_suffix(999_001, SuffixType::Si), "1MB");
-        assert_eq!(to_magnitude_and_suffix(999_999, SuffixType::Si), "1MB");
-        assert_eq!(to_magnitude_and_suffix(1_000_000, SuffixType::Si), "1MB");
-        assert_eq!(to_magnitude_and_suffix(1_000_001, SuffixType::Si), "1.1MB");
-        assert_eq!(to_magnitude_and_suffix(1_100_000, SuffixType::Si), "1.1MB");
-        assert_eq!(to_magnitude_and_suffix(1_100_001, SuffixType::Si), "1.2MB");
-        assert_eq!(to_magnitude_and_suffix(1_900_000, SuffixType::Si), "1.9MB");
-        assert_eq!(to_magnitude_and_suffix(1_900_001, SuffixType::Si), "2MB");
-        assert_eq!(to_magnitude_and_suffix(9_900_000, SuffixType::Si), "9.9MB");
-        assert_eq!(to_magnitude_and_suffix(9_900_001, SuffixType::Si), "10MB");
-        assert_eq!(
-            to_magnitude_and_suffix(999_000_000, SuffixType::Si),
-            "999MB"
-        );
-
-        assert_eq!(to_magnitude_and_suffix(999_000_001, SuffixType::Si), "1GB");
-        assert_eq!(
-            to_magnitude_and_suffix(1_000_000_000, SuffixType::Si),
-            "1GB"
-        );
-        assert_eq!(
-            to_magnitude_and_suffix(1_000_000_001, SuffixType::Si),
-            "1.1GB"
-        );
-    }
-
-    #[test]
-    fn test_block_size_display() {
-        assert_eq!(format!("{}", BlockSize::Bytes(1024)), "1K");
-        assert_eq!(format!("{}", BlockSize::Bytes(2 * 1024)), "2K");
-        assert_eq!(format!("{}", BlockSize::Bytes(3 * 1024 * 1024)), "3M");
-    }
-
-    #[test]
-    fn test_block_size_display_multiples_of_1000_and_1024() {
-        assert_eq!(format!("{}", BlockSize::Bytes(128_000)), "128kB");
-        assert_eq!(format!("{}", BlockSize::Bytes(1000 * 1024)), "1.1MB");
-        assert_eq!(format!("{}", BlockSize::Bytes(1_000_000_000_000)), "1TB");
-    }
-
-    #[test]
-    fn test_default_block_size() {
-        assert_eq!(BlockSize::Bytes(1024), BlockSize::default());
-        env::set_var("POSIXLY_CORRECT", "1");
-        assert_eq!(BlockSize::Bytes(512), BlockSize::default());
-        env::remove_var("POSIXLY_CORRECT");
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_df/columns.rs.html b/coreutils/dev/src/uu_df/columns.rs.html deleted file mode 100644 index 3a3930b87..000000000 --- a/coreutils/dev/src/uu_df/columns.rs.html +++ /dev/null @@ -1,435 +0,0 @@ -columns.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore itotal iused iavail ipcent pcent squashfs
-use crate::{OPT_INODES, OPT_OUTPUT, OPT_PRINT_TYPE};
-use clap::{parser::ValueSource, ArgMatches};
-
-/// The columns in the output table produced by `df`.
-///
-/// The [`Row`] struct has a field corresponding to each of the
-/// variants of this enumeration.
-///
-/// [`Row`]: crate::table::Row
-#[derive(PartialEq, Copy, Clone)]
-pub(crate) enum Column {
-    /// The source of the mount point, usually a device.
-    Source,
-
-    /// Total number of blocks.
-    Size,
-
-    /// Number of used blocks.
-    Used,
-
-    /// Number of available blocks.
-    Avail,
-
-    /// Percentage of blocks used out of total number of blocks.
-    Pcent,
-
-    /// The mount point.
-    Target,
-
-    /// Total number of inodes.
-    Itotal,
-
-    /// Number of used inodes.
-    Iused,
-
-    /// Number of available inodes.
-    Iavail,
-
-    /// Percentage of inodes used out of total number of inodes.
-    Ipcent,
-
-    /// The filename given as a command-line argument.
-    File,
-
-    /// The filesystem type, like "ext4" or "squashfs".
-    Fstype,
-
-    /// Percentage of bytes available to non-privileged processes.
-    #[cfg(target_os = "macos")]
-    Capacity,
-}
-
-/// An error while defining which columns to display in the output table.
-#[derive(Debug)]
-pub(crate) enum ColumnError {
-    /// If a column appears more than once in the `--output` argument.
-    MultipleColumns(String),
-}
-
-impl Column {
-    /// Convert from command-line arguments to sequence of columns.
-    ///
-    /// The set of columns that will appear in the output table can be
-    /// specified by command-line arguments. This function converts
-    /// those arguments to a [`Vec`] of [`Column`] variants.
-    ///
-    /// # Errors
-    ///
-    /// This function returns an error if a column is specified more
-    /// than once in the command-line argument.
-    pub(crate) fn from_matches(matches: &ArgMatches) -> Result<Vec<Self>, ColumnError> {
-        match (
-            matches.get_flag(OPT_PRINT_TYPE),
-            matches.get_flag(OPT_INODES),
-            matches.value_source(OPT_OUTPUT) == Some(ValueSource::CommandLine),
-        ) {
-            (false, false, false) => Ok(vec![
-                Self::Source,
-                Self::Size,
-                Self::Used,
-                Self::Avail,
-                #[cfg(target_os = "macos")]
-                Self::Capacity,
-                Self::Pcent,
-                Self::Target,
-            ]),
-            (false, false, true) => {
-                // Unwrapping should not panic because in this arm of
-                // the `match` statement, we know that `OPT_OUTPUT`
-                // is non-empty.
-                let names = matches
-                    .get_many::<String>(OPT_OUTPUT)
-                    .unwrap()
-                    .map(|s| s.as_str());
-                let mut seen: Vec<&str> = vec![];
-                let mut columns = vec![];
-                for name in names {
-                    if seen.contains(&name) {
-                        return Err(ColumnError::MultipleColumns(name.to_string()));
-                    }
-                    seen.push(name);
-                    // Unwrapping here should not panic because the
-                    // command-line argument parsing library should be
-                    // responsible for ensuring each comma-separated
-                    // string is a valid column label.
-                    let column = Self::parse(name).unwrap();
-                    columns.push(column);
-                }
-                Ok(columns)
-            }
-            (false, true, false) => Ok(vec![
-                Self::Source,
-                Self::Itotal,
-                Self::Iused,
-                Self::Iavail,
-                Self::Ipcent,
-                Self::Target,
-            ]),
-            (true, false, false) => Ok(vec![
-                Self::Source,
-                Self::Fstype,
-                Self::Size,
-                Self::Used,
-                Self::Avail,
-                #[cfg(target_os = "macos")]
-                Self::Capacity,
-                Self::Pcent,
-                Self::Target,
-            ]),
-            (true, true, false) => Ok(vec![
-                Self::Source,
-                Self::Fstype,
-                Self::Itotal,
-                Self::Iused,
-                Self::Iavail,
-                Self::Ipcent,
-                Self::Target,
-            ]),
-            // The command-line arguments -T and -i are each mutually
-            // exclusive with --output, so the command-line argument
-            // parser should reject those combinations before we get
-            // to this point in the code.
-            _ => unreachable!(),
-        }
-    }
-
-    /// Convert a column name to the corresponding enumeration variant.
-    ///
-    /// There are twelve valid column names, one for each variant:
-    ///
-    /// - "source"
-    /// - "fstype"
-    /// - "itotal"
-    /// - "iused"
-    /// - "iavail"
-    /// - "ipcent"
-    /// - "size"
-    /// - "used"
-    /// - "avail"
-    /// - "pcent"
-    /// - "file"
-    /// - "target"
-    ///
-    /// # Errors
-    ///
-    /// If the string `s` is not one of the valid column names.
-    fn parse(s: &str) -> Result<Self, ()> {
-        match s {
-            "source" => Ok(Self::Source),
-            "fstype" => Ok(Self::Fstype),
-            "itotal" => Ok(Self::Itotal),
-            "iused" => Ok(Self::Iused),
-            "iavail" => Ok(Self::Iavail),
-            "ipcent" => Ok(Self::Ipcent),
-            "size" => Ok(Self::Size),
-            "used" => Ok(Self::Used),
-            "avail" => Ok(Self::Avail),
-            "pcent" => Ok(Self::Pcent),
-            "file" => Ok(Self::File),
-            "target" => Ok(Self::Target),
-            _ => Err(()),
-        }
-    }
-
-    /// Return the alignment of the specified column.
-    pub(crate) fn alignment(column: &Self) -> Alignment {
-        match column {
-            Self::Source | Self::Target | Self::File | Self::Fstype => Alignment::Left,
-            _ => Alignment::Right,
-        }
-    }
-
-    /// Return the minimum width of the specified column.
-    pub(crate) fn min_width(column: &Self) -> usize {
-        match column {
-            // 14 = length of "Filesystem" plus 4 spaces
-            Self::Source => 14,
-            Self::Used => 5,
-            // the shortest headers have a length of 4 chars so we use that as the minimum width
-            _ => 4,
-        }
-    }
-}
-
-/// A column's alignment.
-///
-/// We define our own `Alignment` enum instead of using `std::fmt::Alignment` because df doesn't
-/// have centered columns and hence a `Center` variant is not needed.
-pub(crate) enum Alignment {
-    Left,
-    Right,
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_df/df.rs.html b/coreutils/dev/src/uu_df/df.rs.html deleted file mode 100644 index 13a8ee2cc..000000000 --- a/coreutils/dev/src/uu_df/df.rs.html +++ /dev/null @@ -1,1753 +0,0 @@ -df.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-
// This file is part of the uutils coreutils package.
-//
-// (c) Fangxu Hu <framlog@gmail.com>
-// (c) Sylvestre Ledru <sylvestre@debian.org>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-// spell-checker:ignore itotal iused iavail ipcent pcent tmpfs squashfs lofs
-mod blocks;
-mod columns;
-mod filesystem;
-mod table;
-
-use blocks::HumanReadable;
-use clap::builder::ValueParser;
-use table::HeaderMode;
-use uucore::display::Quotable;
-use uucore::error::FromIo;
-use uucore::error::{UError, UResult, USimpleError};
-use uucore::fsext::{read_fs_list, MountInfo};
-use uucore::parse_size::ParseSizeError;
-use uucore::{format_usage, help_about, help_section, help_usage, show};
-
-use clap::{crate_version, parser::ValueSource, Arg, ArgAction, ArgMatches, Command};
-
-use std::error::Error;
-use std::ffi::OsString;
-use std::fmt;
-use std::path::Path;
-
-use crate::blocks::{read_block_size, BlockSize};
-use crate::columns::{Column, ColumnError};
-use crate::filesystem::Filesystem;
-use crate::table::Table;
-
-const ABOUT: &str = help_about!("df.md");
-const USAGE: &str = help_usage!("df.md");
-const AFTER_HELP: &str = help_section!("after help", "df.md");
-
-static OPT_HELP: &str = "help";
-static OPT_ALL: &str = "all";
-static OPT_BLOCKSIZE: &str = "blocksize";
-static OPT_TOTAL: &str = "total";
-static OPT_HUMAN_READABLE_BINARY: &str = "human-readable-binary";
-static OPT_HUMAN_READABLE_DECIMAL: &str = "human-readable-decimal";
-static OPT_INODES: &str = "inodes";
-static OPT_KILO: &str = "kilo";
-static OPT_LOCAL: &str = "local";
-static OPT_NO_SYNC: &str = "no-sync";
-static OPT_OUTPUT: &str = "output";
-static OPT_PATHS: &str = "paths";
-static OPT_PORTABILITY: &str = "portability";
-static OPT_SYNC: &str = "sync";
-static OPT_TYPE: &str = "type";
-static OPT_PRINT_TYPE: &str = "print-type";
-static OPT_EXCLUDE_TYPE: &str = "exclude-type";
-static OUTPUT_FIELD_LIST: [&str; 12] = [
-    "source", "fstype", "itotal", "iused", "iavail", "ipcent", "size", "used", "avail", "pcent",
-    "file", "target",
-];
-
-/// Parameters that control the behavior of `df`.
-///
-/// Most of these parameters control which rows and which columns are
-/// displayed. The `block_size` determines the units to use when
-/// displaying numbers of bytes or inodes.
-struct Options {
-    show_local_fs: bool,
-    show_all_fs: bool,
-    human_readable: Option<HumanReadable>,
-    block_size: BlockSize,
-    header_mode: HeaderMode,
-
-    /// Optional list of filesystem types to include in the output table.
-    ///
-    /// If this is not `None`, only filesystems that match one of
-    /// these types will be listed.
-    include: Option<Vec<String>>,
-
-    /// Optional list of filesystem types to exclude from the output table.
-    ///
-    /// If this is not `None`, filesystems that match one of these
-    /// types will *not* be listed.
-    exclude: Option<Vec<String>>,
-
-    /// Whether to sync before operating.
-    sync: bool,
-
-    /// Whether to show a final row comprising the totals for each column.
-    show_total: bool,
-
-    /// Sequence of columns to display in the output table.
-    columns: Vec<Column>,
-}
-
-impl Default for Options {
-    fn default() -> Self {
-        Self {
-            show_local_fs: Default::default(),
-            show_all_fs: Default::default(),
-            block_size: BlockSize::default(),
-            human_readable: Option::default(),
-            header_mode: HeaderMode::default(),
-            include: Option::default(),
-            exclude: Option::default(),
-            sync: Default::default(),
-            show_total: Default::default(),
-            columns: vec![
-                Column::Source,
-                Column::Size,
-                Column::Used,
-                Column::Avail,
-                Column::Pcent,
-                Column::Target,
-            ],
-        }
-    }
-}
-
-#[derive(Debug)]
-enum OptionsError {
-    BlockSizeTooLarge(String),
-    InvalidBlockSize(String),
-    InvalidSuffix(String),
-
-    /// An error getting the columns to display in the output table.
-    ColumnError(ColumnError),
-
-    FilesystemTypeBothSelectedAndExcluded(Vec<String>),
-}
-
-impl fmt::Display for OptionsError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match self {
-            // TODO This needs to vary based on whether `--block-size`
-            // or `-B` were provided.
-            Self::BlockSizeTooLarge(s) => {
-                write!(f, "--block-size argument {} too large", s.quote())
-            }
-            // TODO This needs to vary based on whether `--block-size`
-            // or `-B` were provided.
-            Self::InvalidBlockSize(s) => write!(f, "invalid --block-size argument {s}"),
-            // TODO This needs to vary based on whether `--block-size`
-            // or `-B` were provided.
-            Self::InvalidSuffix(s) => write!(f, "invalid suffix in --block-size argument {s}"),
-            Self::ColumnError(ColumnError::MultipleColumns(s)) => write!(
-                f,
-                "option --output: field {} used more than once",
-                s.quote()
-            ),
-            #[allow(clippy::print_in_format_impl)]
-            Self::FilesystemTypeBothSelectedAndExcluded(types) => {
-                for t in types {
-                    eprintln!(
-                        "{}: file system type {} both selected and excluded",
-                        uucore::util_name(),
-                        t.quote()
-                    );
-                }
-                Ok(())
-            }
-        }
-    }
-}
-
-impl Options {
-    /// Convert command-line arguments into [`Options`].
-    fn from(matches: &ArgMatches) -> Result<Self, OptionsError> {
-        let include: Option<Vec<_>> = matches
-            .get_many::<OsString>(OPT_TYPE)
-            .map(|v| v.map(|s| s.to_string_lossy().to_string()).collect());
-        let exclude: Option<Vec<_>> = matches
-            .get_many::<OsString>(OPT_EXCLUDE_TYPE)
-            .map(|v| v.map(|s| s.to_string_lossy().to_string()).collect());
-
-        if let (Some(include), Some(exclude)) = (&include, &exclude) {
-            if let Some(types) = Self::get_intersected_types(include, exclude) {
-                return Err(OptionsError::FilesystemTypeBothSelectedAndExcluded(types));
-            }
-        }
-
-        Ok(Self {
-            show_local_fs: matches.get_flag(OPT_LOCAL),
-            show_all_fs: matches.get_flag(OPT_ALL),
-            sync: matches.get_flag(OPT_SYNC),
-            block_size: read_block_size(matches).map_err(|e| match e {
-                ParseSizeError::InvalidSuffix(s) => OptionsError::InvalidSuffix(s),
-                ParseSizeError::SizeTooBig(_) => OptionsError::BlockSizeTooLarge(
-                    matches
-                        .get_one::<String>(OPT_BLOCKSIZE)
-                        .unwrap()
-                        .to_string(),
-                ),
-                ParseSizeError::ParseFailure(s) => OptionsError::InvalidBlockSize(s),
-            })?,
-            header_mode: {
-                if matches.get_flag(OPT_HUMAN_READABLE_BINARY)
-                    || matches.get_flag(OPT_HUMAN_READABLE_DECIMAL)
-                {
-                    HeaderMode::HumanReadable
-                } else if matches.get_flag(OPT_PORTABILITY) {
-                    HeaderMode::PosixPortability
-                // get_flag() doesn't work here, it always returns true because OPT_OUTPUT has
-                // default values and hence is always present
-                } else if matches.value_source(OPT_OUTPUT) == Some(ValueSource::CommandLine) {
-                    HeaderMode::Output
-                } else {
-                    HeaderMode::Default
-                }
-            },
-            human_readable: {
-                if matches.get_flag(OPT_HUMAN_READABLE_BINARY) {
-                    Some(HumanReadable::Binary)
-                } else if matches.get_flag(OPT_HUMAN_READABLE_DECIMAL) {
-                    Some(HumanReadable::Decimal)
-                } else {
-                    None
-                }
-            },
-            include,
-            exclude,
-            show_total: matches.get_flag(OPT_TOTAL),
-            columns: Column::from_matches(matches).map_err(OptionsError::ColumnError)?,
-        })
-    }
-
-    fn get_intersected_types(include: &[String], exclude: &[String]) -> Option<Vec<String>> {
-        let mut intersected_types = Vec::new();
-
-        for t in include {
-            if exclude.contains(t) {
-                intersected_types.push(t.clone());
-            }
-        }
-
-        (!intersected_types.is_empty()).then_some(intersected_types)
-    }
-}
-
-/// Whether to display the mount info given the inclusion settings.
-fn is_included(mi: &MountInfo, opt: &Options) -> bool {
-    // Don't show remote filesystems if `--local` has been given.
-    if mi.remote && opt.show_local_fs {
-        return false;
-    }
-
-    // Don't show pseudo filesystems unless `--all` has been given.
-    if mi.dummy && !opt.show_all_fs {
-        return false;
-    }
-
-    // Don't show filesystems if they have been explicitly excluded.
-    if let Some(ref excludes) = opt.exclude {
-        if excludes.contains(&mi.fs_type) {
-            return false;
-        }
-    }
-    if let Some(ref includes) = opt.include {
-        if !includes.contains(&mi.fs_type) {
-            return false;
-        }
-    }
-
-    true
-}
-
-/// Whether the mount info in `m2` should be prioritized over `m1`.
-///
-/// The "lt" in the function name is in analogy to the
-/// [`std::cmp::PartialOrd::lt`].
-fn mount_info_lt(m1: &MountInfo, m2: &MountInfo) -> bool {
-    // let "real" devices with '/' in the name win.
-    if m1.dev_name.starts_with('/') && !m2.dev_name.starts_with('/') {
-        return false;
-    }
-
-    let m1_nearer_root = m1.mount_dir.len() < m2.mount_dir.len();
-    // With bind mounts, prefer items nearer the root of the source
-    let m2_below_root = !m1.mount_root.is_empty()
-        && !m2.mount_root.is_empty()
-        && m1.mount_root.len() > m2.mount_root.len();
-    // let points towards the root of the device win.
-    if m1_nearer_root && !m2_below_root {
-        return false;
-    }
-
-    // let an entry over-mounted on a new device win, but only when
-    // matching an existing mnt point, to avoid problematic
-    // replacement when given inaccurate mount lists, seen with some
-    // chroot environments for example.
-    if m1.dev_name != m2.dev_name && m1.mount_dir == m2.mount_dir {
-        return false;
-    }
-
-    true
-}
-
-/// Whether to prioritize given mount info over all others on the same device.
-///
-/// This function decides whether the mount info `mi` is better than
-/// all others in `previous` that mount the same device as `mi`.
-fn is_best(previous: &[MountInfo], mi: &MountInfo) -> bool {
-    for seen in previous {
-        if seen.dev_id == mi.dev_id && mount_info_lt(mi, seen) {
-            return false;
-        }
-    }
-    true
-}
-
-/// Keep only the specified subset of [`MountInfo`] instances.
-///
-/// The `opt` argument specifies a variety of ways of excluding
-/// [`MountInfo`] instances; see [`Options`] for more information.
-///
-/// Finally, if there are duplicate entries, the one with the shorter
-/// path is kept.
-
-fn filter_mount_list(vmi: Vec<MountInfo>, opt: &Options) -> Vec<MountInfo> {
-    let mut result = vec![];
-    for mi in vmi {
-        // TODO The running time of the `is_best()` function is linear
-        // in the length of `result`. That makes the running time of
-        // this loop quadratic in the length of `vmi`. This could be
-        // improved by a more efficient implementation of `is_best()`,
-        // but `vmi` is probably not very long in practice.
-        if is_included(&mi, opt) && is_best(&result, &mi) {
-            result.push(mi);
-        }
-    }
-    result
-}
-
-/// Get all currently mounted filesystems.
-///
-/// `opt` excludes certain filesystems from consideration and allows for the synchronization of filesystems before running; see
-/// [`Options`] for more information.
-
-fn get_all_filesystems(opt: &Options) -> Result<Vec<Filesystem>, std::io::Error> {
-    // Run a sync call before any operation if so instructed.
-    if opt.sync {
-        #[cfg(not(windows))]
-        unsafe {
-            #[cfg(not(target_os = "android"))]
-            uucore::libc::sync();
-            #[cfg(target_os = "android")]
-            uucore::libc::syscall(uucore::libc::SYS_sync);
-        }
-    }
-
-    // The list of all mounted filesystems.
-    //
-    // Filesystems excluded by the command-line options are
-    // not considered.
-    let mounts: Vec<MountInfo> = filter_mount_list(read_fs_list()?, opt);
-
-    // Convert each `MountInfo` into a `Filesystem`, which contains
-    // both the mount information and usage information.
-    Ok(mounts
-        .into_iter()
-        .filter_map(|m| Filesystem::new(m, None))
-        .filter(|fs| opt.show_all_fs || fs.usage.blocks > 0)
-        .collect())
-}
-
-/// For each path, get the filesystem that contains that path.
-fn get_named_filesystems<P>(paths: &[P], opt: &Options) -> Result<Vec<Filesystem>, std::io::Error>
-where
-    P: AsRef<Path>,
-{
-    // The list of all mounted filesystems.
-    //
-    // Filesystems marked as `dummy` or of type "lofs" are not
-    // considered. The "lofs" filesystem is a loopback
-    // filesystem present on Solaris and FreeBSD systems. It
-    // is similar to a symbolic link.
-    let mounts: Vec<MountInfo> = filter_mount_list(read_fs_list()?, opt)
-        .into_iter()
-        .filter(|mi| mi.fs_type != "lofs" && !mi.dummy)
-        .collect();
-
-    let mut result = vec![];
-
-    // this happens if the file system type doesn't exist
-    if mounts.is_empty() {
-        show!(USimpleError::new(1, "no file systems processed"));
-        return Ok(result);
-    }
-
-    // Convert each path into a `Filesystem`, which contains
-    // both the mount information and usage information.
-    for path in paths {
-        match Filesystem::from_path(&mounts, path) {
-            Some(fs) => result.push(fs),
-            None => {
-                // this happens if specified file system type != file system type of the file
-                if path.as_ref().exists() {
-                    show!(USimpleError::new(1, "no file systems processed"));
-                } else {
-                    show!(USimpleError::new(
-                        1,
-                        format!("{}: No such file or directory", path.as_ref().display())
-                    ));
-                }
-            }
-        }
-    }
-    Ok(result)
-}
-
-#[derive(Debug)]
-enum DfError {
-    /// A problem while parsing command-line options.
-    OptionsError(OptionsError),
-}
-
-impl Error for DfError {}
-
-impl UError for DfError {
-    fn usage(&self) -> bool {
-        matches!(self, Self::OptionsError(OptionsError::ColumnError(_)))
-    }
-}
-
-impl fmt::Display for DfError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match self {
-            Self::OptionsError(e) => e.fmt(f),
-        }
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    #[cfg(windows)]
-    {
-        if matches.get_flag(OPT_INODES) {
-            println!("{}: doesn't support -i option", uucore::util_name());
-            return Ok(());
-        }
-    }
-
-    let opt = Options::from(&matches).map_err(DfError::OptionsError)?;
-    // Get the list of filesystems to display in the output table.
-    let filesystems: Vec<Filesystem> = match matches.get_many::<String>(OPT_PATHS) {
-        None => {
-            let filesystems = get_all_filesystems(&opt)
-                .map_err_context(|| "cannot read table of mounted file systems".into())?;
-
-            if filesystems.is_empty() {
-                return Err(USimpleError::new(1, "no file systems processed"));
-            }
-
-            filesystems
-        }
-        Some(paths) => {
-            let paths: Vec<_> = paths.collect();
-            let filesystems = get_named_filesystems(&paths, &opt)
-                .map_err_context(|| "cannot read table of mounted file systems".into())?;
-
-            // This can happen if paths are given as command-line arguments
-            // but none of the paths exist.
-            if filesystems.is_empty() {
-                return Ok(());
-            }
-
-            filesystems
-        }
-    };
-
-    println!("{}", Table::new(&opt, filesystems));
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .after_help(AFTER_HELP)
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(OPT_HELP)
-                .long(OPT_HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new(OPT_ALL)
-                .short('a')
-                .long("all")
-                .overrides_with(OPT_ALL)
-                .help("include dummy file systems")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_BLOCKSIZE)
-                .short('B')
-                .long("block-size")
-                .value_name("SIZE")
-                .overrides_with_all([OPT_KILO, OPT_BLOCKSIZE])
-                .help(
-                    "scale sizes by SIZE before printing them; e.g.\
-                    '-BM' prints sizes in units of 1,048,576 bytes",
-                ),
-        )
-        .arg(
-            Arg::new(OPT_TOTAL)
-                .long("total")
-                .overrides_with(OPT_TOTAL)
-                .help("produce a grand total")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_HUMAN_READABLE_BINARY)
-                .short('h')
-                .long("human-readable")
-                .overrides_with_all([OPT_HUMAN_READABLE_DECIMAL, OPT_HUMAN_READABLE_BINARY])
-                .help("print sizes in human readable format (e.g., 1K 234M 2G)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_HUMAN_READABLE_DECIMAL)
-                .short('H')
-                .long("si")
-                .overrides_with_all([OPT_HUMAN_READABLE_BINARY, OPT_HUMAN_READABLE_DECIMAL])
-                .help("likewise, but use powers of 1000 not 1024")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_INODES)
-                .short('i')
-                .long("inodes")
-                .overrides_with(OPT_INODES)
-                .help("list inode information instead of block usage")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_KILO)
-                .short('k')
-                .help("like --block-size=1K")
-                .overrides_with_all([OPT_BLOCKSIZE, OPT_KILO])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_LOCAL)
-                .short('l')
-                .long("local")
-                .overrides_with(OPT_LOCAL)
-                .help("limit listing to local file systems")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_NO_SYNC)
-                .long("no-sync")
-                .overrides_with_all([OPT_SYNC, OPT_NO_SYNC])
-                .help("do not invoke sync before getting usage info (default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_OUTPUT)
-                .long("output")
-                .value_name("FIELD_LIST")
-                .action(ArgAction::Append)
-                .num_args(0..)
-                .require_equals(true)
-                .use_value_delimiter(true)
-                .value_parser(OUTPUT_FIELD_LIST)
-                .default_missing_values(OUTPUT_FIELD_LIST)
-                .default_values(["source", "size", "used", "avail", "pcent", "target"])
-                .conflicts_with_all([OPT_INODES, OPT_PORTABILITY, OPT_PRINT_TYPE])
-                .help(
-                    "use the output format defined by FIELD_LIST, \
-                     or print all fields if FIELD_LIST is omitted.",
-                ),
-        )
-        .arg(
-            Arg::new(OPT_PORTABILITY)
-                .short('P')
-                .long("portability")
-                .overrides_with(OPT_PORTABILITY)
-                .help("use the POSIX output format")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_SYNC)
-                .long("sync")
-                .overrides_with_all([OPT_NO_SYNC, OPT_SYNC])
-                .help("invoke sync before getting usage info (non-windows only)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_TYPE)
-                .short('t')
-                .long("type")
-                .value_parser(ValueParser::os_string())
-                .value_name("TYPE")
-                .action(ArgAction::Append)
-                .help("limit listing to file systems of type TYPE"),
-        )
-        .arg(
-            Arg::new(OPT_PRINT_TYPE)
-                .short('T')
-                .long("print-type")
-                .overrides_with(OPT_PRINT_TYPE)
-                .help("print file system type")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_EXCLUDE_TYPE)
-                .short('x')
-                .long("exclude-type")
-                .action(ArgAction::Append)
-                .value_parser(ValueParser::os_string())
-                .value_name("TYPE")
-                .use_value_delimiter(true)
-                .help("limit listing to file systems not of type TYPE"),
-        )
-        .arg(
-            Arg::new(OPT_PATHS)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
-#[cfg(test)]
-mod tests {
-
-    mod mount_info_lt {
-
-        use crate::mount_info_lt;
-        use uucore::fsext::MountInfo;
-
-        /// Instantiate a [`MountInfo`] with the given fields.
-        fn mount_info(dev_name: &str, mount_root: &str, mount_dir: &str) -> MountInfo {
-            MountInfo {
-                dev_id: String::new(),
-                dev_name: String::from(dev_name),
-                fs_type: String::new(),
-                mount_dir: String::from(mount_dir),
-                mount_option: String::new(),
-                mount_root: String::from(mount_root),
-                remote: false,
-                dummy: false,
-            }
-        }
-
-        #[test]
-        fn test_absolute() {
-            // Prefer device name "/dev/foo" over "dev_foo".
-            let m1 = mount_info("/dev/foo", "/", "/mnt/bar");
-            let m2 = mount_info("dev_foo", "/", "/mnt/bar");
-            assert!(!mount_info_lt(&m1, &m2));
-        }
-
-        #[test]
-        fn test_shorter() {
-            // Prefer mount directory "/mnt/bar" over "/mnt/bar/baz"...
-            let m1 = mount_info("/dev/foo", "/", "/mnt/bar");
-            let m2 = mount_info("/dev/foo", "/", "/mnt/bar/baz");
-            assert!(!mount_info_lt(&m1, &m2));
-
-            // ..but prefer mount root "/root" over "/".
-            let m1 = mount_info("/dev/foo", "/root", "/mnt/bar");
-            let m2 = mount_info("/dev/foo", "/", "/mnt/bar/baz");
-            assert!(mount_info_lt(&m1, &m2));
-        }
-
-        #[test]
-        fn test_over_mounted() {
-            // Prefer the earlier entry if the devices are different but
-            // the mount directory is the same.
-            let m1 = mount_info("/dev/foo", "/", "/mnt/baz");
-            let m2 = mount_info("/dev/bar", "/", "/mnt/baz");
-            assert!(!mount_info_lt(&m1, &m2));
-        }
-    }
-
-    mod is_best {
-
-        use crate::is_best;
-        use uucore::fsext::MountInfo;
-
-        /// Instantiate a [`MountInfo`] with the given fields.
-        fn mount_info(dev_id: &str, mount_dir: &str) -> MountInfo {
-            MountInfo {
-                dev_id: String::from(dev_id),
-                dev_name: String::new(),
-                fs_type: String::new(),
-                mount_dir: String::from(mount_dir),
-                mount_option: String::new(),
-                mount_root: String::new(),
-                remote: false,
-                dummy: false,
-            }
-        }
-
-        #[test]
-        fn test_empty() {
-            let m = mount_info("0", "/mnt/bar");
-            assert!(is_best(&[], &m));
-        }
-
-        #[test]
-        fn test_different_dev_id() {
-            let m1 = mount_info("0", "/mnt/bar");
-            let m2 = mount_info("1", "/mnt/bar");
-            assert!(is_best(&[m1.clone()], &m2));
-            assert!(is_best(&[m2], &m1));
-        }
-
-        #[test]
-        fn test_same_dev_id() {
-            // There are several conditions under which a `MountInfo` is
-            // considered "better" than the others, we're just checking
-            // one condition in this test.
-            let m1 = mount_info("0", "/mnt/bar");
-            let m2 = mount_info("0", "/mnt/bar/baz");
-            assert!(!is_best(&[m1.clone()], &m2));
-            assert!(is_best(&[m2], &m1));
-        }
-    }
-
-    mod is_included {
-
-        use crate::{is_included, Options};
-        use uucore::fsext::MountInfo;
-
-        /// Instantiate a [`MountInfo`] with the given fields.
-        fn mount_info(fs_type: &str, mount_dir: &str, remote: bool, dummy: bool) -> MountInfo {
-            MountInfo {
-                dev_id: String::new(),
-                dev_name: String::new(),
-                fs_type: String::from(fs_type),
-                mount_dir: String::from(mount_dir),
-                mount_option: String::new(),
-                mount_root: String::new(),
-                remote,
-                dummy,
-            }
-        }
-
-        #[test]
-        fn test_remote_included() {
-            let opt = Options::default();
-            let m = mount_info("ext4", "/mnt/foo", true, false);
-            assert!(is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_remote_excluded() {
-            let opt = Options {
-                show_local_fs: true,
-                ..Default::default()
-            };
-            let m = mount_info("ext4", "/mnt/foo", true, false);
-            assert!(!is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_dummy_included() {
-            let opt = Options {
-                show_all_fs: true,
-                ..Default::default()
-            };
-            let m = mount_info("ext4", "/mnt/foo", false, true);
-            assert!(is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_dummy_excluded() {
-            let opt = Options::default();
-            let m = mount_info("ext4", "/mnt/foo", false, true);
-            assert!(!is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_exclude_match() {
-            let exclude = Some(vec![String::from("ext4")]);
-            let opt = Options {
-                exclude,
-                ..Default::default()
-            };
-            let m = mount_info("ext4", "/mnt/foo", false, false);
-            assert!(!is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_exclude_no_match() {
-            let exclude = Some(vec![String::from("tmpfs")]);
-            let opt = Options {
-                exclude,
-                ..Default::default()
-            };
-            let m = mount_info("ext4", "/mnt/foo", false, false);
-            assert!(is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_include_match() {
-            let include = Some(vec![String::from("ext4")]);
-            let opt = Options {
-                include,
-                ..Default::default()
-            };
-            let m = mount_info("ext4", "/mnt/foo", false, false);
-            assert!(is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_include_no_match() {
-            let include = Some(vec![String::from("tmpfs")]);
-            let opt = Options {
-                include,
-                ..Default::default()
-            };
-            let m = mount_info("ext4", "/mnt/foo", false, false);
-            assert!(!is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_include_and_exclude_match_neither() {
-            let include = Some(vec![String::from("tmpfs")]);
-            let exclude = Some(vec![String::from("squashfs")]);
-            let opt = Options {
-                include,
-                exclude,
-                ..Default::default()
-            };
-            let m = mount_info("ext4", "/mnt/foo", false, false);
-            assert!(!is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_include_and_exclude_match_exclude() {
-            let include = Some(vec![String::from("tmpfs")]);
-            let exclude = Some(vec![String::from("ext4")]);
-            let opt = Options {
-                include,
-                exclude,
-                ..Default::default()
-            };
-            let m = mount_info("ext4", "/mnt/foo", false, false);
-            assert!(!is_included(&m, &opt));
-        }
-
-        #[test]
-        fn test_include_and_exclude_match_include() {
-            let include = Some(vec![String::from("ext4")]);
-            let exclude = Some(vec![String::from("squashfs")]);
-            let opt = Options {
-                include,
-                exclude,
-                ..Default::default()
-            };
-            let m = mount_info("ext4", "/mnt/foo", false, false);
-            assert!(is_included(&m, &opt));
-        }
-    }
-
-    mod filter_mount_list {
-
-        use crate::{filter_mount_list, Options};
-
-        #[test]
-        fn test_empty() {
-            let opt = Options::default();
-            let mount_infos = vec![];
-            assert!(filter_mount_list(mount_infos, &opt).is_empty());
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_df/filesystem.rs.html b/coreutils/dev/src/uu_df/filesystem.rs.html deleted file mode 100644 index 83b5d4c21..000000000 --- a/coreutils/dev/src/uu_df/filesystem.rs.html +++ /dev/null @@ -1,475 +0,0 @@ -filesystem.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-//! Provides a summary representation of a filesystem.
-//!
-//! A [`Filesystem`] struct represents a device containing a
-//! filesystem mounted at a particular directory. It also includes
-//! information on amount of space available and amount of space used.
-// spell-checker:ignore canonicalized
-use std::path::Path;
-
-#[cfg(unix)]
-use uucore::fsext::statfs;
-use uucore::fsext::{FsUsage, MountInfo};
-
-/// Summary representation of a filesystem.
-///
-/// A [`Filesystem`] struct represents a device containing a
-/// filesystem mounted at a particular directory. The
-/// [`Filesystem::mount_info`] field exposes that information. The
-/// [`Filesystem::usage`] field provides information on the amount of
-/// space available on the filesystem and the amount of space used.
-#[derive(Debug, Clone)]
-pub(crate) struct Filesystem {
-    /// The file given on the command line if any.
-    ///
-    /// When invoking `df` with a positional argument, it displays
-    /// usage information for the filesystem that contains the given
-    /// file. If given, this field contains that filename.
-    pub file: Option<String>,
-
-    /// Information about the mounted device, mount directory, and related options.
-    pub mount_info: MountInfo,
-
-    /// Information about the amount of space used on the filesystem.
-    pub usage: FsUsage,
-}
-
-/// Find the mount info that best matches a given filesystem path.
-///
-/// This function returns the element of `mounts` on which `path` is
-/// mounted. If there are no matches, this function returns
-/// [`None`]. If there are two or more matches, then the single
-/// [`MountInfo`] with the device name corresponding to the entered path.
-///
-/// If `canonicalize` is `true`, then the `path` is canonicalized
-/// before checking whether it matches any mount directories.
-///
-/// # See also
-///
-/// * [`Path::canonicalize`]
-/// * [`MountInfo::mount_dir`]
-fn mount_info_from_path<P>(
-    mounts: &[MountInfo],
-    path: P,
-    // This is really only used for testing purposes.
-    canonicalize: bool,
-) -> Option<&MountInfo>
-where
-    P: AsRef<Path>,
-{
-    // TODO Refactor this function with `Stater::find_mount_point()`
-    // in the `stat` crate.
-    let path = if canonicalize {
-        path.as_ref().canonicalize().ok()?
-    } else {
-        path.as_ref().to_path_buf()
-    };
-
-    // Find the potential mount point that matches entered path
-    let maybe_mount_point = mounts
-        .iter()
-        // Create pair MountInfo, canonicalized device name
-        // TODO Abstract from accessing real filesystem to
-        // make code more testable
-        .map(|m| (m, std::fs::canonicalize(&m.dev_name)))
-        // Ignore non existing paths
-        .filter(|m| m.1.is_ok())
-        .map(|m| (m.0, m.1.ok().unwrap()))
-        // Try to find canonicalized device name corresponding to entered path
-        .find(|m| m.1.eq(&path))
-        .map(|m| m.0);
-
-    maybe_mount_point.or_else(|| {
-        mounts
-            .iter()
-            .filter(|mi| path.starts_with(&mi.mount_dir))
-            .max_by_key(|mi| mi.mount_dir.len())
-    })
-}
-
-impl Filesystem {
-    // TODO: resolve uuid in `mount_info.dev_name` if exists
-    pub(crate) fn new(mount_info: MountInfo, file: Option<String>) -> Option<Self> {
-        let _stat_path = if mount_info.mount_dir.is_empty() {
-            #[cfg(unix)]
-            {
-                mount_info.dev_name.clone()
-            }
-            #[cfg(windows)]
-            {
-                // On windows, we expect the volume id
-                mount_info.dev_id.clone()
-            }
-        } else {
-            mount_info.mount_dir.clone()
-        };
-        #[cfg(unix)]
-        let usage = FsUsage::new(statfs(_stat_path).ok()?);
-        #[cfg(windows)]
-        let usage = FsUsage::new(Path::new(&_stat_path));
-        Some(Self {
-            mount_info,
-            usage,
-            file,
-        })
-    }
-
-    /// Find and create the filesystem that best matches a given path.
-    ///
-    /// This function returns a new `Filesystem` derived from the
-    /// element of `mounts` on which `path` is mounted. If there are
-    /// no matches, this function returns [`None`]. If there are two
-    /// or more matches, then the single [`Filesystem`] with the
-    /// longest mount directory is returned.
-    ///
-    /// The `path` is canonicalized before checking whether it matches
-    /// any mount directories.
-    ///
-    /// # See also
-    ///
-    /// * [`Path::canonicalize`]
-    /// * [`MountInfo::mount_dir`]
-    ///
-    pub(crate) fn from_path<P>(mounts: &[MountInfo], path: P) -> Option<Self>
-    where
-        P: AsRef<Path>,
-    {
-        let file = path.as_ref().display().to_string();
-        let canonicalize = true;
-        let mount_info = mount_info_from_path(mounts, path, canonicalize)?;
-        // TODO Make it so that we do not need to clone the `mount_info`.
-        let mount_info = (*mount_info).clone();
-        Self::new(mount_info, Some(file))
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    mod mount_info_from_path {
-
-        use uucore::fsext::MountInfo;
-
-        use crate::filesystem::mount_info_from_path;
-
-        // Create a fake `MountInfo` with the given directory name.
-        fn mount_info(mount_dir: &str) -> MountInfo {
-            MountInfo {
-                dev_id: String::default(),
-                dev_name: String::default(),
-                fs_type: String::default(),
-                mount_dir: String::from(mount_dir),
-                mount_option: String::default(),
-                mount_root: String::default(),
-                remote: Default::default(),
-                dummy: Default::default(),
-            }
-        }
-
-        // Check whether two `MountInfo` instances are equal.
-        fn mount_info_eq(m1: &MountInfo, m2: &MountInfo) -> bool {
-            m1.dev_id == m2.dev_id
-                && m1.dev_name == m2.dev_name
-                && m1.fs_type == m2.fs_type
-                && m1.mount_dir == m2.mount_dir
-                && m1.mount_option == m2.mount_option
-                && m1.mount_root == m2.mount_root
-                && m1.remote == m2.remote
-                && m1.dummy == m2.dummy
-        }
-
-        #[test]
-        fn test_empty_mounts() {
-            assert!(mount_info_from_path(&[], "/", false).is_none());
-        }
-
-        #[test]
-        fn test_exact_match() {
-            let mounts = [mount_info("/foo")];
-            let actual = mount_info_from_path(&mounts, "/foo", false).unwrap();
-            assert!(mount_info_eq(actual, &mounts[0]));
-        }
-
-        #[test]
-        fn test_prefix_match() {
-            let mounts = [mount_info("/foo")];
-            let actual = mount_info_from_path(&mounts, "/foo/bar", false).unwrap();
-            assert!(mount_info_eq(actual, &mounts[0]));
-        }
-
-        #[test]
-        fn test_multiple_matches() {
-            let mounts = [mount_info("/foo"), mount_info("/foo/bar")];
-            let actual = mount_info_from_path(&mounts, "/foo/bar", false).unwrap();
-            assert!(mount_info_eq(actual, &mounts[1]));
-        }
-
-        #[test]
-        fn test_no_match() {
-            let mounts = [mount_info("/foo")];
-            assert!(mount_info_from_path(&mounts, "/bar", false).is_none());
-        }
-
-        #[test]
-        fn test_partial_match() {
-            let mounts = [mount_info("/foo/bar")];
-            assert!(mount_info_from_path(&mounts, "/foo/baz", false).is_none());
-        }
-
-        #[test]
-        fn test_dev_name_match() {
-            let tmp = tempfile::TempDir::new().expect("Failed to create temp dir");
-            let dev_name = std::fs::canonicalize(tmp.path())
-                .expect("Failed to canonicalize tmp path")
-                .to_string_lossy()
-                .to_string();
-
-            let mut mount_info = mount_info("/foo");
-            mount_info.dev_name = dev_name.clone();
-            let mounts = [mount_info];
-            let actual = mount_info_from_path(&mounts, dev_name, false).unwrap();
-            assert!(mount_info_eq(actual, &mounts[0]));
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_df/table.rs.html b/coreutils/dev/src/uu_df/table.rs.html deleted file mode 100644 index 0b82d76b9..000000000 --- a/coreutils/dev/src/uu_df/table.rs.html +++ /dev/null @@ -1,1637 +0,0 @@ -table.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore tmpfs Pcent Itotal Iused Iavail Ipcent
-//! The filesystem usage data table.
-//!
-//! A table ([`Table`]) comprises a header row ([`Header`]) and a
-//! collection of data rows ([`Row`]), one per filesystem.
-use unicode_width::UnicodeWidthStr;
-
-use crate::blocks::{to_magnitude_and_suffix, SuffixType};
-use crate::columns::{Alignment, Column};
-use crate::filesystem::Filesystem;
-use crate::{BlockSize, Options};
-use uucore::fsext::{FsUsage, MountInfo};
-
-use std::fmt;
-use std::ops::AddAssign;
-
-/// A row in the filesystem usage data table.
-///
-/// A row comprises several pieces of information, including the
-/// filesystem device, the mountpoint, the number of bytes used, etc.
-pub(crate) struct Row {
-    /// The filename given on the command-line, if given.
-    file: Option<String>,
-
-    /// Name of the device on which the filesystem lives.
-    fs_device: String,
-
-    /// Type of filesystem (for example, `"ext4"`, `"tmpfs"`, etc.).
-    fs_type: String,
-
-    /// Path at which the filesystem is mounted.
-    fs_mount: String,
-
-    /// Total number of bytes in the filesystem regardless of whether they are used.
-    bytes: u64,
-
-    /// Number of used bytes.
-    bytes_used: u64,
-
-    /// Number of available bytes.
-    bytes_avail: u64,
-
-    /// Percentage of bytes that are used, given as a float between 0 and 1.
-    ///
-    /// If the filesystem has zero bytes, then this is `None`.
-    bytes_usage: Option<f64>,
-
-    /// Percentage of bytes that are available, given as a float between 0 and 1.
-    ///
-    /// These are the bytes that are available to non-privileged processes.
-    ///
-    /// If the filesystem has zero bytes, then this is `None`.
-    #[cfg(target_os = "macos")]
-    bytes_capacity: Option<f64>,
-
-    /// Total number of inodes in the filesystem.
-    inodes: u64,
-
-    /// Number of used inodes.
-    inodes_used: u64,
-
-    /// Number of free inodes.
-    inodes_free: u64,
-
-    /// Percentage of inodes that are used, given as a float between 0 and 1.
-    ///
-    /// If the filesystem has zero bytes, then this is `None`.
-    inodes_usage: Option<f64>,
-}
-
-impl Row {
-    pub(crate) fn new(source: &str) -> Self {
-        Self {
-            file: None,
-            fs_device: source.into(),
-            fs_type: "-".into(),
-            fs_mount: "-".into(),
-            bytes: 0,
-            bytes_used: 0,
-            bytes_avail: 0,
-            bytes_usage: None,
-            #[cfg(target_os = "macos")]
-            bytes_capacity: None,
-            inodes: 0,
-            inodes_used: 0,
-            inodes_free: 0,
-            inodes_usage: None,
-        }
-    }
-}
-
-impl AddAssign for Row {
-    /// Sum the numeric values of two rows.
-    ///
-    /// The `Row::fs_device` field is set to `"total"` and the
-    /// remaining `String` fields are set to `"-"`.
-    fn add_assign(&mut self, rhs: Self) {
-        let bytes = self.bytes + rhs.bytes;
-        let bytes_used = self.bytes_used + rhs.bytes_used;
-        let bytes_avail = self.bytes_avail + rhs.bytes_avail;
-        let inodes = self.inodes + rhs.inodes;
-        let inodes_used = self.inodes_used + rhs.inodes_used;
-        *self = Self {
-            file: None,
-            fs_device: "total".into(),
-            fs_type: "-".into(),
-            fs_mount: "-".into(),
-            bytes,
-            bytes_used,
-            bytes_avail,
-            bytes_usage: if bytes == 0 {
-                None
-            } else {
-                // We use "(bytes_used + bytes_avail)" instead of "bytes" because on some filesystems (e.g.
-                // ext4) "bytes" also includes reserved blocks we ignore for the usage calculation.
-                // https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#df-Size-and-Used-and-Available-do-not-add-up
-                Some(bytes_used as f64 / (bytes_used + bytes_avail) as f64)
-            },
-            // TODO Figure out how to compute this.
-            #[cfg(target_os = "macos")]
-            bytes_capacity: None,
-            inodes,
-            inodes_used,
-            inodes_free: self.inodes_free + rhs.inodes_free,
-            inodes_usage: if inodes == 0 {
-                None
-            } else {
-                Some(inodes_used as f64 / inodes as f64)
-            },
-        }
-    }
-}
-
-impl From<Filesystem> for Row {
-    fn from(fs: Filesystem) -> Self {
-        let MountInfo {
-            dev_name,
-            fs_type,
-            mount_dir,
-            ..
-        } = fs.mount_info;
-        let FsUsage {
-            blocksize,
-            blocks,
-            bfree,
-            bavail,
-            files,
-            ffree,
-            ..
-        } = fs.usage;
-        let bused = blocks - bfree;
-        let fused = files - ffree;
-        Self {
-            file: fs.file,
-            fs_device: dev_name,
-            fs_type,
-            fs_mount: mount_dir,
-            bytes: blocksize * blocks,
-            bytes_used: blocksize * bused,
-            bytes_avail: blocksize * bavail,
-            bytes_usage: if blocks == 0 {
-                None
-            } else {
-                // We use "(bused + bavail)" instead of "blocks" because on some filesystems (e.g.
-                // ext4) "blocks" also includes reserved blocks we ignore for the usage calculation.
-                // https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#df-Size-and-Used-and-Available-do-not-add-up
-                Some(bused as f64 / (bused + bavail) as f64)
-            },
-            #[cfg(target_os = "macos")]
-            bytes_capacity: if bavail == 0 {
-                None
-            } else {
-                Some(bavail as f64 / ((bused + bavail) as f64))
-            },
-            inodes: files,
-            inodes_used: fused,
-            inodes_free: ffree,
-            inodes_usage: if files == 0 {
-                None
-            } else {
-                Some(fused as f64 / files as f64)
-            },
-        }
-    }
-}
-
-/// A formatter for [`Row`].
-///
-/// The `options` control how the information in the row gets formatted.
-pub(crate) struct RowFormatter<'a> {
-    /// The data in this row.
-    row: &'a Row,
-
-    /// Options that control how to format the data.
-    options: &'a Options,
-    // TODO We don't need all of the command-line options here. Some
-    // of the command-line options indicate which rows to include or
-    // exclude. Other command-line options indicate which columns to
-    // include or exclude. Still other options indicate how to format
-    // numbers. We could split the options up into those groups to
-    // reduce the coupling between this `table.rs` module and the main
-    // `df.rs` module.
-    /// Whether to use the special rules for displaying the total row.
-    is_total_row: bool,
-}
-
-impl<'a> RowFormatter<'a> {
-    /// Instantiate this struct.
-    pub(crate) fn new(row: &'a Row, options: &'a Options, is_total_row: bool) -> Self {
-        Self {
-            row,
-            options,
-            is_total_row,
-        }
-    }
-
-    /// Get a string giving the scaled version of the input number.
-    ///
-    /// The scaling factor is defined in the `options` field.
-    fn scaled_bytes(&self, size: u64) -> String {
-        if let Some(h) = self.options.human_readable {
-            to_magnitude_and_suffix(size.into(), SuffixType::HumanReadable(h))
-        } else {
-            let BlockSize::Bytes(d) = self.options.block_size;
-            (size as f64 / d as f64).ceil().to_string()
-        }
-    }
-
-    /// Get a string giving the scaled version of the input number.
-    ///
-    /// The scaling factor is defined in the `options` field.
-    fn scaled_inodes(&self, size: u64) -> String {
-        if let Some(h) = self.options.human_readable {
-            to_magnitude_and_suffix(size.into(), SuffixType::HumanReadable(h))
-        } else {
-            size.to_string()
-        }
-    }
-
-    /// Convert a float between 0 and 1 into a percentage string.
-    ///
-    /// If `None`, return the string `"-"` instead.
-    fn percentage(fraction: Option<f64>) -> String {
-        match fraction {
-            None => "-".to_string(),
-            Some(x) => format!("{:.0}%", (100.0 * x).ceil()),
-        }
-    }
-
-    /// Returns formatted row data.
-    fn get_values(&self) -> Vec<String> {
-        let mut strings = Vec::new();
-
-        for column in &self.options.columns {
-            let string = match column {
-                Column::Source => {
-                    if self.is_total_row {
-                        "total".to_string()
-                    } else {
-                        self.row.fs_device.to_string()
-                    }
-                }
-                Column::Size => self.scaled_bytes(self.row.bytes),
-                Column::Used => self.scaled_bytes(self.row.bytes_used),
-                Column::Avail => self.scaled_bytes(self.row.bytes_avail),
-                Column::Pcent => Self::percentage(self.row.bytes_usage),
-
-                Column::Target => {
-                    if self.is_total_row && !self.options.columns.contains(&Column::Source) {
-                        "total".to_string()
-                    } else {
-                        self.row.fs_mount.to_string()
-                    }
-                }
-                Column::Itotal => self.scaled_inodes(self.row.inodes),
-                Column::Iused => self.scaled_inodes(self.row.inodes_used),
-                Column::Iavail => self.scaled_inodes(self.row.inodes_free),
-                Column::Ipcent => Self::percentage(self.row.inodes_usage),
-                Column::File => self.row.file.as_ref().unwrap_or(&"-".into()).to_string(),
-
-                Column::Fstype => self.row.fs_type.to_string(),
-                #[cfg(target_os = "macos")]
-                Column::Capacity => Self::percentage(self.row.bytes_capacity),
-            };
-
-            strings.push(string);
-        }
-
-        strings
-    }
-}
-
-/// A HeaderMode defines what header labels should be shown.
-pub(crate) enum HeaderMode {
-    Default,
-    // the user used -h or -H
-    HumanReadable,
-    // the user used -P
-    PosixPortability,
-    // the user used --output
-    Output,
-}
-
-impl Default for HeaderMode {
-    fn default() -> Self {
-        Self::Default
-    }
-}
-
-/// The data of the header row.
-struct Header {}
-
-impl Header {
-    /// Return the headers for the specified columns.
-    ///
-    /// The `options` control which column headers are returned.
-    fn get_headers(options: &Options) -> Vec<String> {
-        let mut headers = Vec::new();
-
-        for column in &options.columns {
-            let header = match column {
-                Column::Source => String::from("Filesystem"),
-                Column::Size => match options.header_mode {
-                    HeaderMode::HumanReadable => String::from("Size"),
-                    HeaderMode::PosixPortability => {
-                        format!("{}-blocks", options.block_size.as_u64())
-                    }
-                    _ => format!("{}-blocks", options.block_size),
-                },
-                Column::Used => String::from("Used"),
-                Column::Avail => match options.header_mode {
-                    HeaderMode::HumanReadable | HeaderMode::Output => String::from("Avail"),
-                    _ => String::from("Available"),
-                },
-                Column::Pcent => match options.header_mode {
-                    HeaderMode::PosixPortability => String::from("Capacity"),
-                    _ => String::from("Use%"),
-                },
-                Column::Target => String::from("Mounted on"),
-                Column::Itotal => String::from("Inodes"),
-                Column::Iused => String::from("IUsed"),
-                Column::Iavail => String::from("IFree"),
-                Column::Ipcent => String::from("IUse%"),
-                Column::File => String::from("File"),
-                Column::Fstype => String::from("Type"),
-                #[cfg(target_os = "macos")]
-                Column::Capacity => String::from("Capacity"),
-            };
-
-            headers.push(header);
-        }
-
-        headers
-    }
-}
-
-/// The output table.
-pub(crate) struct Table {
-    alignments: Vec<Alignment>,
-    rows: Vec<Vec<String>>,
-    widths: Vec<usize>,
-}
-
-impl Table {
-    pub(crate) fn new(options: &Options, filesystems: Vec<Filesystem>) -> Self {
-        let headers = Header::get_headers(options);
-        let mut widths: Vec<_> = options
-            .columns
-            .iter()
-            .enumerate()
-            .map(|(i, col)| Column::min_width(col).max(headers[i].len()))
-            .collect();
-
-        let mut rows = vec![headers];
-
-        // The running total of filesystem sizes and usage.
-        //
-        // This accumulator is computed in case we need to display the
-        // total counts in the last row of the table.
-        let mut total = Row::new("total");
-
-        for filesystem in filesystems {
-            // If the filesystem is not empty, or if the options require
-            // showing all filesystems, then print the data as a row in
-            // the output table.
-            if options.show_all_fs || filesystem.usage.blocks > 0 {
-                let row = Row::from(filesystem);
-                let fmt = RowFormatter::new(&row, options, false);
-                let values = fmt.get_values();
-                total += row;
-
-                for (i, value) in values.iter().enumerate() {
-                    if UnicodeWidthStr::width(value.as_str()) > widths[i] {
-                        widths[i] = UnicodeWidthStr::width(value.as_str());
-                    }
-                }
-
-                rows.push(values);
-            }
-        }
-
-        if options.show_total {
-            let total_row = RowFormatter::new(&total, options, true);
-            rows.push(total_row.get_values());
-        }
-
-        Self {
-            rows,
-            widths,
-            alignments: Self::get_alignments(&options.columns),
-        }
-    }
-
-    fn get_alignments(columns: &Vec<Column>) -> Vec<Alignment> {
-        let mut alignments = Vec::new();
-
-        for column in columns {
-            alignments.push(Column::alignment(column));
-        }
-
-        alignments
-    }
-}
-
-impl fmt::Display for Table {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        let mut row_iter = self.rows.iter().peekable();
-        while let Some(row) = row_iter.next() {
-            let mut col_iter = row.iter().enumerate().peekable();
-            while let Some((i, elem)) = col_iter.next() {
-                let is_last_col = col_iter.peek().is_none();
-
-                match self.alignments[i] {
-                    Alignment::Left => {
-                        if is_last_col {
-                            // no trailing spaces in last column
-                            write!(f, "{elem}")?;
-                        } else {
-                            write!(f, "{:<width$}", elem, width = self.widths[i])?;
-                        }
-                    }
-                    Alignment::Right => write!(f, "{:>width$}", elem, width = self.widths[i])?,
-                }
-
-                if !is_last_col {
-                    // column separator
-                    write!(f, " ")?;
-                }
-            }
-
-            if row_iter.peek().is_some() {
-                writeln!(f)?;
-            }
-        }
-
-        Ok(())
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::blocks::HumanReadable;
-    use crate::columns::Column;
-    use crate::table::{Header, HeaderMode, Row, RowFormatter};
-    use crate::{BlockSize, Options};
-
-    const COLUMNS_WITH_FS_TYPE: [Column; 7] = [
-        Column::Source,
-        Column::Fstype,
-        Column::Size,
-        Column::Used,
-        Column::Avail,
-        Column::Pcent,
-        Column::Target,
-    ];
-    const COLUMNS_WITH_INODES: [Column; 6] = [
-        Column::Source,
-        Column::Itotal,
-        Column::Iused,
-        Column::Iavail,
-        Column::Ipcent,
-        Column::Target,
-    ];
-
-    impl Default for Row {
-        fn default() -> Self {
-            Self {
-                file: Some("/path/to/file".to_string()),
-                fs_device: "my_device".to_string(),
-                fs_type: "my_type".to_string(),
-                fs_mount: "my_mount".to_string(),
-
-                bytes: 100,
-                bytes_used: 25,
-                bytes_avail: 75,
-                bytes_usage: Some(0.25),
-
-                #[cfg(target_os = "macos")]
-                bytes_capacity: Some(0.5),
-
-                inodes: 10,
-                inodes_used: 2,
-                inodes_free: 8,
-                inodes_usage: Some(0.2),
-            }
-        }
-    }
-
-    #[test]
-    fn test_default_header() {
-        let options = Options::default();
-        assert_eq!(
-            Header::get_headers(&options),
-            vec!(
-                "Filesystem",
-                "1K-blocks",
-                "Used",
-                "Available",
-                "Use%",
-                "Mounted on"
-            )
-        );
-    }
-
-    #[test]
-    fn test_header_with_fs_type() {
-        let options = Options {
-            columns: COLUMNS_WITH_FS_TYPE.to_vec(),
-            ..Default::default()
-        };
-        assert_eq!(
-            Header::get_headers(&options),
-            vec!(
-                "Filesystem",
-                "Type",
-                "1K-blocks",
-                "Used",
-                "Available",
-                "Use%",
-                "Mounted on"
-            )
-        );
-    }
-
-    #[test]
-    fn test_header_with_inodes() {
-        let options = Options {
-            columns: COLUMNS_WITH_INODES.to_vec(),
-            ..Default::default()
-        };
-        assert_eq!(
-            Header::get_headers(&options),
-            vec!(
-                "Filesystem",
-                "Inodes",
-                "IUsed",
-                "IFree",
-                "IUse%",
-                "Mounted on"
-            )
-        );
-    }
-
-    #[test]
-    fn test_header_with_block_size_1024() {
-        let options = Options {
-            block_size: BlockSize::Bytes(3 * 1024),
-            ..Default::default()
-        };
-        assert_eq!(
-            Header::get_headers(&options),
-            vec!(
-                "Filesystem",
-                "3K-blocks",
-                "Used",
-                "Available",
-                "Use%",
-                "Mounted on"
-            )
-        );
-    }
-
-    #[test]
-    fn test_human_readable_header() {
-        let options = Options {
-            header_mode: HeaderMode::HumanReadable,
-            ..Default::default()
-        };
-        assert_eq!(
-            Header::get_headers(&options),
-            vec!("Filesystem", "Size", "Used", "Avail", "Use%", "Mounted on")
-        );
-    }
-
-    #[test]
-    fn test_posix_portability_header() {
-        let options = Options {
-            header_mode: HeaderMode::PosixPortability,
-            ..Default::default()
-        };
-        assert_eq!(
-            Header::get_headers(&options),
-            vec!(
-                "Filesystem",
-                "1024-blocks",
-                "Used",
-                "Available",
-                "Capacity",
-                "Mounted on"
-            )
-        );
-    }
-
-    #[test]
-    fn test_output_header() {
-        let options = Options {
-            header_mode: HeaderMode::Output,
-            ..Default::default()
-        };
-        assert_eq!(
-            Header::get_headers(&options),
-            vec!(
-                "Filesystem",
-                "1K-blocks",
-                "Used",
-                "Avail",
-                "Use%",
-                "Mounted on"
-            )
-        );
-    }
-
-    #[test]
-    fn test_row_formatter() {
-        let options = Options {
-            block_size: BlockSize::Bytes(1),
-            ..Default::default()
-        };
-        let row = Row {
-            fs_device: "my_device".to_string(),
-            fs_mount: "my_mount".to_string(),
-
-            bytes: 100,
-            bytes_used: 25,
-            bytes_avail: 75,
-            bytes_usage: Some(0.25),
-
-            ..Default::default()
-        };
-        let fmt = RowFormatter::new(&row, &options, false);
-        assert_eq!(
-            fmt.get_values(),
-            vec!("my_device", "100", "25", "75", "25%", "my_mount")
-        );
-    }
-
-    #[test]
-    fn test_row_formatter_with_fs_type() {
-        let options = Options {
-            columns: COLUMNS_WITH_FS_TYPE.to_vec(),
-            block_size: BlockSize::Bytes(1),
-            ..Default::default()
-        };
-        let row = Row {
-            fs_device: "my_device".to_string(),
-            fs_type: "my_type".to_string(),
-            fs_mount: "my_mount".to_string(),
-
-            bytes: 100,
-            bytes_used: 25,
-            bytes_avail: 75,
-            bytes_usage: Some(0.25),
-
-            ..Default::default()
-        };
-        let fmt = RowFormatter::new(&row, &options, false);
-        assert_eq!(
-            fmt.get_values(),
-            vec!("my_device", "my_type", "100", "25", "75", "25%", "my_mount")
-        );
-    }
-
-    #[test]
-    fn test_row_formatter_with_inodes() {
-        let options = Options {
-            columns: COLUMNS_WITH_INODES.to_vec(),
-            block_size: BlockSize::Bytes(1),
-            ..Default::default()
-        };
-        let row = Row {
-            fs_device: "my_device".to_string(),
-            fs_mount: "my_mount".to_string(),
-
-            inodes: 10,
-            inodes_used: 2,
-            inodes_free: 8,
-            inodes_usage: Some(0.2),
-
-            ..Default::default()
-        };
-        let fmt = RowFormatter::new(&row, &options, false);
-        assert_eq!(
-            fmt.get_values(),
-            vec!("my_device", "10", "2", "8", "20%", "my_mount")
-        );
-    }
-
-    #[test]
-    fn test_row_formatter_with_bytes_and_inodes() {
-        let options = Options {
-            columns: vec![Column::Size, Column::Itotal],
-            block_size: BlockSize::Bytes(100),
-            ..Default::default()
-        };
-        let row = Row {
-            bytes: 100,
-            inodes: 10,
-            ..Default::default()
-        };
-        let fmt = RowFormatter::new(&row, &options, false);
-        assert_eq!(fmt.get_values(), vec!("1", "10"));
-    }
-
-    #[test]
-    fn test_row_formatter_with_human_readable_si() {
-        let options = Options {
-            human_readable: Some(HumanReadable::Decimal),
-            columns: COLUMNS_WITH_FS_TYPE.to_vec(),
-            ..Default::default()
-        };
-        let row = Row {
-            fs_device: "my_device".to_string(),
-            fs_type: "my_type".to_string(),
-            fs_mount: "my_mount".to_string(),
-
-            bytes: 4000,
-            bytes_used: 1000,
-            bytes_avail: 3000,
-            bytes_usage: Some(0.25),
-
-            ..Default::default()
-        };
-        let fmt = RowFormatter::new(&row, &options, false);
-        assert_eq!(
-            fmt.get_values(),
-            vec!("my_device", "my_type", "4k", "1k", "3k", "25%", "my_mount")
-        );
-    }
-
-    #[test]
-    fn test_row_formatter_with_human_readable_binary() {
-        let options = Options {
-            human_readable: Some(HumanReadable::Binary),
-            columns: COLUMNS_WITH_FS_TYPE.to_vec(),
-            ..Default::default()
-        };
-        let row = Row {
-            fs_device: "my_device".to_string(),
-            fs_type: "my_type".to_string(),
-            fs_mount: "my_mount".to_string(),
-
-            bytes: 4096,
-            bytes_used: 1024,
-            bytes_avail: 3072,
-            bytes_usage: Some(0.25),
-
-            ..Default::default()
-        };
-        let fmt = RowFormatter::new(&row, &options, false);
-        assert_eq!(
-            fmt.get_values(),
-            vec!("my_device", "my_type", "4K", "1K", "3K", "25%", "my_mount")
-        );
-    }
-
-    #[test]
-    fn test_row_formatter_with_round_up_usage() {
-        let options = Options {
-            columns: vec![Column::Pcent],
-            ..Default::default()
-        };
-        let row = Row {
-            bytes_usage: Some(0.251),
-            ..Default::default()
-        };
-        let fmt = RowFormatter::new(&row, &options, false);
-        assert_eq!(fmt.get_values(), vec!("26%"));
-    }
-
-    #[test]
-    fn test_row_formatter_with_round_up_byte_values() {
-        fn get_formatted_values(bytes: u64, bytes_used: u64, bytes_avail: u64) -> Vec<String> {
-            let options = Options {
-                block_size: BlockSize::Bytes(1000),
-                columns: vec![Column::Size, Column::Used, Column::Avail],
-                ..Default::default()
-            };
-
-            let row = Row {
-                bytes,
-                bytes_used,
-                bytes_avail,
-                ..Default::default()
-            };
-            RowFormatter::new(&row, &options, false).get_values()
-        }
-
-        assert_eq!(get_formatted_values(100, 100, 0), vec!("1", "1", "0"));
-        assert_eq!(get_formatted_values(100, 99, 1), vec!("1", "1", "1"));
-        assert_eq!(get_formatted_values(1000, 1000, 0), vec!("1", "1", "0"));
-        assert_eq!(get_formatted_values(1001, 1000, 1), vec!("2", "1", "1"));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dir/dir.rs.html b/coreutils/dev/src/uu_dir/dir.rs.html deleted file mode 100644 index f844c7e26..000000000 --- a/coreutils/dev/src/uu_dir/dir.rs.html +++ /dev/null @@ -1,143 +0,0 @@ -dir.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) gmnsii <gmnsii@protonmail.com>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-use clap::Command;
-use std::ffi::OsString;
-use std::path::Path;
-use uu_ls::{options, Config, Format};
-use uucore::error::UResult;
-use uucore::quoting_style::{Quotes, QuotingStyle};
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let command = uu_app();
-
-    let matches = command.get_matches_from(args);
-
-    let mut default_quoting_style = false;
-    let mut default_format_style = false;
-
-    // We check if any options on formatting or quoting style have been given.
-    // If not, we will use dir default formatting and quoting style options
-
-    if !matches.contains_id(options::QUOTING_STYLE)
-        && !matches.get_flag(options::quoting::C)
-        && !matches.get_flag(options::quoting::ESCAPE)
-        && !matches.get_flag(options::quoting::LITERAL)
-    {
-        default_quoting_style = true;
-    }
-    if !matches.contains_id(options::FORMAT)
-        && !matches.get_flag(options::format::ACROSS)
-        && !matches.get_flag(options::format::COLUMNS)
-        && !matches.get_flag(options::format::COMMAS)
-        && !matches.get_flag(options::format::LONG)
-        && !matches.get_flag(options::format::LONG_NO_GROUP)
-        && !matches.get_flag(options::format::LONG_NO_OWNER)
-        && !matches.get_flag(options::format::LONG_NUMERIC_UID_GID)
-        && !matches.get_flag(options::format::ONE_LINE)
-    {
-        default_format_style = true;
-    }
-
-    let mut config = Config::from(&matches)?;
-
-    if default_quoting_style {
-        config.quoting_style = QuotingStyle::C {
-            quotes: Quotes::None,
-        };
-    }
-    if default_format_style {
-        config.format = Format::Columns;
-    }
-
-    let locs = matches
-        .get_many::<OsString>(options::PATHS)
-        .map(|v| v.map(Path::new).collect())
-        .unwrap_or_else(|| vec![Path::new(".")]);
-
-    uu_ls::list(locs, &config)
-}
-
-// To avoid code duplication, we reuse ls uu_app function which has the same
-// arguments. However, coreutils won't compile if one of the utils is missing
-// an uu_app function, so we return the `ls` app.
-pub fn uu_app() -> Command {
-    uu_ls::uu_app()
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dircolors/colors.rs.html b/coreutils/dev/src/uu_dircolors/colors.rs.html deleted file mode 100644 index 39c077eec..000000000 --- a/coreutils/dev/src/uu_dircolors/colors.rs.html +++ /dev/null @@ -1,443 +0,0 @@ -colors.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-
// spell-checker:ignore (ToDO) EIGHTBIT ETERM MULTIHARDLINK cpio dtterm jfbterm konsole kterm mlterm rmvb rxvt stat'able svgz tmux webm xspf COLORTERM tzst avif tzst mjpg mjpeg webp dpkg rpmnew rpmorig rpmsave
-
-pub const INTERNAL_DB: &str = r#"# Configuration file for dircolors, a utility to help you set the
-# LS_COLORS environment variable used by GNU ls with the --color option.
-# Copyright (C) 1996-2022 Free Software Foundation, Inc.
-# Copying and distribution of this file, with or without modification,
-# are permitted provided the copyright notice and this notice are preserved.
-# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
-# slackware version of dircolors) are recognized but ignored.
-# Global config options can be specified before TERM or COLORTERM entries
-# Below are TERM or COLORTERM entries, which can be glob patterns, which
-# restrict following config to systems with matching environment variables.
-COLORTERM ?*
-TERM Eterm
-TERM ansi
-TERM *color*
-TERM con[0-9]*x[0-9]*
-TERM cons25
-TERM console
-TERM cygwin
-TERM *direct*
-TERM dtterm
-TERM gnome
-TERM hurd
-TERM jfbterm
-TERM konsole
-TERM kterm
-TERM linux
-TERM linux-c
-TERM mlterm
-TERM putty
-TERM rxvt*
-TERM screen*
-TERM st
-TERM terminator
-TERM tmux*
-TERM vt100
-TERM xterm*
-# Below are the color init strings for the basic file types.
-# One can use codes for 256 or more colors supported by modern terminals.
-# The default color codes use the capabilities of an 8 color terminal
-# with some additional attributes as per the following codes:
-# Attribute codes:
-# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
-# Text color codes:
-# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
-# Background color codes:
-# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
-#NORMAL 00 # no color code at all
-#FILE 00 # regular file: use no color at all
-RESET 0 # reset to "normal" color
-DIR 01;34 # directory
-LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
- # numerical value, the color is as for the file pointed to.)
-MULTIHARDLINK 00 # regular file with more than one link
-FIFO 40;33 # pipe
-SOCK 01;35 # socket
-DOOR 01;35 # door
-BLK 40;33;01 # block device driver
-CHR 40;33;01 # character device driver
-ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ...
-MISSING 00 # ... and the files they point to
-SETUID 37;41 # file that is setuid (u+s)
-SETGID 30;43 # file that is setgid (g+s)
-CAPABILITY 00 # file with capability (very expensive to lookup)
-STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
-OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
-STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
-# This is for files with execute permission:
-EXEC 01;32
-# List any file extensions like '.gz' or '.tar' that you would like ls
-# to color below. Put the extension, a space, and the color init string.
-# (and any comments you want to add after a '#')
-# If you use DOS-style suffixes, you may want to uncomment the following:
-#.cmd 01;32 # executables (bright green)
-#.exe 01;32
-#.com 01;32
-#.btm 01;32
-#.bat 01;32
-# Or if you want to color scripts even if they do not have the
-# executable bit actually set.
-#.sh 01;32
-#.csh 01;32
- # archives or compressed (bright red)
-.tar 01;31
-.tgz 01;31
-.arc 01;31
-.arj 01;31
-.taz 01;31
-.lha 01;31
-.lz4 01;31
-.lzh 01;31
-.lzma 01;31
-.tlz 01;31
-.txz 01;31
-.tzo 01;31
-.t7z 01;31
-.zip 01;31
-.z 01;31
-.dz 01;31
-.gz 01;31
-.lrz 01;31
-.lz 01;31
-.lzo 01;31
-.xz 01;31
-.zst 01;31
-.tzst 01;31
-.bz2 01;31
-.bz 01;31
-.tbz 01;31
-.tbz2 01;31
-.tz 01;31
-.deb 01;31
-.rpm 01;31
-.jar 01;31
-.war 01;31
-.ear 01;31
-.sar 01;31
-.rar 01;31
-.alz 01;31
-.ace 01;31
-.zoo 01;31
-.cpio 01;31
-.7z 01;31
-.rz 01;31
-.cab 01;31
-.wim 01;31
-.swm 01;31
-.dwm 01;31
-.esd 01;31
-# image formats
-.avif 01;35
-.jpg 01;35
-.jpeg 01;35
-.mjpg 01;35
-.mjpeg 01;35
-.gif 01;35
-.bmp 01;35
-.pbm 01;35
-.pgm 01;35
-.ppm 01;35
-.tga 01;35
-.xbm 01;35
-.xpm 01;35
-.tif 01;35
-.tiff 01;35
-.png 01;35
-.svg 01;35
-.svgz 01;35
-.mng 01;35
-.pcx 01;35
-.mov 01;35
-.mpg 01;35
-.mpeg 01;35
-.m2v 01;35
-.mkv 01;35
-.webm 01;35
-.webp 01;35
-.ogm 01;35
-.mp4 01;35
-.m4v 01;35
-.mp4v 01;35
-.vob 01;35
-.qt 01;35
-.nuv 01;35
-.wmv 01;35
-.asf 01;35
-.rm 01;35
-.rmvb 01;35
-.flc 01;35
-.avi 01;35
-.fli 01;35
-.flv 01;35
-.gl 01;35
-.dl 01;35
-.xcf 01;35
-.xwd 01;35
-.yuv 01;35
-.cgm 01;35
-.emf 01;35
-# https://wiki.xiph.org/MIME_Types_and_File_Extensions
-.ogv 01;35
-.ogx 01;35
-# audio formats
-.aac 00;36
-.au 00;36
-.flac 00;36
-.m4a 00;36
-.mid 00;36
-.midi 00;36
-.mka 00;36
-.mp3 00;36
-.mpc 00;36
-.ogg 00;36
-.ra 00;36
-.wav 00;36
-# https://wiki.xiph.org/MIME_Types_and_File_Extensions
-.oga 00;36
-.opus 00;36
-.spx 00;36
-.xspf 00;36
-# backup files
-*~ 00;90
-*# 00;90
-.bak 00;90
-.old 00;90
-.orig 00;90
-.part 00;90
-.rej 00;90
-.swp 00;90
-.tmp 00;90
-.dpkg-dist 00;90
-.dpkg-old 00;90
-.ucf-dist 00;90
-.ucf-new 00;90
-.ucf-old 00;90
-.rpmnew 00;90
-.rpmorig 00;90
-.rpmsave 00;90
-# Subsequent TERM or COLORTERM entries, can be used to add / override
-# config specific to those matching environment variables."#;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dircolors/dircolors.rs.html b/coreutils/dev/src/uu_dircolors/dircolors.rs.html deleted file mode 100644 index 3e5ce90a9..000000000 --- a/coreutils/dev/src/uu_dircolors/dircolors.rs.html +++ /dev/null @@ -1,911 +0,0 @@ -dircolors.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-// (c) Mitchell Mebane <mitchell.mebane@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) clrtoeol dircolors eightbit endcode fnmatch leftcode multihardlink rightcode setenv sgid suid colorterm
-
-use std::borrow::Borrow;
-use std::env;
-use std::fs::File;
-use std::io::{BufRead, BufReader};
-use std::path::Path;
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use uucore::display::Quotable;
-use uucore::error::{UResult, USimpleError, UUsageError};
-use uucore::{help_about, help_section, help_usage};
-
-mod options {
-    pub const BOURNE_SHELL: &str = "bourne-shell";
-    pub const C_SHELL: &str = "c-shell";
-    pub const PRINT_DATABASE: &str = "print-database";
-    pub const PRINT_LS_COLORS: &str = "print-ls-colors";
-    pub const FILE: &str = "FILE";
-}
-
-const USAGE: &str = help_usage!("dircolors.md");
-const ABOUT: &str = help_about!("dircolors.md");
-const AFTER_HELP: &str = help_section!("after help", "dircolors.md");
-
-mod colors;
-use self::colors::INTERNAL_DB;
-
-#[derive(PartialEq, Eq, Debug)]
-pub enum OutputFmt {
-    Shell,
-    CShell,
-    Display,
-    Unknown,
-}
-
-pub fn guess_syntax() -> OutputFmt {
-    match env::var("SHELL") {
-        Ok(ref s) if !s.is_empty() => {
-            let shell_path: &Path = s.as_ref();
-            if let Some(name) = shell_path.file_name() {
-                if name == "csh" || name == "tcsh" {
-                    OutputFmt::CShell
-                } else {
-                    OutputFmt::Shell
-                }
-            } else {
-                OutputFmt::Shell
-            }
-        }
-        _ => OutputFmt::Unknown,
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let files = matches
-        .get_many::<String>(options::FILE)
-        .map_or(vec![], |file_values| file_values.collect());
-
-    // clap provides .conflicts_with / .conflicts_with_all, but we want to
-    // manually handle conflicts so we can match the output of GNU coreutils
-    if (matches.get_flag(options::C_SHELL) || matches.get_flag(options::BOURNE_SHELL))
-        && (matches.get_flag(options::PRINT_DATABASE) || matches.get_flag(options::PRINT_LS_COLORS))
-    {
-        return Err(UUsageError::new(
-            1,
-            "the options to output non shell syntax,\n\
-             and to select a shell syntax are mutually exclusive",
-        ));
-    }
-
-    if matches.get_flag(options::PRINT_DATABASE) && matches.get_flag(options::PRINT_LS_COLORS) {
-        return Err(UUsageError::new(
-            1,
-            "options --print-database and --print-ls-colors are mutually exclusive",
-        ));
-    }
-
-    if matches.get_flag(options::PRINT_DATABASE) {
-        if !files.is_empty() {
-            return Err(UUsageError::new(
-                1,
-                format!(
-                    "extra operand {}\nfile operands cannot be combined with \
-                     --print-database (-p)",
-                    files[0].quote()
-                ),
-            ));
-        }
-        println!("{INTERNAL_DB}");
-        return Ok(());
-    }
-
-    let mut out_format = if matches.get_flag(options::C_SHELL) {
-        OutputFmt::CShell
-    } else if matches.get_flag(options::BOURNE_SHELL) {
-        OutputFmt::Shell
-    } else if matches.get_flag(options::PRINT_LS_COLORS) {
-        OutputFmt::Display
-    } else {
-        OutputFmt::Unknown
-    };
-
-    if out_format == OutputFmt::Unknown {
-        match guess_syntax() {
-            OutputFmt::Unknown => {
-                return Err(USimpleError::new(
-                    1,
-                    "no SHELL environment variable, and no shell type option given",
-                ));
-            }
-            fmt => out_format = fmt,
-        }
-    }
-
-    let result;
-    if files.is_empty() {
-        result = parse(INTERNAL_DB.lines(), &out_format, "");
-    } else if files.len() > 1 {
-        return Err(UUsageError::new(
-            1,
-            format!("extra operand {}", files[1].quote()),
-        ));
-    } else if files[0].eq("-") {
-        let fin = BufReader::new(std::io::stdin());
-        result = parse(fin.lines().map_while(Result::ok), &out_format, files[0]);
-    } else {
-        let path = Path::new(files[0]);
-        if path.is_dir() {
-            return Err(USimpleError::new(
-                2,
-                format!("expected file, got directory {}", path.quote()),
-            ));
-        }
-        match File::open(path) {
-            Ok(f) => {
-                let fin = BufReader::new(f);
-                result = parse(
-                    fin.lines().map_while(Result::ok),
-                    &out_format,
-                    &path.to_string_lossy(),
-                );
-            }
-            Err(e) => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("{}: {}", path.maybe_quote(), e),
-                ));
-            }
-        }
-    }
-
-    match result {
-        Ok(s) => {
-            println!("{s}");
-            Ok(())
-        }
-        Err(s) => {
-            return Err(USimpleError::new(1, s));
-        }
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::BOURNE_SHELL)
-                .long("sh")
-                .short('b')
-                .visible_alias("bourne-shell")
-                .overrides_with(options::C_SHELL)
-                .help("output Bourne shell code to set LS_COLORS")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::C_SHELL)
-                .long("csh")
-                .short('c')
-                .visible_alias("c-shell")
-                .overrides_with(options::BOURNE_SHELL)
-                .help("output C shell code to set LS_COLORS")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PRINT_DATABASE)
-                .long("print-database")
-                .short('p')
-                .help("print the byte counts")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PRINT_LS_COLORS)
-                .long("print-ls-colors")
-                .help("output fully escaped colors for display")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .value_hint(clap::ValueHint::FilePath)
-                .action(ArgAction::Append),
-        )
-}
-
-pub trait StrUtils {
-    /// Remove comments and trim whitespace
-    fn purify(&self) -> &Self;
-    /// Like split_whitespace() but only produce 2 components
-    fn split_two(&self) -> (&str, &str);
-    fn fnmatch(&self, pattern: &str) -> bool;
-}
-
-impl StrUtils for str {
-    fn purify(&self) -> &Self {
-        let mut line = self;
-        for (n, _) in self
-            .as_bytes()
-            .iter()
-            .enumerate()
-            .filter(|(_, c)| **c == b'#')
-        {
-            // Ignore the content after '#'
-            // only if it is preceded by at least one whitespace
-            match self[..n].chars().last() {
-                Some(c) if c.is_whitespace() => {
-                    line = &self[..n - c.len_utf8()];
-                    break;
-                }
-                None => {
-                    // n == 0
-                    line = &self[..0];
-                    break;
-                }
-                _ => (),
-            }
-        }
-        line.trim()
-    }
-
-    fn split_two(&self) -> (&str, &str) {
-        if let Some(b) = self.find(char::is_whitespace) {
-            let key = &self[..b];
-            if let Some(e) = self[b..].find(|c: char| !c.is_whitespace()) {
-                (key, &self[b + e..])
-            } else {
-                (key, "")
-            }
-        } else {
-            ("", "")
-        }
-    }
-
-    fn fnmatch(&self, pat: &str) -> bool {
-        parse_glob::from_str(pat).unwrap().matches(self)
-    }
-}
-
-#[derive(PartialEq)]
-enum ParseState {
-    Global,
-    Matched,
-    Continue,
-    Pass,
-}
-
-use std::collections::HashMap;
-use uucore::{format_usage, parse_glob};
-
-#[allow(clippy::cognitive_complexity)]
-fn parse<T>(lines: T, fmt: &OutputFmt, fp: &str) -> Result<String, String>
-where
-    T: IntoIterator,
-    T::Item: Borrow<str>,
-{
-    // 1790 > $(dircolors | wc -m)
-    let mut result = String::with_capacity(1790);
-    match fmt {
-        OutputFmt::Shell => result.push_str("LS_COLORS='"),
-        OutputFmt::CShell => result.push_str("setenv LS_COLORS '"),
-        OutputFmt::Display => (),
-        OutputFmt::Unknown => unreachable!(),
-    }
-
-    let mut table: HashMap<&str, &str> = HashMap::with_capacity(48);
-    table.insert("normal", "no");
-    table.insert("norm", "no");
-    table.insert("file", "fi");
-    table.insert("reset", "rs");
-    table.insert("dir", "di");
-    table.insert("lnk", "ln");
-    table.insert("link", "ln");
-    table.insert("symlink", "ln");
-    table.insert("orphan", "or");
-    table.insert("missing", "mi");
-    table.insert("fifo", "pi");
-    table.insert("pipe", "pi");
-    table.insert("sock", "so");
-    table.insert("blk", "bd");
-    table.insert("block", "bd");
-    table.insert("chr", "cd");
-    table.insert("char", "cd");
-    table.insert("door", "do");
-    table.insert("exec", "ex");
-    table.insert("left", "lc");
-    table.insert("leftcode", "lc");
-    table.insert("right", "rc");
-    table.insert("rightcode", "rc");
-    table.insert("end", "ec");
-    table.insert("endcode", "ec");
-    table.insert("suid", "su");
-    table.insert("setuid", "su");
-    table.insert("sgid", "sg");
-    table.insert("setgid", "sg");
-    table.insert("sticky", "st");
-    table.insert("other_writable", "ow");
-    table.insert("owr", "ow");
-    table.insert("sticky_other_writable", "tw");
-    table.insert("owt", "tw");
-    table.insert("capability", "ca");
-    table.insert("multihardlink", "mh");
-    table.insert("clrtoeol", "cl");
-
-    let term = env::var("TERM").unwrap_or_else(|_| "none".to_owned());
-    let term = term.as_str();
-
-    let mut state = ParseState::Global;
-
-    for (num, line) in lines.into_iter().enumerate() {
-        let num = num + 1;
-        let line = line.borrow().purify();
-        if line.is_empty() {
-            continue;
-        }
-
-        let line = escape(line);
-
-        let (key, val) = line.split_two();
-        if val.is_empty() {
-            return Err(format!(
-                "{}:{}: invalid line;  missing second token",
-                fp.maybe_quote(),
-                num
-            ));
-        }
-        let lower = key.to_lowercase();
-
-        if lower == "term" || lower == "colorterm" {
-            if term.fnmatch(val) {
-                state = ParseState::Matched;
-            } else if state != ParseState::Matched {
-                state = ParseState::Pass;
-            }
-        } else {
-            if state == ParseState::Matched {
-                // prevent subsequent mismatched TERM from
-                // cancelling the input
-                state = ParseState::Continue;
-            }
-            if state != ParseState::Pass {
-                if key.starts_with('.') {
-                    if *fmt == OutputFmt::Display {
-                        result.push_str(format!("\x1b[{val}m*{key}\t{val}\x1b[0m\n").as_str());
-                    } else {
-                        result.push_str(format!("*{key}={val}:").as_str());
-                    }
-                } else if key.starts_with('*') {
-                    if *fmt == OutputFmt::Display {
-                        result.push_str(format!("\x1b[{val}m{key}\t{val}\x1b[0m\n").as_str());
-                    } else {
-                        result.push_str(format!("{key}={val}:").as_str());
-                    }
-                } else if lower == "options" || lower == "color" || lower == "eightbit" {
-                    // Slackware only. Ignore
-                } else if let Some(s) = table.get(lower.as_str()) {
-                    if *fmt == OutputFmt::Display {
-                        result.push_str(format!("\x1b[{val}m{s}\t{val}\x1b[0m\n").as_str());
-                    } else {
-                        result.push_str(format!("{s}={val}:").as_str());
-                    }
-                } else {
-                    return Err(format!(
-                        "{}:{}: unrecognized keyword {}",
-                        fp.maybe_quote(),
-                        num,
-                        key
-                    ));
-                }
-            }
-        }
-    }
-
-    match fmt {
-        OutputFmt::Shell => result.push_str("';\nexport LS_COLORS"),
-        OutputFmt::CShell => result.push('\''),
-        OutputFmt::Display => {
-            // remove latest "\n"
-            result.pop();
-        }
-        OutputFmt::Unknown => unreachable!(),
-    }
-
-    Ok(result)
-}
-
-/// Escape single quotes because they are not allowed between single quotes in shell code, and code
-/// enclosed by single quotes is what is returned by `parse()`.
-///
-/// We also escape ":" to make the "quote" test pass in the GNU test suite:
-/// <https://github.com/coreutils/coreutils/blob/master/tests/misc/dircolors.pl>
-fn escape(s: &str) -> String {
-    let mut result = String::new();
-    let mut previous = ' ';
-
-    for c in s.chars() {
-        match c {
-            '\'' => result.push_str("'\\''"),
-            ':' if previous != '\\' => result.push_str("\\:"),
-            _ => result.push_str(&c.to_string()),
-        }
-        previous = c;
-    }
-
-    result
-}
-
-#[cfg(test)]
-mod tests {
-    use super::escape;
-
-    #[test]
-    fn test_escape() {
-        assert_eq!("", escape(""));
-        assert_eq!("'\\''", escape("'"));
-        assert_eq!("\\:", escape(":"));
-        assert_eq!("\\:", escape("\\:"));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_dirname/dirname.rs.html b/coreutils/dev/src/uu_dirname/dirname.rs.html deleted file mode 100644 index b93c9ad19..000000000 --- a/coreutils/dev/src/uu_dirname/dirname.rs.html +++ /dev/null @@ -1,171 +0,0 @@ -dirname.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-
// This file is part of the uutils coreutils package.
-//
-// (c) Derek Chiang <derekchiang93@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::path::Path;
-use uucore::display::print_verbatim;
-use uucore::error::{UResult, UUsageError};
-use uucore::line_ending::LineEnding;
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-const ABOUT: &str = help_about!("dirname.md");
-const USAGE: &str = help_usage!("dirname.md");
-const AFTER_HELP: &str = help_section!("after help", "dirname.md");
-
-mod options {
-    pub const ZERO: &str = "zero";
-    pub const DIR: &str = "dir";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().after_help(AFTER_HELP).try_get_matches_from(args)?;
-
-    let line_ending = LineEnding::from_zero_flag(matches.get_flag(options::ZERO));
-
-    let dirnames: Vec<String> = matches
-        .get_many::<String>(options::DIR)
-        .unwrap_or_default()
-        .map(|s| s.to_owned())
-        .collect();
-
-    if dirnames.is_empty() {
-        return Err(UUsageError::new(1, "missing operand"));
-    } else {
-        for path in &dirnames {
-            let p = Path::new(path);
-            match p.parent() {
-                Some(d) => {
-                    if d.components().next().is_none() {
-                        print!(".");
-                    } else {
-                        print_verbatim(d).unwrap();
-                    }
-                }
-                None => {
-                    if p.is_absolute() || path == "/" {
-                        print!("/");
-                    } else {
-                        print!(".");
-                    }
-                }
-            }
-            print!("{line_ending}");
-        }
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .about(ABOUT)
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::ZERO)
-                .long(options::ZERO)
-                .short('z')
-                .help("separate output with NUL rather than newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DIR)
-                .hide(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_du/du.rs.html b/coreutils/dev/src/uu_du/du.rs.html deleted file mode 100644 index 60895ddfb..000000000 --- a/coreutils/dev/src/uu_du/du.rs.html +++ /dev/null @@ -1,2007 +0,0 @@ -du.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Derek Chiang <derekchiang93@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use chrono::prelude::DateTime;
-use chrono::Local;
-use clap::ArgAction;
-use clap::{crate_version, Arg, ArgMatches, Command};
-use glob::Pattern;
-use std::collections::HashSet;
-use std::env;
-use std::fs;
-use std::fs::File;
-#[cfg(not(windows))]
-use std::fs::Metadata;
-use std::io::BufRead;
-use std::io::BufReader;
-use std::io::Result;
-use std::iter;
-#[cfg(not(windows))]
-use std::os::unix::fs::MetadataExt;
-#[cfg(windows)]
-use std::os::windows::fs::MetadataExt;
-#[cfg(windows)]
-use std::os::windows::io::AsRawHandle;
-use std::path::Path;
-use std::path::PathBuf;
-use std::str::FromStr;
-use std::time::{Duration, UNIX_EPOCH};
-use std::{error::Error, fmt::Display};
-use uucore::display::{print_verbatim, Quotable};
-use uucore::error::FromIo;
-use uucore::error::{set_exit_code, UError, UResult};
-use uucore::line_ending::LineEnding;
-use uucore::parse_glob;
-use uucore::parse_size::{parse_size, ParseSizeError};
-use uucore::{
-    crash, format_usage, help_about, help_section, help_usage, show, show_error, show_warning,
-};
-#[cfg(windows)]
-use windows_sys::Win32::Foundation::HANDLE;
-#[cfg(windows)]
-use windows_sys::Win32::Storage::FileSystem::{
-    FileIdInfo, FileStandardInfo, GetFileInformationByHandleEx, FILE_ID_128, FILE_ID_INFO,
-    FILE_STANDARD_INFO,
-};
-
-mod options {
-    pub const HELP: &str = "help";
-    pub const NULL: &str = "0";
-    pub const ALL: &str = "all";
-    pub const APPARENT_SIZE: &str = "apparent-size";
-    pub const BLOCK_SIZE: &str = "block-size";
-    pub const BYTES: &str = "b";
-    pub const TOTAL: &str = "c";
-    pub const MAX_DEPTH: &str = "d";
-    pub const HUMAN_READABLE: &str = "h";
-    pub const BLOCK_SIZE_1K: &str = "k";
-    pub const COUNT_LINKS: &str = "l";
-    pub const BLOCK_SIZE_1M: &str = "m";
-    pub const SEPARATE_DIRS: &str = "S";
-    pub const SUMMARIZE: &str = "s";
-    pub const THRESHOLD: &str = "threshold";
-    pub const SI: &str = "si";
-    pub const TIME: &str = "time";
-    pub const TIME_STYLE: &str = "time-style";
-    pub const ONE_FILE_SYSTEM: &str = "one-file-system";
-    pub const DEREFERENCE: &str = "dereference";
-    pub const DEREFERENCE_ARGS: &str = "dereference-args";
-    pub const INODES: &str = "inodes";
-    pub const EXCLUDE: &str = "exclude";
-    pub const EXCLUDE_FROM: &str = "exclude-from";
-    pub const VERBOSE: &str = "verbose";
-    pub const FILE: &str = "FILE";
-}
-
-const ABOUT: &str = help_about!("du.md");
-const AFTER_HELP: &str = help_section!("after help", "du.md");
-const USAGE: &str = help_usage!("du.md");
-
-// TODO: Support Z & Y (currently limited by size of u64)
-const UNITS: [(char, u32); 6] = [('E', 6), ('P', 5), ('T', 4), ('G', 3), ('M', 2), ('K', 1)];
-
-struct Options {
-    all: bool,
-    max_depth: Option<usize>,
-    total: bool,
-    separate_dirs: bool,
-    one_file_system: bool,
-    dereference: Deref,
-    inodes: bool,
-    verbose: bool,
-}
-
-#[derive(PartialEq)]
-enum Deref {
-    All,
-    Args(Vec<PathBuf>),
-    None,
-}
-
-#[derive(PartialEq, Eq, Hash, Clone, Copy)]
-struct FileInfo {
-    file_id: u128,
-    dev_id: u64,
-}
-
-struct Stat {
-    path: PathBuf,
-    is_dir: bool,
-    size: u64,
-    blocks: u64,
-    inodes: u64,
-    inode: Option<FileInfo>,
-    created: Option<u64>,
-    accessed: u64,
-    modified: u64,
-}
-
-impl Stat {
-    fn new(path: &Path, options: &Options) -> Result<Self> {
-        // Determine whether to dereference (follow) the symbolic link
-        let should_dereference = match &options.dereference {
-            Deref::All => true,
-            Deref::Args(paths) => paths.contains(&path.to_path_buf()),
-            Deref::None => false,
-        };
-
-        let metadata = if should_dereference {
-            // Get metadata, following symbolic links if necessary
-            fs::metadata(path)
-        } else {
-            // Get metadata without following symbolic links
-            fs::symlink_metadata(path)
-        }?;
-
-        #[cfg(not(windows))]
-        let file_info = FileInfo {
-            file_id: metadata.ino() as u128,
-            dev_id: metadata.dev(),
-        };
-        #[cfg(not(windows))]
-        return Ok(Self {
-            path: path.to_path_buf(),
-            is_dir: metadata.is_dir(),
-            size: if path.is_dir() { 0 } else { metadata.len() },
-            blocks: metadata.blocks(),
-            inodes: 1,
-            inode: Some(file_info),
-            created: birth_u64(&metadata),
-            accessed: metadata.atime() as u64,
-            modified: metadata.mtime() as u64,
-        });
-
-        #[cfg(windows)]
-        let size_on_disk = get_size_on_disk(path);
-        #[cfg(windows)]
-        let file_info = get_file_info(path);
-        #[cfg(windows)]
-        Ok(Self {
-            path: path.to_path_buf(),
-            is_dir: metadata.is_dir(),
-            size: if path.is_dir() { 0 } else { metadata.len() },
-            blocks: size_on_disk / 1024 * 2,
-            inode: file_info,
-            inodes: 1,
-            created: windows_creation_time_to_unix_time(metadata.creation_time()),
-            accessed: windows_time_to_unix_time(metadata.last_access_time()),
-            modified: windows_time_to_unix_time(metadata.last_write_time()),
-        })
-    }
-}
-
-#[cfg(windows)]
-// https://doc.rust-lang.org/std/os/windows/fs/trait.MetadataExt.html#tymethod.last_access_time
-// "The returned 64-bit value [...] which represents the number of 100-nanosecond intervals since January 1, 1601 (UTC)."
-// "If the underlying filesystem does not support last access time, the returned value is 0."
-fn windows_time_to_unix_time(win_time: u64) -> u64 {
-    (win_time / 10_000_000).saturating_sub(11_644_473_600)
-}
-
-#[cfg(windows)]
-fn windows_creation_time_to_unix_time(win_time: u64) -> Option<u64> {
-    (win_time / 10_000_000).checked_sub(11_644_473_600)
-}
-
-#[cfg(not(windows))]
-fn birth_u64(meta: &Metadata) -> Option<u64> {
-    meta.created()
-        .ok()
-        .and_then(|t| t.duration_since(UNIX_EPOCH).ok())
-        .map(|e| e.as_secs())
-}
-
-#[cfg(windows)]
-fn get_size_on_disk(path: &Path) -> u64 {
-    let mut size_on_disk = 0;
-
-    // bind file so it stays in scope until end of function
-    // if it goes out of scope the handle below becomes invalid
-    let file = match fs::File::open(path) {
-        Ok(file) => file,
-        Err(_) => return size_on_disk, // opening directories will fail
-    };
-
-    unsafe {
-        let mut file_info: FILE_STANDARD_INFO = core::mem::zeroed();
-        let file_info_ptr: *mut FILE_STANDARD_INFO = &mut file_info;
-
-        let success = GetFileInformationByHandleEx(
-            file.as_raw_handle() as HANDLE,
-            FileStandardInfo,
-            file_info_ptr as _,
-            std::mem::size_of::<FILE_STANDARD_INFO>() as u32,
-        );
-
-        if success != 0 {
-            size_on_disk = file_info.AllocationSize as u64;
-        }
-    }
-
-    size_on_disk
-}
-
-#[cfg(windows)]
-fn get_file_info(path: &Path) -> Option<FileInfo> {
-    let mut result = None;
-
-    let file = match fs::File::open(path) {
-        Ok(file) => file,
-        Err(_) => return result,
-    };
-
-    unsafe {
-        let mut file_info: FILE_ID_INFO = core::mem::zeroed();
-        let file_info_ptr: *mut FILE_ID_INFO = &mut file_info;
-
-        let success = GetFileInformationByHandleEx(
-            file.as_raw_handle() as HANDLE,
-            FileIdInfo,
-            file_info_ptr as _,
-            std::mem::size_of::<FILE_ID_INFO>() as u32,
-        );
-
-        if success != 0 {
-            result = Some(FileInfo {
-                file_id: std::mem::transmute::<FILE_ID_128, u128>(file_info.FileId),
-                dev_id: file_info.VolumeSerialNumber,
-            });
-        }
-    }
-
-    result
-}
-
-fn read_block_size(s: Option<&str>) -> u64 {
-    if let Some(s) = s {
-        parse_size(s)
-            .unwrap_or_else(|e| crash!(1, "{}", format_error_message(&e, s, options::BLOCK_SIZE)))
-    } else {
-        for env_var in ["DU_BLOCK_SIZE", "BLOCK_SIZE", "BLOCKSIZE"] {
-            if let Ok(env_size) = env::var(env_var) {
-                if let Ok(v) = parse_size(&env_size) {
-                    return v;
-                }
-            }
-        }
-        if env::var("POSIXLY_CORRECT").is_ok() {
-            512
-        } else {
-            1024
-        }
-    }
-}
-
-fn choose_size(matches: &ArgMatches, stat: &Stat) -> u64 {
-    if matches.get_flag(options::INODES) {
-        stat.inodes
-    } else if matches.get_flag(options::APPARENT_SIZE) || matches.get_flag(options::BYTES) {
-        stat.size
-    } else {
-        // The st_blocks field indicates the number of blocks allocated to the file, 512-byte units.
-        // See: http://linux.die.net/man/2/stat
-        stat.blocks * 512
-    }
-}
-
-// this takes `my_stat` to avoid having to stat files multiple times.
-// XXX: this should use the impl Trait return type when it is stabilized
-#[allow(clippy::cognitive_complexity)]
-fn du(
-    mut my_stat: Stat,
-    options: &Options,
-    depth: usize,
-    inodes: &mut HashSet<FileInfo>,
-    exclude: &[Pattern],
-) -> Box<dyn DoubleEndedIterator<Item = Stat>> {
-    let mut stats = vec![];
-    let mut futures = vec![];
-
-    if my_stat.is_dir {
-        let read = match fs::read_dir(&my_stat.path) {
-            Ok(read) => read,
-            Err(e) => {
-                show!(
-                    e.map_err_context(|| format!("cannot read directory {}", my_stat.path.quote()))
-                );
-                return Box::new(iter::once(my_stat));
-            }
-        };
-
-        'file_loop: for f in read {
-            match f {
-                Ok(entry) => {
-                    match Stat::new(&entry.path(), options) {
-                        Ok(this_stat) => {
-                            // We have an exclude list
-                            for pattern in exclude {
-                                // Look at all patterns with both short and long paths
-                                // if we have 'du foo' but search to exclude 'foo/bar'
-                                // we need the full path
-                                if pattern.matches(&this_stat.path.to_string_lossy())
-                                    || pattern.matches(&entry.file_name().into_string().unwrap())
-                                {
-                                    // if the directory is ignored, leave early
-                                    if options.verbose {
-                                        println!("{} ignored", &this_stat.path.quote());
-                                    }
-                                    // Go to the next file
-                                    continue 'file_loop;
-                                }
-                            }
-
-                            if let Some(inode) = this_stat.inode {
-                                if inodes.contains(&inode) {
-                                    continue;
-                                }
-                                inodes.insert(inode);
-                            }
-                            if this_stat.is_dir {
-                                if options.one_file_system {
-                                    if let (Some(this_inode), Some(my_inode)) =
-                                        (this_stat.inode, my_stat.inode)
-                                    {
-                                        if this_inode.dev_id != my_inode.dev_id {
-                                            continue;
-                                        }
-                                    }
-                                }
-                                futures.push(du(this_stat, options, depth + 1, inodes, exclude));
-                            } else {
-                                my_stat.size += this_stat.size;
-                                my_stat.blocks += this_stat.blocks;
-                                my_stat.inodes += 1;
-                                if options.all {
-                                    stats.push(this_stat);
-                                }
-                            }
-                        }
-                        Err(e) => show!(
-                            e.map_err_context(|| format!("cannot access {}", entry.path().quote()))
-                        ),
-                    }
-                }
-                Err(error) => show_error!("{}", error),
-            }
-        }
-    }
-
-    stats.extend(futures.into_iter().flatten().filter(|stat| {
-        if !options.separate_dirs && stat.path.parent().unwrap() == my_stat.path {
-            my_stat.size += stat.size;
-            my_stat.blocks += stat.blocks;
-            my_stat.inodes += stat.inodes;
-        }
-        options
-            .max_depth
-            .map_or(true, |max_depth| depth < max_depth)
-    }));
-    stats.push(my_stat);
-    Box::new(stats.into_iter())
-}
-
-fn convert_size_human(size: u64, multiplier: u64, _block_size: u64) -> String {
-    for &(unit, power) in &UNITS {
-        let limit = multiplier.pow(power);
-        if size >= limit {
-            return format!("{:.1}{}", (size as f64) / (limit as f64), unit);
-        }
-    }
-    if size == 0 {
-        return "0".to_string();
-    }
-    format!("{size}B")
-}
-
-fn convert_size_b(size: u64, _multiplier: u64, _block_size: u64) -> String {
-    format!("{}", ((size as f64) / (1_f64)).ceil())
-}
-
-fn convert_size_k(size: u64, multiplier: u64, _block_size: u64) -> String {
-    format!("{}", ((size as f64) / (multiplier as f64)).ceil())
-}
-
-fn convert_size_m(size: u64, multiplier: u64, _block_size: u64) -> String {
-    format!(
-        "{}",
-        ((size as f64) / ((multiplier * multiplier) as f64)).ceil()
-    )
-}
-
-fn convert_size_other(size: u64, _multiplier: u64, block_size: u64) -> String {
-    format!("{}", ((size as f64) / (block_size as f64)).ceil())
-}
-
-fn get_convert_size_fn(matches: &ArgMatches) -> Box<dyn Fn(u64, u64, u64) -> String> {
-    if matches.get_flag(options::HUMAN_READABLE) || matches.get_flag(options::SI) {
-        Box::new(convert_size_human)
-    } else if matches.get_flag(options::BYTES) {
-        Box::new(convert_size_b)
-    } else if matches.get_flag(options::BLOCK_SIZE_1K) {
-        Box::new(convert_size_k)
-    } else if matches.get_flag(options::BLOCK_SIZE_1M) {
-        Box::new(convert_size_m)
-    } else {
-        Box::new(convert_size_other)
-    }
-}
-
-#[derive(Debug)]
-enum DuError {
-    InvalidMaxDepthArg(String),
-    SummarizeDepthConflict(String),
-    InvalidTimeStyleArg(String),
-    InvalidTimeArg(String),
-    InvalidGlob(String),
-}
-
-impl Display for DuError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::InvalidMaxDepthArg(s) => write!(f, "invalid maximum depth {}", s.quote()),
-            Self::SummarizeDepthConflict(s) => {
-                write!(
-                    f,
-                    "summarizing conflicts with --max-depth={}",
-                    s.maybe_quote()
-                )
-            }
-            Self::InvalidTimeStyleArg(s) => write!(
-                f,
-                "invalid argument {} for 'time style'
-Valid arguments are:
-- 'full-iso'
-- 'long-iso'
-- 'iso'
-Try '{} --help' for more information.",
-                s.quote(),
-                uucore::execution_phrase()
-            ),
-            Self::InvalidTimeArg(s) => write!(
-                f,
-                "Invalid argument {} for --time.
-'birth' and 'creation' arguments are not supported on this platform.",
-                s.quote()
-            ),
-            Self::InvalidGlob(s) => write!(f, "Invalid exclude syntax: {s}"),
-        }
-    }
-}
-
-impl Error for DuError {}
-
-impl UError for DuError {
-    fn code(&self) -> i32 {
-        match self {
-            Self::InvalidMaxDepthArg(_)
-            | Self::SummarizeDepthConflict(_)
-            | Self::InvalidTimeStyleArg(_)
-            | Self::InvalidTimeArg(_)
-            | Self::InvalidGlob(_) => 1,
-        }
-    }
-}
-
-// Read a file and return each line in a vector of String
-fn file_as_vec(filename: impl AsRef<Path>) -> Vec<String> {
-    let file = File::open(filename).expect("no such file");
-    let buf = BufReader::new(file);
-
-    buf.lines()
-        .map(|l| l.expect("Could not parse line"))
-        .collect()
-}
-
-// Given the --exclude-from and/or --exclude arguments, returns the globset lists
-// to ignore the files
-fn build_exclude_patterns(matches: &ArgMatches) -> UResult<Vec<Pattern>> {
-    let exclude_from_iterator = matches
-        .get_many::<String>(options::EXCLUDE_FROM)
-        .unwrap_or_default()
-        .flat_map(file_as_vec);
-
-    let excludes_iterator = matches
-        .get_many::<String>(options::EXCLUDE)
-        .unwrap_or_default()
-        .map(|v| v.to_owned());
-
-    let mut exclude_patterns = Vec::new();
-    for f in excludes_iterator.chain(exclude_from_iterator) {
-        if matches.get_flag(options::VERBOSE) {
-            println!("adding {:?} to the exclude list ", &f);
-        }
-        match parse_glob::from_str(&f) {
-            Ok(glob) => exclude_patterns.push(glob),
-            Err(err) => return Err(DuError::InvalidGlob(err.to_string()).into()),
-        }
-    }
-    Ok(exclude_patterns)
-}
-
-#[uucore::main]
-#[allow(clippy::cognitive_complexity)]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let summarize = matches.get_flag(options::SUMMARIZE);
-
-    let max_depth = parse_depth(
-        matches
-            .get_one::<String>(options::MAX_DEPTH)
-            .map(|s| s.as_str()),
-        summarize,
-    )?;
-
-    let files = match matches.get_one::<String>(options::FILE) {
-        Some(_) => matches
-            .get_many::<String>(options::FILE)
-            .unwrap()
-            .map(PathBuf::from)
-            .collect(),
-        None => vec![PathBuf::from(".")],
-    };
-
-    let options = Options {
-        all: matches.get_flag(options::ALL),
-        max_depth,
-        total: matches.get_flag(options::TOTAL),
-        separate_dirs: matches.get_flag(options::SEPARATE_DIRS),
-        one_file_system: matches.get_flag(options::ONE_FILE_SYSTEM),
-        dereference: if matches.get_flag(options::DEREFERENCE) {
-            Deref::All
-        } else if matches.get_flag(options::DEREFERENCE_ARGS) {
-            // We don't care about the cost of cloning as it is rarely used
-            Deref::Args(files.clone())
-        } else {
-            Deref::None
-        },
-        inodes: matches.get_flag(options::INODES),
-        verbose: matches.get_flag(options::VERBOSE),
-    };
-
-    if options.inodes
-        && (matches.get_flag(options::APPARENT_SIZE) || matches.get_flag(options::BYTES))
-    {
-        show_warning!("options --apparent-size and -b are ineffective with --inodes");
-    }
-
-    let block_size = read_block_size(
-        matches
-            .get_one::<String>(options::BLOCK_SIZE)
-            .map(|s| s.as_str()),
-    );
-
-    let threshold = matches.get_one::<String>(options::THRESHOLD).map(|s| {
-        Threshold::from_str(s)
-            .unwrap_or_else(|e| crash!(1, "{}", format_error_message(&e, s, options::THRESHOLD)))
-    });
-
-    let multiplier: u64 = if matches.get_flag(options::SI) {
-        1000
-    } else {
-        1024
-    };
-
-    let convert_size_fn = get_convert_size_fn(&matches);
-
-    let convert_size = |size: u64| {
-        if options.inodes {
-            size.to_string()
-        } else {
-            convert_size_fn(size, multiplier, block_size)
-        }
-    };
-
-    let time_format_str =
-        parse_time_style(matches.get_one::<String>("time-style").map(|s| s.as_str()))?;
-
-    let line_ending = LineEnding::from_zero_flag(matches.get_flag(options::NULL));
-
-    let excludes = build_exclude_patterns(&matches)?;
-
-    let mut grand_total = 0;
-    'loop_file: for path in files {
-        // Skip if we don't want to ignore anything
-        if !&excludes.is_empty() {
-            let path_string = path.to_string_lossy();
-            for pattern in &excludes {
-                if pattern.matches(&path_string) {
-                    // if the directory is ignored, leave early
-                    if options.verbose {
-                        println!("{} ignored", path_string.quote());
-                    }
-                    continue 'loop_file;
-                }
-            }
-        }
-
-        // Check existence of path provided in argument
-        if let Ok(stat) = Stat::new(&path, &options) {
-            // Kick off the computation of disk usage from the initial path
-            let mut inodes: HashSet<FileInfo> = HashSet::new();
-            if let Some(inode) = stat.inode {
-                inodes.insert(inode);
-            }
-            let iter = du(stat, &options, 0, &mut inodes, &excludes);
-
-            // Sum up all the returned `Stat`s and display results
-            let (_, len) = iter.size_hint();
-            let len = len.unwrap();
-            for (index, stat) in iter.enumerate() {
-                let size = choose_size(&matches, &stat);
-
-                if threshold.map_or(false, |threshold| threshold.should_exclude(size)) {
-                    continue;
-                }
-
-                if matches.contains_id(options::TIME) {
-                    let tm = {
-                        let secs = matches
-                            .get_one::<String>(options::TIME)
-                            .map(|s| get_time_secs(s, &stat))
-                            .transpose()?
-                            .unwrap_or(stat.modified);
-                        DateTime::<Local>::from(UNIX_EPOCH + Duration::from_secs(secs))
-                    };
-                    if !summarize || index == len - 1 {
-                        let time_str = tm.format(time_format_str).to_string();
-                        print!("{}\t{}\t", convert_size(size), time_str);
-                        print_verbatim(stat.path).unwrap();
-                        print!("{line_ending}");
-                    }
-                } else if !summarize || index == len - 1 {
-                    print!("{}\t", convert_size(size));
-                    print_verbatim(stat.path).unwrap();
-                    print!("{line_ending}");
-                }
-                if options.total && index == (len - 1) {
-                    // The last element will be the total size of the the path under
-                    // path_string.  We add it to the grand total.
-                    grand_total += size;
-                }
-            }
-        } else {
-            show_error!(
-                "{}: {}",
-                path.to_string_lossy().maybe_quote(),
-                "No such file or directory"
-            );
-            set_exit_code(1);
-        }
-    }
-
-    if options.total {
-        print!("{}\ttotal", convert_size(grand_total));
-        print!("{line_ending}");
-    }
-
-    Ok(())
-}
-
-fn get_time_secs(s: &str, stat: &Stat) -> std::result::Result<u64, DuError> {
-    let secs = match s {
-        "ctime" | "status" => stat.modified,
-        "access" | "atime" | "use" => stat.accessed,
-        "birth" | "creation" => stat
-            .created
-            .ok_or_else(|| DuError::InvalidTimeArg(s.into()))?,
-        // below should never happen as clap already restricts the values.
-        _ => unreachable!("Invalid field for --time"),
-    };
-    Ok(secs)
-}
-
-fn parse_time_style(s: Option<&str>) -> UResult<&str> {
-    match s {
-        Some(s) => match s {
-            "full-iso" => Ok("%Y-%m-%d %H:%M:%S.%f %z"),
-            "long-iso" => Ok("%Y-%m-%d %H:%M"),
-            "iso" => Ok("%Y-%m-%d"),
-            _ => Err(DuError::InvalidTimeStyleArg(s.into()).into()),
-        },
-        None => Ok("%Y-%m-%d %H:%M"),
-    }
-}
-
-fn parse_depth(max_depth_str: Option<&str>, summarize: bool) -> UResult<Option<usize>> {
-    let max_depth = max_depth_str.as_ref().and_then(|s| s.parse::<usize>().ok());
-    match (max_depth_str, max_depth) {
-        (Some(s), _) if summarize => Err(DuError::SummarizeDepthConflict(s.into()).into()),
-        (Some(s), None) => Err(DuError::InvalidMaxDepthArg(s.into()).into()),
-        (Some(_), Some(_)) | (None, _) => Ok(max_depth),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help)
-        )
-        .arg(
-            Arg::new(options::ALL)
-                .short('a')
-                .long(options::ALL)
-                .help("write counts for all files, not just directories")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::APPARENT_SIZE)
-                .long(options::APPARENT_SIZE)
-                .help(
-                    "print apparent sizes, rather than disk usage \
-                    although the apparent size is usually smaller, it may be larger due to holes \
-                    in ('sparse') files, internal fragmentation, indirect blocks, and the like"
-                )
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::BLOCK_SIZE)
-                .short('B')
-                .long(options::BLOCK_SIZE)
-                .value_name("SIZE")
-                .help(
-                    "scale sizes by SIZE before printing them. \
-                    E.g., '-BM' prints sizes in units of 1,048,576 bytes. See SIZE format below."
-                )
-        )
-        .arg(
-            Arg::new(options::BYTES)
-                .short('b')
-                .long("bytes")
-                .help("equivalent to '--apparent-size --block-size=1'")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::TOTAL)
-                .long("total")
-                .short('c')
-                .help("produce a grand total")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::MAX_DEPTH)
-                .short('d')
-                .long("max-depth")
-                .value_name("N")
-                .help(
-                    "print the total for a directory (or file, with --all) \
-                    only if it is N or fewer levels below the command \
-                    line argument;  --max-depth=0 is the same as --summarize"
-                )
-        )
-        .arg(
-            Arg::new(options::HUMAN_READABLE)
-                .long("human-readable")
-                .short('h')
-                .help("print sizes in human readable format (e.g., 1K 234M 2G)")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::INODES)
-                .long(options::INODES)
-                .help(
-                    "list inode usage information instead of block usage like --block-size=1K"
-                )
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::BLOCK_SIZE_1K)
-                .short('k')
-                .help("like --block-size=1K")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::COUNT_LINKS)
-                .short('l')
-                .long("count-links")
-                .help("count sizes many times if hard linked")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::DEREFERENCE)
-                .short('L')
-                .long(options::DEREFERENCE)
-                .help("follow all symbolic links")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::DEREFERENCE_ARGS)
-                .short('D')
-                .long(options::DEREFERENCE_ARGS)
-                .help("follow only symlinks that are listed on the command line")
-                .action(ArgAction::SetTrue)
-        )
-        // .arg(
-        //     Arg::new("no-dereference")
-        //         .short('P')
-        //         .long("no-dereference")
-        //         .help("don't follow any symbolic links (this is the default)")
-        //         .action(ArgAction::SetTrue),
-        // )
-        .arg(
-            Arg::new(options::BLOCK_SIZE_1M)
-                .short('m')
-                .help("like --block-size=1M")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::NULL)
-                .short('0')
-                .long("null")
-                .help("end each output line with 0 byte rather than newline")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::SEPARATE_DIRS)
-                .short('S')
-                .long("separate-dirs")
-                .help("do not include size of subdirectories")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::SUMMARIZE)
-                .short('s')
-                .long("summarize")
-                .help("display only a total for each argument")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::SI)
-                .long(options::SI)
-                .help("like -h, but use powers of 1000 not 1024")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::ONE_FILE_SYSTEM)
-                .short('x')
-                .long(options::ONE_FILE_SYSTEM)
-                .help("skip directories on different file systems")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::THRESHOLD)
-                .short('t')
-                .long(options::THRESHOLD)
-                .value_name("SIZE")
-                .num_args(1)
-                .allow_hyphen_values(true)
-                .help("exclude entries smaller than SIZE if positive, \
-                          or entries greater than SIZE if negative")
-        )
-        .arg(
-            Arg::new(options::VERBOSE)
-                .short('v')
-                .long("verbose")
-                .help("verbose mode (option not present in GNU/Coreutils)")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new(options::EXCLUDE)
-                .long(options::EXCLUDE)
-                .value_name("PATTERN")
-                .help("exclude files that match PATTERN")
-                .action(ArgAction::Append)
-        )
-        .arg(
-            Arg::new(options::EXCLUDE_FROM)
-                .short('X')
-                .long("exclude-from")
-                .value_name("FILE")
-                .value_hint(clap::ValueHint::FilePath)
-                .help("exclude files that match any pattern in FILE")
-                .action(ArgAction::Append)
-        )
-        .arg(
-            Arg::new(options::TIME)
-                .long(options::TIME)
-                .value_name("WORD")
-                .require_equals(true)
-                .num_args(0..)
-                .value_parser(["atime", "access", "use", "ctime", "status", "birth", "creation"])
-                .help(
-                    "show time of the last modification of any file in the \
-                    directory, or any of its subdirectories. If WORD is given, show time as WORD instead \
-                    of modification time: atime, access, use, ctime, status, birth or creation"
-                )
-        )
-        .arg(
-            Arg::new(options::TIME_STYLE)
-                .long(options::TIME_STYLE)
-                .value_name("STYLE")
-                .help(
-                    "show times using style STYLE: \
-                    full-iso, long-iso, iso, +FORMAT FORMAT is interpreted like 'date'"
-                )
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .value_hint(clap::ValueHint::AnyPath)
-                .action(ArgAction::Append)
-        )
-}
-
-#[derive(Clone, Copy)]
-enum Threshold {
-    Lower(u64),
-    Upper(u64),
-}
-
-impl FromStr for Threshold {
-    type Err = ParseSizeError;
-
-    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
-        let offset = usize::from(s.starts_with(&['-', '+'][..]));
-
-        let size = parse_size(&s[offset..])?;
-
-        if s.starts_with('-') {
-            // Threshold of '-0' excludes everything besides 0 sized entries
-            // GNU's du treats '-0' as an invalid argument
-            if size == 0 {
-                return Err(ParseSizeError::ParseFailure(s.to_string()));
-            }
-            Ok(Self::Upper(size))
-        } else {
-            Ok(Self::Lower(size))
-        }
-    }
-}
-
-impl Threshold {
-    fn should_exclude(&self, size: u64) -> bool {
-        match *self {
-            Self::Upper(threshold) => size > threshold,
-            Self::Lower(threshold) => size < threshold,
-        }
-    }
-}
-
-fn format_error_message(error: &ParseSizeError, s: &str, option: &str) -> String {
-    // NOTE:
-    // GNU's du echos affected flag, -B or --block-size (-t or --threshold), depending user's selection
-    match error {
-        ParseSizeError::InvalidSuffix(_) => {
-            format!("invalid suffix in --{} argument {}", option, s.quote())
-        }
-        ParseSizeError::ParseFailure(_) => format!("invalid --{} argument {}", option, s.quote()),
-        ParseSizeError::SizeTooBig(_) => format!("--{} argument {} too large", option, s.quote()),
-    }
-}
-
-#[cfg(test)]
-mod test_du {
-    #[allow(unused_imports)]
-    use super::*;
-
-    #[test]
-    fn test_read_block_size() {
-        let test_data = [
-            (Some("1024".to_string()), 1024),
-            (Some("K".to_string()), 1024),
-            (None, 1024),
-        ];
-        for it in &test_data {
-            assert_eq!(read_block_size(it.0.as_deref()), it.1);
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_echo/echo.rs.html b/coreutils/dev/src/uu_echo/echo.rs.html deleted file mode 100644 index 238b68d05..000000000 --- a/coreutils/dev/src/uu_echo/echo.rs.html +++ /dev/null @@ -1,337 +0,0 @@ -echo.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-
// This file is part of the uutils coreutils package.
-//
-// (c) Derek Chiang <derekchiang93@gmail.com>
-// (c) Christopher Brown <ccbrown112@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::io::{self, Write};
-use std::iter::Peekable;
-use std::str::Chars;
-use uucore::error::{FromIo, UResult};
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-const ABOUT: &str = help_about!("echo.md");
-const USAGE: &str = help_usage!("echo.md");
-const AFTER_HELP: &str = help_section!("after help", "echo.md");
-
-mod options {
-    pub const STRING: &str = "STRING";
-    pub const NO_NEWLINE: &str = "no_newline";
-    pub const ENABLE_BACKSLASH_ESCAPE: &str = "enable_backslash_escape";
-    pub const DISABLE_BACKSLASH_ESCAPE: &str = "disable_backslash_escape";
-}
-
-fn parse_code(
-    input: &mut Peekable<Chars>,
-    base: u32,
-    max_digits: u32,
-    bits_per_digit: u32,
-) -> Option<char> {
-    let mut ret = 0x8000_0000;
-    for _ in 0..max_digits {
-        match input.peek().and_then(|c| c.to_digit(base)) {
-            Some(n) => ret = (ret << bits_per_digit) | n,
-            None => break,
-        }
-        input.next();
-    }
-    std::char::from_u32(ret)
-}
-
-fn print_escaped(input: &str, mut output: impl Write) -> io::Result<bool> {
-    let mut should_stop = false;
-
-    let mut buffer = ['\\'; 2];
-
-    // TODO `cargo +nightly clippy` complains that `.peek()` is never
-    // called on `iter`. However, `peek()` is called inside the
-    // `parse_code()` function that borrows `iter`.
-    let mut iter = input.chars().peekable();
-    while let Some(mut c) = iter.next() {
-        let mut start = 1;
-
-        if c == '\\' {
-            if let Some(next) = iter.next() {
-                c = match next {
-                    '\\' => '\\',
-                    'a' => '\x07',
-                    'b' => '\x08',
-                    'c' => {
-                        should_stop = true;
-                        break;
-                    }
-                    'e' => '\x1b',
-                    'f' => '\x0c',
-                    'n' => '\n',
-                    'r' => '\r',
-                    't' => '\t',
-                    'v' => '\x0b',
-                    'x' => parse_code(&mut iter, 16, 2, 4).unwrap_or_else(|| {
-                        start = 0;
-                        next
-                    }),
-                    '0' => parse_code(&mut iter, 8, 3, 3).unwrap_or('\0'),
-                    _ => {
-                        start = 0;
-                        next
-                    }
-                };
-            }
-        }
-
-        buffer[1] = c;
-
-        // because printing char slices is apparently not available in the standard library
-        for ch in &buffer[start..] {
-            write!(output, "{ch}")?;
-        }
-    }
-
-    Ok(should_stop)
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-    let matches = uu_app().get_matches_from(args);
-
-    let no_newline = matches.get_flag(options::NO_NEWLINE);
-    let escaped = matches.get_flag(options::ENABLE_BACKSLASH_ESCAPE);
-    let values: Vec<String> = match matches.get_many::<String>(options::STRING) {
-        Some(s) => s.map(|s| s.to_string()).collect(),
-        None => vec![String::new()],
-    };
-
-    execute(no_newline, escaped, &values)
-        .map_err_context(|| "could not write to stdout".to_string())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        // TrailingVarArg specifies the final positional argument is a VarArg
-        // and it doesn't attempts the parse any further args.
-        // Final argument must have multiple(true) or the usage string equivalent.
-        .trailing_var_arg(true)
-        .allow_hyphen_values(true)
-        .infer_long_args(true)
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .arg(
-            Arg::new(options::NO_NEWLINE)
-                .short('n')
-                .help("do not output the trailing newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ENABLE_BACKSLASH_ESCAPE)
-                .short('e')
-                .help("enable interpretation of backslash escapes")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DISABLE_BACKSLASH_ESCAPE)
-                .short('E')
-                .help("disable interpretation of backslash escapes (default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(Arg::new(options::STRING).action(ArgAction::Append))
-}
-
-fn execute(no_newline: bool, escaped: bool, free: &[String]) -> io::Result<()> {
-    let stdout = io::stdout();
-    let mut output = stdout.lock();
-
-    for (i, input) in free.iter().enumerate() {
-        if i > 0 {
-            write!(output, " ")?;
-        }
-        if escaped {
-            let should_stop = print_escaped(input, &mut output)?;
-            if should_stop {
-                break;
-            }
-        } else {
-            write!(output, "{input}")?;
-        }
-    }
-
-    if !no_newline {
-        writeln!(output)?;
-    }
-
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_env/env.rs.html b/coreutils/dev/src/uu_env/env.rs.html deleted file mode 100644 index 8862a6385..000000000 --- a/coreutils/dev/src/uu_env/env.rs.html +++ /dev/null @@ -1,721 +0,0 @@ -env.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jordi Boggiano <j.boggiano@seld.be>
-// (c) Thomas Queiroz <thomasqueirozb@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-/* last synced with: env (GNU coreutils) 8.13 */
-
-// spell-checker:ignore (ToDO) chdir execvp progname subcommand subcommands unsets setenv putenv spawnp SIGSEGV SIGBUS sigaction
-
-use clap::{crate_name, crate_version, Arg, ArgAction, Command};
-use ini::Ini;
-#[cfg(unix)]
-use nix::sys::signal::{raise, sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal};
-use std::borrow::Cow;
-use std::env;
-use std::io::{self, Write};
-use std::iter::Iterator;
-#[cfg(unix)]
-use std::os::unix::process::ExitStatusExt;
-use std::process;
-use uucore::display::Quotable;
-use uucore::error::{UClapError, UResult, USimpleError, UUsageError};
-use uucore::line_ending::LineEnding;
-use uucore::{format_usage, help_about, help_section, help_usage, show_warning};
-
-const ABOUT: &str = help_about!("env.md");
-const USAGE: &str = help_usage!("env.md");
-const AFTER_HELP: &str = help_section!("after help", "env.md");
-
-struct Options<'a> {
-    ignore_env: bool,
-    line_ending: LineEnding,
-    running_directory: Option<&'a str>,
-    files: Vec<&'a str>,
-    unsets: Vec<&'a str>,
-    sets: Vec<(&'a str, &'a str)>,
-    program: Vec<&'a str>,
-}
-
-// print name=value env pairs on screen
-// if null is true, separate pairs with a \0, \n otherwise
-fn print_env(line_ending: LineEnding) {
-    let stdout_raw = io::stdout();
-    let mut stdout = stdout_raw.lock();
-    for (n, v) in env::vars() {
-        write!(stdout, "{}={}{}", n, v, line_ending).unwrap();
-    }
-}
-
-fn parse_name_value_opt<'a>(opts: &mut Options<'a>, opt: &'a str) -> UResult<bool> {
-    // is it a NAME=VALUE like opt ?
-    if let Some(idx) = opt.find('=') {
-        // yes, so push name, value pair
-        let (name, value) = opt.split_at(idx);
-        opts.sets.push((name, &value['='.len_utf8()..]));
-
-        Ok(false)
-    } else {
-        // no, it's a program-like opt
-        parse_program_opt(opts, opt).map(|_| true)
-    }
-}
-
-fn parse_program_opt<'a>(opts: &mut Options<'a>, opt: &'a str) -> UResult<()> {
-    if opts.line_ending == LineEnding::Nul {
-        Err(UUsageError::new(
-            125,
-            "cannot specify --null (-0) with command".to_string(),
-        ))
-    } else {
-        opts.program.push(opt);
-        Ok(())
-    }
-}
-
-fn load_config_file(opts: &mut Options) -> UResult<()> {
-    // NOTE: config files are parsed using an INI parser b/c it's available and compatible with ".env"-style files
-    //   ... * but support for actual INI files, although working, is not intended, nor claimed
-    for &file in &opts.files {
-        let conf = if file == "-" {
-            let stdin = io::stdin();
-            let mut stdin_locked = stdin.lock();
-            Ini::read_from(&mut stdin_locked)
-        } else {
-            Ini::load_from_file(file)
-        };
-
-        let conf =
-            conf.map_err(|e| USimpleError::new(1, format!("{}: {}", file.maybe_quote(), e)))?;
-
-        for (_, prop) in &conf {
-            // ignore all INI section lines (treat them as comments)
-            for (key, value) in prop.iter() {
-                env::set_var(key, value);
-            }
-        }
-    }
-
-    Ok(())
-}
-
-#[cfg(not(windows))]
-#[allow(clippy::ptr_arg)]
-fn build_command<'a, 'b>(args: &'a mut Vec<&'b str>) -> (Cow<'b, str>, &'a [&'b str]) {
-    let progname = Cow::from(args[0]);
-    (progname, &args[1..])
-}
-
-#[cfg(windows)]
-fn build_command<'a, 'b>(args: &'a mut Vec<&'b str>) -> (Cow<'b, str>, &'a [&'b str]) {
-    args.insert(0, "/d/c");
-    let progname = env::var("ComSpec")
-        .map(Cow::from)
-        .unwrap_or_else(|_| Cow::from("cmd"));
-
-    (progname, &args[..])
-}
-
-pub fn uu_app() -> Command {
-    Command::new(crate_name!())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .after_help(AFTER_HELP)
-        .infer_long_args(true)
-        .trailing_var_arg(true)
-        .arg(
-            Arg::new("ignore-environment")
-                .short('i')
-                .long("ignore-environment")
-                .help("start with an empty environment")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("chdir")
-                .short('C') // GNU env compatibility
-                .long("chdir")
-                .number_of_values(1)
-                .value_name("DIR")
-                .value_hint(clap::ValueHint::DirPath)
-                .help("change working directory to DIR"),
-        )
-        .arg(
-            Arg::new("null")
-                .short('0')
-                .long("null")
-                .help(
-                    "end each output line with a 0 byte rather than a newline (only \
-                valid when printing the environment)",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("file")
-                .short('f')
-                .long("file")
-                .value_name("PATH")
-                .value_hint(clap::ValueHint::FilePath)
-                .action(ArgAction::Append)
-                .help(
-                    "read and set variables from a \".env\"-style configuration file \
-                (prior to any unset and/or set)",
-                ),
-        )
-        .arg(
-            Arg::new("unset")
-                .short('u')
-                .long("unset")
-                .value_name("NAME")
-                .action(ArgAction::Append)
-                .help("remove variable from the environment"),
-        )
-        .arg(Arg::new("vars").action(ArgAction::Append))
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn run_env(args: impl uucore::Args) -> UResult<()> {
-    let app = uu_app();
-    let matches = app.try_get_matches_from(args).with_exit_code(125)?;
-
-    let ignore_env = matches.get_flag("ignore-environment");
-    let line_ending = LineEnding::from_zero_flag(matches.get_flag("null"));
-    let running_directory = matches.get_one::<String>("chdir").map(|s| s.as_str());
-    let files = match matches.get_many::<String>("file") {
-        Some(v) => v.map(|s| s.as_str()).collect(),
-        None => Vec::with_capacity(0),
-    };
-    let unsets = match matches.get_many::<String>("unset") {
-        Some(v) => v.map(|s| s.as_str()).collect(),
-        None => Vec::with_capacity(0),
-    };
-
-    let mut opts = Options {
-        ignore_env,
-        line_ending,
-        running_directory,
-        files,
-        unsets,
-        sets: vec![],
-        program: vec![],
-    };
-
-    // change directory
-    if let Some(d) = opts.running_directory {
-        match env::set_current_dir(d) {
-            Ok(()) => d,
-            Err(error) => {
-                return Err(USimpleError::new(
-                    125,
-                    format!("cannot change directory to \"{d}\": {error}"),
-                ));
-            }
-        };
-    }
-
-    let mut begin_prog_opts = false;
-    if let Some(mut iter) = matches.get_many::<String>("vars") {
-        // read NAME=VALUE arguments (and up to a single program argument)
-        while !begin_prog_opts {
-            if let Some(opt) = iter.next() {
-                if opt == "-" {
-                    opts.ignore_env = true;
-                } else {
-                    begin_prog_opts = parse_name_value_opt(&mut opts, opt)?;
-                }
-            } else {
-                break;
-            }
-        }
-
-        // read any leftover program arguments
-        for opt in iter {
-            parse_program_opt(&mut opts, opt)?;
-        }
-    }
-
-    // GNU env tests this behavior
-    if opts.program.is_empty() && running_directory.is_some() {
-        return Err(UUsageError::new(
-            125,
-            "must specify command with --chdir (-C)".to_string(),
-        ));
-    }
-
-    // NOTE: we manually set and unset the env vars below rather than using Command::env() to more
-    //       easily handle the case where no command is given
-
-    // remove all env vars if told to ignore presets
-    if opts.ignore_env {
-        for (ref name, _) in env::vars() {
-            env::remove_var(name);
-        }
-    }
-
-    // load .env-style config file prior to those given on the command-line
-    load_config_file(&mut opts)?;
-
-    // unset specified env vars
-    for name in &opts.unsets {
-        if name.is_empty() || name.contains(0 as char) || name.contains('=') {
-            return Err(USimpleError::new(
-                125,
-                format!("cannot unset {}: Invalid argument", name.quote()),
-            ));
-        }
-
-        env::remove_var(name);
-    }
-
-    // set specified env vars
-    for &(name, val) in &opts.sets {
-        /*
-         * set_var panics if name is an empty string
-         * set_var internally calls setenv (on unix at least), while GNU env calls putenv instead.
-         *
-         * putenv returns successfully if provided with something like "=a" and modifies the environ
-         * variable to contain "=a" inside it, effectively modifying the process' current environment
-         * to contain a malformed string in it. Using GNU's implementation, the command `env =a`
-         * prints out the malformed string and even invokes the child process with that environment.
-         * This can be seen by using `env -i =a env` or `env -i =a cat /proc/self/environ`
-         *
-         * POSIX.1-2017 doesn't seem to mention what to do if the string is malformed (at least
-         * not in "Chapter 8, Environment Variables" or in the definition for environ and various
-         * exec*'s or in the description of env in the "Shell & Utilities" volume).
-         *
-         * It also doesn't specify any checks for putenv before modifying the environ variable, which
-         * is likely why glibc doesn't do so. However, the first set_var argument cannot point to
-         * an empty string or a string containing '='.
-         *
-         * There is no benefit in replicating GNU's env behavior, since it will only modify the
-         * environment in weird ways
-         */
-
-        if name.is_empty() {
-            show_warning!("no name specified for value {}", val.quote());
-            continue;
-        }
-        env::set_var(name, val);
-    }
-
-    if opts.program.is_empty() {
-        // no program provided, so just dump all env vars to stdout
-        print_env(opts.line_ending);
-    } else {
-        // we need to execute a command
-        let (prog, args) = build_command(&mut opts.program);
-
-        /*
-         * On Unix-like systems Command::status either ends up calling either fork or posix_spawnp
-         * (which ends up calling clone). Keep using the current process would be ideal, but the
-         * standard library contains many checks and fail-safes to ensure the process ends up being
-         * created. This is much simpler than dealing with the hassles of calling execvp directly.
-         */
-        match process::Command::new(&*prog).args(args).status() {
-            Ok(exit) if !exit.success() => {
-                #[cfg(unix)]
-                if let Some(exit_code) = exit.code() {
-                    return Err(exit_code.into());
-                } else {
-                    // `exit.code()` returns `None` on Unix when the process is terminated by a signal.
-                    // See std::os::unix::process::ExitStatusExt for more information. This prints out
-                    // the interrupted process and the signal it received.
-                    let signal_code = exit.signal().unwrap();
-                    let signal = Signal::try_from(signal_code).unwrap();
-
-                    // We have to disable any handler that's installed by default.
-                    // This ensures that we exit on this signal.
-                    // For example, `SIGSEGV` and `SIGBUS` have default handlers installed in Rust.
-                    // We ignore the errors because there is not much we can do if that fails anyway.
-                    // SAFETY: The function is unsafe because installing functions is unsafe, but we are
-                    // just defaulting to default behavior and not installing a function. Hence, the call
-                    // is safe.
-                    let _ = unsafe {
-                        sigaction(
-                            signal,
-                            &SigAction::new(SigHandler::SigDfl, SaFlags::empty(), SigSet::all()),
-                        )
-                    };
-
-                    let _ = raise(signal);
-                }
-                #[cfg(not(unix))]
-                return Err(exit.code().unwrap().into());
-            }
-            Err(ref err) if err.kind() == io::ErrorKind::NotFound => return Err(127.into()),
-            Err(_) => return Err(126.into()),
-            Ok(_) => (),
-        }
-    }
-
-    Ok(())
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    run_env(args)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_expand/expand.rs.html b/coreutils/dev/src/uu_expand/expand.rs.html deleted file mode 100644 index 1d7e7c59e..000000000 --- a/coreutils/dev/src/uu_expand/expand.rs.html +++ /dev/null @@ -1,1019 +0,0 @@ -expand.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-
// This file is part of the uutils coreutils package.
-//
-// (c) Virgile Andreani <virgile.andreani@anbuco.fr>
-// (c) kwantam <kwantam@gmail.com>
-//     * 2015-04-28 ~ updated to work with both UTF-8 and non-UTF-8 encodings
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) ctype cwidth iflag nbytes nspaces nums tspaces uflag Preprocess
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-use std::error::Error;
-use std::fmt;
-use std::fs::File;
-use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write};
-use std::num::IntErrorKind;
-use std::str::from_utf8;
-use unicode_width::UnicodeWidthChar;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UError, UResult};
-use uucore::{crash, format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("expand.md");
-const USAGE: &str = help_usage!("expand.md");
-
-pub mod options {
-    pub static TABS: &str = "tabs";
-    pub static INITIAL: &str = "initial";
-    pub static NO_UTF8: &str = "no-utf8";
-    pub static FILES: &str = "FILES";
-}
-
-static LONG_HELP: &str = "";
-
-static DEFAULT_TABSTOP: usize = 8;
-
-/// The mode to use when replacing tabs beyond the last one specified in
-/// the `--tabs` argument.
-#[derive(PartialEq)]
-enum RemainingMode {
-    None,
-    Slash,
-    Plus,
-}
-
-/// Decide whether the character is either a space or a comma.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// assert!(is_space_or_comma(' '))
-/// assert!(is_space_or_comma(','))
-/// assert!(!is_space_or_comma('a'))
-/// ```
-fn is_space_or_comma(c: char) -> bool {
-    c == ' ' || c == ','
-}
-
-/// Decide whether the character is either a digit or a comma.
-fn is_digit_or_comma(c: char) -> bool {
-    c.is_ascii_digit() || c == ','
-}
-
-/// Errors that can occur when parsing a `--tabs` argument.
-#[derive(Debug)]
-enum ParseError {
-    InvalidCharacter(String),
-    SpecifierNotAtStartOfNumber(String, String),
-    SpecifierOnlyAllowedWithLastValue(String),
-    TabSizeCannotBeZero,
-    TabSizeTooLarge(String),
-    TabSizesMustBeAscending,
-}
-
-impl Error for ParseError {}
-impl UError for ParseError {}
-
-impl fmt::Display for ParseError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match self {
-            Self::InvalidCharacter(s) => {
-                write!(f, "tab size contains invalid character(s): {}", s.quote())
-            }
-            Self::SpecifierNotAtStartOfNumber(specifier, s) => write!(
-                f,
-                "{} specifier not at start of number: {}",
-                specifier.quote(),
-                s.quote(),
-            ),
-            Self::SpecifierOnlyAllowedWithLastValue(specifier) => write!(
-                f,
-                "{} specifier only allowed with the last value",
-                specifier.quote()
-            ),
-            Self::TabSizeCannotBeZero => write!(f, "tab size cannot be 0"),
-            Self::TabSizeTooLarge(s) => write!(f, "tab stop is too large {}", s.quote()),
-            Self::TabSizesMustBeAscending => write!(f, "tab sizes must be ascending"),
-        }
-    }
-}
-
-/// Parse a list of tabstops from a `--tabs` argument.
-///
-/// This function returns both the vector of numbers appearing in the
-/// comma- or space-separated list, and also an optional mode, specified
-/// by either a "/" or a "+" character appearing before the final number
-/// in the list. This mode defines the strategy to use for computing the
-/// number of spaces to use for columns beyond the end of the tab stop
-/// list specified here.
-fn tabstops_parse(s: &str) -> Result<(RemainingMode, Vec<usize>), ParseError> {
-    // Leading commas and spaces are ignored.
-    let s = s.trim_start_matches(is_space_or_comma);
-
-    // If there were only commas and spaces in the string, just use the
-    // default tabstops.
-    if s.is_empty() {
-        return Ok((RemainingMode::None, vec![DEFAULT_TABSTOP]));
-    }
-
-    let mut nums = vec![];
-    let mut remaining_mode = RemainingMode::None;
-    let mut is_specifier_already_used = false;
-    for word in s.split(is_space_or_comma) {
-        let bytes = word.as_bytes();
-        for i in 0..bytes.len() {
-            match bytes[i] {
-                b'+' => remaining_mode = RemainingMode::Plus,
-                b'/' => remaining_mode = RemainingMode::Slash,
-                _ => {
-                    // Parse a number from the byte sequence.
-                    let s = from_utf8(&bytes[i..]).unwrap();
-                    match s.parse::<usize>() {
-                        Ok(num) => {
-                            // Tab size must be positive.
-                            if num == 0 {
-                                return Err(ParseError::TabSizeCannotBeZero);
-                            }
-
-                            // Tab sizes must be ascending.
-                            if let Some(last_stop) = nums.last() {
-                                if *last_stop >= num {
-                                    return Err(ParseError::TabSizesMustBeAscending);
-                                }
-                            }
-
-                            if is_specifier_already_used {
-                                let specifier = if remaining_mode == RemainingMode::Slash {
-                                    "/".to_string()
-                                } else {
-                                    "+".to_string()
-                                };
-                                return Err(ParseError::SpecifierOnlyAllowedWithLastValue(
-                                    specifier,
-                                ));
-                            } else if remaining_mode != RemainingMode::None {
-                                is_specifier_already_used = true;
-                            }
-
-                            // Append this tab stop to the list of all tabstops.
-                            nums.push(num);
-                            break;
-                        }
-                        Err(e) => {
-                            if *e.kind() == IntErrorKind::PosOverflow {
-                                return Err(ParseError::TabSizeTooLarge(s.to_string()));
-                            }
-
-                            let s = s.trim_start_matches(char::is_numeric);
-                            if s.starts_with('/') || s.starts_with('+') {
-                                return Err(ParseError::SpecifierNotAtStartOfNumber(
-                                    s[0..1].to_string(),
-                                    s.to_string(),
-                                ));
-                            } else {
-                                return Err(ParseError::InvalidCharacter(s.to_string()));
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-    // If no numbers could be parsed (for example, if `s` were "+,+,+"),
-    // then just use the default tabstops.
-    if nums.is_empty() {
-        nums = vec![DEFAULT_TABSTOP];
-    }
-
-    if nums.len() < 2 {
-        remaining_mode = RemainingMode::None;
-    }
-    Ok((remaining_mode, nums))
-}
-
-struct Options {
-    files: Vec<String>,
-    tabstops: Vec<usize>,
-    tspaces: String,
-    iflag: bool,
-    uflag: bool,
-
-    /// Strategy for expanding tabs for columns beyond those specified
-    /// in `tabstops`.
-    remaining_mode: RemainingMode,
-}
-
-impl Options {
-    fn new(matches: &ArgMatches) -> Result<Self, ParseError> {
-        let (remaining_mode, tabstops) = match matches.get_many::<String>(options::TABS) {
-            Some(s) => tabstops_parse(&s.map(|s| s.as_str()).collect::<Vec<_>>().join(","))?,
-            None => (RemainingMode::None, vec![DEFAULT_TABSTOP]),
-        };
-
-        let iflag = matches.get_flag(options::INITIAL);
-        let uflag = !matches.get_flag(options::NO_UTF8);
-
-        // avoid allocations when dumping out long sequences of spaces
-        // by precomputing the longest string of spaces we will ever need
-        let nspaces = tabstops
-            .iter()
-            .scan(0, |pr, &it| {
-                let ret = Some(it - *pr);
-                *pr = it;
-                ret
-            })
-            .max()
-            .unwrap(); // length of tabstops is guaranteed >= 1
-        let tspaces = " ".repeat(nspaces);
-
-        let files: Vec<String> = match matches.get_many::<String>(options::FILES) {
-            Some(s) => s.map(|v| v.to_string()).collect(),
-            None => vec!["-".to_owned()],
-        };
-
-        Ok(Self {
-            files,
-            tabstops,
-            tspaces,
-            iflag,
-            uflag,
-            remaining_mode,
-        })
-    }
-}
-
-/// Preprocess command line arguments and expand shortcuts. For example, "-7" is expanded to
-/// "--tabs=7" and "-1,3" to "--tabs=1 --tabs=3".
-fn expand_shortcuts(args: &[String]) -> Vec<String> {
-    let mut processed_args = Vec::with_capacity(args.len());
-
-    for arg in args {
-        if arg.starts_with('-') && arg[1..].chars().all(is_digit_or_comma) {
-            arg[1..]
-                .split(',')
-                .filter(|s| !s.is_empty())
-                .for_each(|s| processed_args.push(format!("--tabs={s}")));
-        } else {
-            processed_args.push(arg.to_string());
-        }
-    }
-
-    processed_args
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(expand_shortcuts(&args))?;
-
-    expand(&Options::new(&matches)?).map_err_context(|| "failed to write output".to_string())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(LONG_HELP)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::INITIAL)
-                .long(options::INITIAL)
-                .short('i')
-                .help("do not convert tabs after non blanks")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::TABS)
-                .long(options::TABS)
-                .short('t')
-                .value_name("N, LIST")
-                .action(ArgAction::Append)
-                .help(
-                    "have tabs N characters apart, not 8 or use comma separated list \
-                    of explicit tab positions",
-                ),
-        )
-        .arg(
-            Arg::new(options::NO_UTF8)
-                .long(options::NO_UTF8)
-                .short('U')
-                .help("interpret input file as 8-bit ASCII rather than UTF-8")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILES)
-                .action(ArgAction::Append)
-                .hide(true)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-fn open(path: &str) -> BufReader<Box<dyn Read + 'static>> {
-    let file_buf;
-    if path == "-" {
-        BufReader::new(Box::new(stdin()) as Box<dyn Read>)
-    } else {
-        file_buf = match File::open(path) {
-            Ok(a) => a,
-            Err(e) => crash!(1, "{}: {}\n", path.maybe_quote(), e),
-        };
-        BufReader::new(Box::new(file_buf) as Box<dyn Read>)
-    }
-}
-
-/// Compute the number of spaces to the next tabstop.
-///
-/// `tabstops` is the sequence of tabstop locations.
-///
-/// `col` is the index of the current cursor in the line being written.
-///
-/// If `remaining_mode` is [`RemainingMode::Plus`], then the last entry
-/// in the `tabstops` slice is interpreted as a relative number of
-/// spaces, which this function will return for every input value of
-/// `col` beyond the end of the second-to-last element of `tabstops`.
-fn next_tabstop(tabstops: &[usize], col: usize, remaining_mode: &RemainingMode) -> usize {
-    let num_tabstops = tabstops.len();
-    match remaining_mode {
-        RemainingMode::Plus => match tabstops[0..num_tabstops - 1].iter().find(|&&t| t > col) {
-            Some(t) => t - col,
-            None => {
-                let step_size = tabstops[num_tabstops - 1];
-                let last_fixed_tabstop = tabstops[num_tabstops - 2];
-                let characters_since_last_tabstop = col - last_fixed_tabstop;
-
-                let steps_required = 1 + characters_since_last_tabstop / step_size;
-                steps_required * step_size - characters_since_last_tabstop
-            }
-        },
-        RemainingMode::Slash => match tabstops[0..num_tabstops - 1].iter().find(|&&t| t > col) {
-            Some(t) => t - col,
-            None => tabstops[num_tabstops - 1] - col % tabstops[num_tabstops - 1],
-        },
-        RemainingMode::None => {
-            if num_tabstops == 1 {
-                tabstops[0] - col % tabstops[0]
-            } else {
-                match tabstops.iter().find(|&&t| t > col) {
-                    Some(t) => t - col,
-                    None => 1,
-                }
-            }
-        }
-    }
-}
-
-#[derive(PartialEq, Eq, Debug)]
-enum CharType {
-    Backspace,
-    Tab,
-    Other,
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn expand(options: &Options) -> std::io::Result<()> {
-    use self::CharType::*;
-
-    let mut output = BufWriter::new(stdout());
-    let ts = options.tabstops.as_ref();
-    let mut buf = Vec::new();
-
-    for file in &options.files {
-        let mut fh = open(file);
-
-        while match fh.read_until(b'\n', &mut buf) {
-            Ok(s) => s > 0,
-            Err(_) => buf.is_empty(),
-        } {
-            let mut col = 0;
-            let mut byte = 0;
-            let mut init = true;
-
-            while byte < buf.len() {
-                let (ctype, cwidth, nbytes) = if options.uflag {
-                    let nbytes = char::from(buf[byte]).len_utf8();
-
-                    if byte + nbytes > buf.len() {
-                        // don't overrun buffer because of invalid UTF-8
-                        (Other, 1, 1)
-                    } else if let Ok(t) = from_utf8(&buf[byte..byte + nbytes]) {
-                        match t.chars().next() {
-                            Some('\t') => (Tab, 0, nbytes),
-                            Some('\x08') => (Backspace, 0, nbytes),
-                            Some(c) => (Other, UnicodeWidthChar::width(c).unwrap_or(0), nbytes),
-                            None => {
-                                // no valid char at start of t, so take 1 byte
-                                (Other, 1, 1)
-                            }
-                        }
-                    } else {
-                        (Other, 1, 1) // implicit assumption: non-UTF-8 char is 1 col wide
-                    }
-                } else {
-                    (
-                        match buf[byte] {
-                            // always take exactly 1 byte in strict ASCII mode
-                            0x09 => Tab,
-                            0x08 => Backspace,
-                            _ => Other,
-                        },
-                        1,
-                        1,
-                    )
-                };
-
-                // figure out how many columns this char takes up
-                match ctype {
-                    Tab => {
-                        // figure out how many spaces to the next tabstop
-                        let nts = next_tabstop(ts, col, &options.remaining_mode);
-                        col += nts;
-
-                        // now dump out either spaces if we're expanding, or a literal tab if we're not
-                        if init || !options.iflag {
-                            if nts <= options.tspaces.len() {
-                                output.write_all(options.tspaces[..nts].as_bytes())?;
-                            } else {
-                                output.write_all(" ".repeat(nts).as_bytes())?;
-                            };
-                        } else {
-                            output.write_all(&buf[byte..byte + nbytes])?;
-                        }
-                    }
-                    _ => {
-                        col = if ctype == Other {
-                            col + cwidth
-                        } else if col > 0 {
-                            col - 1
-                        } else {
-                            0
-                        };
-
-                        // if we're writing anything other than a space, then we're
-                        // done with the line's leading spaces
-                        if buf[byte] != 0x20 {
-                            init = false;
-                        }
-
-                        output.write_all(&buf[byte..byte + nbytes])?;
-                    }
-                }
-
-                byte += nbytes; // advance the pointer
-            }
-
-            output.flush()?;
-            buf.truncate(0); // clear the buffer
-        }
-    }
-    Ok(())
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::is_digit_or_comma;
-
-    use super::next_tabstop;
-    use super::RemainingMode;
-
-    #[test]
-    fn test_next_tabstop_remaining_mode_none() {
-        assert_eq!(next_tabstop(&[1, 5], 0, &RemainingMode::None), 1);
-        assert_eq!(next_tabstop(&[1, 5], 3, &RemainingMode::None), 2);
-        assert_eq!(next_tabstop(&[1, 5], 6, &RemainingMode::None), 1);
-    }
-
-    #[test]
-    fn test_next_tabstop_remaining_mode_plus() {
-        assert_eq!(next_tabstop(&[1, 5], 0, &RemainingMode::Plus), 1);
-        assert_eq!(next_tabstop(&[1, 5], 3, &RemainingMode::Plus), 3);
-        assert_eq!(next_tabstop(&[1, 5], 6, &RemainingMode::Plus), 5);
-    }
-
-    #[test]
-    fn test_next_tabstop_remaining_mode_slash() {
-        assert_eq!(next_tabstop(&[1, 5], 0, &RemainingMode::Slash), 1);
-        assert_eq!(next_tabstop(&[1, 5], 3, &RemainingMode::Slash), 2);
-        assert_eq!(next_tabstop(&[1, 5], 6, &RemainingMode::Slash), 4);
-    }
-
-    #[test]
-    fn test_is_digit_or_comma() {
-        assert!(is_digit_or_comma('1'));
-        assert!(is_digit_or_comma(','));
-        assert!(!is_digit_or_comma('a'));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_expr/expr.rs.html b/coreutils/dev/src/uu_expr/expr.rs.html deleted file mode 100644 index c1e0dfc54..000000000 --- a/coreutils/dev/src/uu_expr/expr.rs.html +++ /dev/null @@ -1,173 +0,0 @@ -expr.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-
//* This file is part of the uutils coreutils package.
-//*
-//* (c) Roman Gafiyatullin <r.gafiyatullin@me.com>
-//*
-//* For the full copyright and license information, please view the LICENSE
-//* file that was distributed with this source code.
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use uucore::{
-    error::{UResult, USimpleError},
-    format_usage, help_about, help_section, help_usage,
-};
-
-mod syntax_tree;
-mod tokens;
-
-mod options {
-    pub const VERSION: &str = "version";
-    pub const HELP: &str = "help";
-    pub const EXPRESSION: &str = "expression";
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(help_about!("expr.md"))
-        .override_usage(format_usage(help_usage!("expr.md")))
-        .after_help(help_section!("after help", "expr.md"))
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .disable_version_flag(true)
-        .arg(
-            Arg::new(options::VERSION)
-                .long(options::VERSION)
-                .help("output version information and exit")
-                .action(ArgAction::Version),
-        )
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("display this help and exit")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new(options::EXPRESSION)
-                .action(ArgAction::Append)
-                .allow_hyphen_values(true),
-        )
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    // For expr utility we do not want getopts.
-    // The following usage should work without escaping hyphens: `expr -15 = 1 +  2 \* \( 3 - -4 \)`
-    let matches = uu_app().try_get_matches_from(args)?;
-    let token_strings = matches
-        .get_many::<String>(options::EXPRESSION)
-        .map(|v| v.into_iter().map(|s| s.as_ref()).collect::<Vec<_>>())
-        .unwrap_or_default();
-
-    match process_expr(&token_strings[..]) {
-        Ok(expr_result) => print_expr_ok(&expr_result),
-        Err(expr_error) => Err(USimpleError::new(2, &expr_error)),
-    }
-}
-
-fn process_expr(token_strings: &[&str]) -> Result<String, String> {
-    let maybe_tokens = tokens::strings_to_tokens(token_strings);
-    let maybe_ast = syntax_tree::tokens_to_ast(maybe_tokens);
-    evaluate_ast(maybe_ast)
-}
-
-fn print_expr_ok(expr_result: &str) -> UResult<()> {
-    println!("{expr_result}");
-    if expr_result.parse::<i32>() == Ok(0) || expr_result.is_empty() {
-        Err(1.into())
-    } else {
-        Ok(())
-    }
-}
-
-fn evaluate_ast(maybe_ast: Result<Box<syntax_tree::AstNode>, String>) -> Result<String, String> {
-    maybe_ast.and_then(|ast| ast.evaluate())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_expr/syntax_tree.rs.html b/coreutils/dev/src/uu_expr/syntax_tree.rs.html deleted file mode 100644 index af9390f71..000000000 --- a/coreutils/dev/src/uu_expr/syntax_tree.rs.html +++ /dev/null @@ -1,1047 +0,0 @@ -syntax_tree.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-
//* This file is part of the uutils coreutils package.
-//*
-//* (c) Roman Gafiyatullin <r.gafiyatullin@me.com>
-//*
-//* For the full copyright and license information, please view the LICENSE
-//* file that was distributed with this source code.
-
-//!
-//! Here we employ shunting-yard algorithm for building AST from tokens according to operators' precedence and associative-ness.
-//! * `<https://en.wikipedia.org/wiki/Shunting-yard_algorithm>`
-//!
-
-// spell-checker:ignore (ToDO) binop binops ints paren prec multibytes
-
-use num_bigint::BigInt;
-use num_traits::{One, Zero};
-use onig::{Regex, RegexOptions, Syntax};
-
-use crate::tokens::Token;
-
-type TokenStack = Vec<(usize, Token)>;
-pub type OperandsList = Vec<Box<AstNode>>;
-
-#[derive(Debug)]
-pub enum AstNode {
-    Leaf {
-        token_idx: usize,
-        value: String,
-    },
-    Node {
-        token_idx: usize,
-        op_type: String,
-        operands: OperandsList,
-    },
-}
-impl AstNode {
-    fn debug_dump(&self) {
-        self.debug_dump_impl(1);
-    }
-    fn debug_dump_impl(&self, depth: usize) {
-        for _ in 0..depth {
-            print!("\t",);
-        }
-        match self {
-            Self::Leaf { token_idx, value } => println!(
-                "Leaf( {} ) at #{} ( evaluate -> {:?} )",
-                value,
-                token_idx,
-                self.evaluate()
-            ),
-            Self::Node {
-                token_idx,
-                op_type,
-                operands,
-            } => {
-                println!(
-                    "Node( {} ) at #{} (evaluate -> {:?})",
-                    op_type,
-                    token_idx,
-                    self.evaluate()
-                );
-                for operand in operands {
-                    operand.debug_dump_impl(depth + 1);
-                }
-            }
-        }
-    }
-
-    fn new_node(token_idx: usize, op_type: &str, operands: OperandsList) -> Box<Self> {
-        Box::new(Self::Node {
-            token_idx,
-            op_type: op_type.into(),
-            operands,
-        })
-    }
-    fn new_leaf(token_idx: usize, value: &str) -> Box<Self> {
-        Box::new(Self::Leaf {
-            token_idx,
-            value: value.into(),
-        })
-    }
-    pub fn evaluate(&self) -> Result<String, String> {
-        match self {
-            Self::Leaf { value, .. } => Ok(value.clone()),
-            Self::Node { op_type, .. } => match self.operand_values() {
-                Err(reason) => Err(reason),
-                Ok(operand_values) => match op_type.as_ref() {
-                    "+" => {
-                        infix_operator_two_ints(|a: BigInt, b: BigInt| Ok(a + b), &operand_values)
-                    }
-                    "-" => {
-                        infix_operator_two_ints(|a: BigInt, b: BigInt| Ok(a - b), &operand_values)
-                    }
-                    "*" => {
-                        infix_operator_two_ints(|a: BigInt, b: BigInt| Ok(a * b), &operand_values)
-                    }
-                    "/" => infix_operator_two_ints(
-                        |a: BigInt, b: BigInt| {
-                            if b.is_zero() {
-                                Err("division by zero".to_owned())
-                            } else {
-                                Ok(a / b)
-                            }
-                        },
-                        &operand_values,
-                    ),
-                    "%" => infix_operator_two_ints(
-                        |a: BigInt, b: BigInt| {
-                            if b.is_zero() {
-                                Err("division by zero".to_owned())
-                            } else {
-                                Ok(a % b)
-                            }
-                        },
-                        &operand_values,
-                    ),
-                    "=" => infix_operator_two_ints_or_two_strings(
-                        |a: BigInt, b: BigInt| Ok(bool_as_int(a == b)),
-                        |a: &String, b: &String| Ok(bool_as_string(a == b)),
-                        &operand_values,
-                    ),
-                    "!=" => infix_operator_two_ints_or_two_strings(
-                        |a: BigInt, b: BigInt| Ok(bool_as_int(a != b)),
-                        |a: &String, b: &String| Ok(bool_as_string(a != b)),
-                        &operand_values,
-                    ),
-                    "<" => infix_operator_two_ints_or_two_strings(
-                        |a: BigInt, b: BigInt| Ok(bool_as_int(a < b)),
-                        |a: &String, b: &String| Ok(bool_as_string(a < b)),
-                        &operand_values,
-                    ),
-                    ">" => infix_operator_two_ints_or_two_strings(
-                        |a: BigInt, b: BigInt| Ok(bool_as_int(a > b)),
-                        |a: &String, b: &String| Ok(bool_as_string(a > b)),
-                        &operand_values,
-                    ),
-                    "<=" => infix_operator_two_ints_or_two_strings(
-                        |a: BigInt, b: BigInt| Ok(bool_as_int(a <= b)),
-                        |a: &String, b: &String| Ok(bool_as_string(a <= b)),
-                        &operand_values,
-                    ),
-                    ">=" => infix_operator_two_ints_or_two_strings(
-                        |a: BigInt, b: BigInt| Ok(bool_as_int(a >= b)),
-                        |a: &String, b: &String| Ok(bool_as_string(a >= b)),
-                        &operand_values,
-                    ),
-                    "|" => Ok(infix_operator_or(&operand_values)),
-                    "&" => Ok(infix_operator_and(&operand_values)),
-                    ":" | "match" => operator_match(&operand_values),
-                    "length" => Ok(prefix_operator_length(&operand_values)),
-                    "index" => Ok(prefix_operator_index(&operand_values)),
-                    "substr" => Ok(prefix_operator_substr(&operand_values)),
-
-                    _ => Err(format!("operation not implemented: {op_type}")),
-                },
-            },
-        }
-    }
-    pub fn operand_values(&self) -> Result<Vec<String>, String> {
-        if let Self::Node { operands, .. } = self {
-            let mut out = Vec::with_capacity(operands.len());
-            for operand in operands {
-                let value = operand.evaluate()?;
-                out.push(value);
-            }
-            Ok(out)
-        } else {
-            panic!("Invoked .operand_values(&self) not with ASTNode::Node")
-        }
-    }
-}
-
-pub fn tokens_to_ast(
-    maybe_tokens: Result<Vec<(usize, Token)>, String>,
-) -> Result<Box<AstNode>, String> {
-    maybe_tokens.and_then(|tokens| {
-        let mut out_stack: TokenStack = Vec::new();
-        let mut op_stack: TokenStack = Vec::new();
-
-        for (token_idx, token) in tokens {
-            push_token_to_either_stack(token_idx, &token, &mut out_stack, &mut op_stack)?;
-        }
-        move_rest_of_ops_to_out(&mut out_stack, &mut op_stack)?;
-        assert!(op_stack.is_empty());
-
-        maybe_dump_rpn(&out_stack);
-        let result = ast_from_rpn(&mut out_stack);
-        if out_stack.is_empty() {
-            maybe_dump_ast(&result);
-            result
-        } else {
-            Err(
-                "syntax error (first RPN token does not represent the root of the expression AST)"
-                    .to_owned(),
-            )
-        }
-    })
-}
-
-fn maybe_dump_ast(result: &Result<Box<AstNode>, String>) {
-    use std::env;
-    if let Ok(debug_var) = env::var("EXPR_DEBUG_AST") {
-        if debug_var == "1" {
-            println!("EXPR_DEBUG_AST");
-            match result {
-                Ok(ast) => ast.debug_dump(),
-                Err(reason) => println!("\terr: {reason:?}"),
-            }
-        }
-    }
-}
-
-#[allow(clippy::ptr_arg)]
-fn maybe_dump_rpn(rpn: &TokenStack) {
-    use std::env;
-    if let Ok(debug_var) = env::var("EXPR_DEBUG_RPN") {
-        if debug_var == "1" {
-            println!("EXPR_DEBUG_RPN");
-            for token in rpn {
-                println!("\t{token:?}");
-            }
-        }
-    }
-}
-
-fn ast_from_rpn(rpn: &mut TokenStack) -> Result<Box<AstNode>, String> {
-    match rpn.pop() {
-        None => Err("syntax error (premature end of expression)".to_owned()),
-
-        Some((token_idx, Token::Value { value })) => Ok(AstNode::new_leaf(token_idx, &value)),
-
-        Some((token_idx, Token::InfixOp { value, .. })) => {
-            maybe_ast_node(token_idx, &value, 2, rpn)
-        }
-
-        Some((token_idx, Token::PrefixOp { value, arity })) => {
-            maybe_ast_node(token_idx, &value, arity, rpn)
-        }
-
-        Some((token_idx, unexpected_token)) => {
-            panic!("unexpected token at #{token_idx} {unexpected_token:?}")
-        }
-    }
-}
-fn maybe_ast_node(
-    token_idx: usize,
-    op_type: &str,
-    arity: usize,
-    rpn: &mut TokenStack,
-) -> Result<Box<AstNode>, String> {
-    let mut operands = Vec::with_capacity(arity);
-    for _ in 0..arity {
-        let operand = ast_from_rpn(rpn)?;
-        operands.push(operand);
-    }
-    operands.reverse();
-    Ok(AstNode::new_node(token_idx, op_type, operands))
-}
-
-fn move_rest_of_ops_to_out(
-    out_stack: &mut TokenStack,
-    op_stack: &mut TokenStack,
-) -> Result<(), String> {
-    loop {
-        match op_stack.pop() {
-            None => return Ok(()),
-            Some((token_idx, Token::ParOpen)) => {
-                return Err(format!(
-                    "syntax error (Mismatched open-parenthesis at #{token_idx})"
-                ))
-            }
-            Some((token_idx, Token::ParClose)) => {
-                return Err(format!(
-                    "syntax error (Mismatched close-parenthesis at #{token_idx})"
-                ))
-            }
-            Some(other) => out_stack.push(other),
-        }
-    }
-}
-
-fn push_token_to_either_stack(
-    token_idx: usize,
-    token: &Token,
-    out_stack: &mut TokenStack,
-    op_stack: &mut TokenStack,
-) -> Result<(), String> {
-    let result = match token {
-        Token::Value { .. } => {
-            out_stack.push((token_idx, token.clone()));
-            Ok(())
-        }
-
-        Token::InfixOp { .. } => {
-            if op_stack.is_empty() {
-                op_stack.push((token_idx, token.clone()));
-                Ok(())
-            } else {
-                push_op_to_stack(token_idx, token, out_stack, op_stack)
-            }
-        }
-
-        Token::PrefixOp { .. } | Token::ParOpen => {
-            op_stack.push((token_idx, token.clone()));
-            Ok(())
-        }
-
-        Token::ParClose => move_till_match_paren(out_stack, op_stack),
-    };
-    maybe_dump_shunting_yard_step(token_idx, token, out_stack, op_stack, &result);
-    result
-}
-
-#[allow(clippy::ptr_arg)]
-fn maybe_dump_shunting_yard_step(
-    token_idx: usize,
-    token: &Token,
-    out_stack: &TokenStack,
-    op_stack: &TokenStack,
-    result: &Result<(), String>,
-) {
-    use std::env;
-    if let Ok(debug_var) = env::var("EXPR_DEBUG_SYA_STEP") {
-        if debug_var == "1" {
-            println!("EXPR_DEBUG_SYA_STEP");
-            println!("\t{token_idx} => {token:?}");
-            println!("\t\tout: {out_stack:?}");
-            println!("\t\top : {op_stack:?}");
-            println!("\t\tresult: {result:?}");
-        }
-    }
-}
-
-fn push_op_to_stack(
-    token_idx: usize,
-    token: &Token,
-    out_stack: &mut TokenStack,
-    op_stack: &mut TokenStack,
-) -> Result<(), String> {
-    if let Token::InfixOp {
-        precedence: prec,
-        left_assoc: la,
-        ..
-    } = *token
-    {
-        loop {
-            match op_stack.last() {
-                None | Some(&(_, Token::ParOpen)) => {
-                    op_stack.push((token_idx, token.clone()));
-                    return Ok(());
-                }
-
-                Some(&(
-                    _,
-                    Token::InfixOp {
-                        precedence: prev_prec,
-                        ..
-                    },
-                )) => {
-                    if la && prev_prec >= prec || !la && prev_prec > prec {
-                        out_stack.push(op_stack.pop().unwrap());
-                    } else {
-                        op_stack.push((token_idx, token.clone()));
-                        return Ok(());
-                    }
-                }
-
-                Some(&(_, Token::PrefixOp { .. })) => {
-                    op_stack.push((token_idx, token.clone()));
-                    return Ok(());
-                }
-
-                Some(_) => panic!("Non-operator on op_stack"),
-            }
-        }
-    } else {
-        panic!("Expected infix-op")
-    }
-}
-
-fn move_till_match_paren(
-    out_stack: &mut TokenStack,
-    op_stack: &mut TokenStack,
-) -> Result<(), String> {
-    loop {
-        let op = op_stack
-            .pop()
-            .ok_or_else(|| "syntax error (Mismatched close-parenthesis)".to_string())?;
-        match op {
-            (_, Token::ParOpen) => return Ok(()),
-            other => out_stack.push(other),
-        }
-    }
-}
-
-fn infix_operator_two_ints<F>(f: F, values: &[String]) -> Result<String, String>
-where
-    F: Fn(BigInt, BigInt) -> Result<BigInt, String>,
-{
-    assert!(values.len() == 2);
-    if let Ok(left) = values[0].parse::<BigInt>() {
-        if let Ok(right) = values[1].parse::<BigInt>() {
-            return f(left, right).map(|big_int| big_int.to_string());
-        }
-    }
-    Err("Expected an integer operand".to_string())
-}
-
-fn infix_operator_two_ints_or_two_strings<FI, FS>(
-    fi: FI,
-    fs: FS,
-    values: &[String],
-) -> Result<String, String>
-where
-    FI: Fn(BigInt, BigInt) -> Result<u8, String>,
-    FS: Fn(&String, &String) -> Result<String, String>,
-{
-    assert!(values.len() == 2);
-    if let (Some(a_int), Some(b_int)) = (
-        values[0].parse::<BigInt>().ok(),
-        values[1].parse::<BigInt>().ok(),
-    ) {
-        match fi(a_int, b_int) {
-            Ok(result) => Ok(result.to_string()),
-            Err(reason) => Err(reason),
-        }
-    } else {
-        fs(&values[0], &values[1])
-    }
-}
-
-fn infix_operator_or(values: &[String]) -> String {
-    assert!(values.len() == 2);
-    if value_as_bool(&values[0]) {
-        values[0].clone()
-    } else {
-        values[1].clone()
-    }
-}
-
-fn infix_operator_and(values: &[String]) -> String {
-    if value_as_bool(&values[0]) && value_as_bool(&values[1]) {
-        values[0].clone()
-    } else {
-        0.to_string()
-    }
-}
-
-fn operator_match(values: &[String]) -> Result<String, String> {
-    assert!(values.len() == 2);
-    let re = Regex::with_options(&values[1], RegexOptions::REGEX_OPTION_NONE, Syntax::grep())
-        .map_err(|err| err.description().to_string())?;
-    Ok(if re.captures_len() > 0 {
-        re.captures(&values[0])
-            .map(|captures| captures.at(1).unwrap())
-            .unwrap_or("")
-            .to_string()
-    } else {
-        re.find(&values[0])
-            .map_or("0".to_string(), |(start, end)| (end - start).to_string())
-    })
-}
-
-fn prefix_operator_length(values: &[String]) -> String {
-    assert!(values.len() == 1);
-    // Use chars().count() as we can have some multibytes chars
-    // See https://github.com/uutils/coreutils/issues/3132
-    values[0].chars().count().to_string()
-}
-
-fn prefix_operator_index(values: &[String]) -> String {
-    assert!(values.len() == 2);
-    let haystack = &values[0];
-    let needles = &values[1];
-
-    for (current_idx, ch_h) in haystack.chars().enumerate() {
-        for ch_n in needles.chars() {
-            if ch_n == ch_h {
-                return (current_idx + 1).to_string();
-            }
-        }
-    }
-    "0".to_string()
-}
-
-fn prefix_operator_substr(values: &[String]) -> String {
-    assert!(values.len() == 3);
-    let subj = &values[0];
-    let idx = match values[1]
-        .parse::<usize>()
-        .ok()
-        .and_then(|v| v.checked_sub(1))
-    {
-        Some(i) => i,
-        None => return String::new(),
-    };
-    let len = match values[2].parse::<usize>() {
-        Ok(i) => i,
-        Err(_) => return String::new(),
-    };
-
-    subj.chars().skip(idx).take(len).collect()
-}
-
-fn bool_as_int(b: bool) -> u8 {
-    u8::from(b)
-}
-fn bool_as_string(b: bool) -> String {
-    if b {
-        "1".to_string()
-    } else {
-        "0".to_string()
-    }
-}
-fn value_as_bool(s: &str) -> bool {
-    if s.is_empty() {
-        return false;
-    }
-    match s.parse::<BigInt>() {
-        Ok(n) => n.is_one(),
-        Err(_) => true,
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_expr/tokens.rs.html b/coreutils/dev/src/uu_expr/tokens.rs.html deleted file mode 100644 index efda3fb50..000000000 --- a/coreutils/dev/src/uu_expr/tokens.rs.html +++ /dev/null @@ -1,301 +0,0 @@ -tokens.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-
//* This file is part of the uutils coreutils package.
-//*
-//* (c) Roman Gafiyatullin <r.gafiyatullin@me.com>
-//*
-//* For the full copyright and license information, please view the LICENSE
-//* file that was distributed with this source code.
-
-//!
-//! The following tokens are present in the expr grammar:
-//! * integer literal;
-//! * string literal;
-//! * infix binary operators;
-//! * prefix operators.
-//!
-//! According to the man-page of expr we have expression split into tokens (each token -- separate CLI-argument).
-//! Hence all we need is to map the strings into the Token structures, except for some ugly fiddling with +-escaping.
-//!
-
-// spell-checker:ignore (ToDO) paren
-
-use num_bigint::BigInt;
-
-#[derive(Debug, Clone)]
-pub enum Token {
-    Value {
-        value: String,
-    },
-
-    ParOpen,
-    ParClose,
-
-    InfixOp {
-        precedence: u8,
-        left_assoc: bool,
-        value: String,
-    },
-
-    PrefixOp {
-        arity: usize,
-        value: String,
-    },
-}
-impl Token {
-    fn new_infix_op(v: &str, left_assoc: bool, precedence: u8) -> Self {
-        Self::InfixOp {
-            left_assoc,
-            precedence,
-            value: v.into(),
-        }
-    }
-    fn new_value(v: &str) -> Self {
-        Self::Value { value: v.into() }
-    }
-
-    fn is_infix_plus(&self) -> bool {
-        match self {
-            Self::InfixOp { value, .. } => value == "+",
-            _ => false,
-        }
-    }
-    fn is_a_number(&self) -> bool {
-        match self {
-            Self::Value { value, .. } => value.parse::<BigInt>().is_ok(),
-            _ => false,
-        }
-    }
-    fn is_a_close_paren(&self) -> bool {
-        matches!(*self, Self::ParClose)
-    }
-}
-
-pub fn strings_to_tokens(strings: &[&str]) -> Result<Vec<(usize, Token)>, String> {
-    let mut tokens_acc = Vec::with_capacity(strings.len());
-    let mut tok_idx = 1;
-
-    for s in strings {
-        let token_if_not_escaped = match *s {
-            "(" => Token::ParOpen,
-            ")" => Token::ParClose,
-
-            "^" => Token::new_infix_op(s, false, 7),
-
-            ":" => Token::new_infix_op(s, true, 6),
-
-            "*" | "/" | "%" => Token::new_infix_op(s, true, 5),
-
-            "+" | "-" => Token::new_infix_op(s, true, 4),
-
-            "=" | "!=" | "<" | ">" | "<=" | ">=" => Token::new_infix_op(s, true, 3),
-
-            "&" => Token::new_infix_op(s, true, 2),
-
-            "|" => Token::new_infix_op(s, true, 1),
-
-            "match" | "index" => Token::PrefixOp {
-                arity: 2,
-                value: s.to_string(),
-            },
-            "substr" => Token::PrefixOp {
-                arity: 3,
-                value: s.to_string(),
-            },
-            "length" => Token::PrefixOp {
-                arity: 1,
-                value: s.to_string(),
-            },
-
-            _ => Token::new_value(s),
-        };
-        push_token_if_not_escaped(&mut tokens_acc, tok_idx, token_if_not_escaped, s);
-        tok_idx += 1;
-    }
-    maybe_dump_tokens_acc(&tokens_acc);
-
-    Ok(tokens_acc)
-}
-
-fn maybe_dump_tokens_acc(tokens_acc: &[(usize, Token)]) {
-    use std::env;
-
-    if let Ok(debug_var) = env::var("EXPR_DEBUG_TOKENS") {
-        if debug_var == "1" {
-            println!("EXPR_DEBUG_TOKENS");
-            for token in tokens_acc {
-                println!("\t{token:?}");
-            }
-        }
-    }
-}
-
-fn push_token_if_not_escaped(acc: &mut Vec<(usize, Token)>, tok_idx: usize, token: Token, s: &str) {
-    // Smells heuristics... :(
-    let prev_is_plus = match acc.last() {
-        None => false,
-        Some(t) => t.1.is_infix_plus(),
-    };
-    let should_use_as_escaped = if prev_is_plus && acc.len() >= 2 {
-        let pre_prev = &acc[acc.len() - 2];
-        !(pre_prev.1.is_a_number() || pre_prev.1.is_a_close_paren())
-    } else {
-        prev_is_plus
-    };
-
-    if should_use_as_escaped {
-        acc.pop();
-        acc.push((tok_idx, Token::new_value(s)));
-    } else {
-        acc.push((tok_idx, token));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/cli.rs.html b/coreutils/dev/src/uu_factor/cli.rs.html deleted file mode 100644 index 7ed92f93b..000000000 --- a/coreutils/dev/src/uu_factor/cli.rs.html +++ /dev/null @@ -1,243 +0,0 @@ -cli.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2014 T. Jameson Little <t.jameson.little@gmail.com>
-// * (c) 2020 nicoo <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-use std::error::Error;
-use std::fmt::Write as FmtWrite;
-use std::io::BufRead;
-use std::io::{self, stdin, stdout, Write};
-
-mod factor;
-use clap::{crate_version, Arg, ArgAction, Command};
-pub use factor::*;
-use uucore::display::Quotable;
-use uucore::error::UResult;
-use uucore::{format_usage, help_about, help_usage, show_error, show_warning};
-
-mod miller_rabin;
-pub mod numeric;
-mod rho;
-pub mod table;
-
-const ABOUT: &str = help_about!("factor.md");
-const USAGE: &str = help_usage!("factor.md");
-
-mod options {
-    pub static EXPONENTS: &str = "exponents";
-    pub static HELP: &str = "help";
-    pub static NUMBER: &str = "NUMBER";
-}
-
-fn print_factors_str(
-    num_str: &str,
-    w: &mut io::BufWriter<impl io::Write>,
-    factors_buffer: &mut String,
-    print_exponents: bool,
-) -> Result<(), Box<dyn Error>> {
-    num_str
-        .trim()
-        .parse::<u64>()
-        .map_err(|e| e.into())
-        .and_then(|x| {
-            factors_buffer.clear();
-            // If print_exponents is true, use the alternate format specifier {:#} from fmt to print the factors
-            // of x in the form of p^e.
-            if print_exponents {
-                writeln!(factors_buffer, "{}:{:#}", x, factor(x))?;
-            } else {
-                writeln!(factors_buffer, "{}:{}", x, factor(x))?;
-            }
-            w.write_all(factors_buffer.as_bytes())?;
-            w.flush()?;
-            Ok(())
-        })
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    // If matches find --exponents flag than variable print_exponents is true and p^e output format will be used.
-    let print_exponents = matches.get_flag(options::EXPONENTS);
-
-    let stdout = stdout();
-    // We use a smaller buffer here to pass a gnu test. 4KiB appears to be the default pipe size for bash.
-    let mut w = io::BufWriter::with_capacity(4 * 1024, stdout.lock());
-    let mut factors_buffer = String::new();
-
-    if let Some(values) = matches.get_many::<String>(options::NUMBER) {
-        for number in values {
-            if let Err(e) = print_factors_str(number, &mut w, &mut factors_buffer, print_exponents)
-            {
-                show_warning!("{}: {}", number.maybe_quote(), e);
-            }
-        }
-    } else {
-        let stdin = stdin();
-        let lines = stdin.lock().lines();
-        for line in lines {
-            for number in line.unwrap().split_whitespace() {
-                if let Err(e) =
-                    print_factors_str(number, &mut w, &mut factors_buffer, print_exponents)
-                {
-                    show_warning!("{}: {}", number.maybe_quote(), e);
-                }
-            }
-        }
-    }
-
-    if let Err(e) = w.flush() {
-        show_error!("{}", e);
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(Arg::new(options::NUMBER).action(ArgAction::Append))
-        .arg(
-            Arg::new(options::EXPONENTS)
-                .short('h')
-                .long(options::EXPONENTS)
-                .help("Print factors in the form p^e")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/factor.rs.html b/coreutils/dev/src/uu_factor/factor.rs.html deleted file mode 100644 index 240b7c7e3..000000000 --- a/coreutils/dev/src/uu_factor/factor.rs.html +++ /dev/null @@ -1,609 +0,0 @@ -factor.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2020 nicoo <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-use smallvec::SmallVec;
-use std::cell::RefCell;
-use std::fmt;
-
-use crate::numeric::{Arithmetic, Montgomery};
-use crate::{miller_rabin, rho, table};
-
-type Exponent = u8;
-
-#[derive(Clone, Debug, Default)]
-struct Decomposition(SmallVec<[(u64, Exponent); NUM_FACTORS_INLINE]>);
-
-// spell-checker:ignore (names) Erdős–Kac * Erdős Kac
-// The number of factors to inline directly into a `Decomposition` object.
-// As a consequence of the Erdős–Kac theorem, the average number of prime factors
-// of integers < 10²⁵ ≃ 2⁸³ is 4, so we can use a slightly higher value.
-const NUM_FACTORS_INLINE: usize = 5;
-
-impl Decomposition {
-    fn one() -> Self {
-        Self::default()
-    }
-
-    fn add(&mut self, factor: u64, exp: Exponent) {
-        debug_assert!(exp > 0);
-
-        if let Some((_, e)) = self.0.iter_mut().find(|(f, _)| *f == factor) {
-            *e += exp;
-        } else {
-            self.0.push((factor, exp));
-        }
-    }
-
-    #[cfg(test)]
-    fn product(&self) -> u64 {
-        self.0
-            .iter()
-            .fold(1, |acc, (p, exp)| acc * p.pow(*exp as u32))
-    }
-
-    fn get(&self, p: u64) -> Option<&(u64, u8)> {
-        self.0.iter().find(|(q, _)| *q == p)
-    }
-}
-
-impl PartialEq for Decomposition {
-    fn eq(&self, other: &Self) -> bool {
-        for p in &self.0 {
-            if other.get(p.0) != Some(p) {
-                return false;
-            }
-        }
-
-        for p in &other.0 {
-            if self.get(p.0) != Some(p) {
-                return false;
-            }
-        }
-
-        true
-    }
-}
-impl Eq for Decomposition {}
-
-#[derive(Clone, Debug, Eq, PartialEq)]
-pub struct Factors(RefCell<Decomposition>);
-
-impl Factors {
-    pub fn one() -> Self {
-        Self(RefCell::new(Decomposition::one()))
-    }
-
-    pub fn add(&mut self, prime: u64, exp: Exponent) {
-        debug_assert!(miller_rabin::is_prime(prime));
-        self.0.borrow_mut().add(prime, exp);
-    }
-
-    pub fn push(&mut self, prime: u64) {
-        self.add(prime, 1);
-    }
-
-    #[cfg(test)]
-    fn product(&self) -> u64 {
-        self.0.borrow().product()
-    }
-}
-
-impl fmt::Display for Factors {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        let v = &mut (self.0).borrow_mut().0;
-        v.sort_unstable();
-
-        let include_exponents = f.alternate();
-        for (p, exp) in v.iter() {
-            if include_exponents && *exp > 1 {
-                write!(f, " {p}^{exp}")?;
-            } else {
-                for _ in 0..*exp {
-                    write!(f, " {p}")?;
-                }
-            }
-        }
-
-        Ok(())
-    }
-}
-
-fn _factor<A: Arithmetic + miller_rabin::Basis>(num: u64, f: Factors) -> Factors {
-    use miller_rabin::Result::*;
-
-    // Shadow the name, so the recursion automatically goes from “Big” arithmetic to small.
-    let _factor = |n, f| {
-        if n < (1 << 32) {
-            _factor::<Montgomery<u32>>(n, f)
-        } else {
-            _factor::<A>(n, f)
-        }
-    };
-
-    if num == 1 {
-        return f;
-    }
-
-    let n = A::new(num);
-    let divisor = match miller_rabin::test::<A>(n) {
-        Prime => {
-            #[cfg(feature = "coz")]
-            coz::progress!("factor found");
-            let mut r = f;
-            r.push(num);
-            return r;
-        }
-
-        Composite(d) => d,
-        Pseudoprime => rho::find_divisor::<A>(n),
-    };
-
-    let f = _factor(divisor, f);
-    _factor(num / divisor, f)
-}
-
-pub fn factor(mut n: u64) -> Factors {
-    #[cfg(feature = "coz")]
-    coz::begin!("factorization");
-    let mut factors = Factors::one();
-
-    if n < 2 {
-        return factors;
-    }
-
-    let n_zeros = n.trailing_zeros();
-    if n_zeros > 0 {
-        factors.add(2, n_zeros as Exponent);
-        n >>= n_zeros;
-    }
-
-    if n == 1 {
-        #[cfg(feature = "coz")]
-        coz::end!("factorization");
-        return factors;
-    }
-
-    table::factor(&mut n, &mut factors);
-
-    #[allow(clippy::let_and_return)]
-    let r = if n < (1 << 32) {
-        _factor::<Montgomery<u32>>(n, factors)
-    } else {
-        _factor::<Montgomery<u64>>(n, factors)
-    };
-
-    #[cfg(feature = "coz")]
-    coz::end!("factorization");
-
-    r
-}
-
-#[cfg(test)]
-mod tests {
-    use super::{factor, Decomposition, Exponent, Factors};
-    use quickcheck::quickcheck;
-    use smallvec::smallvec;
-    use std::cell::RefCell;
-
-    #[test]
-    fn factor_2044854919485649() {
-        let f = Factors(RefCell::new(Decomposition(smallvec![
-            (503, 1),
-            (2423, 1),
-            (40961, 2)
-        ])));
-        assert_eq!(factor(f.product()), f);
-    }
-
-    #[test]
-    fn factor_recombines_small() {
-        assert!((1..10_000)
-            .map(|i| 2 * i + 1)
-            .all(|i| factor(i).product() == i));
-    }
-
-    #[test]
-    fn factor_recombines_overflowing() {
-        assert!((0..250)
-            .map(|i| 2 * i + 2u64.pow(32) + 1)
-            .all(|i| factor(i).product() == i));
-    }
-
-    #[test]
-    fn factor_recombines_strong_pseudoprime() {
-        // This is a strong pseudoprime (wrt. miller_rabin::BASIS)
-        //  and triggered a bug in rho::factor's code path handling
-        //  miller_rabbin::Result::Composite
-        let pseudoprime = 17179869183;
-        for _ in 0..20 {
-            // Repeat the test 20 times, as it only fails some fraction
-            // of the time.
-            assert!(factor(pseudoprime).product() == pseudoprime);
-        }
-    }
-
-    quickcheck! {
-        fn factor_recombines(i: u64) -> bool {
-            i == 0 || factor(i).product() == i
-        }
-
-        fn recombines_factors(f: Factors) -> () {
-            assert_eq!(factor(f.product()), f);
-        }
-
-        fn exponentiate_factors(f: Factors, e: Exponent) -> () {
-            if e == 0 { return; }
-            if let Some(fe) = f.product().checked_pow(e.into()) {
-                assert_eq!(factor(fe), f ^ e);
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-use rand::{
-    distributions::{Distribution, Standard},
-    Rng,
-};
-#[cfg(test)]
-impl Distribution<Factors> for Standard {
-    fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Factors {
-        let mut f = Factors::one();
-        let mut g = 1u64;
-        let mut n = u64::MAX;
-
-        // spell-checker:ignore (names) Adam Kalai * Kalai's
-        // Adam Kalai's algorithm for generating uniformly-distributed
-        // integers and their factorization.
-        //
-        // See Generating Random Factored Numbers, Easily, J. Cryptology (2003)
-        'attempt: loop {
-            while n > 1 {
-                n = rng.gen_range(1..n);
-                if miller_rabin::is_prime(n) {
-                    if let Some(h) = g.checked_mul(n) {
-                        f.push(n);
-                        g = h;
-                    } else {
-                        // We are overflowing u64, retry
-                        continue 'attempt;
-                    }
-                }
-            }
-
-            return f;
-        }
-    }
-}
-
-#[cfg(test)]
-impl quickcheck::Arbitrary for Factors {
-    fn arbitrary(g: &mut quickcheck::Gen) -> Self {
-        factor(u64::arbitrary(g))
-    }
-}
-
-#[cfg(test)]
-impl std::ops::BitXor<Exponent> for Factors {
-    type Output = Self;
-
-    fn bitxor(self, rhs: Exponent) -> Self {
-        debug_assert_ne!(rhs, 0);
-        let mut r = Self::one();
-        for (p, e) in self.0.borrow().0.iter() {
-            r.add(*p, rhs * e);
-        }
-
-        debug_assert_eq!(r.product(), self.product().pow(rhs.into()));
-        r
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/home/runner/work/uutils.github.io/uutils.github.io/coreutils/target/debug/build/uu_factor-f553f2c5abdad045/out/prime_table.rs.html b/coreutils/dev/src/uu_factor/home/runner/work/uutils.github.io/uutils.github.io/coreutils/target/debug/build/uu_factor-f553f2c5abdad045/out/prime_table.rs.html deleted file mode 100644 index 2b1df09ad..000000000 --- a/coreutils/dev/src/uu_factor/home/runner/work/uutils.github.io/uutils.github.io/coreutils/target/debug/build/uu_factor-f553f2c5abdad045/out/prime_table.rs.html +++ /dev/null @@ -1,359 +0,0 @@ -prime_table.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-
/*
-* This file is part of the uutils coreutils package.
-*
-* (c) kwantam <kwantam@gmail.com>
-*
-* For the full copyright and license information, please view the LICENSE file
-* that was distributed with this source code.
-*/
-
-// *** NOTE: this file was automatically generated.
-// Please do not edit by hand. Instead, modify and
-// re-run src/factor/gen_tables.rs.
-
-#[allow(clippy::unreadable_literal)]
-pub const PRIME_INVERSIONS_U64: &[(u64, u64, u64)] = &[
-    (3, 12297829382473034411, 6148914691236517205), (5, 14757395258967641293, 3689348814741910323),
-    (7, 7905747460161236407, 2635249153387078802), (11, 3353953467947191203, 1676976733973595601),
-    (13, 5675921253449092805, 1418980313362273201), (17, 17361641481138401521, 1085102592571150095),
-    (19, 9708812670373448219, 970881267037344821), (23, 15238614669586151335, 802032351030850070),
-    (29, 3816567739388183093, 636094623231363848), (31, 17256631552825064415, 595056260442243600),
-    (37, 1495681951922396077, 498560650640798692), (41, 10348173504763894809, 449920587163647600),
-    (43, 9437869060967677571, 428994048225803525), (47, 5887258746928580303, 392483916461905353),
-    (53, 2436362424829563421, 348051774975651917), (59, 14694863923124558067, 312656679215416129),
-    (61, 5745707170499696405, 302405640552615600), (67, 17345445920055250027, 275324538413575397),
-    (71, 1818693077689674103, 259813296812810586), (73, 9097024474706080249, 252695124297391118),
-    (79, 11208148297950107311, 233503089540627235), (83, 11779246215742243803, 222249928598910260),
-    (89, 17617676924329347049, 207266787345051141), (97, 11790702397628785569, 190172619316593315),
-    (101, 4200743699953660269, 182641030432767837), (103, 15760325033848937303, 179094602657374287),
-    (107, 8619973866219416643, 172399477324388332), (109, 12015769075535579493, 169236184162472950),
-    (113, 10447713457676206225, 163245522776190722), (127, 9150747060186627967, 145249953336295682),
-    (131, 281629680514649643, 140814840257324821), (137, 16292379802327414201, 134647766961383588),
-    (139, 4246732448623781667, 132710389019493177), (149, 16094474695182830269, 123803651501406386),
-    (151, 8062815290495565607, 122163868037811600), (157, 6579730370240349621, 117495185182863386),
-    (163, 2263404180823257867, 113170209041162893), (167, 10162278172342986519, 110459545351554201),
-    (173, 9809829218388894501, 106628578460748853), (179, 17107036403551874683, 103054436165975148),
-    (181, 3770881385233444253, 101915713114417412), (191, 2124755861893246783, 96579811904238490),
-    (193, 8124213711219232577, 95578984837873324), (197, 14513935692512591373, 93638294790403815),
-    (199, 2780916192016515319, 92697206400550510), (211, 13900627050804827995, 87425327363552377),
-    (223, 7527595115280579359, 82720825442643729), (227, 1950316554048586955, 81263189752024456),
-    (229, 2094390156840385773, 80553467570784068), (233, 7204522363551799129, 79170575423646144),
-    (239, 7255204782128442895, 77183029597111094), (241, 17298606475760824337, 76542506529915151),
-    (251, 2939720171109091891, 73493004277727297), (257, 18374966859414961921, 71777214294589695),
-    (263, 15430736487513693367, 70139711306880424), (269, 10354863773718001093, 68575256779589411),
-    (271, 15383631589145234927, 68069166323651481), (277, 17181443938689762877, 66594743948409933),
-    (281, 14245350405676059433, 65646776063023315), (283, 5149444458738708755, 65182841249857072),
-    (293, 2707201348701401773, 62958170900032599), (307, 17305088903023944187, 60087114246610917),
-    (311, 9134400602415662215, 59314289626075728), (313, 6365010734698503433, 58935284580541698),
-    (317, 17050145153302519317, 58191621683626345), (331, 3455281367280943203, 55730344633563600),
-    (337, 9196002980365592497, 54738112978366622), (347, 9941040754419844819, 53160645745560667),
-    (349, 15751088062938241781, 52856000211202153), (353, 8779186981255537313, 52257065364616293),
-    (359, 5600822016808749655, 51383688227603207), (367, 9751139919072624015, 50263607830271257),
-    (373, 3511310534137743069, 49455077945602015), (379, 17181268226964305331, 48672147951740241),
-    (383, 14834457375202459263, 48163822646761231), (389, 12661389891209383757, 47420935922132523),
-    (397, 185861401246443845, 46465350311610961), (401, 3220129888178724721, 46001855545410353),
-    (409, 2074694932495450793, 45102063749901104), (419, 1849076971589024267, 44025642180691053),
-    (421, 14897608040525528621, 43816494236839790), (431, 8046375605237577039, 42799870240625409),
-    (433, 7540585914657253201, 42602180308798040), (439, 15379290047785184263, 42019918163347497),
-    (443, 15615189678648040307, 41640505809728107), (449, 205420312624827969, 41084062524965593),
-    (457, 686202733595322489, 40364866682077793), (461, 3041111821262312197, 40014629227135686),
-    (463, 8127723090792113455, 39841779856824085), (467, 15247201739725667931, 39500522641776341),
-    (479, 8010277176057592351, 38510947961815347), (487, 2386334448960373207, 37878324586672590),
-    (491, 1051952818867347139, 37569743530976683), (499, 12494988971771199291, 36967422993405915),
-    (503, 17969989256695189447, 36673447462643243), (509, 5436172123882971989, 36241147492553146),
-    (521, 1805727346946616377, 35406418567580713), (523, 7195288319381928355, 35271021173440825),
-    (541, 13911777416032342069, 34097493666745936), (547, 13219604528142859659, 33723480939139948),
-    (557, 5133295029488295333, 33118032448311582), (563, 18151858289227516155, 32765087164670606),
-    (569, 6386658317259721737, 32419585366800617), (571, 1873749835858413299, 32306031652731263),
-    (577, 8184343991108570561, 31970093715267853), (587, 8107768264083584867, 31425458387920871),
-    (593, 13407330009728190129, 31107494222107169), (599, 16999336775772408167, 30795899956109435),
-    (601, 10926856722530117097, 30693417759916059), (607, 7810235958720518559, 30390023185682951),
-    (613, 10111102787547160429, 30092567820080834), (617, 5112468778937331161, 29897478239399597),
-    (619, 10400506755613301315, 29800878955912038), (631, 14909412801254946631, 29234142747558718),
-    (641, 18417966001831689601, 28778071877862015), (643, 12450835035754191915, 28688559990217032),
-    (647, 16650538700226241335, 28511196404496988), (653, 18023005695293558853, 28249225227732850),
-    (659, 13744083976011213723, 27992024391061535), (661, 3544230707051608253, 27907328401981167),
-    (673, 7016889276180750689, 27409723735081057), (677, 7711120491668837677, 27247775588935822),
-    (683, 18338710433453565955, 27008410063996415), (691, 16604739238563445883, 26695722248494285),
-    (701, 4578792394900801685, 26314898821268975), (709, 17796294705807240205, 26017974716092456),
-    (719, 7799457855921701935, 25656111368163493), (727, 3501582781529460967, 25373788271952615),
-    (733, 8027982755134170485, 25166090141486427), (739, 12755461734324196043, 24961764646426998),
-    (743, 8416482154761154775, 24827380987496031), (751, 73688724661955599, 24562908220651866),
-    (757, 11233750354002778461, 24368222026036395), (761, 8193166224591101769, 24240136759145271),
-    (769, 8635666926574042369, 23987963684927895), (773, 11955781087876436429, 23863834506739394),
-    (787, 1757948926973591323, 23439319026314550), (797, 3332912354597459765, 23145224684704581),
-    (809, 12062209660064712985, 22801908620160137), (811, 2229076349227541379, 22745677032934095),
-    (821, 4044353146489304861, 22468628591607249), (823, 5536264624794968711, 22414026821032261),
-    (827, 9502192231439261171, 22305615566758829), (829, 9813044796750195733, 22251802260204525),
-    (839, 17941052639030982263, 21986584116459537), (853, 13018686907823153661, 21625725760503577),
-    (857, 12247604875076703465, 21524788884141833), (859, 858986918449804499, 21474672961245112),
-    (863, 13637338028999645343, 21375137976488472), (877, 4964004106494246501, 21033915705484095),
-    (881, 14447506709261737361, 20938415520669184), (883, 17047047751015848379, 20890989890950794),
-    (887, 15763959422628906567, 20796780240935232), (907, 11979197639928253475, 20338196332645591),
-    (911, 16462352285319281519, 20248895799900715), (919, 16098246732442938407, 20072626848432591),
-    (929, 13264181960428396641, 19856559821000593), (937, 11792529028977610905, 19687026759561954),
-    (941, 1725094026021722149, 19603341204792297), (947, 18271431828024877947, 19479138409408185),
-    (953, 18137040080866579081, 19356499552685783), (967, 9614435380713147895, 19076260676018150),
-    (971, 10828675717831559651, 18997676697950104), (977, 12064963626510136625, 18881007240234955),
-    (983, 9326583728009813991, 18765762028188760), (991, 13160290676198438943, 18614272526447579),
-    (997, 11785933776281829869, 18502250826188115), (1009, 6965519813759503633, 18282204235589248),
-    (1013, 7775675932353384541, 18210013893099261), (1019, 10372899268140896051, 18102791043875909),
-    (1021, 7497942008412795221, 18067330140753723), (1031, 13544311604071901623, 17892089305246897),
-    (1033, 15464550210873641529, 17857448280454551), (1039, 1881958490676816623, 17754325383743553),
-    (1049, 8370495880920635433, 17585075380085368), (1051, 15691141010367591955, 17551611868420125),
-    (1061, 10466484384894580653, 17386186685871396), (1063, 5917535022704569239, 17353475139896097),
-    (1069, 13511506650808773541, 17256074905247475), (1087, 4836542834413267903, 16970325734783396),
-    (1091, 12613447368457676907, 16908106392034419), (1093, 12235946434985750157, 16877167496532069),
-    (1097, 14007418243755748857, 16815628143764404), (1103, 13546566364192871087, 16724156005176384),
-    (1109, 14687533829653321981, 16633673646266502), (1117, 17043007953507839989, 16514542590608372),
-    (1123, 10923494932339137867, 16426308168931034), (1129, 8610659102608444377, 16339011579902171),
-    (1151, 2852754513571068799, 16026710750399262), (1153, 16894849732729650049, 15998910731751562),
-    (1163, 14877941479913636643, 15861344861315177), (1171, 10554499171123313051, 15752983837497482),
-    (1181, 9918444103984390581, 15619597014148646), (1187, 6884505159775342347, 15540643701524474),
-    (1193, 17503532515875282841, 15462484554660143), (1201, 10275496907003905105, 15359487155461741),
-    (1213, 12439766407497455253, 15207538395473661), (1217, 6745111842892974913, 15157554703130280),
-    (1223, 5399782811437464823, 15083192210719175), (1229, 11572367518982965253, 15009555796346258),
-    (1231, 1168843247562424879, 14985169840543908), (1237, 12988774525627339901, 14912485104049758),
-    (1249, 2171073962238033697, 14769210627469616), (1259, 2754557494723904451, 14651901567680342),
-    (1277, 8710561218830743637, 14445375155606540), (1279, 10802667170608642815, 14422786609624356),
-    (1283, 17756608675784330667, 14377820790108769), (1289, 715544766241642809, 14310895324832856),
-    (1291, 10173572254439349923, 14288725076459761), (1297, 9401154844041645041, 14222624574949538),
-    (1301, 4069343235322552893, 14178896290322483), (1303, 17455744775812645543, 14157132827098658),
-    (1307, 11545093077501463827, 14113805718216948), (1319, 7286393982109686423, 13985401117293064),
-    (1321, 10375420777264342809, 13964227156479600), (1327, 17848997280062595535, 13901088224347815),
-    (1361, 8864195903163884465, 13553816365694012), (1367, 11915490136858474087, 13494326315808011),
-    (1373, 7241656996161287925, 13435356208091443), (1381, 10365440551193781357, 13357526483497140),
-    (1399, 11511084757933122631, 13185664098434275), (1409, 11062809611273648769, 13092082380205501),
-    (1423, 11991031811792927087, 12963277634370731), (1427, 10910337770294927515, 12926940486131430),
-    (1429, 4001742941112638909, 12908848197137544), (1433, 6539390083352723113, 12872815124710084),
-    (1439, 3589359513994909279, 12819141121410390), (1447, 15973580044476895767, 12748268191920906),
-    (1451, 6496406768894266627, 12713124792356686), (1453, 16301183338364118565, 12695625652931556),
-    (1459, 12921571242858918267, 12643416088903051), (1471, 15612641993044453951, 12540274693208396),
-    (1481, 7535638193514030201, 12455600319857901), (1483, 10846635760131307491, 12438802477214802),
-    (1487, 7517637463798243631, 12405342349502052), (1489, 9155234298503263025, 12388679700275051),
-    (1493, 17211195240909179773, 12355488328003718), (1499, 11419998999601376851, 12306033404742862),
-    (1511, 5310611298519956951, 12208301835678061), (1523, 3355054568888736571, 12112110356999048),
-    (1531, 13325995392242171187, 12048820426982071), (1543, 7651274275550300087, 11955116055547343),
-    (1549, 15826806245293734085, 11908808310980988), (1553, 14028077753413380849, 11878135269613362),
-    (1559, 9773579605442007463, 11832420829832938), (1567, 5579934072072959455, 11772012810280505),
-    (1571, 4004035473669609867, 11742039512227594), (1579, 17874299197451307139, 11682548495066213),
-    (1583, 11163601277709254863, 11653028473600474), (1597, 8663154699613126933, 11550872932817502),
-    (1601, 13918592655241185729, 11522013787451312), (1607, 1503748272343466871, 11478994445369976),
-    (1609, 4574425659049167865, 11464725962529242), (1613, 2904818967589724805, 11436295147991042),
-    (1619, 3999263230310100443, 11393912337065813), (1621, 9707015851248764669, 11379854456329149),
-    (1627, 10045368930120874451, 11337888182980670), (1637, 13127951646836669293, 11268628023035767),
-    (1657, 2237655738573095881, 11132615614791521), (1663, 5291098570751326591, 11092449833860223),
-    (1667, 12747839935760889899, 11065833277570216), (1669, 12312566146262696525, 11052572842246585),
-    (1693, 14633182097455361973, 10895891360726256), (1697, 3782832609104846177, 10870208646853006),
-    (1699, 15080946155610692875, 10857412639028576), (1709, 5137887758388383013, 10793881845353745),
-    (1721, 4062356771607158665, 10718619450150814), (1723, 2141235527998787187, 10706177639993935),
-    (1733, 18372233278258907149, 10644399350092066), (1741, 3401151549489239557, 10595487693112895),
-    (1747, 8806287668845887835, 10559097924275644), (1753, 5387754116223211881, 10522957258248460),
-    (1759, 4184338195230307615, 10487063145940620), (1777, 7816768873102584337, 10380835156842741),
-    (1783, 6114428349726497479, 10345902453005917), (1787, 17001559870956704819, 10322744305377477),
-    (1789, 18085851931406681685, 10311204065796283), (1801, 15916846357881534265, 10242500873797641),
-    (1811, 13751024019606788891, 10185943718227251), (1823, 16463440816196072671, 10118894170987137),
-    (1831, 11374316799136037015, 10074682727312698), (1847, 10307005892836089479, 9987408810887683),
-    (1861, 10526836220461872013, 9912275160510237), (1867, 12903828473628641891, 9880419964493600),
-    (1871, 5176130752911552431, 9859296672212480), (1873, 10567728986166763953, 9848768859428484),
-    (1877, 8451891264459357693, 9827780540069020), (1879, 13538084128603231335, 9817319890212640),
-    (1889, 13896091485912489121, 9765348900852065), (1901, 9383483176894863973, 9703705456975040),
-    (1907, 2843913349591299515, 9673174658473807), (1913, 12053544219622027977, 9642835375697622),
-    (1931, 10661090826649331747, 9552948769399042), (1933, 6680145293117788997, 9543064704453984),
-    (1949, 13790100623599187637, 9464722459573910), (1951, 7043989920509285471, 9455020027529242),
-    (1973, 17128451669050125981, 9349591522407274), (1979, 736378363730699635, 9321245110515185),
-    (1987, 11864589293508206827, 9283716192103448), (1993, 11727057070441546361, 9255767222132238),
-    (1997, 13994400236189269253, 9237227878672784), (1999, 2768395808960913199, 9227986029869710),
-    (2003, 16319336244939253851, 9209557700304319), (2011, 15043590393278798931, 9172920971511462),
-    (2017, 493864243916864545, 9145634146608602), (2027, 11384744369122175171, 9100515083231155),
-    (2029, 5309462069515218405, 9091544639580853), (2039, 9698337247188150727, 9046956387302379),
-    (2053, 11797649765601871053, 8985262578523892), (2063, 3818109413220542191, 8941708227682768),
-    (2069, 3798121302755084093, 8915777705997849), (2081, 15698790847928695777, 8864365244454373),
-    (2083, 13345772116697212811, 8855854092035310), (2087, 12993154666196952983, 8838880725304049),
-    (2089, 7205621428505023513, 8830418417285568), (2099, 9913257415504704251, 8788348772610553),
-    (2111, 6859637185154901951, 8738391318668664), (2113, 34920480972474305, 8730120243118576),
-    (2129, 5588609641870672049, 8664511072667708), (2131, 16317274790681607131, 8656379199300587),
-];
-
-#[allow(dead_code)]
-pub const NEXT_PRIME: u64 = 2137;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/miller_rabin.rs.html b/coreutils/dev/src/uu_factor/miller_rabin.rs.html deleted file mode 100644 index cb31c3d9f..000000000 --- a/coreutils/dev/src/uu_factor/miller_rabin.rs.html +++ /dev/null @@ -1,453 +0,0 @@ -miller_rabin.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2020 nicoo <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-// spell-checker:ignore (URL) appspot
-
-use crate::numeric::*;
-
-pub(crate) trait Basis {
-    const BASIS: &'static [u64];
-}
-
-impl Basis for Montgomery<u64> {
-    // Small set of bases for the Miller-Rabin prime test, valid for all 64b integers;
-    //  discovered by Jim Sinclair on 2011-04-20, see miller-rabin.appspot.com
-    #[allow(clippy::unreadable_literal)]
-    const BASIS: &'static [u64] = &[2, 325, 9375, 28178, 450775, 9780504, 1795265022];
-}
-
-impl Basis for Montgomery<u32> {
-    // spell-checker:ignore (names) Steve Worley
-    // Small set of bases for the Miller-Rabin prime test, valid for all 32b integers;
-    //  discovered by Steve Worley on 2013-05-27, see miller-rabin.appspot.com
-    #[allow(clippy::unreadable_literal)]
-    const BASIS: &'static [u64] = &[
-        4230279247111683200,
-        14694767155120705706,
-        16641139526367750375,
-    ];
-}
-
-#[derive(Eq, PartialEq)]
-#[must_use = "Ignoring the output of a primality test."]
-pub(crate) enum Result {
-    Prime,
-    Pseudoprime,
-    Composite(u64),
-}
-
-impl Result {
-    pub(crate) fn is_prime(&self) -> bool {
-        *self == Self::Prime
-    }
-}
-
-// Deterministic Miller-Rabin primality-checking algorithm, adapted to extract
-// (some) dividers; it will fail to factor strong pseudoprimes.
-#[allow(clippy::many_single_char_names)]
-pub(crate) fn test<A: Arithmetic + Basis>(m: A) -> Result {
-    use self::Result::*;
-
-    let n = m.modulus();
-    debug_assert!(n > 1);
-    debug_assert!(n % 2 != 0);
-
-    // n-1 = r 2ⁱ
-    let i = (n - 1).trailing_zeros();
-    let r = (n - 1) >> i;
-
-    let one = m.one();
-    let minus_one = m.minus_one();
-
-    'witness: for _a in A::BASIS.iter() {
-        let _a = _a % n;
-        if _a == 0 {
-            continue;
-        }
-
-        let a = m.to_mod(_a);
-
-        // x = a^r mod n
-        let mut x = m.pow(a, r);
-
-        if x == one || x == minus_one {
-            continue;
-        }
-
-        for _ in 1..i {
-            let y = m.mul(x, x);
-            if y == one {
-                return Composite(gcd(m.to_u64(x) - 1, m.modulus()));
-            } else if y == minus_one {
-                // This basis element is not a witness of `n` being composite.
-                // Keep looking.
-                continue 'witness;
-            }
-            x = y;
-        }
-
-        return Pseudoprime;
-    }
-
-    Prime
-}
-
-// Used by build.rs' tests and debug assertions
-#[allow(dead_code)]
-pub(crate) fn is_prime(n: u64) -> bool {
-    if n < 2 {
-        false
-    } else if n % 2 == 0 {
-        n == 2
-    } else {
-        test::<Montgomery<u64>>(Montgomery::new(n)).is_prime()
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use crate::numeric::{traits::DoubleInt, Arithmetic, Montgomery};
-    use quickcheck::quickcheck;
-    use std::iter;
-    const LARGEST_U64_PRIME: u64 = 0xFFFFFFFFFFFFFFC5;
-
-    fn primes() -> impl Iterator<Item = u64> {
-        iter::once(2).chain(odd_primes())
-    }
-
-    fn odd_primes() -> impl Iterator<Item = u64> {
-        use crate::table::{NEXT_PRIME, PRIME_INVERSIONS_U64};
-        PRIME_INVERSIONS_U64
-            .iter()
-            .map(|(p, _, _)| *p)
-            .chain(iter::once(NEXT_PRIME))
-    }
-
-    #[test]
-    fn largest_prime() {
-        assert!(is_prime(LARGEST_U64_PRIME));
-    }
-
-    #[test]
-    fn largest_composites() {
-        for i in LARGEST_U64_PRIME + 1..=u64::MAX {
-            assert!(!is_prime(i), "2⁶⁴ - {} reported prime", u64::MAX - i + 1);
-        }
-    }
-
-    #[test]
-    fn two() {
-        assert!(is_prime(2));
-    }
-
-    fn first_primes<A: DoubleInt>()
-    where
-        Montgomery<A>: Basis,
-    {
-        for p in odd_primes() {
-            assert!(
-                test(Montgomery::<A>::new(p)).is_prime(),
-                "{p} reported composite"
-            );
-        }
-    }
-
-    #[test]
-    fn first_primes_u32() {
-        first_primes::<u32>();
-    }
-
-    #[test]
-    fn first_primes_u64() {
-        first_primes::<u64>();
-    }
-
-    #[test]
-    fn one() {
-        assert!(!is_prime(1));
-    }
-    #[test]
-    fn zero() {
-        assert!(!is_prime(0));
-    }
-
-    #[test]
-    fn first_composites() {
-        for (p, q) in primes().zip(odd_primes()) {
-            for i in p + 1..q {
-                assert!(!is_prime(i), "{i} reported prime");
-            }
-        }
-    }
-
-    #[test]
-    fn issue_1556() {
-        // 10 425 511 = 2441 × 4271
-        assert!(!is_prime(10_425_511));
-    }
-
-    fn small_semiprimes<A: DoubleInt>()
-    where
-        Montgomery<A>: Basis,
-    {
-        for p in odd_primes() {
-            for q in odd_primes().take_while(|q| *q <= p) {
-                let n = p * q;
-                let m = Montgomery::<A>::new(n);
-                assert!(!test(m).is_prime(), "{n} = {p} × {q} reported prime");
-            }
-        }
-    }
-
-    #[test]
-    fn small_semiprimes_u32() {
-        small_semiprimes::<u32>();
-    }
-
-    #[test]
-    fn small_semiprimes_u64() {
-        small_semiprimes::<u64>();
-    }
-
-    quickcheck! {
-        fn composites(i: u64, j: u64) -> bool {
-            // TODO: #1559 factor n > 2^64 - 1
-            match i.checked_mul(j) {
-                Some(n) => i < 2 || j < 2 || !is_prime(n),
-                _ => true,
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/numeric/gcd.rs.html b/coreutils/dev/src/uu_factor/numeric/gcd.rs.html deleted file mode 100644 index 33428acb0..000000000 --- a/coreutils/dev/src/uu_factor/numeric/gcd.rs.html +++ /dev/null @@ -1,259 +0,0 @@ -gcd.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2015 Wiktor Kuropatwa <wiktor.kuropatwa@gmail.com>
-// * (c) 2020 nicoo            <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-// spell-checker:ignore (vars) kgcdab gcdac gcdbc
-
-use std::cmp::min;
-use std::mem::swap;
-
-pub fn gcd(mut u: u64, mut v: u64) -> u64 {
-    // Stein's binary GCD algorithm
-    // Base cases: gcd(n, 0) = gcd(0, n) = n
-    if u == 0 {
-        return v;
-    } else if v == 0 {
-        return u;
-    }
-
-    // gcd(2ⁱ u, 2ʲ v) = 2ᵏ gcd(u, v) with u, v odd and k = min(i, j)
-    // 2ᵏ is the greatest power of two that divides both u and v
-    let k = {
-        let i = u.trailing_zeros();
-        let j = v.trailing_zeros();
-        u >>= i;
-        v >>= j;
-        min(i, j)
-    };
-
-    loop {
-        // Loop invariant: u and v are odd
-        debug_assert!(u % 2 == 1, "u = {u} is even");
-        debug_assert!(v % 2 == 1, "v = {v} is even");
-
-        // gcd(u, v) = gcd(|u - v|, min(u, v))
-        if u > v {
-            swap(&mut u, &mut v);
-        }
-        v -= u;
-
-        if v == 0 {
-            // Reached the base case; gcd is 2ᵏ u
-            return u << k;
-        }
-
-        // gcd(u, 2ʲ v) = gcd(u, v) as u is odd
-        v >>= v.trailing_zeros();
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use quickcheck::{quickcheck, TestResult};
-
-    quickcheck! {
-        fn euclidean(a: u64, b: u64) -> bool {
-            // Test against the Euclidean algorithm
-            let g = {
-                let (mut a, mut b) = (a, b);
-                while b > 0 {
-                    a %= b;
-                    swap(&mut a, &mut b);
-                }
-                a
-            };
-            gcd(a, b) == g
-        }
-
-        fn one(a: u64) -> bool {
-            gcd(1, a) == 1
-        }
-
-        fn zero(a: u64) -> bool {
-            gcd(0, a) == a
-        }
-
-        fn divisor(a: u64, b: u64) -> TestResult {
-            // Test that gcd(a, b) divides a and b, unless a == b == 0
-            if a == 0 && b == 0 { return TestResult::discard(); } // restrict test domain to !(a == b == 0)
-
-            let g = gcd(a, b);
-            TestResult::from_bool( g != 0 && a % g == 0 && b % g == 0 )
-        }
-
-        fn commutative(a: u64, b: u64) -> bool {
-            gcd(a, b) == gcd(b, a)
-        }
-
-        fn associative(a: u64, b: u64, c: u64) -> bool {
-            gcd(a, gcd(b, c)) == gcd(gcd(a, b), c)
-        }
-
-        fn scalar_multiplication(a: u64, b: u64, k: u64) -> bool {
-            // TODO: #1559 factor n > 2^64 - 1
-            match (k.checked_mul(a), k.checked_mul(b), k.checked_mul(gcd(a, b))) {
-                (Some(ka), Some(kb), Some(kgcdab)) => gcd(ka, kb) == kgcdab,
-                _ => true
-            }
-        }
-
-        fn multiplicative(a: u64, b: u64, c: u64) -> bool {
-            // TODO: #1559 factor n > 2^64 - 1
-            match (a.checked_mul(b), gcd(a, c).checked_mul(gcd(b, c))) {
-                (Some(ab), Some(gcdac_gcdbc)) => {
-                    // gcd(ab, c) = gcd(a, c) gcd(b, c) when a and b coprime
-                    gcd(a, b) != 1 || gcd(ab, c) == gcdac_gcdbc
-                },
-                _ => true,
-            }
-        }
-
-        fn linearity(a: u64, b: u64, k: u64) -> bool {
-            // TODO: #1559 factor n > 2^64 - 1
-            match k.checked_mul(b) {
-                Some(kb) => {
-                    match a.checked_add(kb) {
-                        Some(a_plus_kb) => gcd(a_plus_kb, b) == gcd(a, b),
-                        _ => true,
-                    }
-                }
-                _ => true,
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/numeric/mod.rs.html b/coreutils/dev/src/uu_factor/numeric/mod.rs.html deleted file mode 100644 index e70b7d7bf..000000000 --- a/coreutils/dev/src/uu_factor/numeric/mod.rs.html +++ /dev/null @@ -1,35 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2020 nicoo            <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-mod gcd;
-pub use gcd::gcd;
-
-pub(crate) mod traits;
-
-mod modular_inverse;
-pub(crate) use modular_inverse::modular_inverse;
-
-mod montgomery;
-pub(crate) use montgomery::{Arithmetic, Montgomery};
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/numeric/modular_inverse.rs.html b/coreutils/dev/src/uu_factor/numeric/modular_inverse.rs.html deleted file mode 100644 index 8545f192e..000000000 --- a/coreutils/dev/src/uu_factor/numeric/modular_inverse.rs.html +++ /dev/null @@ -1,175 +0,0 @@ -modular_inverse.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2015 Wiktor Kuropatwa <wiktor.kuropatwa@gmail.com>
-// * (c) 2020 nicoo            <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-use super::traits::Int;
-
-// extended Euclid algorithm
-// precondition: a is odd
-pub(crate) fn modular_inverse<T: Int>(a: T) -> T {
-    let zero = T::zero();
-    let one = T::one();
-    debug_assert!(a % (one + one) == one, "{a:?} is not odd");
-
-    let mut t = zero;
-    let mut new_t = one;
-    let mut r = zero;
-    let mut new_r = a;
-
-    while new_r != zero {
-        let quot = if r == zero {
-            // special case when we're just starting out
-            // This works because we know that
-            // a does not divide 2^64, so floor(2^64 / a) == floor((2^64-1) / a);
-            T::max_value()
-        } else {
-            r
-        } / new_r;
-
-        let new_tp = t.wrapping_sub(&quot.wrapping_mul(&new_t));
-        t = new_t;
-        new_t = new_tp;
-
-        let new_rp = r.wrapping_sub(&quot.wrapping_mul(&new_r));
-        r = new_r;
-        new_r = new_rp;
-    }
-
-    debug_assert_eq!(r, one);
-    t
-}
-
-#[cfg(test)]
-mod tests {
-    use super::{super::traits::Int, *};
-    use quickcheck::quickcheck;
-
-    fn small_values<T: Int>() {
-        // All odd integers from 1 to 20 000
-        let one = T::from(1).unwrap();
-        let two = T::from(2).unwrap();
-        let mut test_values = (0..10_000)
-            .map(|i| T::from(i).unwrap())
-            .map(|i| two * i + one);
-
-        assert!(test_values.all(|x| x.wrapping_mul(&modular_inverse(x)) == one));
-    }
-
-    #[test]
-    fn small_values_u32() {
-        small_values::<u32>();
-    }
-
-    #[test]
-    fn small_values_u64() {
-        small_values::<u64>();
-    }
-
-    quickcheck! {
-        fn random_values_u32(n: u32) -> bool {
-            match 2_u32.checked_mul(n) {
-                Some(n) => modular_inverse(n + 1).wrapping_mul(n + 1) == 1,
-                _ => true,
-            }
-        }
-
-        fn random_values_u64(n: u64) -> bool {
-            match 2_u64.checked_mul(n) {
-                Some(n) => modular_inverse(n + 1).wrapping_mul(n + 1) == 1,
-                _ => true,
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/numeric/montgomery.rs.html b/coreutils/dev/src/uu_factor/numeric/montgomery.rs.html deleted file mode 100644 index da93be3a2..000000000 --- a/coreutils/dev/src/uu_factor/numeric/montgomery.rs.html +++ /dev/null @@ -1,509 +0,0 @@ -montgomery.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2020 Alex Lyon  <arcterus@mail.com>
-// * (c) 2020 nicoo      <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-use super::*;
-
-use traits::{DoubleInt, Int, One, OverflowingAdd, Zero};
-
-pub(crate) trait Arithmetic: Copy + Sized {
-    // The type of integers mod m, in some opaque representation
-    type ModInt: Copy + Sized + Eq;
-
-    fn new(m: u64) -> Self;
-    fn modulus(&self) -> u64;
-    fn to_mod(&self, n: u64) -> Self::ModInt;
-    fn to_u64(&self, n: Self::ModInt) -> u64;
-    fn add(&self, a: Self::ModInt, b: Self::ModInt) -> Self::ModInt;
-    fn mul(&self, a: Self::ModInt, b: Self::ModInt) -> Self::ModInt;
-
-    fn pow(&self, mut a: Self::ModInt, mut b: u64) -> Self::ModInt {
-        let (_a, _b) = (a, b);
-        let mut result = self.one();
-        while b > 0 {
-            if b & 1 != 0 {
-                result = self.mul(result, a);
-            }
-            a = self.mul(a, a);
-            b >>= 1;
-        }
-
-        // Check that r (reduced back to the usual representation) equals
-        //  a^b % n, unless the latter computation overflows
-        // Temporarily commented-out, as there u64::checked_pow is not available
-        //  on the minimum supported Rust version, nor is an appropriate method
-        //  for compiling the check conditionally.
-        //debug_assert!(self
-        //    .to_u64(_a)
-        //    .checked_pow(_b as u32)
-        //    .map(|r| r % self.modulus() == self.to_u64(result))
-        //    .unwrap_or(true));
-
-        result
-    }
-
-    fn one(&self) -> Self::ModInt {
-        self.to_mod(1)
-    }
-    fn minus_one(&self) -> Self::ModInt {
-        self.to_mod(self.modulus() - 1)
-    }
-    fn zero(&self) -> Self::ModInt {
-        self.to_mod(0)
-    }
-}
-
-#[derive(Clone, Copy, Debug)]
-pub(crate) struct Montgomery<T: DoubleInt> {
-    a: T,
-    n: T,
-}
-
-impl<T: DoubleInt> Montgomery<T> {
-    /// computes x/R mod n efficiently
-    fn reduce(&self, x: T::DoubleWidth) -> T {
-        let t_bits = T::zero().count_zeros() as usize;
-
-        debug_assert!(x < (self.n.as_double_width()) << t_bits);
-        // TODO: optimize
-        let Self { a, n } = self;
-        let m = T::from_double_width(x).wrapping_mul(a);
-        let nm = (n.as_double_width()) * (m.as_double_width());
-        let (xnm, overflow) = x.overflowing_add(&nm); // x + n*m
-        debug_assert_eq!(
-            xnm % (T::DoubleWidth::one() << T::zero().count_zeros() as usize),
-            T::DoubleWidth::zero()
-        );
-
-        // (x + n*m) / R
-        // in case of overflow, this is (2¹²⁸ + xnm)/2⁶⁴ - n = xnm/2⁶⁴ + (2⁶⁴ - n)
-        let y = T::from_double_width(xnm >> t_bits)
-            + if overflow {
-                n.wrapping_neg()
-            } else {
-                T::zero()
-            };
-
-        if y >= *n {
-            y - *n
-        } else {
-            y
-        }
-    }
-}
-
-impl<T: DoubleInt> Arithmetic for Montgomery<T> {
-    // Montgomery transform, R=2⁶⁴
-    // Provides fast arithmetic mod n (n odd, u64)
-    type ModInt = T;
-
-    fn new(n: u64) -> Self {
-        debug_assert!(T::zero().count_zeros() >= 64 || n < (1 << T::zero().count_zeros() as usize));
-        let n = T::from_u64(n);
-        let a = modular_inverse(n).wrapping_neg();
-        debug_assert_eq!(n.wrapping_mul(&a), T::one().wrapping_neg());
-        Self { a, n }
-    }
-
-    fn modulus(&self) -> u64 {
-        self.n.as_u64()
-    }
-
-    fn to_mod(&self, x: u64) -> Self::ModInt {
-        // TODO: optimise!
-        debug_assert!(x < self.n.as_u64());
-        let r = T::from_double_width(
-            ((T::DoubleWidth::from_u64(x)) << T::zero().count_zeros() as usize)
-                % self.n.as_double_width(),
-        );
-        debug_assert_eq!(x, self.to_u64(r));
-        r
-    }
-
-    fn to_u64(&self, n: Self::ModInt) -> u64 {
-        self.reduce(n.as_double_width()).as_u64()
-    }
-
-    fn add(&self, a: Self::ModInt, b: Self::ModInt) -> Self::ModInt {
-        let (r, overflow) = a.overflowing_add(&b);
-
-        // In case of overflow, a+b = 2⁶⁴ + r = (2⁶⁴ - n) + r (working mod n)
-        let r = if overflow {
-            r + self.n.wrapping_neg()
-        } else {
-            r
-        };
-
-        // Normalize to [0; n[
-        let r = if r < self.n { r } else { r - self.n };
-
-        // Check that r (reduced back to the usual representation) equals
-        // a+b % n
-        #[cfg(debug_assertions)]
-        {
-            let a_r = self.to_u64(a) as u128;
-            let b_r = self.to_u64(b) as u128;
-            let r_r = self.to_u64(r);
-            let r_2 = ((a_r + b_r) % self.n.as_u128()) as u64;
-            debug_assert_eq!(
-                r_r, r_2,
-                "[{}] = {} ≠ {} = {} + {} = [{}] + [{}] mod {}; a = {}",
-                r, r_r, r_2, a_r, b_r, a, b, self.n, self.a
-            );
-        }
-        r
-    }
-
-    fn mul(&self, a: Self::ModInt, b: Self::ModInt) -> Self::ModInt {
-        let r = self.reduce(a.as_double_width() * b.as_double_width());
-
-        // Check that r (reduced back to the usual representation) equals
-        // a*b % n
-        #[cfg(debug_assertions)]
-        {
-            let a_r = self.to_u64(a) as u128;
-            let b_r = self.to_u64(b) as u128;
-            let r_r = self.to_u64(r);
-            let r_2: u64 = ((a_r * b_r) % self.n.as_u128()) as u64;
-            debug_assert_eq!(
-                r_r, r_2,
-                "[{}] = {} ≠ {} = {} * {} = [{}] * [{}] mod {}; a = {}",
-                r, r_r, r_2, a_r, b_r, a, b, self.n, self.a
-            );
-        }
-        r
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    fn test_add<A: DoubleInt>() {
-        for n in 0..100 {
-            let n = 2 * n + 1;
-            let m = Montgomery::<A>::new(n);
-            for x in 0..n {
-                let m_x = m.to_mod(x);
-                for y in 0..=x {
-                    let m_y = m.to_mod(y);
-                    println!("{n:?}, {x:?}, {y:?}");
-                    assert_eq!((x + y) % n, m.to_u64(m.add(m_x, m_y)));
-                }
-            }
-        }
-    }
-
-    #[test]
-    fn add_u32() {
-        test_add::<u32>();
-    }
-
-    #[test]
-    fn add_u64() {
-        test_add::<u64>();
-    }
-
-    fn test_multiplication<A: DoubleInt>() {
-        for n in 0..100 {
-            let n = 2 * n + 1;
-            let m = Montgomery::<A>::new(n);
-            for x in 0..n {
-                let m_x = m.to_mod(x);
-                for y in 0..=x {
-                    let m_y = m.to_mod(y);
-                    assert_eq!((x * y) % n, m.to_u64(m.mul(m_x, m_y)));
-                }
-            }
-        }
-    }
-
-    #[test]
-    fn multiplication_u32() {
-        test_multiplication::<u32>();
-    }
-
-    #[test]
-    fn multiplication_u64() {
-        test_multiplication::<u64>();
-    }
-
-    fn test_roundtrip<A: DoubleInt>() {
-        for n in 0..100 {
-            let n = 2 * n + 1;
-            let m = Montgomery::<A>::new(n);
-            for x in 0..n {
-                let x_ = m.to_mod(x);
-                assert_eq!(x, m.to_u64(x_));
-            }
-        }
-    }
-
-    #[test]
-    fn roundtrip_u32() {
-        test_roundtrip::<u32>();
-    }
-
-    #[test]
-    fn roundtrip_u64() {
-        test_roundtrip::<u64>();
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/numeric/traits.rs.html b/coreutils/dev/src/uu_factor/numeric/traits.rs.html deleted file mode 100644 index 616e5240f..000000000 --- a/coreutils/dev/src/uu_factor/numeric/traits.rs.html +++ /dev/null @@ -1,181 +0,0 @@ -traits.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2020 Alex Lyon  <arcterus@mail.com>
-// * (c) 2020 nicoo      <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-pub(crate) use num_traits::{
-    identities::{One, Zero},
-    ops::overflowing::OverflowingAdd,
-};
-use num_traits::{
-    int::PrimInt,
-    ops::wrapping::{WrappingMul, WrappingNeg, WrappingSub},
-};
-use std::fmt::{Debug, Display};
-
-pub(crate) trait Int:
-    Display + Debug + PrimInt + OverflowingAdd + WrappingNeg + WrappingSub + WrappingMul
-{
-    fn as_u64(&self) -> u64;
-    fn from_u64(n: u64) -> Self;
-
-    #[cfg(debug_assertions)]
-    fn as_u128(&self) -> u128;
-}
-
-pub(crate) trait DoubleInt: Int {
-    /// An integer type with twice the width of `Self`.
-    /// In particular, multiplications (of `Int` values) can be performed in
-    ///  `Self::DoubleWidth` without possibility of overflow.
-    type DoubleWidth: Int;
-
-    fn as_double_width(self) -> Self::DoubleWidth;
-    fn from_double_width(n: Self::DoubleWidth) -> Self;
-}
-
-macro_rules! int {
-    ( $x:ty ) => {
-        impl Int for $x {
-            fn as_u64(&self) -> u64 {
-                *self as u64
-            }
-            fn from_u64(n: u64) -> Self {
-                n as _
-            }
-            #[cfg(debug_assertions)]
-            fn as_u128(&self) -> u128 {
-                *self as u128
-            }
-        }
-    };
-}
-macro_rules! double_int {
-    ( $x:ty, $y:ty ) => {
-        int!($x);
-        impl DoubleInt for $x {
-            type DoubleWidth = $y;
-
-            fn as_double_width(self) -> $y {
-                self as _
-            }
-            fn from_double_width(n: $y) -> Self {
-                n as _
-            }
-        }
-    };
-}
-double_int!(u32, u64);
-double_int!(u64, u128);
-int!(u128);
-
-/// Helper macro for instantiating tests over u32 and u64
-#[cfg(test)]
-#[macro_export]
-macro_rules! parametrized_check {
-    ( $f:ident ) => {
-        paste::item! {
-            #[test]
-            fn [< $f _ u32 >]() {
-                $f::<u32>()
-            }
-            #[test]
-            fn [< $f _ u64 >]() {
-                $f::<u64>()
-            }
-        }
-    };
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/rho.rs.html b/coreutils/dev/src/uu_factor/rho.rs.html deleted file mode 100644 index b7dbfa9ec..000000000 --- a/coreutils/dev/src/uu_factor/rho.rs.html +++ /dev/null @@ -1,95 +0,0 @@ -rho.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2015 Wiktor Kuropatwa <wiktor.kuropatwa@gmail.com>
-// * (c) 2020 nicoo <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-use rand::distributions::{Distribution, Uniform};
-use rand::rngs::SmallRng;
-use rand::{thread_rng, SeedableRng};
-use std::cmp::{max, min};
-
-use crate::numeric::*;
-
-pub(crate) fn find_divisor<A: Arithmetic>(n: A) -> u64 {
-    #![allow(clippy::many_single_char_names)]
-    let mut rand = {
-        let range = Uniform::new(1, n.modulus());
-        let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap();
-        move || n.to_mod(range.sample(&mut rng))
-    };
-
-    let quadratic = |a, b| move |x| n.add(n.mul(a, n.mul(x, x)), b);
-
-    loop {
-        let f = quadratic(rand(), rand());
-        let mut x = rand();
-        let mut y = x;
-
-        loop {
-            x = f(x);
-            y = f(f(y));
-            let d = {
-                let _x = n.to_u64(x);
-                let _y = n.to_u64(y);
-                gcd(n.modulus(), max(_x, _y) - min(_x, _y))
-            };
-            if d == n.modulus() {
-                // Failure, retry with a different quadratic
-                break;
-            } else if d > 1 {
-                return d;
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_factor/table.rs.html b/coreutils/dev/src/uu_factor/table.rs.html deleted file mode 100644 index 09463bb5c..000000000 --- a/coreutils/dev/src/uu_factor/table.rs.html +++ /dev/null @@ -1,203 +0,0 @@ -table.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) 2015 kwantam <kwantam@gmail.com>
-// * (c) 2020 nicoo   <nicoo@debian.org>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-// spell-checker: ignore (ToDO) INVS
-
-use crate::Factors;
-
-include!(concat!(env!("OUT_DIR"), "/prime_table.rs"));
-
-pub fn factor(num: &mut u64, factors: &mut Factors) {
-    for &(prime, inv, ceil) in PRIME_INVERSIONS_U64 {
-        if *num == 1 {
-            break;
-        }
-
-        // inv = prime^-1 mod 2^64
-        // ceil = floor((2^64-1) / prime)
-        // if (num * inv) mod 2^64 <= ceil, then prime divides num
-        // See https://math.stackexchange.com/questions/1251327/
-        // for a nice explanation.
-        let mut k = 0;
-        loop {
-            let x = num.wrapping_mul(inv);
-
-            // While prime divides num
-            if x <= ceil {
-                *num = x;
-                k += 1;
-                #[cfg(feature = "coz")]
-                coz::progress!("factor found");
-            } else {
-                if k > 0 {
-                    factors.add(prime, k);
-                }
-                break;
-            }
-        }
-    }
-}
-
-pub const CHUNK_SIZE: usize = 8;
-pub fn factor_chunk(n_s: &mut [u64; CHUNK_SIZE], f_s: &mut [Factors; CHUNK_SIZE]) {
-    for &(prime, inv, ceil) in PRIME_INVERSIONS_U64 {
-        if n_s[0] == 1 && n_s[1] == 1 && n_s[2] == 1 && n_s[3] == 1 {
-            break;
-        }
-
-        for (num, factors) in n_s.iter_mut().zip(f_s.iter_mut()) {
-            if *num == 1 {
-                continue;
-            }
-            let mut k = 0;
-            loop {
-                let x = num.wrapping_mul(inv);
-
-                // While prime divides num
-                if x <= ceil {
-                    *num = x;
-                    k += 1;
-                } else {
-                    if k > 0 {
-                        factors.add(prime, k);
-                    }
-                    break;
-                }
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use crate::Factors;
-    use quickcheck::quickcheck;
-    use rand::{rngs::SmallRng, Rng, SeedableRng};
-
-    quickcheck! {
-        fn chunk_vs_iter(seed: u64) -> () {
-            let mut rng = SmallRng::seed_from_u64(seed);
-            let mut n_c: [u64; CHUNK_SIZE] = rng.gen();
-            let mut f_c: [Factors; CHUNK_SIZE] = rng.gen();
-
-            let mut n_i = n_c;
-            let mut f_i = f_c.clone();
-            for (n, f) in n_i.iter_mut().zip(f_i.iter_mut()) {
-                factor(n, f);
-            }
-
-            factor_chunk(&mut n_c, &mut f_c);
-
-            assert_eq!(n_i, n_c);
-            assert_eq!(f_i, f_c);
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_false/false.rs.html b/coreutils/dev/src/uu_false/false.rs.html deleted file mode 100644 index 80a3d9b26..000000000 --- a/coreutils/dev/src/uu_false/false.rs.html +++ /dev/null @@ -1,135 +0,0 @@ -false.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Jordi Boggiano <j.boggiano@seld.be>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-use clap::{Arg, ArgAction, Command};
-use std::{ffi::OsString, io::Write};
-use uucore::error::{set_exit_code, UResult};
-use uucore::help_about;
-
-const ABOUT: &str = help_about!("false.md");
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let mut command = uu_app();
-
-    // Mirror GNU options, always return `1`. In particular even the 'successful' cases of no-op,
-    // and the interrupted display of help and version should return `1`. Also, we return Ok in all
-    // paths to avoid the allocation of an error object, an operation that could, in theory, fail
-    // and unwind through the standard library allocation handling machinery.
-    set_exit_code(1);
-
-    let args: Vec<OsString> = args.collect();
-    if args.len() > 2 {
-        return Ok(());
-    }
-
-    if let Err(e) = command.try_get_matches_from_mut(args) {
-        let error = match e.kind() {
-            clap::error::ErrorKind::DisplayHelp => command.print_help(),
-            clap::error::ErrorKind::DisplayVersion => {
-                writeln!(std::io::stdout(), "{}", command.render_version())
-            }
-            _ => Ok(()),
-        };
-
-        // Try to display this error.
-        if let Err(print_fail) = error {
-            // Completely ignore any error here, no more failover and we will fail in any case.
-            let _ = writeln!(std::io::stderr(), "{}: {}", uucore::util_name(), print_fail);
-        }
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(clap::crate_version!())
-        .about(ABOUT)
-        // We provide our own help and version options, to ensure maximum compatibility with GNU.
-        .disable_help_flag(true)
-        .disable_version_flag(true)
-        .arg(
-            Arg::new("help")
-                .long("help")
-                .help("Print help information")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new("version")
-                .long("version")
-                .help("Print version information")
-                .action(ArgAction::Version),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_fmt/fmt.rs.html b/coreutils/dev/src/uu_fmt/fmt.rs.html deleted file mode 100644 index 58e78cf54..000000000 --- a/coreutils/dev/src/uu_fmt/fmt.rs.html +++ /dev/null @@ -1,825 +0,0 @@ -fmt.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-
//  * This file is part of `fmt` from the uutils coreutils package.
-//  *
-//  * (c) kwantam <kwantam@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) PSKIP linebreak ostream parasplit tabwidth xanti xprefix
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::cmp;
-use std::fs::File;
-use std::io::{stdin, stdout, Write};
-use std::io::{BufReader, BufWriter, Read, Stdout};
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage, show_warning};
-
-use self::linebreak::break_lines;
-use self::parasplit::ParagraphStream;
-
-mod linebreak;
-mod parasplit;
-
-static ABOUT: &str = help_about!("fmt.md");
-const USAGE: &str = help_usage!("fmt.md");
-static MAX_WIDTH: usize = 2500;
-
-static OPT_CROWN_MARGIN: &str = "crown-margin";
-static OPT_TAGGED_PARAGRAPH: &str = "tagged-paragraph";
-static OPT_PRESERVE_HEADERS: &str = "preserve-headers";
-static OPT_SPLIT_ONLY: &str = "split-only";
-static OPT_UNIFORM_SPACING: &str = "uniform-spacing";
-static OPT_PREFIX: &str = "prefix";
-static OPT_SKIP_PREFIX: &str = "skip-prefix";
-static OPT_EXACT_PREFIX: &str = "exact-prefix";
-static OPT_EXACT_SKIP_PREFIX: &str = "exact-skip-prefix";
-static OPT_WIDTH: &str = "width";
-static OPT_GOAL: &str = "goal";
-static OPT_QUICK: &str = "quick";
-static OPT_TAB_WIDTH: &str = "tab-width";
-
-static ARG_FILES: &str = "files";
-
-pub type FileOrStdReader = BufReader<Box<dyn Read + 'static>>;
-pub struct FmtOptions {
-    crown: bool,
-    tagged: bool,
-    mail: bool,
-    split_only: bool,
-    use_prefix: bool,
-    prefix: String,
-    xprefix: bool,
-    use_anti_prefix: bool,
-    anti_prefix: String,
-    xanti_prefix: bool,
-    uniform: bool,
-    quick: bool,
-    width: usize,
-    goal: usize,
-    tabwidth: usize,
-}
-
-impl Default for FmtOptions {
-    fn default() -> Self {
-        Self {
-            crown: false,
-            tagged: false,
-            mail: false,
-            uniform: false,
-            quick: false,
-            split_only: false,
-            use_prefix: false,
-            prefix: String::new(),
-            xprefix: false,
-            use_anti_prefix: false,
-            anti_prefix: String::new(),
-            xanti_prefix: false,
-            width: 75,
-            goal: 70,
-            tabwidth: 8,
-        }
-    }
-}
-
-/// Parse the command line arguments and return the list of files and formatting options.
-///
-/// # Arguments
-///
-/// * `args` - Command line arguments.
-///
-/// # Returns
-///
-/// A tuple containing a vector of file names and a `FmtOptions` struct.
-#[allow(clippy::cognitive_complexity)]
-#[allow(clippy::field_reassign_with_default)]
-fn parse_arguments(args: impl uucore::Args) -> UResult<(Vec<String>, FmtOptions)> {
-    // by default, goal is 93% of width
-    const DEFAULT_GOAL_TO_WIDTH_RATIO: usize = 93;
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let mut files: Vec<String> = matches
-        .get_many::<String>(ARG_FILES)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    let mut fmt_opts = FmtOptions::default();
-
-    fmt_opts.tagged = matches.get_flag(OPT_TAGGED_PARAGRAPH);
-    if matches.get_flag(OPT_CROWN_MARGIN) {
-        fmt_opts.crown = true;
-        fmt_opts.tagged = false;
-    }
-    fmt_opts.mail = matches.get_flag(OPT_PRESERVE_HEADERS);
-    fmt_opts.uniform = matches.get_flag(OPT_UNIFORM_SPACING);
-    fmt_opts.quick = matches.get_flag(OPT_QUICK);
-    if matches.get_flag(OPT_SPLIT_ONLY) {
-        fmt_opts.split_only = true;
-        fmt_opts.crown = false;
-        fmt_opts.tagged = false;
-    }
-    fmt_opts.xprefix = matches.contains_id(OPT_EXACT_PREFIX);
-    fmt_opts.xanti_prefix = matches.contains_id(OPT_SKIP_PREFIX);
-
-    if let Some(s) = matches.get_one::<String>(OPT_PREFIX).map(String::from) {
-        fmt_opts.prefix = s;
-        fmt_opts.use_prefix = true;
-    };
-
-    if let Some(s) = matches.get_one::<String>(OPT_SKIP_PREFIX).map(String::from) {
-        fmt_opts.anti_prefix = s;
-        fmt_opts.use_anti_prefix = true;
-    };
-
-    if let Some(s) = matches.get_one::<String>(OPT_WIDTH) {
-        fmt_opts.width = match s.parse::<usize>() {
-            Ok(t) => t,
-            Err(e) => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("Invalid WIDTH specification: {}: {}", s.quote(), e),
-                ));
-            }
-        };
-        if fmt_opts.width > MAX_WIDTH {
-            return Err(USimpleError::new(
-                1,
-                format!(
-                    "invalid width: '{}': Numerical result out of range",
-                    fmt_opts.width,
-                ),
-            ));
-        }
-        fmt_opts.goal = cmp::min(
-            fmt_opts.width * DEFAULT_GOAL_TO_WIDTH_RATIO / 100,
-            fmt_opts.width - 3,
-        );
-    };
-
-    if let Some(s) = matches.get_one::<String>(OPT_GOAL) {
-        fmt_opts.goal = match s.parse::<usize>() {
-            Ok(t) => t,
-            Err(e) => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("Invalid GOAL specification: {}: {}", s.quote(), e),
-                ));
-            }
-        };
-        if !matches.contains_id(OPT_WIDTH) {
-            fmt_opts.width = cmp::max(
-                fmt_opts.goal * 100 / DEFAULT_GOAL_TO_WIDTH_RATIO,
-                fmt_opts.goal + 3,
-            );
-        } else if fmt_opts.goal > fmt_opts.width {
-            return Err(USimpleError::new(1, "GOAL cannot be greater than WIDTH."));
-        }
-    };
-
-    if let Some(s) = matches.get_one::<String>(OPT_TAB_WIDTH) {
-        fmt_opts.tabwidth = match s.parse::<usize>() {
-            Ok(t) => t,
-            Err(e) => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("Invalid TABWIDTH specification: {}: {}", s.quote(), e),
-                ));
-            }
-        };
-    };
-
-    if fmt_opts.tabwidth < 1 {
-        fmt_opts.tabwidth = 1;
-    }
-
-    // immutable now
-    let fmt_opts = fmt_opts;
-
-    if files.is_empty() {
-        files.push("-".to_owned());
-    }
-
-    Ok((files, fmt_opts))
-}
-
-/// Process the content of a file and format it according to the provided options.
-///
-/// # Arguments
-///
-/// * `file_name` - The name of the file to process. A value of "-" represents the standard input.
-/// * `fmt_opts` - A reference to a `FmtOptions` struct containing the formatting options.
-/// * `ostream` - A mutable reference to a `BufWriter` wrapping the standard output.
-///
-/// # Returns
-///
-/// A `UResult<()>` indicating success or failure.
-fn process_file(
-    file_name: &str,
-    fmt_opts: &FmtOptions,
-    ostream: &mut BufWriter<Stdout>,
-) -> UResult<()> {
-    let mut fp = match file_name {
-        "-" => BufReader::new(Box::new(stdin()) as Box<dyn Read + 'static>),
-        _ => match File::open(file_name) {
-            Ok(f) => BufReader::new(Box::new(f) as Box<dyn Read + 'static>),
-            Err(e) => {
-                show_warning!("{}: {}", file_name.maybe_quote(), e);
-                return Ok(());
-            }
-        },
-    };
-
-    let p_stream = ParagraphStream::new(fmt_opts, &mut fp);
-    for para_result in p_stream {
-        match para_result {
-            Err(s) => {
-                ostream
-                    .write_all(s.as_bytes())
-                    .map_err_context(|| "failed to write output".to_string())?;
-                ostream
-                    .write_all(b"\n")
-                    .map_err_context(|| "failed to write output".to_string())?;
-            }
-            Ok(para) => break_lines(&para, fmt_opts, ostream)
-                .map_err_context(|| "failed to write output".to_string())?,
-        }
-    }
-
-    // flush the output after each file
-    ostream
-        .flush()
-        .map_err_context(|| "failed to write output".to_string())?;
-
-    Ok(())
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let (files, fmt_opts) = parse_arguments(args)?;
-
-    let mut ostream = BufWriter::new(stdout());
-
-    for file_name in &files {
-        process_file(file_name, &fmt_opts, &mut ostream)?;
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_CROWN_MARGIN)
-                .short('c')
-                .long(OPT_CROWN_MARGIN)
-                .help(
-                    "First and second line of paragraph \
-                    may have different indentations, in which \
-                    case the first line's indentation is preserved, \
-                    and each subsequent line's indentation matches the second line.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_TAGGED_PARAGRAPH)
-                .short('t')
-                .long("tagged-paragraph")
-                .help(
-                    "Like -c, except that the first and second line of a paragraph *must* \
-                    have different indentation or they are treated as separate paragraphs.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_PRESERVE_HEADERS)
-                .short('m')
-                .long("preserve-headers")
-                .help(
-                    "Attempt to detect and preserve mail headers in the input. \
-                    Be careful when combining this flag with -p.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_SPLIT_ONLY)
-                .short('s')
-                .long("split-only")
-                .help("Split lines only, do not reflow.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_UNIFORM_SPACING)
-                .short('u')
-                .long("uniform-spacing")
-                .help(
-                    "Insert exactly one \
-                    space between words, and two between sentences. \
-                    Sentence breaks in the input are detected as [?!.] \
-                    followed by two spaces or a newline; other punctuation \
-                    is not interpreted as a sentence break.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_PREFIX)
-                .short('p')
-                .long("prefix")
-                .help(
-                    "Reformat only lines \
-                    beginning with PREFIX, reattaching PREFIX to reformatted lines. \
-                    Unless -x is specified, leading whitespace will be ignored \
-                    when matching PREFIX.",
-                )
-                .value_name("PREFIX"),
-        )
-        .arg(
-            Arg::new(OPT_SKIP_PREFIX)
-                .short('P')
-                .long("skip-prefix")
-                .help(
-                    "Do not reformat lines \
-                    beginning with PSKIP. Unless -X is specified, leading whitespace \
-                    will be ignored when matching PSKIP",
-                )
-                .value_name("PSKIP"),
-        )
-        .arg(
-            Arg::new(OPT_EXACT_PREFIX)
-                .short('x')
-                .long("exact-prefix")
-                .help(
-                    "PREFIX must match at the \
-                    beginning of the line with no preceding whitespace.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_EXACT_SKIP_PREFIX)
-                .short('X')
-                .long("exact-skip-prefix")
-                .help(
-                    "PSKIP must match at the \
-                    beginning of the line with no preceding whitespace.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_WIDTH)
-                .short('w')
-                .long("width")
-                .help("Fill output lines up to a maximum of WIDTH columns, default 75.")
-                .value_name("WIDTH"),
-        )
-        .arg(
-            Arg::new(OPT_GOAL)
-                .short('g')
-                .long("goal")
-                .help("Goal width, default of 93% of WIDTH. Must be less than WIDTH.")
-                .value_name("GOAL"),
-        )
-        .arg(
-            Arg::new(OPT_QUICK)
-                .short('q')
-                .long("quick")
-                .help(
-                    "Break lines more quickly at the \
-            expense of a potentially more ragged appearance.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_TAB_WIDTH)
-                .short('T')
-                .long("tab-width")
-                .help(
-                    "Treat tabs as TABWIDTH spaces for \
-                    determining line length, default 8. Note that this is used only for \
-                    calculating line lengths; tabs are preserved in the output.",
-                )
-                .value_name("TABWIDTH"),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_fmt/linebreak.rs.html b/coreutils/dev/src/uu_fmt/linebreak.rs.html deleted file mode 100644 index 8c04c2916..000000000 --- a/coreutils/dev/src/uu_fmt/linebreak.rs.html +++ /dev/null @@ -1,1049 +0,0 @@ -linebreak.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-
//  * This file is part of `fmt` from the uutils coreutils package.
-//  *
-//  * (c) kwantam <kwantam@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) INFTY MULT accum breakwords linebreak linebreaking linebreaks linelen maxlength minlength nchars ostream overlen parasplit plass posn powf punct signum slen sstart tabwidth tlen underlen winfo wlen wordlen
-
-use std::cmp;
-use std::i64;
-use std::io::{BufWriter, Stdout, Write};
-use std::mem;
-
-use uucore::crash;
-
-use crate::parasplit::{ParaWords, Paragraph, WordInfo};
-use crate::FmtOptions;
-
-struct BreakArgs<'a> {
-    opts: &'a FmtOptions,
-    init_len: usize,
-    indent_str: &'a str,
-    indent_len: usize,
-    uniform: bool,
-    ostream: &'a mut BufWriter<Stdout>,
-}
-
-impl<'a> BreakArgs<'a> {
-    fn compute_width(&self, winfo: &WordInfo, posn: usize, fresh: bool) -> usize {
-        if fresh {
-            0
-        } else {
-            let post = winfo.after_tab;
-            match winfo.before_tab {
-                None => post,
-                Some(pre) => {
-                    post + ((pre + posn) / self.opts.tabwidth + 1) * self.opts.tabwidth - posn
-                }
-            }
-        }
-    }
-}
-
-pub fn break_lines(
-    para: &Paragraph,
-    opts: &FmtOptions,
-    ostream: &mut BufWriter<Stdout>,
-) -> std::io::Result<()> {
-    // indent
-    let p_indent = &para.indent_str[..];
-    let p_indent_len = para.indent_len;
-
-    // words
-    let p_words = ParaWords::new(opts, para);
-    let mut p_words_words = p_words.words();
-
-    // the first word will *always* appear on the first line
-    // make sure of this here
-    let (w, w_len) = match p_words_words.next() {
-        Some(winfo) => (winfo.word, winfo.word_nchars),
-        None => {
-            return ostream.write_all(b"\n");
-        }
-    };
-    // print the init, if it exists, and get its length
-    let p_init_len = w_len
-        + if opts.crown || opts.tagged {
-            // handle "init" portion
-            ostream.write_all(para.init_str.as_bytes())?;
-            para.init_len
-        } else if !para.mail_header {
-            // for non-(crown, tagged) that's the same as a normal indent
-            ostream.write_all(p_indent.as_bytes())?;
-            p_indent_len
-        } else {
-            // except that mail headers get no indent at all
-            0
-        };
-    // write first word after writing init
-    ostream.write_all(w.as_bytes())?;
-
-    // does this paragraph require uniform spacing?
-    let uniform = para.mail_header || opts.uniform;
-
-    let mut break_args = BreakArgs {
-        opts,
-        init_len: p_init_len,
-        indent_str: p_indent,
-        indent_len: p_indent_len,
-        uniform,
-        ostream,
-    };
-
-    if opts.quick || para.mail_header {
-        break_simple(p_words_words, &mut break_args)
-    } else {
-        break_knuth_plass(p_words_words, &mut break_args)
-    }
-}
-
-// break_simple implements a "greedy" breaking algorithm: print words until
-// maxlength would be exceeded, then print a linebreak and indent and continue.
-fn break_simple<'a, T: Iterator<Item = &'a WordInfo<'a>>>(
-    mut iter: T,
-    args: &mut BreakArgs<'a>,
-) -> std::io::Result<()> {
-    iter.try_fold((args.init_len, false), |l, winfo| {
-        accum_words_simple(args, l, winfo)
-    })?;
-    args.ostream.write_all(b"\n")
-}
-
-fn accum_words_simple<'a>(
-    args: &mut BreakArgs<'a>,
-    (l, prev_punct): (usize, bool),
-    winfo: &'a WordInfo<'a>,
-) -> std::io::Result<(usize, bool)> {
-    // compute the length of this word, considering how tabs will expand at this position on the line
-    let wlen = winfo.word_nchars + args.compute_width(winfo, l, false);
-
-    let slen = compute_slen(
-        args.uniform,
-        winfo.new_line,
-        winfo.sentence_start,
-        prev_punct,
-    );
-
-    if l + wlen + slen > args.opts.width {
-        write_newline(args.indent_str, args.ostream)?;
-        write_with_spaces(&winfo.word[winfo.word_start..], 0, args.ostream)?;
-        Ok((args.indent_len + winfo.word_nchars, winfo.ends_punct))
-    } else {
-        write_with_spaces(winfo.word, slen, args.ostream)?;
-        Ok((l + wlen + slen, winfo.ends_punct))
-    }
-}
-
-// break_knuth_plass implements an "optimal" breaking algorithm in the style of
-//    Knuth, D.E., and Plass, M.F. "Breaking Paragraphs into Lines." in Software,
-//    Practice and Experience. Vol. 11, No. 11, November 1981.
-//    http://onlinelibrary.wiley.com/doi/10.1002/spe.4380111102/pdf
-fn break_knuth_plass<'a, T: Clone + Iterator<Item = &'a WordInfo<'a>>>(
-    mut iter: T,
-    args: &mut BreakArgs<'a>,
-) -> std::io::Result<()> {
-    // run the algorithm to get the breakpoints
-    let breakpoints = find_kp_breakpoints(iter.clone(), args);
-
-    // iterate through the breakpoints (note that breakpoints is in reverse break order, so we .rev() it
-    let result: std::io::Result<(bool, bool)> = breakpoints.iter().rev().try_fold(
-        (false, false),
-        |(mut prev_punct, mut fresh), &(next_break, break_before)| {
-            if fresh {
-                write_newline(args.indent_str, args.ostream)?;
-            }
-            // at each breakpoint, keep emitting words until we find the word matching this breakpoint
-            for winfo in &mut iter {
-                let (slen, word) = slice_if_fresh(
-                    fresh,
-                    winfo.word,
-                    winfo.word_start,
-                    args.uniform,
-                    winfo.new_line,
-                    winfo.sentence_start,
-                    prev_punct,
-                );
-                fresh = false;
-                prev_punct = winfo.ends_punct;
-
-                // We find identical breakpoints here by comparing addresses of the references.
-                // This is OK because the backing vector is not mutating once we are linebreaking.
-                let winfo_ptr = winfo as *const _;
-                let next_break_ptr = next_break as *const _;
-                if winfo_ptr == next_break_ptr {
-                    // OK, we found the matching word
-                    if break_before {
-                        write_newline(args.indent_str, args.ostream)?;
-                        write_with_spaces(&winfo.word[winfo.word_start..], 0, args.ostream)?;
-                    } else {
-                        // breaking after this word, so that means "fresh" is true for the next iteration
-                        write_with_spaces(word, slen, args.ostream)?;
-                        fresh = true;
-                    }
-                    break;
-                } else {
-                    write_with_spaces(word, slen, args.ostream)?;
-                }
-            }
-            Ok((prev_punct, fresh))
-        },
-    );
-    let (mut prev_punct, mut fresh) = result?;
-
-    // after the last linebreak, write out the rest of the final line.
-    for winfo in iter {
-        if fresh {
-            write_newline(args.indent_str, args.ostream)?;
-        }
-        let (slen, word) = slice_if_fresh(
-            fresh,
-            winfo.word,
-            winfo.word_start,
-            args.uniform,
-            winfo.new_line,
-            winfo.sentence_start,
-            prev_punct,
-        );
-        prev_punct = winfo.ends_punct;
-        fresh = false;
-        write_with_spaces(word, slen, args.ostream)?;
-    }
-    args.ostream.write_all(b"\n")
-}
-
-struct LineBreak<'a> {
-    prev: usize,
-    linebreak: Option<&'a WordInfo<'a>>,
-    break_before: bool,
-    demerits: i64,
-    prev_rat: f32,
-    length: usize,
-    fresh: bool,
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn find_kp_breakpoints<'a, T: Iterator<Item = &'a WordInfo<'a>>>(
-    iter: T,
-    args: &BreakArgs<'a>,
-) -> Vec<(&'a WordInfo<'a>, bool)> {
-    let mut iter = iter.peekable();
-    // set up the initial null linebreak
-    let mut linebreaks = vec![LineBreak {
-        prev: 0,
-        linebreak: None,
-        break_before: false,
-        demerits: 0,
-        prev_rat: 0.0f32,
-        length: args.init_len,
-        fresh: false,
-    }];
-    // this vec holds the current active linebreaks; next_ holds the breaks that will be active for
-    // the next word
-    let active_breaks = &mut vec![0];
-    let next_active_breaks = &mut vec![];
-
-    let stretch = (args.opts.width - args.opts.goal) as isize;
-    let minlength = args.opts.goal - stretch as usize;
-    let mut new_linebreaks = vec![];
-    let mut is_sentence_start = false;
-    let mut least_demerits = 0;
-    loop {
-        let w = match iter.next() {
-            None => break,
-            Some(w) => w,
-        };
-
-        // if this is the last word, we don't add additional demerits for this break
-        let (is_last_word, is_sentence_end) = match iter.peek() {
-            None => (true, true),
-            Some(&&WordInfo {
-                sentence_start: st,
-                new_line: nl,
-                ..
-            }) => (false, st || (nl && w.ends_punct)),
-        };
-
-        // should we be adding extra space at the beginning of the next sentence?
-        let slen = compute_slen(args.uniform, w.new_line, is_sentence_start, false);
-
-        let mut ld_new = i64::MAX;
-        let mut ld_next = i64::MAX;
-        let mut ld_idx = 0;
-        new_linebreaks.clear();
-        next_active_breaks.clear();
-        // go through each active break, extending it and possibly adding a new active
-        // break if we are above the minimum required length
-        for &i in active_breaks.iter() {
-            let active = &mut linebreaks[i];
-            // normalize demerits to avoid overflow, and record if this is the least
-            active.demerits -= least_demerits;
-            if active.demerits < ld_next {
-                ld_next = active.demerits;
-                ld_idx = i;
-            }
-
-            // get the new length
-            let tlen = w.word_nchars
-                + args.compute_width(w, active.length, active.fresh)
-                + slen
-                + active.length;
-
-            // if tlen is longer than args.opts.width, we drop this break from the active list
-            // otherwise, we extend the break, and possibly add a new break at this point
-            if tlen <= args.opts.width {
-                // this break will still be active next time
-                next_active_breaks.push(i);
-                // we can put this word on this line
-                active.fresh = false;
-                active.length = tlen;
-
-                // if we're above the minlength, we can also consider breaking here
-                if tlen >= minlength {
-                    let (new_demerits, new_ratio) = if is_last_word {
-                        // there is no penalty for the final line's length
-                        (0, 0.0)
-                    } else {
-                        compute_demerits(
-                            args.opts.goal as isize - tlen as isize,
-                            stretch,
-                            w.word_nchars as isize,
-                            active.prev_rat,
-                        )
-                    };
-
-                    // do not even consider adding a line that has too many demerits
-                    // also, try to detect overflow by checking signum
-                    let total_demerits = new_demerits + active.demerits;
-                    if new_demerits < BAD_INFTY_SQ
-                        && total_demerits < ld_new
-                        && active.demerits.signum() <= new_demerits.signum()
-                    {
-                        ld_new = total_demerits;
-                        new_linebreaks.push(LineBreak {
-                            prev: i,
-                            linebreak: Some(w),
-                            break_before: false,
-                            demerits: total_demerits,
-                            prev_rat: new_ratio,
-                            length: args.indent_len,
-                            fresh: true,
-                        });
-                    }
-                }
-            }
-        }
-
-        // if we generated any new linebreaks, add the last one to the list
-        // the last one is always the best because we don't add to new_linebreaks unless
-        // it's better than the best one so far
-        match new_linebreaks.pop() {
-            None => (),
-            Some(lb) => {
-                next_active_breaks.push(linebreaks.len());
-                linebreaks.push(lb);
-            }
-        }
-
-        if next_active_breaks.is_empty() {
-            // every potential linebreak is too long! choose the linebreak with the least demerits, ld_idx
-            let new_break =
-                restart_active_breaks(args, &linebreaks[ld_idx], ld_idx, w, slen, minlength);
-            next_active_breaks.push(linebreaks.len());
-            linebreaks.push(new_break);
-            least_demerits = 0;
-        } else {
-            // next time around, normalize out the demerits fields
-            // on active linebreaks to make overflow less likely
-            least_demerits = cmp::max(ld_next, 0);
-        }
-        // swap in new list of active breaks
-        mem::swap(active_breaks, next_active_breaks);
-        // If this was the last word in a sentence, the next one must be the first in the next.
-        is_sentence_start = is_sentence_end;
-    }
-
-    // return the best path
-    build_best_path(&linebreaks, active_breaks)
-}
-
-fn build_best_path<'a>(paths: &[LineBreak<'a>], active: &[usize]) -> Vec<(&'a WordInfo<'a>, bool)> {
-    let mut breakwords = vec![];
-    // of the active paths, we select the one with the fewest demerits
-    let mut best_idx = match active.iter().min_by_key(|&&a| paths[a].demerits) {
-        None => crash!(
-            1,
-            "Failed to find a k-p linebreak solution. This should never happen."
-        ),
-        Some(&s) => s,
-    };
-
-    // now, chase the pointers back through the break list, recording
-    // the words at which we should break
-    loop {
-        let next_best = &paths[best_idx];
-        match next_best.linebreak {
-            None => return breakwords,
-            Some(prev) => {
-                breakwords.push((prev, next_best.break_before));
-                best_idx = next_best.prev;
-            }
-        }
-    }
-}
-
-// "infinite" badness is more like (1+BAD_INFTY)^2 because of how demerits are computed
-const BAD_INFTY: i64 = 10_000_000;
-const BAD_INFTY_SQ: i64 = BAD_INFTY * BAD_INFTY;
-// badness = BAD_MULT * abs(r) ^ 3
-const BAD_MULT: f32 = 100.0;
-// DR_MULT is multiplier for delta-R between lines
-const DR_MULT: f32 = 600.0;
-// DL_MULT is penalty multiplier for short words at end of line
-const DL_MULT: f32 = 300.0;
-
-fn compute_demerits(delta_len: isize, stretch: isize, wlen: isize, prev_rat: f32) -> (i64, f32) {
-    // how much stretch are we using?
-    let ratio = if delta_len == 0 {
-        0.0f32
-    } else {
-        delta_len as f32 / stretch as f32
-    };
-
-    // compute badness given the stretch ratio
-    let bad_linelen = if ratio.abs() > 1.0f32 {
-        BAD_INFTY
-    } else {
-        (BAD_MULT * ratio.powi(3).abs()) as i64
-    };
-
-    // we penalize lines ending in really short words
-    let bad_wordlen = if wlen >= stretch {
-        0
-    } else {
-        (DL_MULT
-            * ((stretch - wlen) as f32 / (stretch - 1) as f32)
-                .powi(3)
-                .abs()) as i64
-    };
-
-    // we penalize lines that have very different ratios from previous lines
-    let bad_delta_r = (DR_MULT * (((ratio - prev_rat) / 2.0).powi(3)).abs()) as i64;
-
-    let demerits = i64::pow(1 + bad_linelen + bad_wordlen + bad_delta_r, 2);
-
-    (demerits, ratio)
-}
-
-fn restart_active_breaks<'a>(
-    args: &BreakArgs<'a>,
-    active: &LineBreak<'a>,
-    act_idx: usize,
-    w: &'a WordInfo<'a>,
-    slen: usize,
-    min: usize,
-) -> LineBreak<'a> {
-    let (break_before, line_length) = if active.fresh {
-        // never break before a word if that word would be the first on a line
-        (false, args.indent_len)
-    } else {
-        // choose the lesser evil: breaking too early, or breaking too late
-        let wlen = w.word_nchars + args.compute_width(w, active.length, active.fresh);
-        let underlen = (min - active.length) as isize;
-        let overlen = ((wlen + slen + active.length) - args.opts.width) as isize;
-        if overlen > underlen {
-            // break early, put this word on the next line
-            (true, args.indent_len + w.word_nchars)
-        } else {
-            (false, args.indent_len)
-        }
-    };
-
-    // restart the linebreak. This will be our only active path.
-    LineBreak {
-        prev: act_idx,
-        linebreak: Some(w),
-        break_before,
-        demerits: 0, // this is the only active break, so we can reset the demerit count
-        prev_rat: if break_before { 1.0 } else { -1.0 },
-        length: line_length,
-        fresh: !break_before,
-    }
-}
-
-// Number of spaces to add before a word, based on mode, newline, sentence start.
-fn compute_slen(uniform: bool, newline: bool, start: bool, punct: bool) -> usize {
-    if uniform || newline {
-        if start || (newline && punct) {
-            2
-        } else {
-            1
-        }
-    } else {
-        0
-    }
-}
-
-// If we're on a fresh line, slen=0 and we slice off leading whitespace.
-// Otherwise, compute slen and leave whitespace alone.
-fn slice_if_fresh(
-    fresh: bool,
-    word: &str,
-    start: usize,
-    uniform: bool,
-    newline: bool,
-    sstart: bool,
-    punct: bool,
-) -> (usize, &str) {
-    if fresh {
-        (0, &word[start..])
-    } else {
-        (compute_slen(uniform, newline, sstart, punct), word)
-    }
-}
-
-// Write a newline and add the indent.
-fn write_newline(indent: &str, ostream: &mut BufWriter<Stdout>) -> std::io::Result<()> {
-    ostream.write_all(b"\n")?;
-    ostream.write_all(indent.as_bytes())
-}
-
-// Write the word, along with slen spaces.
-fn write_with_spaces(
-    word: &str,
-    slen: usize,
-    ostream: &mut BufWriter<Stdout>,
-) -> std::io::Result<()> {
-    if slen == 2 {
-        ostream.write_all(b"  ")?;
-    } else if slen == 1 {
-        ostream.write_all(b" ")?;
-    }
-    ostream.write_all(word.as_bytes())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_fmt/parasplit.rs.html b/coreutils/dev/src/uu_fmt/parasplit.rs.html deleted file mode 100644 index 26063c4f5..000000000 --- a/coreutils/dev/src/uu_fmt/parasplit.rs.html +++ /dev/null @@ -1,1257 +0,0 @@ -parasplit.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-
//  * This file is part of `fmt` from the uutils coreutils package.
-//  *
-//  * (c) kwantam <kwantam@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) INFTY MULT PSKIP accum aftertab beforetab breakwords fmt's formatline linebreak linebreaking linebreaks linelen maxlength minlength nchars noformat noformatline ostream overlen parasplit pfxind plass pmatch poffset posn powf prefixindent punct signum slen sstart tabwidth tlen underlen winfo wlen wordlen wordsplits xanti xprefix
-
-use std::io::{BufRead, Lines};
-use std::iter::Peekable;
-use std::slice::Iter;
-use unicode_width::UnicodeWidthChar;
-
-use crate::FileOrStdReader;
-use crate::FmtOptions;
-
-fn char_width(c: char) -> usize {
-    if (c as usize) < 0xA0 {
-        // if it is ASCII, call it exactly 1 wide (including control chars)
-        // calling control chars' widths 1 is consistent with OpenBSD fmt
-        1
-    } else {
-        // otherwise, get the unicode width
-        // note that we shouldn't actually get None here because only c < 0xA0
-        // can return None, but for safety and future-proofing we do it this way
-        UnicodeWidthChar::width(c).unwrap_or(1)
-    }
-}
-
-// lines with PSKIP, lacking PREFIX, or which are entirely blank are
-// NoFormatLines; otherwise, they are FormatLines
-#[derive(Debug)]
-pub enum Line {
-    FormatLine(FileLine),
-    NoFormatLine(String, bool),
-}
-
-impl Line {
-    // when we know that it's a FormatLine, as in the ParagraphStream iterator
-    fn get_formatline(self) -> FileLine {
-        match self {
-            Self::FormatLine(fl) => fl,
-            Self::NoFormatLine(..) => panic!("Found NoFormatLine when expecting FormatLine"),
-        }
-    }
-
-    // when we know that it's a NoFormatLine, as in the ParagraphStream iterator
-    fn get_noformatline(self) -> (String, bool) {
-        match self {
-            Self::NoFormatLine(s, b) => (s, b),
-            Self::FormatLine(..) => panic!("Found FormatLine when expecting NoFormatLine"),
-        }
-    }
-}
-
-// each line's prefix has to be considered to know whether to merge it with
-// the next line or not
-#[derive(Debug)]
-pub struct FileLine {
-    line: String,
-    indent_end: usize, // the end of the indent, always the start of the text
-    pfxind_end: usize, // the end of the PREFIX's indent, that is, the spaces before the prefix
-    indent_len: usize, // display length of indent taking into account tabs
-    prefix_len: usize, // PREFIX indent length taking into account tabs
-}
-
-// iterator that produces a stream of Lines from a file
-pub struct FileLines<'a> {
-    opts: &'a FmtOptions,
-    lines: Lines<&'a mut FileOrStdReader>,
-}
-
-impl<'a> FileLines<'a> {
-    fn new<'b>(opts: &'b FmtOptions, lines: Lines<&'b mut FileOrStdReader>) -> FileLines<'b> {
-        FileLines { opts, lines }
-    }
-
-    // returns true if this line should be formatted
-    fn match_prefix(&self, line: &str) -> (bool, usize) {
-        if !self.opts.use_prefix {
-            return (true, 0);
-        }
-
-        FileLines::match_prefix_generic(&self.opts.prefix[..], line, self.opts.xprefix)
-    }
-
-    // returns true if this line should be formatted
-    fn match_anti_prefix(&self, line: &str) -> bool {
-        if !self.opts.use_anti_prefix {
-            return true;
-        }
-
-        match FileLines::match_prefix_generic(
-            &self.opts.anti_prefix[..],
-            line,
-            self.opts.xanti_prefix,
-        ) {
-            (true, _) => false,
-            (_, _) => true,
-        }
-    }
-
-    fn match_prefix_generic(pfx: &str, line: &str, exact: bool) -> (bool, usize) {
-        if line.starts_with(pfx) {
-            return (true, 0);
-        }
-
-        if !exact {
-            // we do it this way rather than byte indexing to support unicode whitespace chars
-            for (i, char) in line.char_indices() {
-                if line[i..].starts_with(pfx) {
-                    return (true, i);
-                } else if !char.is_whitespace() {
-                    break;
-                }
-            }
-        }
-
-        (false, 0)
-    }
-
-    fn compute_indent(&self, string: &str, prefix_end: usize) -> (usize, usize, usize) {
-        let mut prefix_len = 0;
-        let mut indent_len = 0;
-        let mut indent_end = 0;
-        for (os, c) in string.char_indices() {
-            if os == prefix_end {
-                // we found the end of the prefix, so this is the printed length of the prefix here
-                prefix_len = indent_len;
-            }
-
-            if (os >= prefix_end) && !c.is_whitespace() {
-                // found first non-whitespace after prefix, this is indent_end
-                indent_end = os;
-                break;
-            } else if c == '\t' {
-                // compute tab length
-                indent_len = (indent_len / self.opts.tabwidth + 1) * self.opts.tabwidth;
-            } else {
-                // non-tab character
-                indent_len += char_width(c);
-            }
-        }
-        (indent_end, prefix_len, indent_len)
-    }
-}
-
-impl<'a> Iterator for FileLines<'a> {
-    type Item = Line;
-
-    fn next(&mut self) -> Option<Line> {
-        let n = match self.lines.next() {
-            Some(t) => match t {
-                Ok(tt) => tt,
-                Err(_) => return None,
-            },
-            None => return None,
-        };
-
-        // if this line is entirely whitespace,
-        // emit a blank line
-        // Err(true) indicates that this was a linebreak,
-        // which is important to know when detecting mail headers
-        if n.chars().all(char::is_whitespace) {
-            return Some(Line::NoFormatLine(String::new(), true));
-        }
-
-        let (pmatch, poffset) = self.match_prefix(&n[..]);
-
-        // if this line does not match the prefix,
-        // emit the line unprocessed and iterate again
-        if !pmatch {
-            return Some(Line::NoFormatLine(n, false));
-        }
-
-        // if the line matches the prefix, but is blank after,
-        // don't allow lines to be combined through it (that is,
-        // treat it like a blank line, except that since it's
-        // not truly blank we will not allow mail headers on the
-        // following line)
-        if pmatch
-            && n[poffset + self.opts.prefix.len()..]
-                .chars()
-                .all(char::is_whitespace)
-        {
-            return Some(Line::NoFormatLine(n, false));
-        }
-
-        // skip if this line matches the anti_prefix
-        // (NOTE definition of match_anti_prefix is TRUE if we should process)
-        if !self.match_anti_prefix(&n[..]) {
-            return Some(Line::NoFormatLine(n, false));
-        }
-
-        // figure out the indent, prefix, and prefixindent ending points
-        let prefix_end = poffset + self.opts.prefix.len();
-        let (indent_end, prefix_len, indent_len) = self.compute_indent(&n[..], prefix_end);
-
-        Some(Line::FormatLine(FileLine {
-            line: n,
-            indent_end,
-            pfxind_end: poffset,
-            indent_len,
-            prefix_len,
-        }))
-    }
-}
-
-// a paragraph : a collection of FileLines that are to be formatted
-// plus info about the paragraph's indentation
-// (but we only retain the String from the FileLine; the other info
-// is only there to help us in deciding how to merge lines into Paragraphs
-#[derive(Debug)]
-pub struct Paragraph {
-    lines: Vec<String>,     // the lines of the file
-    pub init_str: String,   // string representing the init, that is, the first line's indent
-    pub init_len: usize,    // printable length of the init string considering TABWIDTH
-    init_end: usize,        // byte location of end of init in first line String
-    pub indent_str: String, // string representing indent
-    pub indent_len: usize,  // length of above
-    indent_end: usize, // byte location of end of indent (in crown and tagged mode, only applies to 2nd line and onward)
-    pub mail_header: bool, // we need to know if this is a mail header because we do word splitting differently in that case
-}
-
-// an iterator producing a stream of paragraphs from a stream of lines
-// given a set of options.
-pub struct ParagraphStream<'a> {
-    lines: Peekable<FileLines<'a>>,
-    next_mail: bool,
-    opts: &'a FmtOptions,
-}
-
-impl<'a> ParagraphStream<'a> {
-    pub fn new<'b>(opts: &'b FmtOptions, reader: &'b mut FileOrStdReader) -> ParagraphStream<'b> {
-        let lines = FileLines::new(opts, reader.lines()).peekable();
-        // at the beginning of the file, we might find mail headers
-        ParagraphStream {
-            lines,
-            next_mail: true,
-            opts,
-        }
-    }
-
-    // detect RFC822 mail header
-    fn is_mail_header(line: &FileLine) -> bool {
-        // a mail header begins with either "From " (envelope sender line)
-        // or with a sequence of printable ASCII chars (33 to 126, inclusive,
-        // except colon) followed by a colon.
-        if line.indent_end > 0 {
-            false
-        } else {
-            let l_slice = &line.line[..];
-            if l_slice.starts_with("From ") {
-                true
-            } else {
-                let colon_posn = match l_slice.find(':') {
-                    Some(n) => n,
-                    None => return false,
-                };
-
-                // header field must be nonzero length
-                if colon_posn == 0 {
-                    return false;
-                }
-
-                l_slice[..colon_posn]
-                    .chars()
-                    .all(|x| !matches!(x as usize, y if !(33..=126).contains(&y)))
-            }
-        }
-    }
-}
-
-impl<'a> Iterator for ParagraphStream<'a> {
-    type Item = Result<Paragraph, String>;
-
-    #[allow(clippy::cognitive_complexity)]
-    fn next(&mut self) -> Option<Result<Paragraph, String>> {
-        // return a NoFormatLine in an Err; it should immediately be output
-        let noformat = match self.lines.peek() {
-            None => return None,
-            Some(l) => match *l {
-                Line::FormatLine(_) => false,
-                Line::NoFormatLine(_, _) => true,
-            },
-        };
-
-        // found a NoFormatLine, immediately dump it out
-        if noformat {
-            let (s, nm) = self.lines.next().unwrap().get_noformatline();
-            self.next_mail = nm;
-            return Some(Err(s));
-        }
-
-        // found a FormatLine, now build a paragraph
-        let mut init_str = String::new();
-        let mut init_end = 0;
-        let mut init_len = 0;
-        let mut indent_str = String::new();
-        let mut indent_end = 0;
-        let mut indent_len = 0;
-        let mut prefix_len = 0;
-        let mut pfxind_end = 0;
-        let mut p_lines = Vec::new();
-
-        let mut in_mail = false;
-        let mut second_done = false; // for when we use crown or tagged mode
-        loop {
-            {
-                // peek ahead
-                // need to explicitly force fl out of scope before we can call self.lines.next()
-                let fl = match self.lines.peek() {
-                    None => break,
-                    Some(l) => match *l {
-                        Line::FormatLine(ref x) => x,
-                        Line::NoFormatLine(..) => break,
-                    },
-                };
-
-                if p_lines.is_empty() {
-                    // first time through the loop, get things set up
-                    // detect mail header
-                    if self.opts.mail && self.next_mail && ParagraphStream::is_mail_header(fl) {
-                        in_mail = true;
-                        // there can't be any indent or pfxind because otherwise is_mail_header
-                        // would fail since there cannot be any whitespace before the colon in a
-                        // valid header field
-                        indent_str.push_str("  ");
-                        indent_len = 2;
-                    } else {
-                        if self.opts.crown || self.opts.tagged {
-                            init_str.push_str(&fl.line[..fl.indent_end]);
-                            init_len = fl.indent_len;
-                            init_end = fl.indent_end;
-                        } else {
-                            second_done = true;
-                        }
-
-                        // these will be overwritten in the 2nd line of crown or tagged mode, but
-                        // we are not guaranteed to get to the 2nd line, e.g., if the next line
-                        // is a NoFormatLine or None. Thus, we set sane defaults the 1st time around
-                        indent_str.push_str(&fl.line[..fl.indent_end]);
-                        indent_len = fl.indent_len;
-                        indent_end = fl.indent_end;
-
-                        // save these to check for matching lines
-                        prefix_len = fl.prefix_len;
-                        pfxind_end = fl.pfxind_end;
-
-                        // in tagged mode, add 4 spaces of additional indenting by default
-                        // (gnu fmt's behavior is different: it seems to find the closest column to
-                        // indent_end that is divisible by 3. But honestly that behavior seems
-                        // pretty arbitrary.
-                        // Perhaps a better default would be 1 TABWIDTH? But ugh that's so big.
-                        if self.opts.tagged {
-                            indent_str.push_str("    ");
-                            indent_len += 4;
-                        }
-                    }
-                } else if in_mail {
-                    // lines following mail headers must begin with spaces
-                    if fl.indent_end == 0 || (self.opts.use_prefix && fl.pfxind_end == 0) {
-                        break; // this line does not begin with spaces
-                    }
-                } else if !second_done {
-                    // now we have enough info to handle crown margin and tagged mode
-
-                    // in both crown and tagged modes we require that prefix_len is the same
-                    if prefix_len != fl.prefix_len || pfxind_end != fl.pfxind_end {
-                        break;
-                    }
-
-                    // in tagged mode, indent has to be *different* on following lines
-                    if self.opts.tagged
-                        && indent_len - 4 == fl.indent_len
-                        && indent_end == fl.indent_end
-                    {
-                        break;
-                    }
-
-                    // this is part of the same paragraph, get the indent info from this line
-                    indent_str.clear();
-                    indent_str.push_str(&fl.line[..fl.indent_end]);
-                    indent_len = fl.indent_len;
-                    indent_end = fl.indent_end;
-
-                    second_done = true;
-                } else {
-                    // detect mismatch
-                    if indent_end != fl.indent_end
-                        || pfxind_end != fl.pfxind_end
-                        || indent_len != fl.indent_len
-                        || prefix_len != fl.prefix_len
-                    {
-                        break;
-                    }
-                }
-            }
-
-            p_lines.push(self.lines.next().unwrap().get_formatline().line);
-
-            // when we're in split-only mode, we never join lines, so stop here
-            if self.opts.split_only {
-                break;
-            }
-        }
-
-        // if this was a mail header, then the next line can be detected as one. Otherwise, it cannot.
-        // NOTE next_mail is true at ParagraphStream instantiation, and is set to true after a blank
-        // NoFormatLine.
-        self.next_mail = in_mail;
-
-        Some(Ok(Paragraph {
-            lines: p_lines,
-            init_str,
-            init_len,
-            init_end,
-            indent_str,
-            indent_len,
-            indent_end,
-            mail_header: in_mail,
-        }))
-    }
-}
-
-pub struct ParaWords<'a> {
-    opts: &'a FmtOptions,
-    para: &'a Paragraph,
-    words: Vec<WordInfo<'a>>,
-}
-
-impl<'a> ParaWords<'a> {
-    pub fn new<'b>(opts: &'b FmtOptions, para: &'b Paragraph) -> ParaWords<'b> {
-        let mut pw = ParaWords {
-            opts,
-            para,
-            words: Vec::new(),
-        };
-        pw.create_words();
-        pw
-    }
-
-    fn create_words(&mut self) {
-        if self.para.mail_header {
-            // no extra spacing for mail headers; always exactly 1 space
-            // safe to trim_start on every line of a mail header, since the
-            // first line is guaranteed not to have any spaces
-            self.words.extend(
-                self.para
-                    .lines
-                    .iter()
-                    .flat_map(|x| x.split_whitespace())
-                    .map(|x| WordInfo {
-                        word: x,
-                        word_start: 0,
-                        word_nchars: x.len(), // OK for mail headers; only ASCII allowed (unicode is escaped)
-                        before_tab: None,
-                        after_tab: 0,
-                        sentence_start: false,
-                        ends_punct: false,
-                        new_line: false,
-                    }),
-            );
-        } else {
-            // first line
-            self.words.extend(if self.opts.crown || self.opts.tagged {
-                // crown and tagged mode has the "init" in the first line, so slice from there
-                WordSplit::new(self.opts, &self.para.lines[0][self.para.init_end..])
-            } else {
-                // otherwise we slice from the indent
-                WordSplit::new(self.opts, &self.para.lines[0][self.para.indent_end..])
-            });
-
-            if self.para.lines.len() > 1 {
-                let indent_end = self.para.indent_end;
-                let opts = self.opts;
-                self.words.extend(
-                    self.para
-                        .lines
-                        .iter()
-                        .skip(1)
-                        .flat_map(|x| WordSplit::new(opts, &x[indent_end..])),
-                );
-            }
-        }
-    }
-
-    pub fn words(&'a self) -> Iter<'a, WordInfo<'a>> {
-        self.words.iter()
-    }
-}
-
-struct WordSplit<'a> {
-    opts: &'a FmtOptions,
-    string: &'a str,
-    length: usize,
-    position: usize,
-    prev_punct: bool,
-}
-
-impl<'a> WordSplit<'a> {
-    fn analyze_tabs(&self, string: &str) -> (Option<usize>, usize, Option<usize>) {
-        // given a string, determine (length before tab) and (printed length after first tab)
-        // if there are no tabs, beforetab = -1 and aftertab is the printed length
-        let mut beforetab = None;
-        let mut aftertab = 0;
-        let mut word_start = None;
-        for (os, c) in string.char_indices() {
-            if !c.is_whitespace() {
-                word_start = Some(os);
-                break;
-            } else if c == '\t' {
-                if beforetab.is_none() {
-                    beforetab = Some(aftertab);
-                    aftertab = 0;
-                } else {
-                    aftertab = (aftertab / self.opts.tabwidth + 1) * self.opts.tabwidth;
-                }
-            } else {
-                aftertab += 1;
-            }
-        }
-        (beforetab, aftertab, word_start)
-    }
-}
-
-impl<'a> WordSplit<'a> {
-    fn new<'b>(opts: &'b FmtOptions, string: &'b str) -> WordSplit<'b> {
-        // wordsplits *must* start at a non-whitespace character
-        let trim_string = string.trim_start();
-        WordSplit {
-            opts,
-            string: trim_string,
-            length: string.len(),
-            position: 0,
-            prev_punct: false,
-        }
-    }
-
-    fn is_punctuation(c: char) -> bool {
-        matches!(c, '!' | '.' | '?')
-    }
-}
-
-pub struct WordInfo<'a> {
-    pub word: &'a str,
-    pub word_start: usize,
-    pub word_nchars: usize,
-    pub before_tab: Option<usize>,
-    pub after_tab: usize,
-    pub sentence_start: bool,
-    pub ends_punct: bool,
-    pub new_line: bool,
-}
-
-// returns (&str, is_start_of_sentence)
-impl<'a> Iterator for WordSplit<'a> {
-    type Item = WordInfo<'a>;
-
-    fn next(&mut self) -> Option<WordInfo<'a>> {
-        if self.position >= self.length {
-            return None;
-        }
-
-        let old_position = self.position;
-        let new_line = old_position == 0;
-
-        // find the start of the next word, and record if we find a tab character
-        let (before_tab, after_tab, word_start) =
-            match self.analyze_tabs(&self.string[old_position..]) {
-                (b, a, Some(s)) => (b, a, s + old_position),
-                (_, _, None) => {
-                    self.position = self.length;
-                    return None;
-                }
-            };
-
-        // find the beginning of the next whitespace
-        // note that this preserves the invariant that self.position
-        // points to whitespace character OR end of string
-        let mut word_nchars = 0;
-        self.position = match self.string[word_start..].find(|x: char| {
-            if x.is_whitespace() {
-                true
-            } else {
-                word_nchars += char_width(x);
-                false
-            }
-        }) {
-            None => self.length,
-            Some(s) => s + word_start,
-        };
-
-        let word_start_relative = word_start - old_position;
-        // if the previous sentence was punctuation and this sentence has >2 whitespace or one tab, is a new sentence.
-        let is_start_of_sentence =
-            self.prev_punct && (before_tab.is_some() || word_start_relative > 1);
-
-        // now record whether this word ends in punctuation
-        self.prev_punct = match self.string[..self.position].chars().next_back() {
-            Some(ch) => WordSplit::is_punctuation(ch),
-            _ => panic!("fatal: expected word not to be empty"),
-        };
-
-        let (word, word_start_relative, before_tab, after_tab) = if self.opts.uniform {
-            (&self.string[word_start..self.position], 0, None, 0)
-        } else {
-            (
-                &self.string[old_position..self.position],
-                word_start_relative,
-                before_tab,
-                after_tab,
-            )
-        };
-
-        Some(WordInfo {
-            word,
-            word_start: word_start_relative,
-            word_nchars,
-            before_tab,
-            after_tab,
-            sentence_start: is_start_of_sentence,
-            ends_punct: self.prev_punct,
-            new_line,
-        })
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_fold/fold.rs.html b/coreutils/dev/src/uu_fold/fold.rs.html deleted file mode 100644 index 294756cdd..000000000 --- a/coreutils/dev/src/uu_fold/fold.rs.html +++ /dev/null @@ -1,593 +0,0 @@ -fold.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDOs) ncount routput
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::fs::File;
-use std::io::{stdin, BufRead, BufReader, Read};
-use std::path::Path;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage};
-
-const TAB_WIDTH: usize = 8;
-
-const USAGE: &str = help_usage!("fold.md");
-const ABOUT: &str = help_about!("fold.md");
-
-mod options {
-    pub const BYTES: &str = "bytes";
-    pub const SPACES: &str = "spaces";
-    pub const WIDTH: &str = "width";
-    pub const FILE: &str = "file";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let (args, obs_width) = handle_obsolete(&args[..]);
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let bytes = matches.get_flag(options::BYTES);
-    let spaces = matches.get_flag(options::SPACES);
-    let poss_width = match matches.get_one::<String>(options::WIDTH) {
-        Some(v) => Some(v.to_owned()),
-        None => obs_width,
-    };
-
-    let width = match poss_width {
-        Some(inp_width) => inp_width.parse::<usize>().map_err(|e| {
-            USimpleError::new(
-                1,
-                format!("illegal width value ({}): {}", inp_width.quote(), e),
-            )
-        })?,
-        None => 80,
-    };
-
-    let files = match matches.get_many::<String>(options::FILE) {
-        Some(v) => v.map(|v| v.to_owned()).collect(),
-        None => vec!["-".to_owned()],
-    };
-
-    fold(&files, bytes, spaces, width)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::BYTES)
-                .long(options::BYTES)
-                .short('b')
-                .help(
-                    "count using bytes rather than columns (meaning control characters \
-                     such as newline are not treated specially)",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SPACES)
-                .long(options::SPACES)
-                .short('s')
-                .help("break lines at word boundaries rather than a hard cut-off")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::WIDTH)
-                .long(options::WIDTH)
-                .short('w')
-                .help("set WIDTH as the maximum line width rather than 80")
-                .value_name("WIDTH")
-                .allow_hyphen_values(true),
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-fn handle_obsolete(args: &[String]) -> (Vec<String>, Option<String>) {
-    for (i, arg) in args.iter().enumerate() {
-        let slice = &arg;
-        if slice.starts_with('-') && slice.chars().nth(1).map_or(false, |c| c.is_ascii_digit()) {
-            let mut v = args.to_vec();
-            v.remove(i);
-            return (v, Some(slice[1..].to_owned()));
-        }
-    }
-    (args.to_vec(), None)
-}
-
-fn fold(filenames: &[String], bytes: bool, spaces: bool, width: usize) -> UResult<()> {
-    for filename in filenames {
-        let filename: &str = filename;
-        let mut stdin_buf;
-        let mut file_buf;
-        let buffer = BufReader::new(if filename == "-" {
-            stdin_buf = stdin();
-            &mut stdin_buf as &mut dyn Read
-        } else {
-            file_buf = File::open(Path::new(filename)).map_err_context(|| filename.to_string())?;
-            &mut file_buf as &mut dyn Read
-        });
-
-        if bytes {
-            fold_file_bytewise(buffer, spaces, width)?;
-        } else {
-            fold_file(buffer, spaces, width)?;
-        }
-    }
-    Ok(())
-}
-
-/// Fold `file` to fit `width` (number of columns), counting all characters as
-/// one column.
-///
-/// This function handles folding for the `-b`/`--bytes` option, counting
-/// tab, backspace, and carriage return as occupying one column, identically
-/// to all other characters in the stream.
-///
-///  If `spaces` is `true`, attempt to break lines at whitespace boundaries.
-fn fold_file_bytewise<T: Read>(mut file: BufReader<T>, spaces: bool, width: usize) -> UResult<()> {
-    let mut line = String::new();
-
-    loop {
-        if file
-            .read_line(&mut line)
-            .map_err_context(|| "failed to read line".to_string())?
-            == 0
-        {
-            break;
-        }
-
-        if line == "\n" {
-            println!();
-            line.truncate(0);
-            continue;
-        }
-
-        let len = line.len();
-        let mut i = 0;
-
-        while i < len {
-            let width = if len - i >= width { width } else { len - i };
-            let slice = {
-                let slice = &line[i..i + width];
-                if spaces && i + width < len {
-                    match slice.rfind(|c: char| c.is_whitespace() && c != '\r') {
-                        Some(m) => &slice[..=m],
-                        None => slice,
-                    }
-                } else {
-                    slice
-                }
-            };
-
-            // Don't duplicate trailing newlines: if the slice is "\n", the
-            // previous iteration folded just before the end of the line and
-            // has already printed this newline.
-            if slice == "\n" {
-                break;
-            }
-
-            i += slice.len();
-
-            let at_eol = i >= len;
-
-            if at_eol {
-                print!("{slice}");
-            } else {
-                println!("{slice}");
-            }
-        }
-
-        line.truncate(0);
-    }
-
-    Ok(())
-}
-
-/// Fold `file` to fit `width` (number of columns).
-///
-/// By default `fold` treats tab, backspace, and carriage return specially:
-/// tab characters count as 8 columns, backspace decreases the
-/// column count, and carriage return resets the column count to 0.
-///
-/// If `spaces` is `true`, attempt to break lines at whitespace boundaries.
-#[allow(unused_assignments)]
-#[allow(clippy::cognitive_complexity)]
-fn fold_file<T: Read>(mut file: BufReader<T>, spaces: bool, width: usize) -> UResult<()> {
-    let mut line = String::new();
-    let mut output = String::new();
-    let mut col_count = 0;
-    let mut last_space = None;
-
-    /// Print the output line, resetting the column and character counts.
-    ///
-    /// If `spaces` is `true`, print the output line up to the last
-    /// encountered whitespace character (inclusive) and set the remaining
-    /// characters as the start of the next line.
-    macro_rules! emit_output {
-        () => {
-            let consume = match last_space {
-                Some(i) => i + 1,
-                None => output.len(),
-            };
-
-            println!("{}", &output[..consume]);
-            output.replace_range(..consume, "");
-
-            // we know there are no tabs left in output, so each char counts
-            // as 1 column
-            col_count = output.len();
-
-            last_space = None;
-        };
-    }
-
-    loop {
-        if file
-            .read_line(&mut line)
-            .map_err_context(|| "failed to read line".to_string())?
-            == 0
-        {
-            break;
-        }
-
-        for ch in line.chars() {
-            if ch == '\n' {
-                // make sure to _not_ split output at whitespace, since we
-                // know the entire output will fit
-                last_space = None;
-                emit_output!();
-                break;
-            }
-
-            if col_count >= width {
-                emit_output!();
-            }
-
-            match ch {
-                '\r' => col_count = 0,
-                '\t' => {
-                    let next_tab_stop = col_count + TAB_WIDTH - col_count % TAB_WIDTH;
-
-                    if next_tab_stop > width && !output.is_empty() {
-                        emit_output!();
-                    }
-
-                    col_count = next_tab_stop;
-                    last_space = if spaces { Some(output.len()) } else { None };
-                }
-                '\x08' => {
-                    col_count = col_count.saturating_sub(1);
-                }
-                _ if spaces && ch.is_whitespace() => {
-                    last_space = Some(output.len());
-                    col_count += 1;
-                }
-                _ => col_count += 1,
-            };
-
-            output.push(ch);
-        }
-
-        if !output.is_empty() {
-            print!("{output}");
-            output.truncate(0);
-        }
-
-        line.truncate(0);
-    }
-
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_groups/groups.rs.html b/coreutils/dev/src/uu_groups/groups.rs.html deleted file mode 100644 index 7e605bafe..000000000 --- a/coreutils/dev/src/uu_groups/groups.rs.html +++ /dev/null @@ -1,225 +0,0 @@ -groups.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-
// This file is part of the uutils coreutils package.
-//
-// (c) Alan Andrade <alan.andradec@gmail.com>
-// (c) Jian Zeng <anonymousknight96 AT gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-//
-// ============================================================================
-// Test suite summary for GNU coreutils 8.32.162-4eda
-// ============================================================================
-// PASS: tests/misc/groups-dash.sh
-// PASS: tests/misc/groups-process-all.sh
-// PASS: tests/misc/groups-version.sh
-
-// spell-checker:ignore (ToDO) passwd
-
-use std::error::Error;
-use std::fmt::Display;
-use uucore::{
-    display::Quotable,
-    entries::{get_groups_gnu, gid2grp, Locate, Passwd},
-    error::{UError, UResult},
-    format_usage, help_about, help_usage, show,
-};
-
-use clap::{crate_version, Arg, ArgAction, Command};
-
-mod options {
-    pub const USERS: &str = "USERNAME";
-}
-const ABOUT: &str = help_about!("groups.md");
-const USAGE: &str = help_usage!("groups.md");
-
-#[derive(Debug)]
-enum GroupsError {
-    GetGroupsFailed,
-    GroupNotFound(u32),
-    UserNotFound(String),
-}
-
-impl Error for GroupsError {}
-impl UError for GroupsError {}
-
-impl Display for GroupsError {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
-        match self {
-            Self::GetGroupsFailed => write!(f, "failed to fetch groups"),
-            Self::GroupNotFound(gid) => write!(f, "cannot find name for group ID {gid}"),
-            Self::UserNotFound(user) => write!(f, "{}: no such user", user.quote()),
-        }
-    }
-}
-
-fn infallible_gid2grp(gid: &u32) -> String {
-    match gid2grp(*gid) {
-        Ok(grp) => grp,
-        Err(_) => {
-            // The `show!()` macro sets the global exit code for the program.
-            show!(GroupsError::GroupNotFound(*gid));
-            gid.to_string()
-        }
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let users: Vec<String> = matches
-        .get_many::<String>(options::USERS)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    if users.is_empty() {
-        let gids = match get_groups_gnu(None) {
-            Ok(v) => v,
-            Err(_) => return Err(GroupsError::GetGroupsFailed.into()),
-        };
-        let groups: Vec<String> = gids.iter().map(infallible_gid2grp).collect();
-        println!("{}", groups.join(" "));
-        return Ok(());
-    }
-
-    for user in users {
-        match Passwd::locate(user.as_str()) {
-            Ok(p) => {
-                let groups: Vec<String> = p.belongs_to().iter().map(infallible_gid2grp).collect();
-                println!("{} : {}", user, groups.join(" "));
-            }
-            Err(_) => {
-                // The `show!()` macro sets the global exit code for the program.
-                show!(GroupsError::UserNotFound(user));
-            }
-        }
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::USERS)
-                .action(ArgAction::Append)
-                .value_name(options::USERS)
-                .value_hint(clap::ValueHint::Username),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_hashsum/hashsum.rs.html b/coreutils/dev/src/uu_hashsum/hashsum.rs.html deleted file mode 100644 index 318dec49c..000000000 --- a/coreutils/dev/src/uu_hashsum/hashsum.rs.html +++ /dev/null @@ -1,1631 +0,0 @@ -hashsum.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  * (c) Vsevolod Velichko <torkvemada@sorokdva.net>
-//  * (c) Gil Cottle <gcottle@redtown.org>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) algo, algoname, regexes, nread, nonames
-
-use clap::builder::ValueParser;
-use clap::crate_version;
-use clap::ArgAction;
-use clap::{Arg, ArgMatches, Command};
-use hex::encode;
-use regex::Captures;
-use regex::Regex;
-use std::cmp::Ordering;
-use std::error::Error;
-use std::ffi::{OsStr, OsString};
-use std::fs::File;
-use std::io::{self, stdin, BufRead, BufReader, Read};
-use std::iter;
-use std::num::ParseIntError;
-use std::path::Path;
-use uucore::error::{FromIo, UError, UResult};
-use uucore::sum::{
-    Blake2b, Blake3, Digest, DigestWriter, Md5, Sha1, Sha224, Sha256, Sha384, Sha3_224, Sha3_256,
-    Sha3_384, Sha3_512, Sha512, Shake128, Shake256,
-};
-use uucore::{crash, display::Quotable, show_warning};
-use uucore::{format_usage, help_about, help_usage};
-
-const NAME: &str = "hashsum";
-const ABOUT: &str = help_about!("hashsum.md");
-const USAGE: &str = help_usage!("hashsum.md");
-
-struct Options {
-    algoname: &'static str,
-    digest: Box<dyn Digest + 'static>,
-    binary: bool,
-    check: bool,
-    tag: bool,
-    nonames: bool,
-    status: bool,
-    quiet: bool,
-    strict: bool,
-    warn: bool,
-    output_bits: usize,
-    zero: bool,
-}
-
-/// Creates a Blake2b hasher instance based on the specified length argument.
-///
-/// # Returns
-///
-/// Returns a tuple containing the algorithm name, the hasher instance, and the output length in bits.
-///
-/// # Panics
-///
-/// Panics if the length is not a multiple of 8 or if it is greater than 512.
-fn create_blake2b(matches: &ArgMatches) -> (&'static str, Box<dyn Digest>, usize) {
-    match matches.get_one::<usize>("length") {
-        Some(0) | None => ("BLAKE2", Box::new(Blake2b::new()) as Box<dyn Digest>, 512),
-        Some(length_in_bits) => {
-            if *length_in_bits > 512 {
-                crash!(1, "Invalid length (maximum digest length is 512 bits)")
-            }
-
-            if length_in_bits % 8 == 0 {
-                let length_in_bytes = length_in_bits / 8;
-                (
-                    "BLAKE2",
-                    Box::new(Blake2b::with_output_bytes(length_in_bytes)),
-                    *length_in_bits,
-                )
-            } else {
-                crash!(1, "Invalid length (expected a multiple of 8)")
-            }
-        }
-    }
-}
-
-/// Creates a SHA3 hasher instance based on the specified bits argument.
-///
-/// # Returns
-///
-/// Returns a tuple containing the algorithm name, the hasher instance, and the output length in bits.
-///
-/// # Panics
-///
-/// Panics if an unsupported output size is provided, or if the `--bits` flag is missing.
-fn create_sha3(matches: &ArgMatches) -> (&'static str, Box<dyn Digest>, usize) {
-    match matches.get_one::<usize>("bits") {
-        Some(224) => (
-            "SHA3-224",
-            Box::new(Sha3_224::new()) as Box<dyn Digest>,
-            224,
-        ),
-        Some(256) => (
-            "SHA3-256",
-            Box::new(Sha3_256::new()) as Box<dyn Digest>,
-            256,
-        ),
-        Some(384) => (
-            "SHA3-384",
-            Box::new(Sha3_384::new()) as Box<dyn Digest>,
-            384,
-        ),
-        Some(512) => (
-            "SHA3-512",
-            Box::new(Sha3_512::new()) as Box<dyn Digest>,
-            512,
-        ),
-        Some(_) => crash!(
-            1,
-            "Invalid output size for SHA3 (expected 224, 256, 384, or 512)"
-        ),
-        None => crash!(1, "--bits required for SHA3"),
-    }
-}
-
-/// Creates a SHAKE-128 hasher instance based on the specified bits argument.
-///
-/// # Returns
-///
-/// Returns a tuple containing the algorithm name, the hasher instance, and the output length in bits.
-///
-/// # Panics
-///
-/// Panics if the `--bits` flag is missing.
-fn create_shake128(matches: &ArgMatches) -> (&'static str, Box<dyn Digest>, usize) {
-    match matches.get_one::<usize>("bits") {
-        Some(bits) => (
-            "SHAKE128",
-            Box::new(Shake128::new()) as Box<dyn Digest>,
-            *bits,
-        ),
-        None => crash!(1, "--bits required for SHAKE-128"),
-    }
-}
-
-/// Creates a SHAKE-256 hasher instance based on the specified bits argument.
-///
-/// # Returns
-///
-/// Returns a tuple containing the algorithm name, the hasher instance, and the output length in bits.
-///
-/// # Panics
-///
-/// Panics if the `--bits` flag is missing.
-fn create_shake256(matches: &ArgMatches) -> (&'static str, Box<dyn Digest>, usize) {
-    match matches.get_one::<usize>("bits") {
-        Some(bits) => (
-            "SHAKE256",
-            Box::new(Shake256::new()) as Box<dyn Digest>,
-            *bits,
-        ),
-        None => crash!(1, "--bits required for SHAKE-256"),
-    }
-}
-
-/// Detects the hash algorithm from the program name or command-line arguments.
-///
-/// # Arguments
-///
-/// * `program` - A string slice containing the program name.
-/// * `matches` - A reference to the `ArgMatches` object containing the command-line arguments.
-///
-/// # Returns
-///
-/// Returns a tuple containing the algorithm name, the hasher instance, and the output length in bits.
-fn detect_algo(
-    program: &str,
-    matches: &ArgMatches,
-) -> (&'static str, Box<dyn Digest + 'static>, usize) {
-    let (name, alg, output_bits) = match program {
-        "md5sum" => ("MD5", Box::new(Md5::new()) as Box<dyn Digest>, 128),
-        "sha1sum" => ("SHA1", Box::new(Sha1::new()) as Box<dyn Digest>, 160),
-        "sha224sum" => ("SHA224", Box::new(Sha224::new()) as Box<dyn Digest>, 224),
-        "sha256sum" => ("SHA256", Box::new(Sha256::new()) as Box<dyn Digest>, 256),
-        "sha384sum" => ("SHA384", Box::new(Sha384::new()) as Box<dyn Digest>, 384),
-        "sha512sum" => ("SHA512", Box::new(Sha512::new()) as Box<dyn Digest>, 512),
-        "b2sum" => create_blake2b(matches),
-        "b3sum" => ("BLAKE3", Box::new(Blake3::new()) as Box<dyn Digest>, 256),
-        "sha3sum" => create_sha3(matches),
-        "sha3-224sum" => (
-            "SHA3-224",
-            Box::new(Sha3_224::new()) as Box<dyn Digest>,
-            224,
-        ),
-        "sha3-256sum" => (
-            "SHA3-256",
-            Box::new(Sha3_256::new()) as Box<dyn Digest>,
-            256,
-        ),
-        "sha3-384sum" => (
-            "SHA3-384",
-            Box::new(Sha3_384::new()) as Box<dyn Digest>,
-            384,
-        ),
-        "sha3-512sum" => (
-            "SHA3-512",
-            Box::new(Sha3_512::new()) as Box<dyn Digest>,
-            512,
-        ),
-        "shake128sum" => create_shake128(matches),
-        "shake256sum" => create_shake256(matches),
-        _ => create_algorithm_from_flags(matches),
-    };
-    (name, alg, output_bits)
-}
-
-/// Creates a hasher instance based on the command-line flags.
-///
-/// # Arguments
-///
-/// * `matches` - A reference to the `ArgMatches` object containing the command-line arguments.
-///
-/// # Returns
-///
-/// Returns a tuple containing the algorithm name, the hasher instance, and the output length in bits.
-///
-/// # Panics
-///
-/// Panics if multiple hash algorithms are specified or if a required flag is missing.
-#[allow(clippy::cognitive_complexity)]
-fn create_algorithm_from_flags(matches: &ArgMatches) -> (&'static str, Box<dyn Digest>, usize) {
-    let mut alg: Option<Box<dyn Digest>> = None;
-    let mut name: &'static str = "";
-    let mut output_bits = 0;
-    let mut set_or_crash = |n, val, bits| {
-        if alg.is_some() {
-            crash!(1, "You cannot combine multiple hash algorithms!");
-        };
-        name = n;
-        alg = Some(val);
-        output_bits = bits;
-    };
-
-    if matches.get_flag("md5") {
-        set_or_crash("MD5", Box::new(Md5::new()), 128);
-    }
-    if matches.get_flag("sha1") {
-        set_or_crash("SHA1", Box::new(Sha1::new()), 160);
-    }
-    if matches.get_flag("sha224") {
-        set_or_crash("SHA224", Box::new(Sha224::new()), 224);
-    }
-    if matches.get_flag("sha256") {
-        set_or_crash("SHA256", Box::new(Sha256::new()), 256);
-    }
-    if matches.get_flag("sha384") {
-        set_or_crash("SHA384", Box::new(Sha384::new()), 384);
-    }
-    if matches.get_flag("sha512") {
-        set_or_crash("SHA512", Box::new(Sha512::new()), 512);
-    }
-    if matches.get_flag("b2sum") {
-        set_or_crash("BLAKE2", Box::new(Blake2b::new()), 512);
-    }
-    if matches.get_flag("b3sum") {
-        set_or_crash("BLAKE3", Box::new(Blake3::new()), 256);
-    }
-    if matches.get_flag("sha3") {
-        let (n, val, bits) = create_sha3(matches);
-        set_or_crash(n, val, bits);
-    }
-    if matches.get_flag("sha3-224") {
-        set_or_crash("SHA3-224", Box::new(Sha3_224::new()), 224);
-    }
-    if matches.get_flag("sha3-256") {
-        set_or_crash("SHA3-256", Box::new(Sha3_256::new()), 256);
-    }
-    if matches.get_flag("sha3-384") {
-        set_or_crash("SHA3-384", Box::new(Sha3_384::new()), 384);
-    }
-    if matches.get_flag("sha3-512") {
-        set_or_crash("SHA3-512", Box::new(Sha3_512::new()), 512);
-    }
-    if matches.get_flag("shake128") {
-        match matches.get_one::<usize>("bits") {
-            Some(bits) => set_or_crash("SHAKE128", Box::new(Shake128::new()), *bits),
-            None => crash!(1, "--bits required for SHAKE-128"),
-        }
-    }
-    if matches.get_flag("shake256") {
-        match matches.get_one::<usize>("bits") {
-            Some(bits) => set_or_crash("SHAKE256", Box::new(Shake256::new()), *bits),
-            None => crash!(1, "--bits required for SHAKE-256"),
-        }
-    }
-
-    let alg = alg.unwrap_or_else(|| crash!(1, "You must specify hash algorithm!"));
-    (name, alg, output_bits)
-}
-
-// TODO: return custom error type
-fn parse_bit_num(arg: &str) -> Result<usize, ParseIntError> {
-    arg.parse()
-}
-
-#[uucore::main]
-pub fn uumain(mut args: impl uucore::Args) -> UResult<()> {
-    // if there is no program name for some reason, default to "hashsum"
-    let program = args.next().unwrap_or_else(|| OsString::from(NAME));
-    let binary_name = Path::new(&program)
-        .file_stem()
-        .unwrap_or_else(|| OsStr::new(NAME))
-        .to_string_lossy();
-
-    let args = iter::once(program.clone()).chain(args);
-
-    // Default binary in Windows, text mode otherwise
-    let binary_flag_default = cfg!(windows);
-
-    let command = uu_app(&binary_name);
-
-    // FIXME: this should use try_get_matches_from() and crash!(), but at the moment that just
-    //        causes "error: " to be printed twice (once from crash!() and once from clap).  With
-    //        the current setup, the name of the utility is not printed, but I think this is at
-    //        least somewhat better from a user's perspective.
-    let matches = command.try_get_matches_from(args)?;
-
-    let (name, algo, bits) = detect_algo(&binary_name, &matches);
-
-    let binary = if matches.get_flag("binary") {
-        true
-    } else if matches.get_flag("text") {
-        false
-    } else {
-        binary_flag_default
-    };
-    let check = matches.get_flag("check");
-    let tag = matches.get_flag("tag");
-    let nonames = *matches
-        .try_get_one("no-names")
-        .unwrap_or(None)
-        .unwrap_or(&false);
-    let status = matches.get_flag("status");
-    let quiet = matches.get_flag("quiet") || status;
-    let strict = matches.get_flag("strict");
-    let warn = matches.get_flag("warn") && !status;
-    let zero = matches.get_flag("zero");
-
-    let opts = Options {
-        algoname: name,
-        digest: algo,
-        output_bits: bits,
-        binary,
-        check,
-        tag,
-        nonames,
-        status,
-        quiet,
-        strict,
-        warn,
-        zero,
-    };
-
-    match matches.get_many::<OsString>("FILE") {
-        Some(files) => hashsum(opts, files.map(|f| f.as_os_str())),
-        None => hashsum(opts, iter::once(OsStr::new("-"))),
-    }
-}
-
-pub fn uu_app_common() -> Command {
-    #[cfg(windows)]
-    const BINARY_HELP: &str = "read in binary mode (default)";
-    #[cfg(not(windows))]
-    const BINARY_HELP: &str = "read in binary mode";
-    #[cfg(windows)]
-    const TEXT_HELP: &str = "read in text mode";
-    #[cfg(not(windows))]
-    const TEXT_HELP: &str = "read in text mode (default)";
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new("binary")
-                .short('b')
-                .long("binary")
-                .help(BINARY_HELP)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("check")
-                .short('c')
-                .long("check")
-                .help("read hashsums from the FILEs and check them")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("tag")
-                .long("tag")
-                .help("create a BSD-style checksum")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("text")
-                .short('t')
-                .long("text")
-                .help(TEXT_HELP)
-                .conflicts_with("binary")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("quiet")
-                .short('q')
-                .long("quiet")
-                .help("don't print OK for each successfully verified file")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("status")
-                .short('s')
-                .long("status")
-                .help("don't output anything, status code shows success")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("strict")
-                .long("strict")
-                .help("exit non-zero for improperly formatted checksum lines")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("warn")
-                .short('w')
-                .long("warn")
-                .help("warn about improperly formatted checksum lines")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("zero")
-                .short('z')
-                .long("zero")
-                .help("end each output line with NUL, not newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("FILE")
-                .index(1)
-                .action(ArgAction::Append)
-                .value_name("FILE")
-                .value_hint(clap::ValueHint::FilePath)
-                .value_parser(ValueParser::os_string()),
-        )
-}
-
-pub fn uu_app_length() -> Command {
-    uu_app_opt_length(uu_app_common())
-}
-
-fn uu_app_opt_length(command: Command) -> Command {
-    command.arg(
-        Arg::new("length")
-            .short('l')
-            .long("length")
-            .help("digest length in bits; must not exceed the max for the blake2 algorithm (512) and must be a multiple of 8")
-            .value_name("BITS")
-            .value_parser(parse_bit_num),
-    )
-}
-
-pub fn uu_app_b3sum() -> Command {
-    uu_app_b3sum_opts(uu_app_common())
-}
-
-fn uu_app_b3sum_opts(command: Command) -> Command {
-    command.arg(
-        Arg::new("no-names")
-            .long("no-names")
-            .help("Omits filenames in the output (option not present in GNU/Coreutils)")
-            .action(ArgAction::SetTrue),
-    )
-}
-
-pub fn uu_app_bits() -> Command {
-    uu_app_opt_bits(uu_app_common())
-}
-
-fn uu_app_opt_bits(command: Command) -> Command {
-    // Needed for variable-length output sums (e.g. SHAKE)
-    command.arg(
-        Arg::new("bits")
-            .long("bits")
-            .help("set the size of the output (only for SHAKE)")
-            .value_name("BITS")
-            // XXX: should we actually use validators?  they're not particularly efficient
-            .value_parser(parse_bit_num),
-    )
-}
-
-pub fn uu_app_custom() -> Command {
-    let mut command = uu_app_b3sum_opts(uu_app_opt_bits(uu_app_common()));
-    let algorithms = &[
-        ("md5", "work with MD5"),
-        ("sha1", "work with SHA1"),
-        ("sha224", "work with SHA224"),
-        ("sha256", "work with SHA256"),
-        ("sha384", "work with SHA384"),
-        ("sha512", "work with SHA512"),
-        ("sha3", "work with SHA3"),
-        ("sha3-224", "work with SHA3-224"),
-        ("sha3-256", "work with SHA3-256"),
-        ("sha3-384", "work with SHA3-384"),
-        ("sha3-512", "work with SHA3-512"),
-        (
-            "shake128",
-            "work with SHAKE128 using BITS for the output size",
-        ),
-        (
-            "shake256",
-            "work with SHAKE256 using BITS for the output size",
-        ),
-        ("b2sum", "work with BLAKE2"),
-        ("b3sum", "work with BLAKE3"),
-    ];
-
-    for (name, desc) in algorithms {
-        command = command.arg(
-            Arg::new(*name)
-                .long(name)
-                .help(*desc)
-                .action(ArgAction::SetTrue),
-        );
-    }
-    command
-}
-
-// hashsum is handled differently in build.rs, therefore this is not the same
-// as in other utilities.
-fn uu_app(binary_name: &str) -> Command {
-    match binary_name {
-        // These all support the same options.
-        "md5sum" | "sha1sum" | "sha224sum" | "sha256sum" | "sha384sum" | "sha512sum" => {
-            uu_app_common()
-        }
-        // b2sum supports the md5sum options plus -l/--length.
-        "b2sum" => uu_app_length(),
-        // These have never been part of GNU Coreutils, but can function with the same
-        // options as md5sum.
-        "sha3-224sum" | "sha3-256sum" | "sha3-384sum" | "sha3-512sum" => uu_app_common(),
-        // These have never been part of GNU Coreutils, and require an additional --bits
-        // option to specify their output size.
-        "sha3sum" | "shake128sum" | "shake256sum" => uu_app_bits(),
-        // b3sum has never been part of GNU Coreutils, and has a --no-names option in
-        // addition to the b2sum options.
-        "b3sum" => uu_app_b3sum(),
-        // We're probably just being called as `hashsum`, so give them everything.
-        _ => uu_app_custom(),
-    }
-}
-
-#[derive(Debug)]
-enum HashsumError {
-    InvalidRegex,
-    InvalidFormat,
-}
-
-impl Error for HashsumError {}
-impl UError for HashsumError {}
-
-impl std::fmt::Display for HashsumError {
-    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
-        match self {
-            Self::InvalidRegex => write!(f, "invalid regular expression"),
-            Self::InvalidFormat => Ok(()),
-        }
-    }
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn hashsum<'a, I>(mut options: Options, files: I) -> UResult<()>
-where
-    I: Iterator<Item = &'a OsStr>,
-{
-    let mut bad_format = 0;
-    let mut failed_cksum = 0;
-    let mut failed_open_file = 0;
-    let binary_marker = if options.binary { "*" } else { " " };
-    for filename in files {
-        let filename = Path::new(filename);
-
-        let stdin_buf;
-        let file_buf;
-        let mut file = BufReader::new(if filename == OsStr::new("-") {
-            stdin_buf = stdin();
-            Box::new(stdin_buf) as Box<dyn Read>
-        } else {
-            file_buf =
-                File::open(filename).map_err_context(|| "failed to open file".to_string())?;
-            Box::new(file_buf) as Box<dyn Read>
-        });
-        if options.check {
-            // Set up Regexes for line validation and parsing
-            //
-            // First, we compute the number of bytes we expect to be in
-            // the digest string. If the algorithm has a variable number
-            // of output bits, then we use the `+` modifier in the
-            // regular expression, otherwise we use the `{n}` modifier,
-            // where `n` is the number of bytes.
-            let bytes = options.digest.output_bits() / 4;
-            let bytes_marker = if bytes > 0 {
-                format!("{{{bytes}}}")
-            } else {
-                "+".to_string()
-            };
-            // BSD reversed mode format is similar to the default mode, but doesn’t use a character to distinguish binary and text modes.
-            let mut bsd_reversed = None;
-
-            /// Creates a Regex for parsing lines based on the given format.
-            /// The default value of `gnu_re` created with this function has to be recreated
-            /// after the initial line has been parsed, as this line dictates the format
-            /// for the rest of them, and mixing of formats is disallowed.
-            fn gnu_re_template(
-                bytes_marker: &str,
-                format_marker: &str,
-            ) -> Result<Regex, HashsumError> {
-                Regex::new(&format!(
-                    r"^(?P<digest>[a-fA-F0-9]{bytes_marker}) {format_marker}(?P<fileName>.*)"
-                ))
-                .map_err(|_| HashsumError::InvalidRegex)
-            }
-            let mut gnu_re = gnu_re_template(&bytes_marker, r"(?P<binary>[ \*])?")?;
-            let bsd_re = Regex::new(&format!(
-                r"^{algorithm} \((?P<fileName>.*)\) = (?P<digest>[a-fA-F0-9]{digest_size})",
-                algorithm = options.algoname,
-                digest_size = bytes_marker,
-            ))
-            .map_err(|_| HashsumError::InvalidRegex)?;
-
-            fn handle_captures(
-                caps: &Captures,
-                bytes_marker: &str,
-                bsd_reversed: &mut Option<bool>,
-                gnu_re: &mut Regex,
-            ) -> Result<(String, String, bool), HashsumError> {
-                if bsd_reversed.is_none() {
-                    let is_bsd_reversed = caps.name("binary").is_none();
-                    let format_marker = if is_bsd_reversed {
-                        ""
-                    } else {
-                        r"(?P<binary>[ \*])"
-                    }
-                    .to_string();
-
-                    *bsd_reversed = Some(is_bsd_reversed);
-                    *gnu_re = gnu_re_template(bytes_marker, &format_marker)?;
-                }
-
-                Ok((
-                    caps.name("fileName").unwrap().as_str().to_string(),
-                    caps.name("digest").unwrap().as_str().to_ascii_lowercase(),
-                    if *bsd_reversed == Some(false) {
-                        caps.name("binary").unwrap().as_str() == "*"
-                    } else {
-                        false
-                    },
-                ))
-            }
-
-            let buffer = file;
-            for (i, maybe_line) in buffer.lines().enumerate() {
-                let line = match maybe_line {
-                    Ok(l) => l,
-                    Err(e) => return Err(e.map_err_context(|| "failed to read file".to_string())),
-                };
-                let (ck_filename, sum, binary_check) = match gnu_re.captures(&line) {
-                    Some(caps) => {
-                        handle_captures(&caps, &bytes_marker, &mut bsd_reversed, &mut gnu_re)?
-                    }
-                    None => match bsd_re.captures(&line) {
-                        Some(caps) => (
-                            caps.name("fileName").unwrap().as_str().to_string(),
-                            caps.name("digest").unwrap().as_str().to_ascii_lowercase(),
-                            true,
-                        ),
-                        None => {
-                            bad_format += 1;
-                            if options.strict {
-                                return Err(HashsumError::InvalidFormat.into());
-                            }
-                            if options.warn {
-                                show_warning!(
-                                    "{}: {}: improperly formatted {} checksum line",
-                                    filename.maybe_quote(),
-                                    i + 1,
-                                    options.algoname
-                                );
-                            }
-                            continue;
-                        }
-                    },
-                };
-                let f = match File::open(ck_filename.clone()) {
-                    Err(_) => {
-                        failed_open_file += 1;
-                        println!(
-                            "{}: {}: No such file or directory",
-                            uucore::util_name(),
-                            ck_filename
-                        );
-                        println!("{ck_filename}: FAILED open or read");
-                        continue;
-                    }
-                    Ok(file) => file,
-                };
-                let mut ckf = BufReader::new(Box::new(f) as Box<dyn Read>);
-                let real_sum = digest_reader(
-                    &mut options.digest,
-                    &mut ckf,
-                    binary_check,
-                    options.output_bits,
-                )
-                .map_err_context(|| "failed to read input".to_string())?
-                .to_ascii_lowercase();
-                // FIXME: Filenames with newlines should be treated specially.
-                // GNU appears to replace newlines by \n and backslashes by
-                // \\ and prepend a backslash (to the hash or filename) if it did
-                // this escaping.
-                // Different sorts of output (checking vs outputting hashes) may
-                // handle this differently. Compare carefully to GNU.
-                // If you can, try to preserve invalid unicode using OsStr(ing)Ext
-                // and display it using uucore::display::print_verbatim(). This is
-                // easier (and more important) on Unix than on Windows.
-                if sum == real_sum {
-                    if !options.quiet {
-                        println!("{ck_filename}: OK");
-                    }
-                } else {
-                    if !options.status {
-                        println!("{ck_filename}: FAILED");
-                    }
-                    failed_cksum += 1;
-                }
-            }
-        } else {
-            let sum = digest_reader(
-                &mut options.digest,
-                &mut file,
-                options.binary,
-                options.output_bits,
-            )
-            .map_err_context(|| "failed to read input".to_string())?;
-            if options.tag {
-                println!("{} ({:?}) = {}", options.algoname, filename.display(), sum);
-            } else if options.nonames {
-                println!("{sum}");
-            } else if options.zero {
-                print!("{} {}{}\0", sum, binary_marker, filename.display());
-            } else {
-                println!("{} {}{}", sum, binary_marker, filename.display());
-            }
-        }
-    }
-    if !options.status {
-        match bad_format.cmp(&1) {
-            Ordering::Equal => show_warning!("{} line is improperly formatted", bad_format),
-            Ordering::Greater => show_warning!("{} lines are improperly formatted", bad_format),
-            Ordering::Less => {}
-        };
-        if failed_cksum > 0 {
-            show_warning!("{} computed checksum did NOT match", failed_cksum);
-        }
-        match failed_open_file.cmp(&1) {
-            Ordering::Equal => show_warning!("{} listed file could not be read", failed_open_file),
-            Ordering::Greater => {
-                show_warning!("{} listed files could not be read", failed_open_file);
-            }
-            Ordering::Less => {}
-        }
-    }
-
-    Ok(())
-}
-
-fn digest_reader<T: Read>(
-    digest: &mut Box<dyn Digest>,
-    reader: &mut BufReader<T>,
-    binary: bool,
-    output_bits: usize,
-) -> io::Result<String> {
-    digest.reset();
-
-    // Read bytes from `reader` and write those bytes to `digest`.
-    //
-    // If `binary` is `false` and the operating system is Windows, then
-    // `DigestWriter` replaces "\r\n" with "\n" before it writes the
-    // bytes into `digest`. Otherwise, it just inserts the bytes as-is.
-    //
-    // In order to support replacing "\r\n", we must call `finalize()`
-    // in order to support the possibility that the last character read
-    // from the reader was "\r". (This character gets buffered by
-    // `DigestWriter` and only written if the following character is
-    // "\n". But when "\r" is the last character read, we need to force
-    // it to be written.)
-    let mut digest_writer = DigestWriter::new(digest, binary);
-    std::io::copy(reader, &mut digest_writer)?;
-    digest_writer.finalize();
-
-    if digest.output_bits() > 0 {
-        Ok(digest.result_str())
-    } else {
-        // Assume it's SHAKE.  result_str() doesn't work with shake (as of 8/30/2016)
-        let mut bytes = Vec::new();
-        bytes.resize((output_bits + 7) / 8, 0);
-        digest.hash_finalize(&mut bytes);
-        Ok(encode(bytes))
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_head/head.rs.html b/coreutils/dev/src/uu_head/head.rs.html deleted file mode 100644 index 53808ed09..000000000 --- a/coreutils/dev/src/uu_head/head.rs.html +++ /dev/null @@ -1,1277 +0,0 @@ -head.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (vars) zlines BUFWRITER seekable
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-use std::ffi::OsString;
-use std::io::{self, BufWriter, ErrorKind, Read, Seek, SeekFrom, Write};
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UError, UResult, USimpleError};
-use uucore::line_ending::LineEnding;
-use uucore::lines::lines;
-use uucore::{format_usage, help_about, help_usage, show};
-
-const BUF_SIZE: usize = 65536;
-
-/// The capacity in bytes for buffered writers.
-const BUFWRITER_CAPACITY: usize = 16_384; // 16 kilobytes
-
-const ABOUT: &str = help_about!("head.md");
-const USAGE: &str = help_usage!("head.md");
-
-mod options {
-    pub const BYTES_NAME: &str = "BYTES";
-    pub const LINES_NAME: &str = "LINES";
-    pub const QUIET_NAME: &str = "QUIET";
-    pub const VERBOSE_NAME: &str = "VERBOSE";
-    pub const ZERO_NAME: &str = "ZERO";
-    pub const FILES_NAME: &str = "FILE";
-    pub const PRESUME_INPUT_PIPE: &str = "-PRESUME-INPUT-PIPE";
-}
-mod parse;
-mod take;
-use take::take_all_but;
-use take::take_lines;
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::BYTES_NAME)
-                .short('c')
-                .long("bytes")
-                .value_name("[-]NUM")
-                .help(
-                    "\
-                     print the first NUM bytes of each file;\n\
-                     with the leading '-', print all but the last\n\
-                     NUM bytes of each file\
-                     ",
-                )
-                .overrides_with_all([options::BYTES_NAME, options::LINES_NAME])
-                .allow_hyphen_values(true),
-        )
-        .arg(
-            Arg::new(options::LINES_NAME)
-                .short('n')
-                .long("lines")
-                .value_name("[-]NUM")
-                .help(
-                    "\
-                     print the first NUM lines instead of the first 10;\n\
-                     with the leading '-', print all but the last\n\
-                     NUM lines of each file\
-                     ",
-                )
-                .overrides_with_all([options::LINES_NAME, options::BYTES_NAME])
-                .allow_hyphen_values(true),
-        )
-        .arg(
-            Arg::new(options::QUIET_NAME)
-                .short('q')
-                .long("quiet")
-                .visible_alias("silent")
-                .help("never print headers giving file names")
-                .overrides_with_all([options::VERBOSE_NAME, options::QUIET_NAME])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::VERBOSE_NAME)
-                .short('v')
-                .long("verbose")
-                .help("always print headers giving file names")
-                .overrides_with_all([options::QUIET_NAME, options::VERBOSE_NAME])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PRESUME_INPUT_PIPE)
-                .long("presume-input-pipe")
-                .alias("-presume-input-pipe")
-                .hide(true)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ZERO_NAME)
-                .short('z')
-                .long("zero-terminated")
-                .help("line delimiter is NUL, not newline")
-                .overrides_with(options::ZERO_NAME)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILES_NAME)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-#[derive(Debug, PartialEq)]
-enum Mode {
-    FirstLines(u64),
-    AllButLastLines(u64),
-    FirstBytes(u64),
-    AllButLastBytes(u64),
-}
-
-impl Default for Mode {
-    fn default() -> Self {
-        Self::FirstLines(10)
-    }
-}
-
-impl Mode {
-    fn from(matches: &ArgMatches) -> Result<Self, String> {
-        if let Some(v) = matches.get_one::<String>(options::BYTES_NAME) {
-            let (n, all_but_last) =
-                parse::parse_num(v).map_err(|err| format!("invalid number of bytes: {err}"))?;
-            if all_but_last {
-                Ok(Self::AllButLastBytes(n))
-            } else {
-                Ok(Self::FirstBytes(n))
-            }
-        } else if let Some(v) = matches.get_one::<String>(options::LINES_NAME) {
-            let (n, all_but_last) =
-                parse::parse_num(v).map_err(|err| format!("invalid number of lines: {err}"))?;
-            if all_but_last {
-                Ok(Self::AllButLastLines(n))
-            } else {
-                Ok(Self::FirstLines(n))
-            }
-        } else {
-            Ok(Self::default())
-        }
-    }
-}
-
-fn arg_iterate<'a>(
-    mut args: impl uucore::Args + 'a,
-) -> UResult<Box<dyn Iterator<Item = OsString> + 'a>> {
-    // argv[0] is always present
-    let first = args.next().unwrap();
-    if let Some(second) = args.next() {
-        if let Some(s) = second.to_str() {
-            match parse::parse_obsolete(s) {
-                Some(Ok(iter)) => Ok(Box::new(vec![first].into_iter().chain(iter).chain(args))),
-                Some(Err(e)) => match e {
-                    parse::ParseError::Syntax => Err(USimpleError::new(
-                        1,
-                        format!("bad argument format: {}", s.quote()),
-                    )),
-                    parse::ParseError::Overflow => Err(USimpleError::new(
-                        1,
-                        format!(
-                            "invalid argument: {} Value too large for defined datatype",
-                            s.quote()
-                        ),
-                    )),
-                },
-                None => Ok(Box::new(vec![first, second].into_iter().chain(args))),
-            }
-        } else {
-            Err(USimpleError::new(1, "bad argument encoding".to_owned()))
-        }
-    } else {
-        Ok(Box::new(vec![first].into_iter()))
-    }
-}
-
-#[derive(Debug, PartialEq, Default)]
-struct HeadOptions {
-    pub quiet: bool,
-    pub verbose: bool,
-    pub line_ending: LineEnding,
-    pub presume_input_pipe: bool,
-    pub mode: Mode,
-    pub files: Vec<String>,
-}
-
-impl HeadOptions {
-    ///Construct options from matches
-    pub fn get_from(matches: &clap::ArgMatches) -> Result<Self, String> {
-        let mut options = Self::default();
-
-        options.quiet = matches.get_flag(options::QUIET_NAME);
-        options.verbose = matches.get_flag(options::VERBOSE_NAME);
-        options.line_ending = LineEnding::from_zero_flag(matches.get_flag(options::ZERO_NAME));
-        options.presume_input_pipe = matches.get_flag(options::PRESUME_INPUT_PIPE);
-
-        options.mode = Mode::from(matches)?;
-
-        options.files = match matches.get_many::<String>(options::FILES_NAME) {
-            Some(v) => v.map(|s| s.to_owned()).collect(),
-            None => vec!["-".to_owned()],
-        };
-        //println!("{:#?}", options);
-        Ok(options)
-    }
-}
-
-fn read_n_bytes<R>(input: R, n: u64) -> std::io::Result<()>
-where
-    R: Read,
-{
-    // Read the first `n` bytes from the `input` reader.
-    let mut reader = input.take(n);
-
-    // Write those bytes to `stdout`.
-    let stdout = std::io::stdout();
-    let mut stdout = stdout.lock();
-
-    io::copy(&mut reader, &mut stdout)?;
-
-    Ok(())
-}
-
-fn read_n_lines(input: &mut impl std::io::BufRead, n: u64, separator: u8) -> std::io::Result<()> {
-    // Read the first `n` lines from the `input` reader.
-    let mut reader = take_lines(input, n, separator);
-
-    // Write those bytes to `stdout`.
-    let stdout = std::io::stdout();
-    let stdout = stdout.lock();
-    let mut writer = BufWriter::with_capacity(BUFWRITER_CAPACITY, stdout);
-
-    io::copy(&mut reader, &mut writer)?;
-
-    Ok(())
-}
-
-fn read_but_last_n_bytes(input: &mut impl std::io::BufRead, n: usize) -> std::io::Result<()> {
-    if n == 0 {
-        //prints everything
-        return read_n_bytes(input, std::u64::MAX);
-    }
-
-    let stdout = std::io::stdout();
-    let mut stdout = stdout.lock();
-
-    let mut ring_buffer = vec![0u8; n];
-
-    // first we fill the ring buffer
-    if let Err(e) = input.read_exact(&mut ring_buffer) {
-        if e.kind() == ErrorKind::UnexpectedEof {
-            return Ok(());
-        } else {
-            return Err(e);
-        }
-    }
-    let mut buffer = [0u8; BUF_SIZE];
-    loop {
-        let read = loop {
-            match input.read(&mut buffer) {
-                Ok(n) => break n,
-                Err(e) => match e.kind() {
-                    ErrorKind::Interrupted => {}
-                    _ => return Err(e),
-                },
-            }
-        };
-        if read == 0 {
-            return Ok(());
-        } else if read >= n {
-            stdout.write_all(&ring_buffer)?;
-            stdout.write_all(&buffer[..read - n])?;
-            for i in 0..n {
-                ring_buffer[i] = buffer[read - n + i];
-            }
-        } else {
-            stdout.write_all(&ring_buffer[..read])?;
-            for i in 0..n - read {
-                ring_buffer[i] = ring_buffer[read + i];
-            }
-            ring_buffer[n - read..].copy_from_slice(&buffer[..read]);
-        }
-    }
-}
-
-fn read_but_last_n_lines(
-    input: impl std::io::BufRead,
-    n: usize,
-    separator: u8,
-) -> std::io::Result<()> {
-    let stdout = std::io::stdout();
-    let mut stdout = stdout.lock();
-    for bytes in take_all_but(lines(input, separator), n) {
-        stdout.write_all(&bytes?)?;
-    }
-    Ok(())
-}
-
-/// Return the index in `input` just after the `n`th line from the end.
-///
-/// If `n` exceeds the number of lines in this file, then return 0.
-///
-/// The cursor must be at the start of the seekable input before
-/// calling this function. This function rewinds the cursor to the
-/// beginning of the input just before returning unless there is an
-/// I/O error.
-///
-/// If `zeroed` is `false`, interpret the newline character `b'\n'` as
-/// a line ending. If `zeroed` is `true`, interpret the null character
-/// `b'\0'` as a line ending instead.
-///
-/// # Errors
-///
-/// This function returns an error if there is a problem seeking
-/// through or reading the input.
-///
-/// # Examples
-///
-/// The function returns the index of the byte immediately following
-/// the line ending character of the `n`th line from the end of the
-/// input:
-///
-/// ```rust,ignore
-/// let mut input = Cursor::new("x\ny\nz\n");
-/// assert_eq!(find_nth_line_from_end(&mut input, 0, false).unwrap(), 6);
-/// assert_eq!(find_nth_line_from_end(&mut input, 1, false).unwrap(), 4);
-/// assert_eq!(find_nth_line_from_end(&mut input, 2, false).unwrap(), 2);
-/// ```
-///
-/// If `n` exceeds the number of lines in the file, always return 0:
-///
-/// ```rust,ignore
-/// let mut input = Cursor::new("x\ny\nz\n");
-/// assert_eq!(find_nth_line_from_end(&mut input, 3, false).unwrap(), 0);
-/// assert_eq!(find_nth_line_from_end(&mut input, 4, false).unwrap(), 0);
-/// assert_eq!(find_nth_line_from_end(&mut input, 1000, false).unwrap(), 0);
-/// ```
-fn find_nth_line_from_end<R>(input: &mut R, n: u64, separator: u8) -> std::io::Result<u64>
-where
-    R: Read + Seek,
-{
-    let size = input.seek(SeekFrom::End(0))?;
-
-    let mut buffer = [0u8; BUF_SIZE];
-    let buf_size: usize = (BUF_SIZE as u64).min(size).try_into().unwrap();
-    let buffer = &mut buffer[..buf_size];
-
-    let mut i = 0u64;
-    let mut lines = 0u64;
-
-    loop {
-        // the casts here are ok, `buffer.len()` should never be above a few k
-        input.seek(SeekFrom::Current(
-            -((buffer.len() as i64).min((size - i) as i64)),
-        ))?;
-        input.read_exact(buffer)?;
-        for byte in buffer.iter().rev() {
-            if byte == &separator {
-                lines += 1;
-            }
-            // if it were just `n`,
-            if lines == n + 1 {
-                input.rewind()?;
-                return Ok(size - i);
-            }
-            i += 1;
-        }
-        if size - i == 0 {
-            input.rewind()?;
-            return Ok(0);
-        }
-    }
-}
-
-fn head_backwards_file(input: &mut std::fs::File, options: &HeadOptions) -> std::io::Result<()> {
-    match options.mode {
-        Mode::AllButLastBytes(n) => {
-            let size = input.metadata()?.len();
-            if n >= size {
-                return Ok(());
-            } else {
-                read_n_bytes(
-                    &mut std::io::BufReader::with_capacity(BUF_SIZE, input),
-                    size - n,
-                )?;
-            }
-        }
-        Mode::AllButLastLines(n) => {
-            let found = find_nth_line_from_end(input, n, options.line_ending.into())?;
-            read_n_bytes(
-                &mut std::io::BufReader::with_capacity(BUF_SIZE, input),
-                found,
-            )?;
-        }
-        _ => unreachable!(),
-    }
-    Ok(())
-}
-
-fn head_file(input: &mut std::fs::File, options: &HeadOptions) -> std::io::Result<()> {
-    match options.mode {
-        Mode::FirstBytes(n) => {
-            read_n_bytes(&mut std::io::BufReader::with_capacity(BUF_SIZE, input), n)
-        }
-        Mode::FirstLines(n) => read_n_lines(
-            &mut std::io::BufReader::with_capacity(BUF_SIZE, input),
-            n,
-            options.line_ending.into(),
-        ),
-        Mode::AllButLastBytes(_) | Mode::AllButLastLines(_) => head_backwards_file(input, options),
-    }
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn uu_head(options: &HeadOptions) -> UResult<()> {
-    let mut first = true;
-    for file in &options.files {
-        let res = match (file.as_str(), options.presume_input_pipe) {
-            (_, true) | ("-", false) => {
-                if (options.files.len() > 1 && !options.quiet) || options.verbose {
-                    if !first {
-                        println!();
-                    }
-                    println!("==> standard input <==");
-                }
-                let stdin = std::io::stdin();
-                let mut stdin = stdin.lock();
-
-                // Outputting "all-but-last" requires us to use a ring buffer with size n, so n
-                // must be converted from u64 to usize to fit in memory. If such conversion fails,
-                // it means the platform doesn't have enough memory to hold the buffer, so we fail.
-                if let Mode::AllButLastLines(n) | Mode::AllButLastBytes(n) = options.mode {
-                    if let Err(e) = usize::try_from(n) {
-                        show!(USimpleError::new(
-                            1,
-                            format!("{e}: number of bytes is too large")
-                        ));
-                        continue;
-                    };
-                };
-
-                match options.mode {
-                    Mode::FirstBytes(n) => read_n_bytes(&mut stdin, n),
-                    // unwrap is guaranteed to succeed because we checked the value of n above
-                    Mode::AllButLastBytes(n) => {
-                        read_but_last_n_bytes(&mut stdin, n.try_into().unwrap())
-                    }
-                    Mode::FirstLines(n) => read_n_lines(&mut stdin, n, options.line_ending.into()),
-                    // unwrap is guaranteed to succeed because we checked the value of n above
-                    Mode::AllButLastLines(n) => read_but_last_n_lines(
-                        &mut stdin,
-                        n.try_into().unwrap(),
-                        options.line_ending.into(),
-                    ),
-                }
-            }
-            (name, false) => {
-                let mut file = match std::fs::File::open(name) {
-                    Ok(f) => f,
-                    Err(err) => {
-                        show!(err.map_err_context(|| format!(
-                            "cannot open {} for reading",
-                            name.quote()
-                        )));
-                        continue;
-                    }
-                };
-                if (options.files.len() > 1 && !options.quiet) || options.verbose {
-                    if !first {
-                        println!();
-                    }
-                    println!("==> {name} <==");
-                }
-                head_file(&mut file, options)
-            }
-        };
-        if res.is_err() {
-            let name = if file.as_str() == "-" {
-                "standard input"
-            } else {
-                file
-            };
-            show!(USimpleError::new(
-                1,
-                format!("error reading {name}: Input/output error")
-            ));
-        }
-        first = false;
-    }
-    // Even though this is returning `Ok`, it is possible that a call
-    // to `show!()` and thus a call to `set_exit_code()` has been
-    // called above. If that happens, then this process will exit with
-    // a non-zero exit code.
-    Ok(())
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(arg_iterate(args)?)?;
-    let args = match HeadOptions::get_from(&matches) {
-        Ok(o) => o,
-        Err(s) => {
-            return Err(USimpleError::new(1, s));
-        }
-    };
-    uu_head(&args)
-}
-
-#[cfg(test)]
-mod tests {
-    use std::ffi::OsString;
-    use std::io::Cursor;
-
-    use super::*;
-    fn options(args: &str) -> Result<HeadOptions, String> {
-        let combined = "head ".to_owned() + args;
-        let args = combined.split_whitespace().map(OsString::from);
-        let matches = uu_app()
-            .get_matches_from(arg_iterate(args).map_err(|_| String::from("Arg iterate failed"))?);
-        HeadOptions::get_from(&matches)
-    }
-    #[test]
-    fn test_args_modes() {
-        let args = options("-n -10M -vz").unwrap();
-        assert_eq!(args.line_ending, LineEnding::Nul);
-        assert!(args.verbose);
-        assert_eq!(args.mode, Mode::AllButLastLines(10 * 1024 * 1024));
-    }
-    #[test]
-    fn test_gnu_compatibility() {
-        let args = options("-n 1 -c 1 -n 5 -c kiB -vqvqv").unwrap(); // spell-checker:disable-line
-        assert!(args.mode == Mode::FirstBytes(1024));
-        assert!(args.verbose);
-        assert_eq!(options("-5").unwrap().mode, Mode::FirstLines(5));
-        assert_eq!(options("-2b").unwrap().mode, Mode::FirstBytes(1024));
-        assert_eq!(options("-5 -c 1").unwrap().mode, Mode::FirstBytes(1));
-    }
-    #[test]
-    fn all_args_test() {
-        assert!(options("--silent").unwrap().quiet);
-        assert!(options("--quiet").unwrap().quiet);
-        assert!(options("-q").unwrap().quiet);
-        assert!(options("--verbose").unwrap().verbose);
-        assert!(options("-v").unwrap().verbose);
-        assert_eq!(
-            options("--zero-terminated").unwrap().line_ending,
-            LineEnding::Nul
-        );
-        assert_eq!(options("-z").unwrap().line_ending, LineEnding::Nul);
-        assert_eq!(options("--lines 15").unwrap().mode, Mode::FirstLines(15));
-        assert_eq!(options("-n 15").unwrap().mode, Mode::FirstLines(15));
-        assert_eq!(options("--bytes 15").unwrap().mode, Mode::FirstBytes(15));
-        assert_eq!(options("-c 15").unwrap().mode, Mode::FirstBytes(15));
-    }
-    #[test]
-    fn test_options_errors() {
-        assert!(options("-n IsThisTheRealLife?").is_err());
-        assert!(options("-c IsThisJustFantasy").is_err());
-    }
-    #[test]
-    fn test_options_correct_defaults() {
-        let opts = HeadOptions::default();
-
-        assert!(!opts.verbose);
-        assert!(!opts.quiet);
-        assert_eq!(opts.line_ending, LineEnding::Newline);
-        assert_eq!(opts.mode, Mode::FirstLines(10));
-        assert!(opts.files.is_empty());
-    }
-    fn arg_outputs(src: &str) -> Result<String, ()> {
-        let split = src.split_whitespace().map(OsString::from);
-        match arg_iterate(split) {
-            Ok(args) => {
-                let vec = args
-                    .map(|s| s.to_str().unwrap().to_owned())
-                    .collect::<Vec<_>>();
-                Ok(vec.join(" "))
-            }
-            Err(_) => Err(()),
-        }
-    }
-    #[test]
-    fn test_arg_iterate() {
-        // test that normal args remain unchanged
-        assert_eq!(
-            arg_outputs("head -n -5 -zv"),
-            Ok("head -n -5 -zv".to_owned())
-        );
-        // tests that nonsensical args are unchanged
-        assert_eq!(
-            arg_outputs("head -to_be_or_not_to_be,..."),
-            Ok("head -to_be_or_not_to_be,...".to_owned())
-        );
-        //test that the obsolete syntax is unrolled
-        assert_eq!(
-            arg_outputs("head -123qvqvqzc"), // spell-checker:disable-line
-            Ok("head -q -z -c 123".to_owned())
-        );
-        //test that bad obsoletes are an error
-        assert!(arg_outputs("head -123FooBar").is_err());
-        //test overflow
-        assert!(arg_outputs("head -100000000000000000000000000000000000000000").is_err());
-        //test that empty args remain unchanged
-        assert_eq!(arg_outputs("head"), Ok("head".to_owned()));
-    }
-    #[test]
-    #[cfg(target_os = "linux")]
-    fn test_arg_iterate_bad_encoding() {
-        use std::os::unix::ffi::OsStringExt;
-        let invalid = OsString::from_vec(vec![b'\x80', b'\x81']);
-        // this arises from a conversion from OsString to &str
-        assert!(arg_iterate(vec![OsString::from("head"), invalid].into_iter()).is_err());
-    }
-    #[test]
-    fn read_early_exit() {
-        let mut empty = std::io::BufReader::new(std::io::Cursor::new(Vec::new()));
-        assert!(read_n_bytes(&mut empty, 0).is_ok());
-        assert!(read_n_lines(&mut empty, 0, b'\n').is_ok());
-    }
-
-    #[test]
-    fn test_find_nth_line_from_end() {
-        let mut input = Cursor::new("x\ny\nz\n");
-        assert_eq!(find_nth_line_from_end(&mut input, 0, b'\n').unwrap(), 6);
-        assert_eq!(find_nth_line_from_end(&mut input, 1, b'\n').unwrap(), 4);
-        assert_eq!(find_nth_line_from_end(&mut input, 2, b'\n').unwrap(), 2);
-        assert_eq!(find_nth_line_from_end(&mut input, 3, b'\n').unwrap(), 0);
-        assert_eq!(find_nth_line_from_end(&mut input, 4, b'\n').unwrap(), 0);
-        assert_eq!(find_nth_line_from_end(&mut input, 1000, b'\n').unwrap(), 0);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_head/parse.rs.html b/coreutils/dev/src/uu_head/parse.rs.html deleted file mode 100644 index ec43dc4e0..000000000 --- a/coreutils/dev/src/uu_head/parse.rs.html +++ /dev/null @@ -1,379 +0,0 @@ -parse.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use std::ffi::OsString;
-use uucore::parse_size::{parse_size, ParseSizeError};
-
-#[derive(PartialEq, Eq, Debug)]
-pub enum ParseError {
-    Syntax,
-    Overflow,
-}
-/// Parses obsolete syntax
-/// head -NUM\[kmzv\] // spell-checker:disable-line
-#[allow(clippy::cognitive_complexity)]
-pub fn parse_obsolete(src: &str) -> Option<Result<impl Iterator<Item = OsString>, ParseError>> {
-    let mut chars = src.char_indices();
-    if let Some((_, '-')) = chars.next() {
-        let mut num_end = 0usize;
-        let mut has_num = false;
-        let mut last_char = 0 as char;
-        for (n, c) in &mut chars {
-            if c.is_ascii_digit() {
-                has_num = true;
-                num_end = n;
-            } else {
-                last_char = c;
-                break;
-            }
-        }
-        if has_num {
-            match src[1..=num_end].parse::<usize>() {
-                Ok(num) => {
-                    let mut quiet = false;
-                    let mut verbose = false;
-                    let mut zero_terminated = false;
-                    let mut multiplier = None;
-                    let mut c = last_char;
-                    loop {
-                        // not that here, we only match lower case 'k', 'c', and 'm'
-                        match c {
-                            // we want to preserve order
-                            // this also saves us 1 heap allocation
-                            'q' => {
-                                quiet = true;
-                                verbose = false;
-                            }
-                            'v' => {
-                                verbose = true;
-                                quiet = false;
-                            }
-                            'z' => zero_terminated = true,
-                            'c' => multiplier = Some(1),
-                            'b' => multiplier = Some(512),
-                            'k' => multiplier = Some(1024),
-                            'm' => multiplier = Some(1024 * 1024),
-                            '\0' => {}
-                            _ => return Some(Err(ParseError::Syntax)),
-                        }
-                        if let Some((_, next)) = chars.next() {
-                            c = next;
-                        } else {
-                            break;
-                        }
-                    }
-                    let mut options = Vec::new();
-                    if quiet {
-                        options.push(OsString::from("-q"));
-                    }
-                    if verbose {
-                        options.push(OsString::from("-v"));
-                    }
-                    if zero_terminated {
-                        options.push(OsString::from("-z"));
-                    }
-                    if let Some(n) = multiplier {
-                        options.push(OsString::from("-c"));
-                        let num = match num.checked_mul(n) {
-                            Some(n) => n,
-                            None => return Some(Err(ParseError::Overflow)),
-                        };
-                        options.push(OsString::from(format!("{num}")));
-                    } else {
-                        options.push(OsString::from("-n"));
-                        options.push(OsString::from(format!("{num}")));
-                    }
-                    Some(Ok(options.into_iter()))
-                }
-                Err(_) => Some(Err(ParseError::Overflow)),
-            }
-        } else {
-            None
-        }
-    } else {
-        None
-    }
-}
-/// Parses an -c or -n argument,
-/// the bool specifies whether to read from the end
-pub fn parse_num(src: &str) -> Result<(u64, bool), ParseSizeError> {
-    let mut size_string = src.trim();
-    let mut all_but_last = false;
-
-    if let Some(c) = size_string.chars().next() {
-        if c == '+' || c == '-' {
-            // head: '+' is not documented (8.32 man pages)
-            size_string = &size_string[1..];
-            if c == '-' {
-                all_but_last = true;
-            }
-        }
-    } else {
-        return Err(ParseSizeError::ParseFailure(src.to_string()));
-    }
-
-    // remove leading zeros so that size is interpreted as decimal, not octal
-    let trimmed_string = size_string.trim_start_matches('0');
-    if trimmed_string.is_empty() {
-        Ok((0, all_but_last))
-    } else {
-        parse_size(trimmed_string).map(|n| (n, all_but_last))
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    fn obsolete(src: &str) -> Option<Result<Vec<String>, ParseError>> {
-        let r = parse_obsolete(src);
-        match r {
-            Some(s) => match s {
-                Ok(v) => Some(Ok(v.map(|s| s.to_str().unwrap().to_owned()).collect())),
-                Err(e) => Some(Err(e)),
-            },
-            None => None,
-        }
-    }
-    fn obsolete_result(src: &[&str]) -> Option<Result<Vec<String>, ParseError>> {
-        Some(Ok(src.iter().map(|s| s.to_string()).collect()))
-    }
-    #[test]
-    fn test_parse_numbers_obsolete() {
-        assert_eq!(obsolete("-5"), obsolete_result(&["-n", "5"]));
-        assert_eq!(obsolete("-100"), obsolete_result(&["-n", "100"]));
-        assert_eq!(obsolete("-5m"), obsolete_result(&["-c", "5242880"]));
-        assert_eq!(obsolete("-1k"), obsolete_result(&["-c", "1024"]));
-        assert_eq!(obsolete("-2b"), obsolete_result(&["-c", "1024"]));
-        assert_eq!(obsolete("-1mmk"), obsolete_result(&["-c", "1024"]));
-        assert_eq!(obsolete("-1vz"), obsolete_result(&["-v", "-z", "-n", "1"]));
-        assert_eq!(
-            obsolete("-1vzqvq"), // spell-checker:disable-line
-            obsolete_result(&["-q", "-z", "-n", "1"])
-        );
-        assert_eq!(obsolete("-1vzc"), obsolete_result(&["-v", "-z", "-c", "1"]));
-        assert_eq!(
-            obsolete("-105kzm"),
-            obsolete_result(&["-z", "-c", "110100480"])
-        );
-    }
-    #[test]
-    fn test_parse_errors_obsolete() {
-        assert_eq!(obsolete("-5n"), Some(Err(ParseError::Syntax)));
-        assert_eq!(obsolete("-5c5"), Some(Err(ParseError::Syntax)));
-    }
-    #[test]
-    fn test_parse_obsolete_no_match() {
-        assert_eq!(obsolete("-k"), None);
-        assert_eq!(obsolete("asd"), None);
-    }
-    #[test]
-    #[cfg(target_pointer_width = "64")]
-    fn test_parse_obsolete_overflow_x64() {
-        assert_eq!(
-            obsolete("-1000000000000000m"),
-            Some(Err(ParseError::Overflow))
-        );
-        assert_eq!(
-            obsolete("-10000000000000000000000"),
-            Some(Err(ParseError::Overflow))
-        );
-    }
-    #[test]
-    #[cfg(target_pointer_width = "32")]
-    fn test_parse_obsolete_overflow_x32() {
-        assert_eq!(obsolete("-42949672960"), Some(Err(ParseError::Overflow)));
-        assert_eq!(obsolete("-42949672k"), Some(Err(ParseError::Overflow)));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_head/take.rs.html b/coreutils/dev/src/uu_head/take.rs.html deleted file mode 100644 index 242b742ed..000000000 --- a/coreutils/dev/src/uu_head/take.rs.html +++ /dev/null @@ -1,359 +0,0 @@ -take.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-
//! Take all but the last elements of an iterator.
-use std::io::Read;
-
-use memchr::memchr_iter;
-
-use uucore::ringbuffer::RingBuffer;
-
-/// Create an iterator over all but the last `n` elements of `iter`.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// let data = [1, 2, 3, 4, 5];
-/// let n = 2;
-/// let mut iter = take_all_but(data.iter(), n);
-/// assert_eq!(Some(4), iter.next());
-/// assert_eq!(Some(5), iter.next());
-/// assert_eq!(None, iter.next());
-/// ```
-pub fn take_all_but<I: Iterator>(iter: I, n: usize) -> TakeAllBut<I> {
-    TakeAllBut::new(iter, n)
-}
-
-/// An iterator that only iterates over the last elements of another iterator.
-pub struct TakeAllBut<I: Iterator> {
-    iter: I,
-    buf: RingBuffer<<I as Iterator>::Item>,
-}
-
-impl<I: Iterator> TakeAllBut<I> {
-    pub fn new(mut iter: I, n: usize) -> Self {
-        // Create a new ring buffer and fill it up.
-        //
-        // If there are fewer than `n` elements in `iter`, then we
-        // exhaust the iterator so that whenever `TakeAllBut::next()` is
-        // called, it will return `None`, as expected.
-        let mut buf = RingBuffer::new(n);
-        for _ in 0..n {
-            let value = match iter.next() {
-                None => {
-                    break;
-                }
-                Some(x) => x,
-            };
-            buf.push_back(value);
-        }
-        Self { iter, buf }
-    }
-}
-
-impl<I: Iterator> Iterator for TakeAllBut<I>
-where
-    I: Iterator,
-{
-    type Item = <I as Iterator>::Item;
-
-    fn next(&mut self) -> Option<<I as Iterator>::Item> {
-        match self.iter.next() {
-            Some(value) => self.buf.push_back(value),
-            None => None,
-        }
-    }
-}
-
-/// Like `std::io::Take`, but for lines instead of bytes.
-///
-/// This struct is generally created by calling [`take_lines`] on a
-/// reader. Please see the documentation of [`take_lines`] for more
-/// details.
-pub struct TakeLines<T> {
-    inner: T,
-    limit: u64,
-    separator: u8,
-}
-
-impl<T: Read> Read for TakeLines<T> {
-    /// Read bytes from a buffer up to the requested number of lines.
-    fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
-        if self.limit == 0 {
-            return Ok(0);
-        }
-        match self.inner.read(buf) {
-            Ok(0) => Ok(0),
-            Ok(n) => {
-                for i in memchr_iter(self.separator, &buf[..n]) {
-                    self.limit -= 1;
-                    if self.limit == 0 {
-                        return Ok(i + 1);
-                    }
-                }
-                Ok(n)
-            }
-            Err(e) => Err(e),
-        }
-    }
-}
-
-/// Create an adaptor that will read at most `limit` lines from a given reader.
-///
-/// This function returns a new instance of `Read` that will read at
-/// most `limit` lines, after which it will always return EOF
-/// (`Ok(0)`).
-///
-/// The `separator` defines the character to interpret as the line
-/// ending. For the usual notion of "line", set this to `b'\n'`.
-pub fn take_lines<R>(reader: R, limit: u64, separator: u8) -> TakeLines<R> {
-    TakeLines {
-        inner: reader,
-        limit,
-        separator,
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use std::io::BufRead;
-    use std::io::BufReader;
-
-    use crate::take::take_all_but;
-    use crate::take::take_lines;
-
-    #[test]
-    fn test_fewer_elements() {
-        let mut iter = take_all_but([0, 1, 2].iter(), 2);
-        assert_eq!(Some(&0), iter.next());
-        assert_eq!(None, iter.next());
-    }
-
-    #[test]
-    fn test_same_number_of_elements() {
-        let mut iter = take_all_but([0, 1].iter(), 2);
-        assert_eq!(None, iter.next());
-    }
-
-    #[test]
-    fn test_more_elements() {
-        let mut iter = take_all_but([0].iter(), 2);
-        assert_eq!(None, iter.next());
-    }
-
-    #[test]
-    fn test_zero_elements() {
-        let mut iter = take_all_but([0, 1, 2].iter(), 0);
-        assert_eq!(Some(&0), iter.next());
-        assert_eq!(Some(&1), iter.next());
-        assert_eq!(Some(&2), iter.next());
-        assert_eq!(None, iter.next());
-    }
-
-    #[test]
-    fn test_zero_lines() {
-        let input_reader = std::io::Cursor::new("a\nb\nc\n");
-        let output_reader = BufReader::new(take_lines(input_reader, 0, b'\n'));
-        let mut iter = output_reader.lines().map(|l| l.unwrap());
-        assert_eq!(None, iter.next());
-    }
-
-    #[test]
-    fn test_fewer_lines() {
-        let input_reader = std::io::Cursor::new("a\nb\nc\n");
-        let output_reader = BufReader::new(take_lines(input_reader, 2, b'\n'));
-        let mut iter = output_reader.lines().map(|l| l.unwrap());
-        assert_eq!(Some(String::from("a")), iter.next());
-        assert_eq!(Some(String::from("b")), iter.next());
-        assert_eq!(None, iter.next());
-    }
-
-    #[test]
-    fn test_more_lines() {
-        let input_reader = std::io::Cursor::new("a\nb\nc\n");
-        let output_reader = BufReader::new(take_lines(input_reader, 4, b'\n'));
-        let mut iter = output_reader.lines().map(|l| l.unwrap());
-        assert_eq!(Some(String::from("a")), iter.next());
-        assert_eq!(Some(String::from("b")), iter.next());
-        assert_eq!(Some(String::from("c")), iter.next());
-        assert_eq!(None, iter.next());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_hostid/hostid.rs.html b/coreutils/dev/src/uu_hostid/hostid.rs.html deleted file mode 100644 index a2c9963e3..000000000 --- a/coreutils/dev/src/uu_hostid/hostid.rs.html +++ /dev/null @@ -1,109 +0,0 @@ -hostid.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Maciej Dziardziel <fiedzia@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE file
-//  * that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) gethostid
-
-use clap::{crate_version, Command};
-use libc::c_long;
-use uucore::{error::UResult, format_usage, help_about, help_usage};
-
-const USAGE: &str = help_usage!("hostid.md");
-const ABOUT: &str = help_about!("hostid.md");
-
-// currently rust libc interface doesn't include gethostid
-extern "C" {
-    pub fn gethostid() -> c_long;
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    uu_app().get_matches_from(args);
-    hostid();
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-}
-
-fn hostid() {
-    /*
-     * POSIX says gethostid returns a "32-bit identifier" but is silent
-     * whether it's sign-extended.  Turn off any sign-extension.  This
-     * is a no-op unless unsigned int is wider than 32 bits.
-     */
-
-    let mut result: c_long;
-    unsafe {
-        result = gethostid();
-    }
-
-    #[allow(overflowing_literals)]
-    let mask = 0xffff_ffff;
-
-    result &= mask;
-    println!("{result:0>8x}");
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_hostname/hostname.rs.html b/coreutils/dev/src/uu_hostname/hostname.rs.html deleted file mode 100644 index 4aa4c1160..000000000 --- a/coreutils/dev/src/uu_hostname/hostname.rs.html +++ /dev/null @@ -1,343 +0,0 @@ -hostname.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alan Andrade <alan.andradec@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) MAKEWORD addrs hashset
-
-use std::net::ToSocketAddrs;
-use std::str;
-use std::{collections::hash_set::HashSet, ffi::OsString};
-
-use clap::builder::ValueParser;
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-
-use uucore::{
-    error::{FromIo, UResult},
-    format_usage, help_about, help_usage,
-};
-
-const ABOUT: &str = help_about!("hostname.md");
-const USAGE: &str = help_usage!("hostname.md");
-
-static OPT_DOMAIN: &str = "domain";
-static OPT_IP_ADDRESS: &str = "ip-address";
-static OPT_FQDN: &str = "fqdn";
-static OPT_SHORT: &str = "short";
-static OPT_HOST: &str = "host";
-
-#[cfg(windows)]
-mod wsa {
-    use std::io;
-
-    use windows_sys::Win32::Networking::WinSock::{WSACleanup, WSAStartup, WSADATA};
-
-    pub(super) struct WsaHandle(());
-
-    pub(super) fn start() -> io::Result<WsaHandle> {
-        let err = unsafe {
-            let mut data = std::mem::MaybeUninit::<WSADATA>::uninit();
-            WSAStartup(0x0202, data.as_mut_ptr())
-        };
-        if err == 0 {
-            Ok(WsaHandle(()))
-        } else {
-            Err(io::Error::from_raw_os_error(err))
-        }
-    }
-
-    impl Drop for WsaHandle {
-        fn drop(&mut self) {
-            unsafe {
-                // This possibly returns an error but we can't handle it
-                let _err = WSACleanup();
-            }
-        }
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    #[cfg(windows)]
-    let _handle = wsa::start().map_err_context(|| "failed to start Winsock".to_owned())?;
-
-    match matches.get_one::<OsString>(OPT_HOST) {
-        None => display_hostname(&matches),
-        Some(host) => hostname::set(host).map_err_context(|| "failed to set hostname".to_owned()),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_DOMAIN)
-                .short('d')
-                .long("domain")
-                .overrides_with_all([OPT_DOMAIN, OPT_IP_ADDRESS, OPT_FQDN, OPT_SHORT])
-                .help("Display the name of the DNS domain if possible")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_IP_ADDRESS)
-                .short('i')
-                .long("ip-address")
-                .overrides_with_all([OPT_DOMAIN, OPT_IP_ADDRESS, OPT_FQDN, OPT_SHORT])
-                .help("Display the network address(es) of the host")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_FQDN)
-                .short('f')
-                .long("fqdn")
-                .overrides_with_all([OPT_DOMAIN, OPT_IP_ADDRESS, OPT_FQDN, OPT_SHORT])
-                .help("Display the FQDN (Fully Qualified Domain Name) (default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_SHORT)
-                .short('s')
-                .long("short")
-                .overrides_with_all([OPT_DOMAIN, OPT_IP_ADDRESS, OPT_FQDN, OPT_SHORT])
-                .help("Display the short hostname (the portion before the first dot) if possible")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_HOST)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::Hostname),
-        )
-}
-
-fn display_hostname(matches: &ArgMatches) -> UResult<()> {
-    let hostname = hostname::get()
-        .map_err_context(|| "failed to get hostname".to_owned())?
-        .to_string_lossy()
-        .into_owned();
-
-    if matches.get_flag(OPT_IP_ADDRESS) {
-        // XXX: to_socket_addrs needs hostname:port so append a dummy port and remove it later.
-        // This was originally supposed to use std::net::lookup_host, but that seems to be
-        // deprecated.  Perhaps we should use the dns-lookup crate?
-        let hostname = hostname + ":1";
-        let addresses = hostname
-            .to_socket_addrs()
-            .map_err_context(|| "failed to resolve socket addresses".to_owned())?;
-        let mut hashset = HashSet::new();
-        let mut output = String::new();
-        for addr in addresses {
-            // XXX: not sure why this is necessary...
-            if !hashset.contains(&addr) {
-                let mut ip = addr.to_string();
-                if ip.ends_with(":1") {
-                    let len = ip.len();
-                    ip.truncate(len - 2);
-                }
-                output.push_str(&ip);
-                output.push(' ');
-                hashset.insert(addr);
-            }
-        }
-        let len = output.len();
-        if len > 0 {
-            println!("{}", &output[0..len - 1]);
-        }
-
-        Ok(())
-    } else {
-        if matches.get_flag(OPT_SHORT) || matches.get_flag(OPT_DOMAIN) {
-            let mut it = hostname.char_indices().filter(|&ci| ci.1 == '.');
-            if let Some(ci) = it.next() {
-                if matches.get_flag(OPT_SHORT) {
-                    println!("{}", &hostname[0..ci.0]);
-                } else {
-                    println!("{}", &hostname[ci.0 + 1..]);
-                }
-                return Ok(());
-            }
-        }
-
-        println!("{hostname}");
-
-        Ok(())
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_id/id.rs.html b/coreutils/dev/src/uu_id/id.rs.html deleted file mode 100644 index b73d3b232..000000000 --- a/coreutils/dev/src/uu_id/id.rs.html +++ /dev/null @@ -1,1333 +0,0 @@ -id.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-
// This file is part of the uutils coreutils package.
-//
-// (c) Alan Andrade <alan.andradec@gmail.com>
-// (c) Jian Zeng <anonymousknight96 AT gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) asid auditid auditinfo auid cstr egid emod euid getaudit getlogin gflag nflag pline rflag termid uflag gsflag zflag cflag
-
-// README:
-// This was originally based on BSD's `id`
-// (noticeable in functionality, usage text, options text, etc.)
-// and synced with:
-//  http://ftp-archive.freebsd.org/mirror/FreeBSD-Archive/old-releases/i386/1.0-RELEASE/ports/shellutils/src/id.c
-//  http://www.opensource.apple.com/source/shell_cmds/shell_cmds-118/id/id.c
-//
-// * This was partially rewritten in order for stdout/stderr/exit_code
-//   to be conform with GNU coreutils (8.32) test suite for `id`.
-//
-// * This supports multiple users (a feature that was introduced in coreutils 8.31)
-//
-// * This passes GNU's coreutils Test suite (8.32)
-//   for "tests/id/uid.sh" and "tests/id/zero/sh".
-//
-// * Option '--zero' does not exist for BSD's `id`, therefore '--zero' is only
-//   allowed together with other options that are available on GNU's `id`.
-//
-// * Help text based on BSD's `id` manpage and GNU's `id` manpage.
-//
-// * This passes GNU's coreutils Test suite (8.32) for "tests/id/context.sh" if compiled with
-//   `--features feat_selinux`. It should also pass "tests/id/no-context.sh", but that depends on
-//   `uu_ls -Z` being implemented and therefore fails at the moment
-//
-
-#![allow(non_camel_case_types)]
-#![allow(dead_code)]
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::ffi::CStr;
-use uucore::display::Quotable;
-use uucore::entries::{self, Group, Locate, Passwd};
-use uucore::error::UResult;
-use uucore::error::{set_exit_code, USimpleError};
-pub use uucore::libc;
-use uucore::libc::{getlogin, uid_t};
-use uucore::line_ending::LineEnding;
-use uucore::process::{getegid, geteuid, getgid, getuid};
-use uucore::{format_usage, help_about, help_section, help_usage, show_error};
-
-macro_rules! cstr2cow {
-    ($v:expr) => {
-        unsafe { CStr::from_ptr($v).to_string_lossy() }
-    };
-}
-
-const ABOUT: &str = help_about!("id.md");
-const USAGE: &str = help_usage!("id.md");
-const AFTER_HELP: &str = help_section!("after help", "id.md");
-
-#[cfg(not(feature = "selinux"))]
-static CONTEXT_HELP_TEXT: &str = "print only the security context of the process (not enabled)";
-#[cfg(feature = "selinux")]
-static CONTEXT_HELP_TEXT: &str = "print only the security context of the process";
-
-mod options {
-    pub const OPT_AUDIT: &str = "audit"; // GNU's id does not have this
-    pub const OPT_CONTEXT: &str = "context";
-    pub const OPT_EFFECTIVE_USER: &str = "user";
-    pub const OPT_GROUP: &str = "group";
-    pub const OPT_GROUPS: &str = "groups";
-    pub const OPT_HUMAN_READABLE: &str = "human-readable"; // GNU's id does not have this
-    pub const OPT_NAME: &str = "name";
-    pub const OPT_PASSWORD: &str = "password"; // GNU's id does not have this
-    pub const OPT_REAL_ID: &str = "real";
-    pub const OPT_ZERO: &str = "zero"; // BSD's id does not have this
-    pub const ARG_USERS: &str = "USER";
-}
-
-struct Ids {
-    uid: u32,  // user id
-    gid: u32,  // group id
-    euid: u32, // effective uid
-    egid: u32, // effective gid
-}
-
-struct State {
-    nflag: bool,  // --name
-    uflag: bool,  // --user
-    gflag: bool,  // --group
-    gsflag: bool, // --groups
-    rflag: bool,  // --real
-    zflag: bool,  // --zero
-    cflag: bool,  // --context
-    selinux_supported: bool,
-    ids: Option<Ids>,
-    // The behavior for calling GNU's `id` and calling GNU's `id $USER` is similar but different.
-    // * The SELinux context is only displayed without a specified user.
-    // * The `getgroups` system call is only used without a specified user, this causes
-    //   the order of the displayed groups to be different between `id` and `id $USER`.
-    //
-    // Example:
-    // $ strace -e getgroups id -G $USER
-    // 1000 10 975 968
-    // +++ exited with 0 +++
-    // $ strace -e getgroups id -G
-    // getgroups(0, NULL)                      = 4
-    // getgroups(4, [10, 968, 975, 1000])      = 4
-    // 1000 10 968 975
-    // +++ exited with 0 +++
-    user_specified: bool,
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().after_help(AFTER_HELP).try_get_matches_from(args)?;
-
-    let users: Vec<String> = matches
-        .get_many::<String>(options::ARG_USERS)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    let mut state = State {
-        nflag: matches.get_flag(options::OPT_NAME),
-        uflag: matches.get_flag(options::OPT_EFFECTIVE_USER),
-        gflag: matches.get_flag(options::OPT_GROUP),
-        gsflag: matches.get_flag(options::OPT_GROUPS),
-        rflag: matches.get_flag(options::OPT_REAL_ID),
-        zflag: matches.get_flag(options::OPT_ZERO),
-        cflag: matches.get_flag(options::OPT_CONTEXT),
-
-        selinux_supported: {
-            #[cfg(feature = "selinux")]
-            {
-                selinux::kernel_support() != selinux::KernelSupport::Unsupported
-            }
-            #[cfg(not(feature = "selinux"))]
-            {
-                false
-            }
-        },
-        user_specified: !users.is_empty(),
-        ids: None,
-    };
-
-    let default_format = {
-        // "default format" is when none of '-ugG' was used
-        !(state.uflag || state.gflag || state.gsflag)
-    };
-
-    if (state.nflag || state.rflag) && default_format && !state.cflag {
-        return Err(USimpleError::new(
-            1,
-            "cannot print only names or real IDs in default format",
-        ));
-    }
-    if state.zflag && default_format && !state.cflag {
-        // NOTE: GNU test suite "id/zero.sh" needs this stderr output:
-        return Err(USimpleError::new(
-            1,
-            "option --zero not permitted in default format",
-        ));
-    }
-    if state.user_specified && state.cflag {
-        return Err(USimpleError::new(
-            1,
-            "cannot print security context when user specified",
-        ));
-    }
-
-    let delimiter = {
-        if state.zflag {
-            "\0".to_string()
-        } else {
-            " ".to_string()
-        }
-    };
-    let line_ending = LineEnding::from_zero_flag(state.zflag);
-
-    if state.cflag {
-        if state.selinux_supported {
-            // print SElinux context and exit
-            #[cfg(all(any(target_os = "linux", target_os = "android"), feature = "selinux"))]
-            if let Ok(context) = selinux::SecurityContext::current(false) {
-                let bytes = context.as_bytes();
-                print!("{}{}", String::from_utf8_lossy(bytes), line_ending);
-            } else {
-                // print error because `cflag` was explicitly requested
-                return Err(USimpleError::new(1, "can't get process context"));
-            }
-            return Ok(());
-        } else {
-            return Err(USimpleError::new(
-                1,
-                "--context (-Z) works only on an SELinux-enabled kernel",
-            ));
-        }
-    }
-
-    for i in 0..=users.len() {
-        let possible_pw = if state.user_specified {
-            match Passwd::locate(users[i].as_str()) {
-                Ok(p) => Some(p),
-                Err(_) => {
-                    show_error!("{}: no such user", users[i].quote());
-                    set_exit_code(1);
-                    if i + 1 >= users.len() {
-                        break;
-                    } else {
-                        continue;
-                    }
-                }
-            }
-        } else {
-            None
-        };
-
-        // GNU's `id` does not support the flags: -p/-P/-A.
-        if matches.get_flag(options::OPT_PASSWORD) {
-            // BSD's `id` ignores all but the first specified user
-            pline(possible_pw.as_ref().map(|v| v.uid));
-            return Ok(());
-        };
-        if matches.get_flag(options::OPT_HUMAN_READABLE) {
-            // BSD's `id` ignores all but the first specified user
-            pretty(possible_pw);
-            return Ok(());
-        }
-        if matches.get_flag(options::OPT_AUDIT) {
-            // BSD's `id` ignores specified users
-            auditid();
-            return Ok(());
-        }
-
-        let (uid, gid) = possible_pw.as_ref().map(|p| (p.uid, p.gid)).unwrap_or((
-            if state.rflag { getuid() } else { geteuid() },
-            if state.rflag { getgid() } else { getegid() },
-        ));
-        state.ids = Some(Ids {
-            uid,
-            gid,
-            euid: geteuid(),
-            egid: getegid(),
-        });
-
-        if state.gflag {
-            print!(
-                "{}",
-                if state.nflag {
-                    entries::gid2grp(gid).unwrap_or_else(|_| {
-                        show_error!("cannot find name for group ID {}", gid);
-                        set_exit_code(1);
-                        gid.to_string()
-                    })
-                } else {
-                    gid.to_string()
-                }
-            );
-        }
-
-        if state.uflag {
-            print!(
-                "{}",
-                if state.nflag {
-                    entries::uid2usr(uid).unwrap_or_else(|_| {
-                        show_error!("cannot find name for user ID {}", uid);
-                        set_exit_code(1);
-                        uid.to_string()
-                    })
-                } else {
-                    uid.to_string()
-                }
-            );
-        }
-
-        let groups = entries::get_groups_gnu(Some(gid)).unwrap();
-        let groups = if state.user_specified {
-            possible_pw.as_ref().map(|p| p.belongs_to()).unwrap()
-        } else {
-            groups.clone()
-        };
-
-        if state.gsflag {
-            print!(
-                "{}{}",
-                groups
-                    .iter()
-                    .map(|&id| {
-                        if state.nflag {
-                            entries::gid2grp(id).unwrap_or_else(|_| {
-                                show_error!("cannot find name for group ID {}", id);
-                                set_exit_code(1);
-                                id.to_string()
-                            })
-                        } else {
-                            id.to_string()
-                        }
-                    })
-                    .collect::<Vec<_>>()
-                    .join(&delimiter),
-                // NOTE: this is necessary to pass GNU's "tests/id/zero.sh":
-                if state.zflag && state.user_specified && users.len() > 1 {
-                    "\0"
-                } else {
-                    ""
-                }
-            );
-        }
-
-        if default_format {
-            id_print(&mut state, &groups);
-        }
-        print!("{line_ending}");
-
-        if i + 1 >= users.len() {
-            break;
-        }
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::OPT_AUDIT)
-                .short('A')
-                .conflicts_with_all([
-                    options::OPT_GROUP,
-                    options::OPT_EFFECTIVE_USER,
-                    options::OPT_HUMAN_READABLE,
-                    options::OPT_PASSWORD,
-                    options::OPT_GROUPS,
-                    options::OPT_ZERO,
-                ])
-                .help(
-                    "Display the process audit user ID and other process audit properties,\n\
-                      which requires privilege (not available on Linux).",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OPT_EFFECTIVE_USER)
-                .short('u')
-                .long(options::OPT_EFFECTIVE_USER)
-                .conflicts_with(options::OPT_GROUP)
-                .help("Display only the effective user ID as a number.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OPT_GROUP)
-                .short('g')
-                .long(options::OPT_GROUP)
-                .conflicts_with(options::OPT_EFFECTIVE_USER)
-                .help("Display only the effective group ID as a number")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OPT_GROUPS)
-                .short('G')
-                .long(options::OPT_GROUPS)
-                .conflicts_with_all([
-                    options::OPT_GROUP,
-                    options::OPT_EFFECTIVE_USER,
-                    options::OPT_CONTEXT,
-                    options::OPT_HUMAN_READABLE,
-                    options::OPT_PASSWORD,
-                    options::OPT_AUDIT,
-                ])
-                .help(
-                    "Display only the different group IDs as white-space separated numbers, \
-                      in no particular order.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OPT_HUMAN_READABLE)
-                .short('p')
-                .help("Make the output human-readable. Each display is on a separate line.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OPT_NAME)
-                .short('n')
-                .long(options::OPT_NAME)
-                .help(
-                    "Display the name of the user or group ID for the -G, -g and -u options \
-                      instead of the number.\nIf any of the ID numbers cannot be mapped into \
-                      names, the number will be displayed as usual.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OPT_PASSWORD)
-                .short('P')
-                .help("Display the id as a password file entry.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OPT_REAL_ID)
-                .short('r')
-                .long(options::OPT_REAL_ID)
-                .help(
-                    "Display the real ID for the -G, -g and -u options instead of \
-                      the effective ID.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OPT_ZERO)
-                .short('z')
-                .long(options::OPT_ZERO)
-                .help(
-                    "delimit entries with NUL characters, not whitespace;\n\
-                      not permitted in default format",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OPT_CONTEXT)
-                .short('Z')
-                .long(options::OPT_CONTEXT)
-                .conflicts_with_all([options::OPT_GROUP, options::OPT_EFFECTIVE_USER])
-                .help(CONTEXT_HELP_TEXT)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ARG_USERS)
-                .action(ArgAction::Append)
-                .value_name(options::ARG_USERS)
-                .value_hint(clap::ValueHint::Username),
-        )
-}
-
-fn pretty(possible_pw: Option<Passwd>) {
-    if let Some(p) = possible_pw {
-        print!("uid\t{}\ngroups\t", p.name);
-        println!(
-            "{}",
-            p.belongs_to()
-                .iter()
-                .map(|&gr| entries::gid2grp(gr).unwrap())
-                .collect::<Vec<_>>()
-                .join(" ")
-        );
-    } else {
-        let login = cstr2cow!(getlogin() as *const _);
-        let rid = getuid();
-        if let Ok(p) = Passwd::locate(rid) {
-            if login == p.name {
-                println!("login\t{login}");
-            }
-            println!("uid\t{}", p.name);
-        } else {
-            println!("uid\t{rid}");
-        }
-
-        let eid = getegid();
-        if eid == rid {
-            if let Ok(p) = Passwd::locate(eid) {
-                println!("euid\t{}", p.name);
-            } else {
-                println!("euid\t{eid}");
-            }
-        }
-
-        let rid = getgid();
-        if rid != eid {
-            if let Ok(g) = Group::locate(rid) {
-                println!("euid\t{}", g.name);
-            } else {
-                println!("euid\t{rid}");
-            }
-        }
-
-        println!(
-            "groups\t{}",
-            entries::get_groups_gnu(None)
-                .unwrap()
-                .iter()
-                .map(|&gr| entries::gid2grp(gr).unwrap())
-                .collect::<Vec<_>>()
-                .join(" ")
-        );
-    }
-}
-
-#[cfg(any(target_vendor = "apple", target_os = "freebsd"))]
-fn pline(possible_uid: Option<uid_t>) {
-    let uid = possible_uid.unwrap_or_else(getuid);
-    let pw = Passwd::locate(uid).unwrap();
-
-    println!(
-        "{}:{}:{}:{}:{}:{}:{}:{}:{}:{}",
-        pw.name,
-        pw.user_passwd.unwrap_or_default(),
-        pw.uid,
-        pw.gid,
-        pw.user_access_class.unwrap_or_default(),
-        pw.passwd_change_time,
-        pw.expiration,
-        pw.user_info.unwrap_or_default(),
-        pw.user_dir.unwrap_or_default(),
-        pw.user_shell.unwrap_or_default()
-    );
-}
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-fn pline(possible_uid: Option<uid_t>) {
-    let uid = possible_uid.unwrap_or_else(getuid);
-    let pw = Passwd::locate(uid).unwrap();
-
-    println!(
-        "{}:{}:{}:{}:{}:{}:{}",
-        pw.name,
-        pw.user_passwd.unwrap_or_default(),
-        pw.uid,
-        pw.gid,
-        pw.user_info.unwrap_or_default(),
-        pw.user_dir.unwrap_or_default(),
-        pw.user_shell.unwrap_or_default()
-    );
-}
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-fn auditid() {}
-
-#[cfg(not(any(target_os = "linux", target_os = "android")))]
-fn auditid() {
-    use std::mem::MaybeUninit;
-
-    let mut auditinfo: MaybeUninit<audit::c_auditinfo_addr_t> = MaybeUninit::uninit();
-    let address = auditinfo.as_mut_ptr();
-    if unsafe { audit::getaudit(address) } < 0 {
-        println!("couldn't retrieve information");
-        return;
-    }
-
-    // SAFETY: getaudit wrote a valid struct to auditinfo
-    let auditinfo = unsafe { auditinfo.assume_init() };
-
-    println!("auid={}", auditinfo.ai_auid);
-    println!("mask.success=0x{:x}", auditinfo.ai_mask.am_success);
-    println!("mask.failure=0x{:x}", auditinfo.ai_mask.am_failure);
-    println!("termid.port=0x{:x}", auditinfo.ai_termid.port);
-    println!("asid={}", auditinfo.ai_asid);
-}
-
-fn id_print(state: &mut State, groups: &[u32]) {
-    let uid = state.ids.as_ref().unwrap().uid;
-    let gid = state.ids.as_ref().unwrap().gid;
-    let euid = state.ids.as_ref().unwrap().euid;
-    let egid = state.ids.as_ref().unwrap().egid;
-
-    print!(
-        "uid={}({})",
-        uid,
-        entries::uid2usr(uid).unwrap_or_else(|_| {
-            show_error!("cannot find name for user ID {}", uid);
-            set_exit_code(1);
-            uid.to_string()
-        })
-    );
-    print!(
-        " gid={}({})",
-        gid,
-        entries::gid2grp(gid).unwrap_or_else(|_| {
-            show_error!("cannot find name for group ID {}", gid);
-            set_exit_code(1);
-            gid.to_string()
-        })
-    );
-    if !state.user_specified && (euid != uid) {
-        print!(
-            " euid={}({})",
-            euid,
-            entries::uid2usr(euid).unwrap_or_else(|_| {
-                show_error!("cannot find name for user ID {}", euid);
-                set_exit_code(1);
-                euid.to_string()
-            })
-        );
-    }
-    if !state.user_specified && (egid != gid) {
-        print!(
-            " egid={}({})",
-            euid,
-            entries::gid2grp(egid).unwrap_or_else(|_| {
-                show_error!("cannot find name for group ID {}", egid);
-                set_exit_code(1);
-                egid.to_string()
-            })
-        );
-    }
-    print!(
-        " groups={}",
-        groups
-            .iter()
-            .map(|&gr| format!(
-                "{}({})",
-                gr,
-                entries::gid2grp(gr).unwrap_or_else(|_| {
-                    show_error!("cannot find name for group ID {}", gr);
-                    set_exit_code(1);
-                    gr.to_string()
-                })
-            ))
-            .collect::<Vec<_>>()
-            .join(",")
-    );
-
-    #[cfg(all(any(target_os = "linux", target_os = "android"), feature = "selinux"))]
-    if state.selinux_supported
-        && !state.user_specified
-        && std::env::var_os("POSIXLY_CORRECT").is_none()
-    {
-        // print SElinux context (does not depend on "-Z")
-        if let Ok(context) = selinux::SecurityContext::current(false) {
-            let bytes = context.as_bytes();
-            print!(" context={}", String::from_utf8_lossy(bytes));
-        }
-    }
-}
-
-#[cfg(not(any(target_os = "linux", target_os = "android")))]
-mod audit {
-    use super::libc::{c_int, c_uint, dev_t, pid_t, uid_t};
-
-    pub type au_id_t = uid_t;
-    pub type au_asid_t = pid_t;
-    pub type au_event_t = c_uint;
-    pub type au_emod_t = c_uint;
-    pub type au_class_t = c_int;
-    pub type au_flag_t = u64;
-
-    #[repr(C)]
-    pub struct au_mask {
-        pub am_success: c_uint,
-        pub am_failure: c_uint,
-    }
-    pub type au_mask_t = au_mask;
-
-    #[repr(C)]
-    pub struct au_tid_addr {
-        pub port: dev_t,
-    }
-    pub type au_tid_addr_t = au_tid_addr;
-
-    #[repr(C)]
-    pub struct c_auditinfo_addr {
-        pub ai_auid: au_id_t,         // Audit user ID
-        pub ai_mask: au_mask_t,       // Audit masks.
-        pub ai_termid: au_tid_addr_t, // Terminal ID.
-        pub ai_asid: au_asid_t,       // Audit session ID.
-        pub ai_flags: au_flag_t,      // Audit session flags
-    }
-    pub type c_auditinfo_addr_t = c_auditinfo_addr;
-
-    extern "C" {
-        pub fn getaudit(auditinfo_addr: *mut c_auditinfo_addr_t) -> c_int;
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_install/install.rs.html b/coreutils/dev/src/uu_install/install.rs.html deleted file mode 100644 index 2c0d48bb3..000000000 --- a/coreutils/dev/src/uu_install/install.rs.html +++ /dev/null @@ -1,1897 +0,0 @@ -install.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Ben Eills <ben@beneills.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE file
-//  * that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) rwxr sourcepath targetpath Isnt uioerror
-
-mod mode;
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-use file_diff::diff;
-use filetime::{set_file_times, FileTime};
-use uucore::backup_control::{self, BackupMode};
-use uucore::display::Quotable;
-use uucore::entries::{grp2gid, usr2uid};
-use uucore::error::{FromIo, UError, UIoError, UResult, UUsageError};
-use uucore::fs::dir_strip_dot_for_creation;
-use uucore::mode::get_umask;
-use uucore::perms::{wrap_chown, Verbosity, VerbosityLevel};
-use uucore::{format_usage, help_about, help_usage, show, show_error, show_if_err, uio_error};
-
-use libc::{getegid, geteuid};
-use std::error::Error;
-use std::fmt::{Debug, Display};
-use std::fs;
-use std::fs::File;
-use std::os::unix::fs::MetadataExt;
-#[cfg(unix)]
-use std::os::unix::prelude::OsStrExt;
-use std::path::{Path, PathBuf, MAIN_SEPARATOR};
-use std::process;
-
-const DEFAULT_MODE: u32 = 0o755;
-const DEFAULT_STRIP_PROGRAM: &str = "strip";
-
-#[allow(dead_code)]
-pub struct Behavior {
-    main_function: MainFunction,
-    specified_mode: Option<u32>,
-    backup_mode: BackupMode,
-    suffix: String,
-    owner_id: Option<u32>,
-    group_id: Option<u32>,
-    verbose: bool,
-    preserve_timestamps: bool,
-    compare: bool,
-    strip: bool,
-    strip_program: String,
-    create_leading: bool,
-    target_dir: Option<String>,
-}
-
-#[derive(Debug)]
-enum InstallError {
-    Unimplemented(String),
-    DirNeedsArg(),
-    CreateDirFailed(PathBuf, std::io::Error),
-    ChmodFailed(PathBuf),
-    ChownFailed(PathBuf, String),
-    InvalidTarget(PathBuf),
-    TargetDirIsntDir(PathBuf),
-    BackupFailed(PathBuf, PathBuf, std::io::Error),
-    InstallFailed(PathBuf, PathBuf, std::io::Error),
-    StripProgramFailed(String),
-    MetadataFailed(std::io::Error),
-    InvalidUser(String),
-    InvalidGroup(String),
-    OmittingDirectory(PathBuf),
-}
-
-impl UError for InstallError {
-    fn code(&self) -> i32 {
-        match self {
-            Self::Unimplemented(_) => 2,
-            _ => 1,
-        }
-    }
-
-    fn usage(&self) -> bool {
-        false
-    }
-}
-
-impl Error for InstallError {}
-
-impl Display for InstallError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::Unimplemented(opt) => write!(f, "Unimplemented feature: {opt}"),
-            Self::DirNeedsArg() => {
-                write!(
-                    f,
-                    "{} with -d requires at least one argument.",
-                    uucore::util_name()
-                )
-            }
-            Self::CreateDirFailed(dir, e) => {
-                Display::fmt(&uio_error!(e, "failed to create {}", dir.quote()), f)
-            }
-            Self::ChmodFailed(file) => write!(f, "failed to chmod {}", file.quote()),
-            Self::ChownFailed(file, msg) => write!(f, "failed to chown {}: {}", file.quote(), msg),
-            Self::InvalidTarget(target) => write!(
-                f,
-                "invalid target {}: No such file or directory",
-                target.quote()
-            ),
-            Self::TargetDirIsntDir(target) => {
-                write!(f, "target {} is not a directory", target.quote())
-            }
-            Self::BackupFailed(from, to, e) => Display::fmt(
-                &uio_error!(e, "cannot backup {} to {}", from.quote(), to.quote()),
-                f,
-            ),
-            Self::InstallFailed(from, to, e) => Display::fmt(
-                &uio_error!(e, "cannot install {} to {}", from.quote(), to.quote()),
-                f,
-            ),
-            Self::StripProgramFailed(msg) => write!(f, "strip program failed: {msg}"),
-            Self::MetadataFailed(e) => Display::fmt(&uio_error!(e, ""), f),
-            Self::InvalidUser(user) => write!(f, "invalid user: {}", user.quote()),
-            Self::InvalidGroup(group) => write!(f, "invalid group: {}", group.quote()),
-            Self::OmittingDirectory(dir) => write!(f, "omitting directory {}", dir.quote()),
-        }
-    }
-}
-
-#[derive(Clone, Eq, PartialEq)]
-pub enum MainFunction {
-    /// Create directories
-    Directory,
-    /// Install files to locations (primary functionality)
-    Standard,
-}
-
-impl Behavior {
-    /// Determine the mode for chmod after copy.
-    pub fn mode(&self) -> u32 {
-        match self.specified_mode {
-            Some(x) => x,
-            None => DEFAULT_MODE,
-        }
-    }
-}
-
-const ABOUT: &str = help_about!("install.md");
-const USAGE: &str = help_usage!("install.md");
-
-static OPT_COMPARE: &str = "compare";
-static OPT_DIRECTORY: &str = "directory";
-static OPT_IGNORED: &str = "ignored";
-static OPT_CREATE_LEADING: &str = "create-leading";
-static OPT_GROUP: &str = "group";
-static OPT_MODE: &str = "mode";
-static OPT_OWNER: &str = "owner";
-static OPT_PRESERVE_TIMESTAMPS: &str = "preserve-timestamps";
-static OPT_STRIP: &str = "strip";
-static OPT_STRIP_PROGRAM: &str = "strip-program";
-static OPT_TARGET_DIRECTORY: &str = "target-directory";
-static OPT_NO_TARGET_DIRECTORY: &str = "no-target-directory";
-static OPT_VERBOSE: &str = "verbose";
-static OPT_PRESERVE_CONTEXT: &str = "preserve-context";
-static OPT_CONTEXT: &str = "context";
-
-static ARG_FILES: &str = "files";
-
-/// Main install utility function, called from main.rs.
-///
-/// Returns a program return code.
-///
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let paths: Vec<String> = matches
-        .get_many::<String>(ARG_FILES)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    check_unimplemented(&matches)?;
-
-    let behavior = behavior(&matches)?;
-
-    match behavior.main_function {
-        MainFunction::Directory => directory(&paths, &behavior),
-        MainFunction::Standard => standard(paths, &behavior),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(backup_control::arguments::backup())
-        .arg(backup_control::arguments::backup_no_args())
-        .arg(
-            Arg::new(OPT_IGNORED)
-                .short('c')
-                .help("ignored")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_COMPARE)
-                .short('C')
-                .long(OPT_COMPARE)
-                .help(
-                    "compare each pair of source and destination files, and in some cases, \
-                    do not modify the destination at all",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_DIRECTORY)
-                .short('d')
-                .long(OPT_DIRECTORY)
-                .help(
-                    "treat all arguments as directory names. create all components of \
-                        the specified directories",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            // TODO implement flag
-            Arg::new(OPT_CREATE_LEADING)
-                .short('D')
-                .help(
-                    "create all leading components of DEST except the last, then copy \
-                        SOURCE to DEST",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_GROUP)
-                .short('g')
-                .long(OPT_GROUP)
-                .help("set group ownership, instead of process's current group")
-                .value_name("GROUP"),
-        )
-        .arg(
-            Arg::new(OPT_MODE)
-                .short('m')
-                .long(OPT_MODE)
-                .help("set permission mode (as in chmod), instead of rwxr-xr-x")
-                .value_name("MODE"),
-        )
-        .arg(
-            Arg::new(OPT_OWNER)
-                .short('o')
-                .long(OPT_OWNER)
-                .help("set ownership (super-user only)")
-                .value_name("OWNER")
-                .value_hint(clap::ValueHint::Username),
-        )
-        .arg(
-            Arg::new(OPT_PRESERVE_TIMESTAMPS)
-                .short('p')
-                .long(OPT_PRESERVE_TIMESTAMPS)
-                .help(
-                    "apply access/modification times of SOURCE files to \
-                    corresponding destination files",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_STRIP)
-                .short('s')
-                .long(OPT_STRIP)
-                .help("strip symbol tables (no action Windows)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_STRIP_PROGRAM)
-                .long(OPT_STRIP_PROGRAM)
-                .help("program used to strip binaries (no action Windows)")
-                .value_name("PROGRAM")
-                .value_hint(clap::ValueHint::CommandName),
-        )
-        .arg(backup_control::arguments::suffix())
-        .arg(
-            // TODO implement flag
-            Arg::new(OPT_TARGET_DIRECTORY)
-                .short('t')
-                .long(OPT_TARGET_DIRECTORY)
-                .help("move all SOURCE arguments into DIRECTORY")
-                .value_name("DIRECTORY")
-                .value_hint(clap::ValueHint::DirPath),
-        )
-        .arg(
-            // TODO implement flag
-            Arg::new(OPT_NO_TARGET_DIRECTORY)
-                .short('T')
-                .long(OPT_NO_TARGET_DIRECTORY)
-                .help("(unimplemented) treat DEST as a normal file")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_VERBOSE)
-                .short('v')
-                .long(OPT_VERBOSE)
-                .help("explain what is being done")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            // TODO implement flag
-            Arg::new(OPT_PRESERVE_CONTEXT)
-                .short('P')
-                .long(OPT_PRESERVE_CONTEXT)
-                .help("(unimplemented) preserve security context")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            // TODO implement flag
-            Arg::new(OPT_CONTEXT)
-                .short('Z')
-                .long(OPT_CONTEXT)
-                .help("(unimplemented) set security context of files and directories")
-                .value_name("CONTEXT")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .num_args(1..)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
-/// Check for unimplemented command line arguments.
-///
-/// Either return the degenerate Ok value, or an Err with string.
-///
-/// # Errors
-///
-/// Error datum is a string of the unimplemented argument.
-///
-///
-fn check_unimplemented(matches: &ArgMatches) -> UResult<()> {
-    if matches.get_flag(OPT_NO_TARGET_DIRECTORY) {
-        Err(InstallError::Unimplemented(String::from("--no-target-directory, -T")).into())
-    } else if matches.get_flag(OPT_PRESERVE_CONTEXT) {
-        Err(InstallError::Unimplemented(String::from("--preserve-context, -P")).into())
-    } else if matches.get_flag(OPT_CONTEXT) {
-        Err(InstallError::Unimplemented(String::from("--context, -Z")).into())
-    } else {
-        Ok(())
-    }
-}
-
-/// Determine behavior, given command line arguments.
-///
-/// If successful, returns a filled-out Behavior struct.
-///
-/// # Errors
-///
-/// In event of failure, returns an integer intended as a program return code.
-///
-fn behavior(matches: &ArgMatches) -> UResult<Behavior> {
-    let main_function = if matches.get_flag(OPT_DIRECTORY) {
-        MainFunction::Directory
-    } else {
-        MainFunction::Standard
-    };
-
-    let considering_dir: bool = MainFunction::Directory == main_function;
-
-    let specified_mode: Option<u32> = if matches.contains_id(OPT_MODE) {
-        let x = matches.get_one::<String>(OPT_MODE).ok_or(1)?;
-        Some(mode::parse(x, considering_dir, get_umask()).map_err(|err| {
-            show_error!("Invalid mode string: {}", err);
-            1
-        })?)
-    } else {
-        None
-    };
-
-    let backup_mode = backup_control::determine_backup_mode(matches)?;
-    let target_dir = matches
-        .get_one::<String>(OPT_TARGET_DIRECTORY)
-        .map(|d| d.to_owned());
-
-    let preserve_timestamps = matches.get_flag(OPT_PRESERVE_TIMESTAMPS);
-    let compare = matches.get_flag(OPT_COMPARE);
-    let strip = matches.get_flag(OPT_STRIP);
-    if preserve_timestamps && compare {
-        show_error!("Options --compare and --preserve-timestamps are mutually exclusive");
-        return Err(1.into());
-    }
-    if compare && strip {
-        show_error!("Options --compare and --strip are mutually exclusive");
-        return Err(1.into());
-    }
-
-    let owner = matches
-        .get_one::<String>(OPT_OWNER)
-        .map(|s| s.as_str())
-        .unwrap_or("")
-        .to_string();
-
-    let owner_id = if owner.is_empty() {
-        None
-    } else {
-        match usr2uid(&owner) {
-            Ok(u) => Some(u),
-            Err(_) => return Err(InstallError::InvalidUser(owner.clone()).into()),
-        }
-    };
-
-    let group = matches
-        .get_one::<String>(OPT_GROUP)
-        .map(|s| s.as_str())
-        .unwrap_or("")
-        .to_string();
-
-    let group_id = if group.is_empty() {
-        None
-    } else {
-        match grp2gid(&group) {
-            Ok(g) => Some(g),
-            Err(_) => return Err(InstallError::InvalidGroup(group.clone()).into()),
-        }
-    };
-
-    Ok(Behavior {
-        main_function,
-        specified_mode,
-        backup_mode,
-        suffix: backup_control::determine_backup_suffix(matches),
-        owner_id,
-        group_id,
-        verbose: matches.get_flag(OPT_VERBOSE),
-        preserve_timestamps,
-        compare,
-        strip,
-        strip_program: String::from(
-            matches
-                .get_one::<String>(OPT_STRIP_PROGRAM)
-                .map(|s| s.as_str())
-                .unwrap_or(DEFAULT_STRIP_PROGRAM),
-        ),
-        create_leading: matches.get_flag(OPT_CREATE_LEADING),
-        target_dir,
-    })
-}
-
-/// Creates directories.
-///
-/// GNU man pages describe this functionality as creating 'all components of
-/// the specified directories'.
-///
-/// Returns a Result type with the Err variant containing the error message.
-///
-fn directory(paths: &[String], b: &Behavior) -> UResult<()> {
-    if paths.is_empty() {
-        Err(InstallError::DirNeedsArg().into())
-    } else {
-        for path in paths.iter().map(Path::new) {
-            // if the path already exist, don't try to create it again
-            if !path.exists() {
-                // Special case to match GNU's behavior:
-                // install -d foo/. should work and just create foo/
-                // std::fs::create_dir("foo/."); fails in pure Rust
-                // See also mkdir.rs for another occurrence of this
-                let path_to_create = dir_strip_dot_for_creation(path);
-                // Differently than the primary functionality
-                // (MainFunction::Standard), the directory functionality should
-                // create all ancestors (or components) of a directory
-                // regardless of the presence of the "-D" flag.
-                //
-                // NOTE: the GNU "install" sets the expected mode only for the
-                // target directory. All created ancestor directories will have
-                // the default mode. Hence it is safe to use fs::create_dir_all
-                // and then only modify the target's dir mode.
-                if let Err(e) = fs::create_dir_all(path_to_create.as_path())
-                    .map_err_context(|| path_to_create.as_path().maybe_quote().to_string())
-                {
-                    show!(e);
-                    continue;
-                }
-
-                if b.verbose {
-                    println!("creating directory {}", path_to_create.quote());
-                }
-            }
-
-            if mode::chmod(path, b.mode()).is_err() {
-                // Error messages are printed by the mode::chmod function!
-                uucore::error::set_exit_code(1);
-                continue;
-            }
-
-            show_if_err!(chown_optional_user_group(path, b));
-        }
-        // If the exit code was set, or show! has been called at least once
-        // (which sets the exit code as well), function execution will end after
-        // this return.
-        Ok(())
-    }
-}
-
-/// Test if the path is a new file path that can be
-/// created immediately
-fn is_new_file_path(path: &Path) -> bool {
-    !path.exists()
-        && (path.parent().map(Path::is_dir).unwrap_or(true)
-            || path.parent().unwrap().as_os_str().is_empty()) // In case of a simple file
-}
-
-/// Test if the path is an existing directory or ends with a trailing separator.
-///
-/// Returns true, if one of the conditions above is met; else false.
-///
-#[cfg(unix)]
-fn is_potential_directory_path(path: &Path) -> bool {
-    let separator = MAIN_SEPARATOR as u8;
-    path.as_os_str().as_bytes().last() == Some(&separator) || path.is_dir()
-}
-
-#[cfg(not(unix))]
-fn is_potential_directory_path(path: &Path) -> bool {
-    let path_str = path.to_string_lossy();
-    path_str.ends_with(MAIN_SEPARATOR) || path_str.ends_with('/') || path.is_dir()
-}
-
-/// Perform an install, given a list of paths and behavior.
-///
-/// Returns a Result type with the Err variant containing the error message.
-///
-fn standard(mut paths: Vec<String>, b: &Behavior) -> UResult<()> {
-    // first check that paths contains at least one element
-    if paths.is_empty() {
-        return Err(UUsageError::new(1, "missing file operand"));
-    }
-
-    // get the target from either "-t foo" param or from the last given paths argument
-    let target: PathBuf = if let Some(path) = &b.target_dir {
-        path.into()
-    } else {
-        let last_path: PathBuf = paths.pop().unwrap().into();
-
-        // paths has to contain more elements
-        if paths.is_empty() {
-            return Err(UUsageError::new(
-                1,
-                format!(
-                    "missing destination file operand after '{}'",
-                    last_path.to_str().unwrap()
-                ),
-            ));
-        }
-
-        last_path
-    };
-
-    let sources = &paths.iter().map(PathBuf::from).collect::<Vec<_>>();
-
-    if b.create_leading {
-        // if -t is used in combination with -D, create whole target because it does not include filename
-        let to_create: Option<&Path> = if b.target_dir.is_some() {
-            Some(target.as_path())
-        // if source and target are filenames used in combination with -D, create target's parent
-        } else if !(sources.len() > 1 || is_potential_directory_path(&target)) {
-            target.parent()
-        } else {
-            None
-        };
-
-        if let Some(to_create) = to_create {
-            if !to_create.exists() {
-                if b.verbose {
-                    let mut result = PathBuf::new();
-                    // When creating directories with -Dv, show directory creations step by step
-                    for part in to_create.components() {
-                        result.push(part.as_os_str());
-                        if !result.is_dir() {
-                            // Don't display when the directory already exists
-                            println!("install: creating directory {}", result.quote());
-                        }
-                    }
-                }
-
-                if let Err(e) = fs::create_dir_all(to_create) {
-                    return Err(InstallError::CreateDirFailed(to_create.to_path_buf(), e).into());
-                }
-            }
-        }
-    }
-
-    if sources.len() > 1 || is_potential_directory_path(&target) {
-        copy_files_into_dir(sources, &target, b)
-    } else {
-        let source = sources.first().unwrap();
-
-        if source.is_dir() {
-            return Err(InstallError::OmittingDirectory(source.to_path_buf()).into());
-        }
-
-        if target.is_file() || is_new_file_path(&target) {
-            copy(source, &target, b)
-        } else {
-            Err(InstallError::InvalidTarget(target).into())
-        }
-    }
-}
-
-/// Copy some files into a directory.
-///
-/// Prints verbose information and error messages.
-/// Returns a Result type with the Err variant containing the error message.
-///
-/// # Parameters
-///
-/// _files_ must all exist as non-directories.
-/// _target_dir_ must be a directory.
-///
-fn copy_files_into_dir(files: &[PathBuf], target_dir: &Path, b: &Behavior) -> UResult<()> {
-    if !target_dir.is_dir() {
-        return Err(InstallError::TargetDirIsntDir(target_dir.to_path_buf()).into());
-    }
-    for sourcepath in files.iter() {
-        if let Err(err) = sourcepath
-            .metadata()
-            .map_err_context(|| format!("cannot stat {}", sourcepath.quote()))
-        {
-            show!(err);
-            continue;
-        }
-
-        if sourcepath.is_dir() {
-            let err = InstallError::OmittingDirectory(sourcepath.to_path_buf());
-            show!(err);
-            continue;
-        }
-
-        let mut targetpath = target_dir.to_path_buf();
-        let filename = sourcepath.components().last().unwrap();
-        targetpath.push(filename);
-
-        show_if_err!(copy(sourcepath, &targetpath, b));
-    }
-    // If the exit code was set, or show! has been called at least once
-    // (which sets the exit code as well), function execution will end after
-    // this return.
-    Ok(())
-}
-
-/// Handle incomplete user/group parings for chown.
-///
-/// Returns a Result type with the Err variant containing the error message.
-///
-/// # Parameters
-///
-/// _path_ must exist.
-///
-/// # Errors
-///
-/// If the owner or group are invalid or copy system call fails, we print a verbose error and
-/// return an empty error value.
-///
-fn chown_optional_user_group(path: &Path, b: &Behavior) -> UResult<()> {
-    if b.owner_id.is_some() || b.group_id.is_some() {
-        let meta = match fs::metadata(path) {
-            Ok(meta) => meta,
-            Err(e) => return Err(InstallError::MetadataFailed(e).into()),
-        };
-
-        // GNU coreutils doesn't print chown operations during install with verbose flag.
-        let verbosity = Verbosity {
-            groups_only: b.owner_id.is_none(),
-            level: VerbosityLevel::Normal,
-        };
-
-        match wrap_chown(path, &meta, b.owner_id, b.group_id, false, verbosity) {
-            Ok(msg) if b.verbose && !msg.is_empty() => println!("chown: {msg}"),
-            Ok(_) => {}
-            Err(e) => return Err(InstallError::ChownFailed(path.to_path_buf(), e).into()),
-        }
-    }
-
-    Ok(())
-}
-
-/// Perform backup before overwriting.
-///
-/// # Parameters
-///
-/// * `to` - The destination file path.
-/// * `b` - The behavior configuration.
-///
-/// # Returns
-///
-/// Returns an Option containing the backup path, or None if backup is not needed.
-///
-fn perform_backup(to: &Path, b: &Behavior) -> UResult<Option<PathBuf>> {
-    if to.exists() {
-        if b.verbose {
-            println!("removed {}", to.quote());
-        }
-        let backup_path = backup_control::get_backup_path(b.backup_mode, to, &b.suffix);
-        if let Some(ref backup_path) = backup_path {
-            // TODO!!
-            if let Err(err) = fs::rename(to, backup_path) {
-                return Err(InstallError::BackupFailed(
-                    to.to_path_buf(),
-                    backup_path.to_path_buf(),
-                    err,
-                )
-                .into());
-            }
-        }
-        Ok(backup_path)
-    } else {
-        Ok(None)
-    }
-}
-
-/// Copy a file from one path to another.
-///
-/// # Parameters
-///
-/// * `from` - The source file path.
-/// * `to` - The destination file path.
-///
-/// # Returns
-///
-/// Returns an empty Result or an error in case of failure.
-///
-fn copy_file(from: &Path, to: &Path) -> UResult<()> {
-    if from.as_os_str() == "/dev/null" {
-        /* workaround a limitation of fs::copy
-         * https://github.com/rust-lang/rust/issues/79390
-         */
-        if let Err(err) = File::create(to) {
-            return Err(
-                InstallError::InstallFailed(from.to_path_buf(), to.to_path_buf(), err).into(),
-            );
-        }
-    } else if let Err(err) = fs::copy(from, to) {
-        return Err(InstallError::InstallFailed(from.to_path_buf(), to.to_path_buf(), err).into());
-    }
-    Ok(())
-}
-
-/// Strip a file using an external program.
-///
-/// # Parameters
-///
-/// * `to` - The destination file path.
-/// * `b` - The behavior configuration.
-///
-/// # Returns
-///
-/// Returns an empty Result or an error in case of failure.
-///
-fn strip_file(to: &Path, b: &Behavior) -> UResult<()> {
-    match process::Command::new(&b.strip_program).arg(to).output() {
-        Ok(o) => {
-            if !o.status.success() {
-                // Follow GNU's behavior: if strip fails, removes the target
-                let _ = fs::remove_file(to);
-                return Err(InstallError::StripProgramFailed(
-                    String::from_utf8(o.stderr).unwrap_or_default(),
-                )
-                .into());
-            }
-        }
-        Err(e) => {
-            // Follow GNU's behavior: if strip fails, removes the target
-            let _ = fs::remove_file(to);
-            return Err(InstallError::StripProgramFailed(e.to_string()).into());
-        }
-    }
-    Ok(())
-}
-
-/// Set ownership and permissions on the destination file.
-///
-/// # Parameters
-///
-/// * `to` - The destination file path.
-/// * `b` - The behavior configuration.
-///
-/// # Returns
-///
-/// Returns an empty Result or an error in case of failure.
-///
-fn set_ownership_and_permissions(to: &Path, b: &Behavior) -> UResult<()> {
-    // Silent the warning as we want to the error message
-    #[allow(clippy::question_mark)]
-    if mode::chmod(to, b.mode()).is_err() {
-        return Err(InstallError::ChmodFailed(to.to_path_buf()).into());
-    }
-
-    chown_optional_user_group(to, b)?;
-
-    Ok(())
-}
-
-/// Preserve timestamps on the destination file.
-///
-/// # Parameters
-///
-/// * `from` - The source file path.
-/// * `to` - The destination file path.
-///
-/// # Returns
-///
-/// Returns an empty Result or an error in case of failure.
-///
-fn preserve_timestamps(from: &Path, to: &Path) -> UResult<()> {
-    let meta = match fs::metadata(from) {
-        Ok(meta) => meta,
-        Err(e) => return Err(InstallError::MetadataFailed(e).into()),
-    };
-
-    let modified_time = FileTime::from_last_modification_time(&meta);
-    let accessed_time = FileTime::from_last_access_time(&meta);
-
-    match set_file_times(to, accessed_time, modified_time) {
-        Ok(_) => Ok(()),
-        Err(e) => {
-            show_error!("{}", e);
-            Ok(())
-        }
-    }
-}
-
-/// Copy one file to a new location, changing metadata.
-///
-/// Returns a Result type with the Err variant containing the error message.
-///
-/// # Parameters
-///
-/// _from_ must exist as a non-directory.
-/// _to_ must be a non-existent file, whose parent directory exists.
-///
-/// # Errors
-///
-/// If the copy system call fails, we print a verbose error and return an empty error value.
-///
-fn copy(from: &Path, to: &Path, b: &Behavior) -> UResult<()> {
-    if b.compare && !need_copy(from, to, b)? {
-        return Ok(());
-    }
-    // Declare the path here as we may need it for the verbose output below.
-    let backup_path = perform_backup(to, b)?;
-
-    copy_file(from, to)?;
-
-    #[cfg(not(windows))]
-    if b.strip {
-        strip_file(to, b)?;
-    }
-
-    set_ownership_and_permissions(to, b)?;
-
-    if b.preserve_timestamps {
-        preserve_timestamps(from, to)?;
-    }
-
-    if b.verbose {
-        print!("{} -> {}", from.quote(), to.quote());
-        match backup_path {
-            Some(path) => println!(" (backup: {})", path.quote()),
-            None => println!(),
-        }
-    }
-
-    Ok(())
-}
-
-/// Return true if a file is necessary to copy. This is the case when:
-///
-/// - _from_ or _to_ is nonexistent;
-/// - either file has a sticky bit or set\[ug\]id bit, or the user specified one;
-/// - either file isn't a regular file;
-/// - the sizes of _from_ and _to_ differ;
-/// - _to_'s owner differs from intended; or
-/// - the contents of _from_ and _to_ differ.
-///
-/// # Parameters
-///
-/// _from_ and _to_, if existent, must be non-directories.
-///
-/// # Errors
-///
-/// Crashes the program if a nonexistent owner or group is specified in _b_.
-///
-fn need_copy(from: &Path, to: &Path, b: &Behavior) -> UResult<bool> {
-    let from_meta = match fs::metadata(from) {
-        Ok(meta) => meta,
-        Err(_) => return Ok(true),
-    };
-    let to_meta = match fs::metadata(to) {
-        Ok(meta) => meta,
-        Err(_) => return Ok(true),
-    };
-
-    // setuid || setgid || sticky
-    let extra_mode: u32 = 0o7000;
-    // setuid || setgid || sticky || permissions
-    let all_modes: u32 = 0o7777;
-
-    if b.specified_mode.unwrap_or(0) & extra_mode != 0
-        || from_meta.mode() & extra_mode != 0
-        || to_meta.mode() & extra_mode != 0
-    {
-        return Ok(true);
-    }
-    if b.mode() != to_meta.mode() & all_modes {
-        return Ok(true);
-    }
-
-    if !from_meta.is_file() || !to_meta.is_file() {
-        return Ok(true);
-    }
-
-    if from_meta.len() != to_meta.len() {
-        return Ok(true);
-    }
-
-    // TODO: if -P (#1809) and from/to contexts mismatch, return true.
-
-    if let Some(owner_id) = b.owner_id {
-        if owner_id != to_meta.uid() {
-            return Ok(true);
-        }
-    } else if let Some(group_id) = b.group_id {
-        if group_id != to_meta.gid() {
-            return Ok(true);
-        }
-    } else {
-        #[cfg(not(target_os = "windows"))]
-        unsafe {
-            if to_meta.uid() != geteuid() || to_meta.gid() != getegid() {
-                return Ok(true);
-            }
-        }
-    }
-
-    if !diff(from.to_str().unwrap(), to.to_str().unwrap()) {
-        return Ok(true);
-    }
-
-    Ok(false)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_install/mode.rs.html b/coreutils/dev/src/uu_install/mode.rs.html deleted file mode 100644 index 3a107b0ae..000000000 --- a/coreutils/dev/src/uu_install/mode.rs.html +++ /dev/null @@ -1,79 +0,0 @@ -mode.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-
use std::fs;
-use std::path::Path;
-#[cfg(not(windows))]
-use uucore::mode;
-
-/// Takes a user-supplied string and tries to parse to u16 mode bitmask.
-pub fn parse(mode_string: &str, considering_dir: bool, umask: u32) -> Result<u32, String> {
-    let numbers: &[char] = &['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
-
-    // Passing 000 as the existing permissions seems to mirror GNU behavior.
-    if mode_string.contains(numbers) {
-        mode::parse_numeric(0, mode_string, considering_dir)
-    } else {
-        mode::parse_symbolic(0, mode_string, umask, considering_dir)
-    }
-}
-
-/// chmod a file or directory on UNIX.
-///
-/// Adapted from mkdir.rs.  Handles own error printing.
-///
-#[cfg(any(unix, target_os = "redox"))]
-pub fn chmod(path: &Path, mode: u32) -> Result<(), ()> {
-    use std::os::unix::fs::PermissionsExt;
-    use uucore::{display::Quotable, show_error};
-    fs::set_permissions(path, fs::Permissions::from_mode(mode)).map_err(|err| {
-        show_error!("{}: chmod failed with error {}", path.maybe_quote(), err);
-    })
-}
-
-/// chmod a file or directory on Windows.
-///
-/// Adapted from mkdir.rs.
-///
-#[cfg(windows)]
-pub fn chmod(path: &Path, mode: u32) -> Result<(), ()> {
-    // chmod on Windows only sets the readonly flag, which isn't even honored on directories
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_join/join.rs.html b/coreutils/dev/src/uu_join/join.rs.html deleted file mode 100644 index 085755b2d..000000000 --- a/coreutils/dev/src/uu_join/join.rs.html +++ /dev/null @@ -1,1989 +0,0 @@ -join.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Konstantin Pospelov <kupospelov@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) autoformat FILENUM whitespaces pairable unpairable nocheck
-
-use clap::builder::ValueParser;
-use clap::{crate_version, Arg, ArgAction, Command};
-use memchr::{memchr3_iter, memchr_iter};
-use std::cmp::Ordering;
-use std::convert::From;
-use std::error::Error;
-use std::ffi::OsString;
-use std::fmt::Display;
-use std::fs::File;
-use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Split, Stdin, Write};
-use std::num::IntErrorKind;
-#[cfg(unix)]
-use std::os::unix::ffi::OsStrExt;
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, UError, UResult, USimpleError};
-use uucore::line_ending::LineEnding;
-use uucore::{crash, crash_if_err, format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("join.md");
-const USAGE: &str = help_usage!("join.md");
-
-#[derive(Debug)]
-enum JoinError {
-    IOError(std::io::Error),
-    UnorderedInput(String),
-}
-
-impl UError for JoinError {
-    fn code(&self) -> i32 {
-        1
-    }
-}
-
-impl Error for JoinError {}
-
-impl Display for JoinError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::IOError(e) => write!(f, "io error: {e}"),
-            Self::UnorderedInput(e) => f.write_str(e),
-        }
-    }
-}
-
-impl From<std::io::Error> for JoinError {
-    fn from(error: std::io::Error) -> Self {
-        Self::IOError(error)
-    }
-}
-
-#[derive(Copy, Clone, PartialEq)]
-enum FileNum {
-    File1,
-    File2,
-}
-
-#[derive(Copy, Clone, PartialEq)]
-enum Sep {
-    Char(u8),
-    Line,
-    Whitespaces,
-}
-
-#[derive(Copy, Clone, PartialEq)]
-enum CheckOrder {
-    Default,
-    Disabled,
-    Enabled,
-}
-
-struct Settings {
-    key1: usize,
-    key2: usize,
-    print_unpaired1: bool,
-    print_unpaired2: bool,
-    print_joined: bool,
-    ignore_case: bool,
-    line_ending: LineEnding,
-    separator: Sep,
-    autoformat: bool,
-    format: Vec<Spec>,
-    empty: Vec<u8>,
-    check_order: CheckOrder,
-    headers: bool,
-}
-
-impl Default for Settings {
-    fn default() -> Self {
-        Self {
-            key1: 0,
-            key2: 0,
-            print_unpaired1: false,
-            print_unpaired2: false,
-            print_joined: true,
-            ignore_case: false,
-            line_ending: LineEnding::Newline,
-            separator: Sep::Whitespaces,
-            autoformat: false,
-            format: vec![],
-            empty: vec![],
-            check_order: CheckOrder::Default,
-            headers: false,
-        }
-    }
-}
-
-/// Output representation.
-struct Repr<'a> {
-    line_ending: LineEnding,
-    separator: u8,
-    format: &'a [Spec],
-    empty: &'a [u8],
-}
-
-impl<'a> Repr<'a> {
-    fn new(
-        line_ending: LineEnding,
-        separator: u8,
-        format: &'a [Spec],
-        empty: &'a [u8],
-    ) -> Repr<'a> {
-        Repr {
-            line_ending,
-            separator,
-            format,
-            empty,
-        }
-    }
-
-    fn uses_format(&self) -> bool {
-        !self.format.is_empty()
-    }
-
-    /// Print the field or empty filler if the field is not set.
-    fn print_field(
-        &self,
-        writer: &mut impl Write,
-        field: Option<&[u8]>,
-    ) -> Result<(), std::io::Error> {
-        let value = match field {
-            Some(field) => field,
-            None => self.empty,
-        };
-
-        writer.write_all(value)
-    }
-
-    /// Print each field except the one at the index.
-    fn print_fields(
-        &self,
-        writer: &mut impl Write,
-        line: &Line,
-        index: usize,
-    ) -> Result<(), std::io::Error> {
-        for i in 0..line.field_ranges.len() {
-            if i != index {
-                writer.write_all(&[self.separator])?;
-                writer.write_all(line.get_field(i).unwrap())?;
-            }
-        }
-        Ok(())
-    }
-
-    /// Print each field or the empty filler if the field is not set.
-    fn print_format<F>(&self, writer: &mut impl Write, f: F) -> Result<(), std::io::Error>
-    where
-        F: Fn(&Spec) -> Option<&'a [u8]>,
-    {
-        for i in 0..self.format.len() {
-            if i > 0 {
-                writer.write_all(&[self.separator])?;
-            }
-
-            let field = match f(&self.format[i]) {
-                Some(value) => value,
-                None => self.empty,
-            };
-
-            writer.write_all(field)?;
-        }
-        Ok(())
-    }
-
-    fn print_line_ending(&self, writer: &mut impl Write) -> Result<(), std::io::Error> {
-        writer.write_all(&[self.line_ending as u8])
-    }
-}
-
-/// Input processing parameters.
-struct Input {
-    separator: Sep,
-    ignore_case: bool,
-    check_order: CheckOrder,
-}
-
-impl Input {
-    fn new(separator: Sep, ignore_case: bool, check_order: CheckOrder) -> Self {
-        Self {
-            separator,
-            ignore_case,
-            check_order,
-        }
-    }
-
-    fn compare(&self, field1: Option<&[u8]>, field2: Option<&[u8]>) -> Ordering {
-        if let (Some(field1), Some(field2)) = (field1, field2) {
-            if self.ignore_case {
-                field1
-                    .to_ascii_lowercase()
-                    .cmp(&field2.to_ascii_lowercase())
-            } else {
-                field1.cmp(field2)
-            }
-        } else {
-            match field1 {
-                Some(_) => Ordering::Greater,
-                None => match field2 {
-                    Some(_) => Ordering::Less,
-                    None => Ordering::Equal,
-                },
-            }
-        }
-    }
-}
-
-enum Spec {
-    Key,
-    Field(FileNum, usize),
-}
-
-impl Spec {
-    fn parse(format: &str) -> UResult<Self> {
-        let mut chars = format.chars();
-
-        let file_num = match chars.next() {
-            Some('0') => {
-                // Must be all alone without a field specifier.
-                if chars.next().is_none() {
-                    return Ok(Self::Key);
-                }
-                return Err(USimpleError::new(
-                    1,
-                    format!("invalid field specifier: {}", format.quote()),
-                ));
-            }
-            Some('1') => FileNum::File1,
-            Some('2') => FileNum::File2,
-            _ => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("invalid file number in field spec: {}", format.quote()),
-                ));
-            }
-        };
-
-        if let Some('.') = chars.next() {
-            return Ok(Self::Field(file_num, parse_field_number(chars.as_str())?));
-        }
-
-        Err(USimpleError::new(
-            1,
-            format!("invalid field specifier: {}", format.quote()),
-        ))
-    }
-}
-
-struct Line {
-    field_ranges: Vec<(usize, usize)>,
-    string: Vec<u8>,
-}
-
-impl Line {
-    fn new(string: Vec<u8>, separator: Sep, len_guess: usize) -> Self {
-        let mut field_ranges = Vec::with_capacity(len_guess);
-        let mut last_end = 0;
-        if separator == Sep::Whitespaces {
-            // GNU join uses Bourne shell field splitters by default
-            for i in memchr3_iter(b' ', b'\t', b'\n', &string) {
-                if i > last_end {
-                    field_ranges.push((last_end, i));
-                }
-                last_end = i + 1;
-            }
-        } else if let Sep::Char(sep) = separator {
-            for i in memchr_iter(sep, &string) {
-                field_ranges.push((last_end, i));
-                last_end = i + 1;
-            }
-        }
-        field_ranges.push((last_end, string.len()));
-
-        Self {
-            field_ranges,
-            string,
-        }
-    }
-
-    /// Get field at index.
-    fn get_field(&self, index: usize) -> Option<&[u8]> {
-        if index < self.field_ranges.len() {
-            let (low, high) = self.field_ranges[index];
-            Some(&self.string[low..high])
-        } else {
-            None
-        }
-    }
-}
-
-struct State<'a> {
-    key: usize,
-    file_name: &'a str,
-    file_num: FileNum,
-    print_unpaired: bool,
-    lines: Split<Box<dyn BufRead + 'a>>,
-    max_len: usize,
-    seq: Vec<Line>,
-    line_num: usize,
-    has_failed: bool,
-    has_unpaired: bool,
-}
-
-impl<'a> State<'a> {
-    fn new(
-        file_num: FileNum,
-        name: &'a str,
-        stdin: &'a Stdin,
-        key: usize,
-        line_ending: LineEnding,
-        print_unpaired: bool,
-    ) -> State<'a> {
-        let f = if name == "-" {
-            Box::new(stdin.lock()) as Box<dyn BufRead>
-        } else {
-            match File::open(name) {
-                Ok(file) => Box::new(BufReader::new(file)) as Box<dyn BufRead>,
-                Err(err) => crash!(1, "{}: {}", name.maybe_quote(), err),
-            }
-        };
-
-        State {
-            key,
-            file_name: name,
-            file_num,
-            print_unpaired,
-            lines: f.split(line_ending as u8),
-            max_len: 1,
-            seq: Vec::new(),
-            line_num: 0,
-            has_failed: false,
-            has_unpaired: false,
-        }
-    }
-
-    /// Skip the current unpaired line.
-    fn skip_line(
-        &mut self,
-        writer: &mut impl Write,
-        input: &Input,
-        repr: &Repr,
-    ) -> Result<(), JoinError> {
-        if self.print_unpaired {
-            self.print_first_line(writer, repr)?;
-        }
-
-        self.reset_next_line(input)?;
-        Ok(())
-    }
-
-    /// Keep reading line sequence until the key does not change, return
-    /// the first line whose key differs.
-    fn extend(&mut self, input: &Input) -> Result<Option<Line>, JoinError> {
-        while let Some(line) = self.next_line(input)? {
-            let diff = input.compare(self.get_current_key(), line.get_field(self.key));
-
-            if diff == Ordering::Equal {
-                self.seq.push(line);
-            } else {
-                return Ok(Some(line));
-            }
-        }
-
-        Ok(None)
-    }
-
-    /// Print lines in the buffers as headers.
-    fn print_headers(
-        &self,
-        writer: &mut impl Write,
-        other: &State,
-        repr: &Repr,
-    ) -> Result<(), std::io::Error> {
-        if self.has_line() {
-            if other.has_line() {
-                self.combine(writer, other, repr)?;
-            } else {
-                self.print_first_line(writer, repr)?;
-            }
-        } else if other.has_line() {
-            other.print_first_line(writer, repr)?;
-        }
-
-        Ok(())
-    }
-
-    /// Combine two line sequences.
-    fn combine(
-        &self,
-        writer: &mut impl Write,
-        other: &State,
-        repr: &Repr,
-    ) -> Result<(), std::io::Error> {
-        let key = self.get_current_key();
-
-        for line1 in &self.seq {
-            for line2 in &other.seq {
-                if repr.uses_format() {
-                    repr.print_format(writer, |spec| match *spec {
-                        Spec::Key => key,
-                        Spec::Field(file_num, field_num) => {
-                            if file_num == self.file_num {
-                                return line1.get_field(field_num);
-                            }
-
-                            if file_num == other.file_num {
-                                return line2.get_field(field_num);
-                            }
-
-                            None
-                        }
-                    })?;
-                } else {
-                    repr.print_field(writer, key)?;
-                    repr.print_fields(writer, line1, self.key)?;
-                    repr.print_fields(writer, line2, other.key)?;
-                }
-
-                repr.print_line_ending(writer)?;
-            }
-        }
-
-        Ok(())
-    }
-
-    /// Reset with the next line.
-    fn reset(&mut self, next_line: Option<Line>) {
-        self.seq.clear();
-
-        if let Some(line) = next_line {
-            self.seq.push(line);
-        }
-    }
-
-    fn reset_read_line(&mut self, input: &Input) -> Result<(), std::io::Error> {
-        let line = self.read_line(input.separator)?;
-        self.reset(line);
-        Ok(())
-    }
-
-    fn reset_next_line(&mut self, input: &Input) -> Result<(), JoinError> {
-        let line = self.next_line(input)?;
-        self.reset(line);
-        Ok(())
-    }
-
-    fn has_line(&self) -> bool {
-        !self.seq.is_empty()
-    }
-
-    fn initialize(&mut self, read_sep: Sep, autoformat: bool) -> usize {
-        if let Some(line) = crash_if_err!(1, self.read_line(read_sep)) {
-            self.seq.push(line);
-
-            if autoformat {
-                return self.seq[0].field_ranges.len();
-            }
-        }
-        0
-    }
-
-    fn finalize(
-        &mut self,
-        writer: &mut impl Write,
-        input: &Input,
-        repr: &Repr,
-    ) -> Result<(), JoinError> {
-        if self.has_line() {
-            if self.print_unpaired {
-                self.print_first_line(writer, repr)?;
-            }
-
-            let mut next_line = self.next_line(input)?;
-            while let Some(line) = &next_line {
-                if self.print_unpaired {
-                    self.print_line(writer, line, repr)?;
-                }
-                self.reset(next_line);
-                next_line = self.next_line(input)?;
-            }
-        }
-
-        Ok(())
-    }
-
-    /// Get the next line without the order check.
-    fn read_line(&mut self, sep: Sep) -> Result<Option<Line>, std::io::Error> {
-        match self.lines.next() {
-            Some(value) => {
-                self.line_num += 1;
-                let line = Line::new(value?, sep, self.max_len);
-                if line.field_ranges.len() > self.max_len {
-                    self.max_len = line.field_ranges.len();
-                }
-                Ok(Some(line))
-            }
-            None => Ok(None),
-        }
-    }
-
-    /// Get the next line with the order check.
-    fn next_line(&mut self, input: &Input) -> Result<Option<Line>, JoinError> {
-        if let Some(line) = self.read_line(input.separator)? {
-            if input.check_order == CheckOrder::Disabled {
-                return Ok(Some(line));
-            }
-
-            let diff = input.compare(self.get_current_key(), line.get_field(self.key));
-
-            if diff == Ordering::Greater
-                && (input.check_order == CheckOrder::Enabled
-                    || (self.has_unpaired && !self.has_failed))
-            {
-                let err_msg = format!(
-                    "{}:{}: is not sorted: {}",
-                    self.file_name.maybe_quote(),
-                    self.line_num,
-                    String::from_utf8_lossy(&line.string)
-                );
-                // This is fatal if the check is enabled.
-                if input.check_order == CheckOrder::Enabled {
-                    return Err(JoinError::UnorderedInput(err_msg));
-                }
-                eprintln!("{}: {}", uucore::execution_phrase(), err_msg);
-                self.has_failed = true;
-            }
-
-            Ok(Some(line))
-        } else {
-            Ok(None)
-        }
-    }
-
-    /// Gets the key value of the lines stored in seq.
-    fn get_current_key(&self) -> Option<&[u8]> {
-        self.seq[0].get_field(self.key)
-    }
-
-    fn print_line(
-        &self,
-        writer: &mut impl Write,
-        line: &Line,
-        repr: &Repr,
-    ) -> Result<(), std::io::Error> {
-        if repr.uses_format() {
-            repr.print_format(writer, |spec| match *spec {
-                Spec::Key => line.get_field(self.key),
-                Spec::Field(file_num, field_num) => {
-                    if file_num == self.file_num {
-                        line.get_field(field_num)
-                    } else {
-                        None
-                    }
-                }
-            })?;
-        } else {
-            repr.print_field(writer, line.get_field(self.key))?;
-            repr.print_fields(writer, line, self.key)?;
-        }
-
-        repr.print_line_ending(writer)
-    }
-
-    fn print_first_line(&self, writer: &mut impl Write, repr: &Repr) -> Result<(), std::io::Error> {
-        self.print_line(writer, &self.seq[0], repr)
-    }
-}
-
-#[uucore::main]
-#[allow(clippy::cognitive_complexity)]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let keys = parse_field_number_option(matches.get_one::<String>("j").map(|s| s.as_str()))?;
-    let key1 = parse_field_number_option(matches.get_one::<String>("1").map(|s| s.as_str()))?;
-    let key2 = parse_field_number_option(matches.get_one::<String>("2").map(|s| s.as_str()))?;
-
-    let mut settings = Settings::default();
-
-    let v_values = matches.get_many::<String>("v");
-    if v_values.is_some() {
-        settings.print_joined = false;
-    }
-
-    let unpaired = v_values
-        .unwrap_or_default()
-        .chain(matches.get_many("a").unwrap_or_default());
-    for file_num in unpaired {
-        match parse_file_number(file_num)? {
-            FileNum::File1 => settings.print_unpaired1 = true,
-            FileNum::File2 => settings.print_unpaired2 = true,
-        }
-    }
-
-    settings.ignore_case = matches.get_flag("i");
-    settings.key1 = get_field_number(keys, key1)?;
-    settings.key2 = get_field_number(keys, key2)?;
-
-    if let Some(value_os) = matches.get_one::<OsString>("t") {
-        #[cfg(unix)]
-        let value = value_os.as_bytes();
-        #[cfg(not(unix))]
-        let value = match value_os.to_str() {
-            Some(value) => value.as_bytes(),
-            None => {
-                return Err(USimpleError::new(
-                    1,
-                    "unprintable field separators are only supported on unix-like platforms",
-                ))
-            }
-        };
-        settings.separator = match value.len() {
-            0 => Sep::Line,
-            1 => Sep::Char(value[0]),
-            2 if value[0] == b'\\' && value[1] == b'0' => Sep::Char(0),
-            _ => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("multi-character tab {}", value_os.to_string_lossy()),
-                ))
-            }
-        };
-    }
-
-    if let Some(format) = matches.get_one::<String>("o") {
-        if format == "auto" {
-            settings.autoformat = true;
-        } else {
-            let mut specs = vec![];
-            for part in format.split(|c| c == ' ' || c == ',' || c == '\t') {
-                specs.push(Spec::parse(part)?);
-            }
-            settings.format = specs;
-        }
-    }
-
-    if let Some(empty) = matches.get_one::<String>("e") {
-        settings.empty = empty.as_bytes().to_vec();
-    }
-
-    if matches.get_flag("nocheck-order") {
-        settings.check_order = CheckOrder::Disabled;
-    }
-
-    if matches.get_flag("check-order") {
-        settings.check_order = CheckOrder::Enabled;
-    }
-
-    if matches.get_flag("header") {
-        settings.headers = true;
-    }
-
-    settings.line_ending = LineEnding::from_zero_flag(matches.get_flag("z"));
-
-    let file1 = matches.get_one::<String>("file1").unwrap();
-    let file2 = matches.get_one::<String>("file2").unwrap();
-
-    if file1 == "-" && file2 == "-" {
-        return Err(USimpleError::new(1, "both files cannot be standard input"));
-    }
-
-    match exec(file1, file2, settings) {
-        Ok(_) => Ok(()),
-        Err(e) => Err(USimpleError::new(1, format!("{e}"))),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new("a")
-                .short('a')
-                .action(ArgAction::Append)
-                .num_args(1)
-                .value_parser(["1", "2"])
-                .value_name("FILENUM")
-                .help(
-                    "also print unpairable lines from file FILENUM, where
-FILENUM is 1 or 2, corresponding to FILE1 or FILE2",
-                ),
-        )
-        .arg(
-            Arg::new("v")
-                .short('v')
-                .action(ArgAction::Append)
-                .num_args(1)
-                .value_parser(["1", "2"])
-                .value_name("FILENUM")
-                .help("like -a FILENUM, but suppress joined output lines"),
-        )
-        .arg(
-            Arg::new("e")
-                .short('e')
-                .value_name("EMPTY")
-                .help("replace missing input fields with EMPTY"),
-        )
-        .arg(
-            Arg::new("i")
-                .short('i')
-                .long("ignore-case")
-                .help("ignore differences in case when comparing fields")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("j")
-                .short('j')
-                .value_name("FIELD")
-                .help("equivalent to '-1 FIELD -2 FIELD'"),
-        )
-        .arg(
-            Arg::new("o")
-                .short('o')
-                .value_name("FORMAT")
-                .help("obey FORMAT while constructing output line"),
-        )
-        .arg(
-            Arg::new("t")
-                .short('t')
-                .value_name("CHAR")
-                .value_parser(ValueParser::os_string())
-                .help("use CHAR as input and output field separator"),
-        )
-        .arg(
-            Arg::new("1")
-                .short('1')
-                .value_name("FIELD")
-                .help("join on this FIELD of file 1"),
-        )
-        .arg(
-            Arg::new("2")
-                .short('2')
-                .value_name("FIELD")
-                .help("join on this FIELD of file 2"),
-        )
-        .arg(
-            Arg::new("check-order")
-                .long("check-order")
-                .help(
-                    "check that the input is correctly sorted, \
-             even if all input lines are pairable",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("nocheck-order")
-                .long("nocheck-order")
-                .help("do not check that the input is correctly sorted")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("header")
-                .long("header")
-                .help(
-                    "treat the first line in each file as field headers, \
-             print them without trying to pair them",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("z")
-                .short('z')
-                .long("zero-terminated")
-                .help("line delimiter is NUL, not newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("file1")
-                .required(true)
-                .value_name("FILE1")
-                .value_hint(clap::ValueHint::FilePath)
-                .hide(true),
-        )
-        .arg(
-            Arg::new("file2")
-                .required(true)
-                .value_name("FILE2")
-                .value_hint(clap::ValueHint::FilePath)
-                .hide(true),
-        )
-}
-
-fn exec(file1: &str, file2: &str, settings: Settings) -> Result<(), JoinError> {
-    let stdin = stdin();
-
-    let mut state1 = State::new(
-        FileNum::File1,
-        file1,
-        &stdin,
-        settings.key1,
-        settings.line_ending,
-        settings.print_unpaired1,
-    );
-
-    let mut state2 = State::new(
-        FileNum::File2,
-        file2,
-        &stdin,
-        settings.key2,
-        settings.line_ending,
-        settings.print_unpaired2,
-    );
-
-    let input = Input::new(
-        settings.separator,
-        settings.ignore_case,
-        settings.check_order,
-    );
-
-    let format = if settings.autoformat {
-        let mut format = vec![Spec::Key];
-        let mut initialize = |state: &mut State| {
-            let max_fields = state.initialize(settings.separator, settings.autoformat);
-            for i in 0..max_fields {
-                if i != state.key {
-                    format.push(Spec::Field(state.file_num, i));
-                }
-            }
-        };
-        initialize(&mut state1);
-        initialize(&mut state2);
-        format
-    } else {
-        state1.initialize(settings.separator, settings.autoformat);
-        state2.initialize(settings.separator, settings.autoformat);
-        settings.format
-    };
-
-    let repr = Repr::new(
-        settings.line_ending,
-        match settings.separator {
-            Sep::Char(sep) => sep,
-            _ => b' ',
-        },
-        &format,
-        &settings.empty,
-    );
-
-    let stdout = stdout();
-    let mut writer = BufWriter::new(stdout.lock());
-
-    if settings.headers {
-        state1.print_headers(&mut writer, &state2, &repr)?;
-        state1.reset_read_line(&input)?;
-        state2.reset_read_line(&input)?;
-    }
-
-    while state1.has_line() && state2.has_line() {
-        let diff = input.compare(state1.get_current_key(), state2.get_current_key());
-
-        match diff {
-            Ordering::Less => {
-                if let Err(e) = state1.skip_line(&mut writer, &input, &repr) {
-                    writer.flush()?;
-                    return Err(e);
-                }
-                state1.has_unpaired = true;
-                state2.has_unpaired = true;
-            }
-            Ordering::Greater => {
-                if let Err(e) = state2.skip_line(&mut writer, &input, &repr) {
-                    writer.flush()?;
-                    return Err(e);
-                }
-                state1.has_unpaired = true;
-                state2.has_unpaired = true;
-            }
-            Ordering::Equal => {
-                let next_line1 = match state1.extend(&input) {
-                    Ok(line) => line,
-                    Err(e) => {
-                        writer.flush()?;
-                        return Err(e);
-                    }
-                };
-                let next_line2 = match state2.extend(&input) {
-                    Ok(line) => line,
-                    Err(e) => {
-                        writer.flush()?;
-                        return Err(e);
-                    }
-                };
-
-                if settings.print_joined {
-                    state1.combine(&mut writer, &state2, &repr)?;
-                }
-
-                state1.reset(next_line1);
-                state2.reset(next_line2);
-            }
-        }
-    }
-
-    if let Err(e) = state1.finalize(&mut writer, &input, &repr) {
-        writer.flush()?;
-        return Err(e);
-    };
-    if let Err(e) = state2.finalize(&mut writer, &input, &repr) {
-        writer.flush()?;
-        return Err(e);
-    };
-
-    writer.flush()?;
-
-    if state1.has_failed || state2.has_failed {
-        eprintln!(
-            "{}: input is not in sorted order",
-            uucore::execution_phrase()
-        );
-        set_exit_code(1);
-    }
-    Ok(())
-}
-
-/// Check that keys for both files and for a particular file are not
-/// contradictory and return the key index.
-fn get_field_number(keys: Option<usize>, key: Option<usize>) -> UResult<usize> {
-    if let Some(keys) = keys {
-        if let Some(key) = key {
-            if keys != key {
-                // Show zero-based field numbers as one-based.
-                return Err(USimpleError::new(
-                    1,
-                    format!("incompatible join fields {}, {}", keys + 1, key + 1),
-                ));
-            }
-        }
-
-        return Ok(keys);
-    }
-
-    Ok(key.unwrap_or(0))
-}
-
-/// Parse the specified field string as a natural number and return
-/// the zero-based field number.
-fn parse_field_number(value: &str) -> UResult<usize> {
-    match value.parse::<usize>() {
-        Ok(result) if result > 0 => Ok(result - 1),
-        Err(e) if e.kind() == &IntErrorKind::PosOverflow => Ok(usize::MAX),
-        _ => Err(USimpleError::new(
-            1,
-            format!("invalid field number: {}", value.quote()),
-        )),
-    }
-}
-
-fn parse_file_number(value: &str) -> UResult<FileNum> {
-    match value {
-        "1" => Ok(FileNum::File1),
-        "2" => Ok(FileNum::File2),
-        value => Err(USimpleError::new(
-            1,
-            format!("invalid file number: {}", value.quote()),
-        )),
-    }
-}
-
-fn parse_field_number_option(value: Option<&str>) -> UResult<Option<usize>> {
-    match value {
-        None => Ok(None),
-        Some(val) => Ok(Some(parse_field_number(val)?)),
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_kill/kill.rs.html b/coreutils/dev/src/uu_kill/kill.rs.html deleted file mode 100644 index 27d3e2f8f..000000000 --- a/coreutils/dev/src/uu_kill/kill.rs.html +++ /dev/null @@ -1,423 +0,0 @@ -kill.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Maciej Dziardziel <fiedzia@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE file
-//  * that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) signalname pids killpg
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use nix::sys::signal::{self, Signal};
-use nix::unistd::Pid;
-use std::io::Error;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UError, UResult, USimpleError};
-use uucore::signals::{signal_by_name_or_value, ALL_SIGNALS};
-use uucore::{format_usage, help_about, help_usage, show};
-
-static ABOUT: &str = help_about!("kill.md");
-const USAGE: &str = help_usage!("kill.md");
-
-pub mod options {
-    pub static PIDS_OR_SIGNALS: &str = "pids_or_signals";
-    pub static LIST: &str = "list";
-    pub static TABLE: &str = "table";
-    pub static SIGNAL: &str = "signal";
-}
-
-#[derive(Clone, Copy)]
-pub enum Mode {
-    Kill,
-    Table,
-    List,
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let mut args = args.collect_ignore();
-    let obs_signal = handle_obsolete(&mut args);
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let mode = if matches.get_flag(options::TABLE) {
-        Mode::Table
-    } else if matches.get_flag(options::LIST) {
-        Mode::List
-    } else {
-        Mode::Kill
-    };
-
-    let pids_or_signals: Vec<String> = matches
-        .get_many::<String>(options::PIDS_OR_SIGNALS)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    match mode {
-        Mode::Kill => {
-            let sig = if let Some(signal) = obs_signal {
-                signal
-            } else if let Some(signal) = matches.get_one::<String>(options::SIGNAL) {
-                parse_signal_value(signal)?
-            } else {
-                15_usize //SIGTERM
-            };
-            let sig: Signal = (sig as i32)
-                .try_into()
-                .map_err(|e| std::io::Error::from_raw_os_error(e as i32))?;
-            let pids = parse_pids(&pids_or_signals)?;
-            kill(sig, &pids);
-            Ok(())
-        }
-        Mode::Table => {
-            table();
-            Ok(())
-        }
-        Mode::List => list(pids_or_signals.get(0)),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .allow_negative_numbers(true)
-        .arg(
-            Arg::new(options::LIST)
-                .short('l')
-                .long(options::LIST)
-                .help("Lists signals")
-                .conflicts_with(options::TABLE)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::TABLE)
-                .short('t')
-                .short_alias('L')
-                .long(options::TABLE)
-                .help("Lists table of signals")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SIGNAL)
-                .short('s')
-                .long(options::SIGNAL)
-                .value_name("signal")
-                .help("Sends given signal instead of SIGTERM"),
-        )
-        .arg(
-            Arg::new(options::PIDS_OR_SIGNALS)
-                .hide(true)
-                .action(ArgAction::Append),
-        )
-}
-
-fn handle_obsolete(args: &mut Vec<String>) -> Option<usize> {
-    // Sanity check
-    if args.len() > 2 {
-        // Old signal can only be in the first argument position
-        let slice = args[1].as_str();
-        if let Some(signal) = slice.strip_prefix('-') {
-            // Check if it is a valid signal
-            let opt_signal = signal_by_name_or_value(signal);
-            if opt_signal.is_some() {
-                // remove the signal before return
-                args.remove(1);
-                return opt_signal;
-            }
-        }
-    }
-    None
-}
-
-fn table() {
-    let name_width = ALL_SIGNALS.iter().map(|n| n.len()).max().unwrap();
-
-    for (idx, signal) in ALL_SIGNALS.iter().enumerate() {
-        print!("{0: >#2} {1: <#2$}", idx, signal, name_width + 2);
-        if (idx + 1) % 7 == 0 {
-            println!();
-        }
-    }
-    println!();
-}
-
-fn print_signal(signal_name_or_value: &str) -> UResult<()> {
-    for (value, &signal) in ALL_SIGNALS.iter().enumerate() {
-        if signal == signal_name_or_value || (format!("SIG{signal}")) == signal_name_or_value {
-            println!("{value}");
-            return Ok(());
-        } else if signal_name_or_value == value.to_string() {
-            println!("{signal}");
-            return Ok(());
-        }
-    }
-    Err(USimpleError::new(
-        1,
-        format!("unknown signal name {}", signal_name_or_value.quote()),
-    ))
-}
-
-fn print_signals() {
-    for (idx, signal) in ALL_SIGNALS.iter().enumerate() {
-        if idx > 0 {
-            print!(" ");
-        }
-        print!("{signal}");
-    }
-    println!();
-}
-
-fn list(arg: Option<&String>) -> UResult<()> {
-    match arg {
-        Some(x) => print_signal(x),
-        None => {
-            print_signals();
-            Ok(())
-        }
-    }
-}
-
-fn parse_signal_value(signal_name: &str) -> UResult<usize> {
-    let optional_signal_value = signal_by_name_or_value(signal_name);
-    match optional_signal_value {
-        Some(x) => Ok(x),
-        None => Err(USimpleError::new(
-            1,
-            format!("unknown signal name {}", signal_name.quote()),
-        )),
-    }
-}
-
-fn parse_pids(pids: &[String]) -> UResult<Vec<i32>> {
-    pids.iter()
-        .map(|x| {
-            x.parse::<i32>().map_err(|e| {
-                USimpleError::new(1, format!("failed to parse argument {}: {}", x.quote(), e))
-            })
-        })
-        .collect()
-}
-
-fn kill(sig: Signal, pids: &[i32]) {
-    for &pid in pids {
-        if let Err(e) = signal::kill(Pid::from_raw(pid), sig) {
-            show!(Error::from_raw_os_error(e as i32)
-                .map_err_context(|| format!("sending signal to {pid} failed")));
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_link/link.rs.html b/coreutils/dev/src/uu_link/link.rs.html deleted file mode 100644 index db271c376..000000000 --- a/coreutils/dev/src/uu_link/link.rs.html +++ /dev/null @@ -1,105 +0,0 @@ -link.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Michael Gehring <mg@ebfe.org>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-use clap::builder::ValueParser;
-use clap::{crate_version, Arg, Command};
-use std::ffi::OsString;
-use std::fs::hard_link;
-use std::path::Path;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult};
-use uucore::{format_usage, help_about, help_usage};
-
-static ABOUT: &str = help_about!("link.md");
-const USAGE: &str = help_usage!("link.md");
-
-pub mod options {
-    pub static FILES: &str = "FILES";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let files: Vec<_> = matches
-        .get_many::<OsString>(options::FILES)
-        .unwrap_or_default()
-        .collect();
-    let old = Path::new(files[0]);
-    let new = Path::new(files[1]);
-
-    hard_link(old, new)
-        .map_err_context(|| format!("cannot create link {} to {}", new.quote(), old.quote()))
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::FILES)
-                .hide(true)
-                .required(true)
-                .num_args(2)
-                .value_hint(clap::ValueHint::AnyPath)
-                .value_parser(ValueParser::os_string()),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_ln/ln.rs.html b/coreutils/dev/src/uu_ln/ln.rs.html deleted file mode 100644 index e31d008d8..000000000 --- a/coreutils/dev/src/uu_ln/ln.rs.html +++ /dev/null @@ -1,953 +0,0 @@ -ln.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Joseph Crail <jbcrail@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) srcpath targetpath EEXIST
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UError, UResult};
-use uucore::fs::{make_path_relative_to, paths_refer_to_same_file};
-use uucore::{format_usage, help_about, help_section, help_usage, prompt_yes, show_error};
-
-use std::borrow::Cow;
-use std::error::Error;
-use std::ffi::OsString;
-use std::fmt::Display;
-use std::fs;
-
-#[cfg(any(unix, target_os = "redox"))]
-use std::os::unix::fs::symlink;
-#[cfg(windows)]
-use std::os::windows::fs::{symlink_dir, symlink_file};
-use std::path::{Path, PathBuf};
-use uucore::backup_control::{self, BackupMode};
-use uucore::fs::{canonicalize, MissingHandling, ResolveMode};
-
-pub struct Settings {
-    overwrite: OverwriteMode,
-    backup: BackupMode,
-    suffix: String,
-    symbolic: bool,
-    relative: bool,
-    logical: bool,
-    target_dir: Option<String>,
-    no_target_dir: bool,
-    no_dereference: bool,
-    verbose: bool,
-}
-
-#[derive(Clone, Debug, Eq, PartialEq)]
-pub enum OverwriteMode {
-    NoClobber,
-    Interactive,
-    Force,
-}
-
-#[derive(Debug)]
-enum LnError {
-    TargetIsDirectory(PathBuf),
-    SomeLinksFailed,
-    SameFile(PathBuf, PathBuf),
-    MissingDestination(PathBuf),
-    ExtraOperand(OsString),
-}
-
-impl Display for LnError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::TargetIsDirectory(s) => write!(f, "target {} is not a directory", s.quote()),
-            Self::SameFile(s, d) => {
-                write!(f, "{} and {} are the same file", s.quote(), d.quote())
-            }
-            Self::SomeLinksFailed => Ok(()),
-            Self::MissingDestination(s) => {
-                write!(f, "missing destination file operand after {}", s.quote())
-            }
-            Self::ExtraOperand(s) => write!(
-                f,
-                "extra operand {}\nTry '{} --help' for more information.",
-                s.quote(),
-                uucore::execution_phrase()
-            ),
-        }
-    }
-}
-
-impl Error for LnError {}
-
-impl UError for LnError {
-    fn code(&self) -> i32 {
-        1
-    }
-}
-
-const ABOUT: &str = help_about!("ln.md");
-const USAGE: &str = help_usage!("ln.md");
-const AFTER_HELP: &str = help_section!("after help", "ln.md");
-
-mod options {
-    pub const FORCE: &str = "force";
-    //pub const DIRECTORY: &str = "directory";
-    pub const INTERACTIVE: &str = "interactive";
-    pub const NO_DEREFERENCE: &str = "no-dereference";
-    pub const SYMBOLIC: &str = "symbolic";
-    pub const LOGICAL: &str = "logical";
-    pub const PHYSICAL: &str = "physical";
-    pub const TARGET_DIRECTORY: &str = "target-directory";
-    pub const NO_TARGET_DIRECTORY: &str = "no-target-directory";
-    pub const RELATIVE: &str = "relative";
-    pub const VERBOSE: &str = "verbose";
-}
-
-static ARG_FILES: &str = "files";
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let after_help = format!(
-        "{}\n\n{}",
-        AFTER_HELP,
-        backup_control::BACKUP_CONTROL_LONG_HELP
-    );
-
-    let matches = uu_app().after_help(after_help).try_get_matches_from(args)?;
-
-    /* the list of files */
-
-    let paths: Vec<PathBuf> = matches
-        .get_many::<String>(ARG_FILES)
-        .unwrap()
-        .map(PathBuf::from)
-        .collect();
-
-    let symbolic = matches.get_flag(options::SYMBOLIC);
-
-    let overwrite_mode = if matches.get_flag(options::FORCE) {
-        OverwriteMode::Force
-    } else if matches.get_flag(options::INTERACTIVE) {
-        OverwriteMode::Interactive
-    } else {
-        OverwriteMode::NoClobber
-    };
-
-    let backup_mode = backup_control::determine_backup_mode(&matches)?;
-    let backup_suffix = backup_control::determine_backup_suffix(&matches);
-
-    // When we have "-L" or "-L -P", false otherwise
-    let logical = matches.get_flag(options::LOGICAL);
-
-    let settings = Settings {
-        overwrite: overwrite_mode,
-        backup: backup_mode,
-        suffix: backup_suffix,
-        symbolic,
-        logical,
-        relative: matches.get_flag(options::RELATIVE),
-        target_dir: matches
-            .get_one::<String>(options::TARGET_DIRECTORY)
-            .map(String::from),
-        no_target_dir: matches.get_flag(options::NO_TARGET_DIRECTORY),
-        no_dereference: matches.get_flag(options::NO_DEREFERENCE),
-        verbose: matches.get_flag(options::VERBOSE),
-    };
-
-    exec(&paths[..], &settings)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(backup_control::arguments::backup())
-        .arg(backup_control::arguments::backup_no_args())
-        /*.arg(
-            Arg::new(options::DIRECTORY)
-                .short('d')
-                .long(options::DIRECTORY)
-                .help("allow users with appropriate privileges to attempt to make hard links to directories")
-        )*/
-        .arg(
-            Arg::new(options::FORCE)
-                .short('f')
-                .long(options::FORCE)
-                .help("remove existing destination files")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::INTERACTIVE)
-                .short('i')
-                .long(options::INTERACTIVE)
-                .help("prompt whether to remove existing destination files")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NO_DEREFERENCE)
-                .short('n')
-                .long(options::NO_DEREFERENCE)
-                .help(
-                    "treat LINK_NAME as a normal file if it is a \
-                     symbolic link to a directory",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::LOGICAL)
-                .short('L')
-                .long(options::LOGICAL)
-                .help("follow TARGETs that are symbolic links")
-                .overrides_with(options::PHYSICAL)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            // Not implemented yet
-            Arg::new(options::PHYSICAL)
-                .short('P')
-                .long(options::PHYSICAL)
-                .help("make hard links directly to symbolic links")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SYMBOLIC)
-                .short('s')
-                .long(options::SYMBOLIC)
-                .help("make symbolic links instead of hard links")
-                // override added for https://github.com/uutils/coreutils/issues/2359
-                .overrides_with(options::SYMBOLIC)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(backup_control::arguments::suffix())
-        .arg(
-            Arg::new(options::TARGET_DIRECTORY)
-                .short('t')
-                .long(options::TARGET_DIRECTORY)
-                .help("specify the DIRECTORY in which to create the links")
-                .value_name("DIRECTORY")
-                .value_hint(clap::ValueHint::DirPath)
-                .conflicts_with(options::NO_TARGET_DIRECTORY),
-        )
-        .arg(
-            Arg::new(options::NO_TARGET_DIRECTORY)
-                .short('T')
-                .long(options::NO_TARGET_DIRECTORY)
-                .help("treat LINK_NAME as a normal file always")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::RELATIVE)
-                .short('r')
-                .long(options::RELATIVE)
-                .help("create symbolic links relative to link location")
-                .requires(options::SYMBOLIC)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::VERBOSE)
-                .short('v')
-                .long(options::VERBOSE)
-                .help("print name of each linked file")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath)
-                .required(true)
-                .num_args(1..),
-        )
-}
-
-fn exec(files: &[PathBuf], settings: &Settings) -> UResult<()> {
-    // Handle cases where we create links in a directory first.
-    if let Some(ref name) = settings.target_dir {
-        // 4th form: a directory is specified by -t.
-        return link_files_in_dir(files, &PathBuf::from(name), settings);
-    }
-    if !settings.no_target_dir {
-        if files.len() == 1 {
-            // 2nd form: the target directory is the current directory.
-            return link_files_in_dir(files, &PathBuf::from("."), settings);
-        }
-        let last_file = &PathBuf::from(files.last().unwrap());
-        if files.len() > 2 || last_file.is_dir() {
-            // 3rd form: create links in the last argument.
-            return link_files_in_dir(&files[0..files.len() - 1], last_file, settings);
-        }
-    }
-
-    // 1st form. Now there should be only two operands, but if -T is
-    // specified we may have a wrong number of operands.
-    if files.len() == 1 {
-        return Err(LnError::MissingDestination(files[0].clone()).into());
-    }
-    if files.len() > 2 {
-        return Err(LnError::ExtraOperand(files[2].clone().into()).into());
-    }
-    assert!(!files.is_empty());
-
-    link(&files[0], &files[1], settings)
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn link_files_in_dir(files: &[PathBuf], target_dir: &Path, settings: &Settings) -> UResult<()> {
-    if !target_dir.is_dir() {
-        return Err(LnError::TargetIsDirectory(target_dir.to_owned()).into());
-    }
-
-    let mut all_successful = true;
-    for srcpath in files.iter() {
-        let targetpath =
-            if settings.no_dereference && matches!(settings.overwrite, OverwriteMode::Force) {
-                // In that case, we don't want to do link resolution
-                // We need to clean the target
-                if target_dir.is_symlink() {
-                    if target_dir.is_file() {
-                        if let Err(e) = fs::remove_file(target_dir) {
-                            show_error!("Could not update {}: {}", target_dir.quote(), e);
-                        };
-                    }
-                    if target_dir.is_dir() {
-                        // Not sure why but on Windows, the symlink can be
-                        // considered as a dir
-                        // See test_ln::test_symlink_no_deref_dir
-                        if let Err(e) = fs::remove_dir(target_dir) {
-                            show_error!("Could not update {}: {}", target_dir.quote(), e);
-                        };
-                    }
-                }
-                target_dir.to_path_buf()
-            } else {
-                match srcpath.as_os_str().to_str() {
-                    Some(name) => {
-                        match Path::new(name).file_name() {
-                            Some(basename) => target_dir.join(basename),
-                            // This can be None only for "." or "..". Trying
-                            // to create a link with such name will fail with
-                            // EEXIST, which agrees with the behavior of GNU
-                            // coreutils.
-                            None => target_dir.join(name),
-                        }
-                    }
-                    None => {
-                        show_error!("cannot stat {}: No such file or directory", srcpath.quote());
-                        all_successful = false;
-                        continue;
-                    }
-                }
-            };
-
-        if let Err(e) = link(srcpath, &targetpath, settings) {
-            show_error!("{}", e);
-            all_successful = false;
-        }
-    }
-    if all_successful {
-        Ok(())
-    } else {
-        Err(LnError::SomeLinksFailed.into())
-    }
-}
-
-fn relative_path<'a>(src: &'a Path, dst: &Path) -> Cow<'a, Path> {
-    if let Ok(src_abs) = canonicalize(src, MissingHandling::Missing, ResolveMode::Physical) {
-        if let Ok(dst_abs) = canonicalize(
-            dst.parent().unwrap(),
-            MissingHandling::Missing,
-            ResolveMode::Physical,
-        ) {
-            return make_path_relative_to(src_abs, dst_abs).into();
-        }
-    }
-    src.into()
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn link(src: &Path, dst: &Path, settings: &Settings) -> UResult<()> {
-    let mut backup_path = None;
-    let source: Cow<'_, Path> = if settings.relative {
-        relative_path(src, dst)
-    } else {
-        src.into()
-    };
-
-    if dst.is_symlink() || dst.exists() {
-        backup_path = match settings.backup {
-            BackupMode::NoBackup => None,
-            BackupMode::SimpleBackup => Some(simple_backup_path(dst, &settings.suffix)),
-            BackupMode::NumberedBackup => Some(numbered_backup_path(dst)),
-            BackupMode::ExistingBackup => Some(existing_backup_path(dst, &settings.suffix)),
-        };
-        if settings.backup == BackupMode::ExistingBackup && !settings.symbolic {
-            // when ln --backup f f, it should detect that it is the same file
-            if paths_refer_to_same_file(src, dst, true) {
-                return Err(LnError::SameFile(src.to_owned(), dst.to_owned()).into());
-            }
-        }
-        if let Some(ref p) = backup_path {
-            fs::rename(dst, p).map_err_context(|| format!("cannot backup {}", dst.quote()))?;
-        }
-        match settings.overwrite {
-            OverwriteMode::NoClobber => {}
-            OverwriteMode::Interactive => {
-                if !prompt_yes!("replace {}?", dst.quote()) {
-                    return Err(LnError::SomeLinksFailed.into());
-                }
-
-                if fs::remove_file(dst).is_ok() {};
-                // In case of error, don't do anything
-            }
-            OverwriteMode::Force => {
-                if !dst.is_symlink() && paths_refer_to_same_file(src, dst, true) {
-                    return Err(LnError::SameFile(src.to_owned(), dst.to_owned()).into());
-                }
-                if fs::remove_file(dst).is_ok() {};
-                // In case of error, don't do anything
-            }
-        };
-    }
-
-    if settings.symbolic {
-        symlink(&source, dst)?;
-    } else {
-        let p = if settings.logical && source.is_symlink() {
-            // if we want to have an hard link,
-            // source is a symlink and -L is passed
-            // we want to resolve the symlink to create the hardlink
-            fs::canonicalize(&source)
-                .map_err_context(|| format!("failed to access {}", source.quote()))?
-        } else {
-            source.to_path_buf()
-        };
-        fs::hard_link(p, dst).map_err_context(|| {
-            format!(
-                "failed to create hard link {} => {}",
-                source.quote(),
-                dst.quote()
-            )
-        })?;
-    }
-
-    if settings.verbose {
-        print!("{} -> {}", dst.quote(), source.quote());
-        match backup_path {
-            Some(path) => println!(" (backup: {})", path.quote()),
-            None => println!(),
-        }
-    }
-    Ok(())
-}
-
-fn simple_backup_path(path: &Path, suffix: &str) -> PathBuf {
-    let mut p = path.as_os_str().to_str().unwrap().to_owned();
-    p.push_str(suffix);
-    PathBuf::from(p)
-}
-
-fn numbered_backup_path(path: &Path) -> PathBuf {
-    let mut i: u64 = 1;
-    loop {
-        let new_path = simple_backup_path(path, &format!(".~{i}~"));
-        if !new_path.exists() {
-            return new_path;
-        }
-        i += 1;
-    }
-}
-
-fn existing_backup_path(path: &Path, suffix: &str) -> PathBuf {
-    let test_path = simple_backup_path(path, ".~1~");
-    if test_path.exists() {
-        return numbered_backup_path(path);
-    }
-    simple_backup_path(path, suffix)
-}
-
-#[cfg(windows)]
-pub fn symlink<P1: AsRef<Path>, P2: AsRef<Path>>(src: P1, dst: P2) -> std::io::Result<()> {
-    if src.as_ref().is_dir() {
-        symlink_dir(src, dst)
-    } else {
-        symlink_file(src, dst)
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_logname/logname.rs.html b/coreutils/dev/src/uu_logname/logname.rs.html deleted file mode 100644 index ddfd7e1fb..000000000 --- a/coreutils/dev/src/uu_logname/logname.rs.html +++ /dev/null @@ -1,111 +0,0 @@ -logname.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Benoit Benedetti <benoit.benedetti@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-/* last synced with: logname (GNU coreutils) 8.22 */
-
-// spell-checker:ignore (ToDO) getlogin userlogin
-
-use clap::{crate_version, Command};
-use std::ffi::CStr;
-use uucore::{error::UResult, format_usage, help_about, help_usage, show_error};
-
-extern "C" {
-    // POSIX requires using getlogin (or equivalent code)
-    pub fn getlogin() -> *const libc::c_char;
-}
-
-fn get_userlogin() -> Option<String> {
-    unsafe {
-        let login: *const libc::c_char = getlogin();
-        if login.is_null() {
-            None
-        } else {
-            Some(String::from_utf8_lossy(CStr::from_ptr(login).to_bytes()).to_string())
-        }
-    }
-}
-
-const ABOUT: &str = help_about!("logname.md");
-const USAGE: &str = help_usage!("logname.md");
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let _ = uu_app().try_get_matches_from(args)?;
-
-    match get_userlogin() {
-        Some(userlogin) => println!("{userlogin}"),
-        None => show_error!("no login name"),
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .infer_long_args(true)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_ls/ls.rs.html b/coreutils/dev/src/uu_ls/ls.rs.html deleted file mode 100644 index 7e35623cc..000000000 --- a/coreutils/dev/src/uu_ls/ls.rs.html +++ /dev/null @@ -1,6333 +0,0 @@ -ls.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
-1143
-1144
-1145
-1146
-1147
-1148
-1149
-1150
-1151
-1152
-1153
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162
-1163
-1164
-1165
-1166
-1167
-1168
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179
-1180
-1181
-1182
-1183
-1184
-1185
-1186
-1187
-1188
-1189
-1190
-1191
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200
-1201
-1202
-1203
-1204
-1205
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214
-1215
-1216
-1217
-1218
-1219
-1220
-1221
-1222
-1223
-1224
-1225
-1226
-1227
-1228
-1229
-1230
-1231
-1232
-1233
-1234
-1235
-1236
-1237
-1238
-1239
-1240
-1241
-1242
-1243
-1244
-1245
-1246
-1247
-1248
-1249
-1250
-1251
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-1265
-1266
-1267
-1268
-1269
-1270
-1271
-1272
-1273
-1274
-1275
-1276
-1277
-1278
-1279
-1280
-1281
-1282
-1283
-1284
-1285
-1286
-1287
-1288
-1289
-1290
-1291
-1292
-1293
-1294
-1295
-1296
-1297
-1298
-1299
-1300
-1301
-1302
-1303
-1304
-1305
-1306
-1307
-1308
-1309
-1310
-1311
-1312
-1313
-1314
-1315
-1316
-1317
-1318
-1319
-1320
-1321
-1322
-1323
-1324
-1325
-1326
-1327
-1328
-1329
-1330
-1331
-1332
-1333
-1334
-1335
-1336
-1337
-1338
-1339
-1340
-1341
-1342
-1343
-1344
-1345
-1346
-1347
-1348
-1349
-1350
-1351
-1352
-1353
-1354
-1355
-1356
-1357
-1358
-1359
-1360
-1361
-1362
-1363
-1364
-1365
-1366
-1367
-1368
-1369
-1370
-1371
-1372
-1373
-1374
-1375
-1376
-1377
-1378
-1379
-1380
-1381
-1382
-1383
-1384
-1385
-1386
-1387
-1388
-1389
-1390
-1391
-1392
-1393
-1394
-1395
-1396
-1397
-1398
-1399
-1400
-1401
-1402
-1403
-1404
-1405
-1406
-1407
-1408
-1409
-1410
-1411
-1412
-1413
-1414
-1415
-1416
-1417
-1418
-1419
-1420
-1421
-1422
-1423
-1424
-1425
-1426
-1427
-1428
-1429
-1430
-1431
-1432
-1433
-1434
-1435
-1436
-1437
-1438
-1439
-1440
-1441
-1442
-1443
-1444
-1445
-1446
-1447
-1448
-1449
-1450
-1451
-1452
-1453
-1454
-1455
-1456
-1457
-1458
-1459
-1460
-1461
-1462
-1463
-1464
-1465
-1466
-1467
-1468
-1469
-1470
-1471
-1472
-1473
-1474
-1475
-1476
-1477
-1478
-1479
-1480
-1481
-1482
-1483
-1484
-1485
-1486
-1487
-1488
-1489
-1490
-1491
-1492
-1493
-1494
-1495
-1496
-1497
-1498
-1499
-1500
-1501
-1502
-1503
-1504
-1505
-1506
-1507
-1508
-1509
-1510
-1511
-1512
-1513
-1514
-1515
-1516
-1517
-1518
-1519
-1520
-1521
-1522
-1523
-1524
-1525
-1526
-1527
-1528
-1529
-1530
-1531
-1532
-1533
-1534
-1535
-1536
-1537
-1538
-1539
-1540
-1541
-1542
-1543
-1544
-1545
-1546
-1547
-1548
-1549
-1550
-1551
-1552
-1553
-1554
-1555
-1556
-1557
-1558
-1559
-1560
-1561
-1562
-1563
-1564
-1565
-1566
-1567
-1568
-1569
-1570
-1571
-1572
-1573
-1574
-1575
-1576
-1577
-1578
-1579
-1580
-1581
-1582
-1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590
-1591
-1592
-1593
-1594
-1595
-1596
-1597
-1598
-1599
-1600
-1601
-1602
-1603
-1604
-1605
-1606
-1607
-1608
-1609
-1610
-1611
-1612
-1613
-1614
-1615
-1616
-1617
-1618
-1619
-1620
-1621
-1622
-1623
-1624
-1625
-1626
-1627
-1628
-1629
-1630
-1631
-1632
-1633
-1634
-1635
-1636
-1637
-1638
-1639
-1640
-1641
-1642
-1643
-1644
-1645
-1646
-1647
-1648
-1649
-1650
-1651
-1652
-1653
-1654
-1655
-1656
-1657
-1658
-1659
-1660
-1661
-1662
-1663
-1664
-1665
-1666
-1667
-1668
-1669
-1670
-1671
-1672
-1673
-1674
-1675
-1676
-1677
-1678
-1679
-1680
-1681
-1682
-1683
-1684
-1685
-1686
-1687
-1688
-1689
-1690
-1691
-1692
-1693
-1694
-1695
-1696
-1697
-1698
-1699
-1700
-1701
-1702
-1703
-1704
-1705
-1706
-1707
-1708
-1709
-1710
-1711
-1712
-1713
-1714
-1715
-1716
-1717
-1718
-1719
-1720
-1721
-1722
-1723
-1724
-1725
-1726
-1727
-1728
-1729
-1730
-1731
-1732
-1733
-1734
-1735
-1736
-1737
-1738
-1739
-1740
-1741
-1742
-1743
-1744
-1745
-1746
-1747
-1748
-1749
-1750
-1751
-1752
-1753
-1754
-1755
-1756
-1757
-1758
-1759
-1760
-1761
-1762
-1763
-1764
-1765
-1766
-1767
-1768
-1769
-1770
-1771
-1772
-1773
-1774
-1775
-1776
-1777
-1778
-1779
-1780
-1781
-1782
-1783
-1784
-1785
-1786
-1787
-1788
-1789
-1790
-1791
-1792
-1793
-1794
-1795
-1796
-1797
-1798
-1799
-1800
-1801
-1802
-1803
-1804
-1805
-1806
-1807
-1808
-1809
-1810
-1811
-1812
-1813
-1814
-1815
-1816
-1817
-1818
-1819
-1820
-1821
-1822
-1823
-1824
-1825
-1826
-1827
-1828
-1829
-1830
-1831
-1832
-1833
-1834
-1835
-1836
-1837
-1838
-1839
-1840
-1841
-1842
-1843
-1844
-1845
-1846
-1847
-1848
-1849
-1850
-1851
-1852
-1853
-1854
-1855
-1856
-1857
-1858
-1859
-1860
-1861
-1862
-1863
-1864
-1865
-1866
-1867
-1868
-1869
-1870
-1871
-1872
-1873
-1874
-1875
-1876
-1877
-1878
-1879
-1880
-1881
-1882
-1883
-1884
-1885
-1886
-1887
-1888
-1889
-1890
-1891
-1892
-1893
-1894
-1895
-1896
-1897
-1898
-1899
-1900
-1901
-1902
-1903
-1904
-1905
-1906
-1907
-1908
-1909
-1910
-1911
-1912
-1913
-1914
-1915
-1916
-1917
-1918
-1919
-1920
-1921
-1922
-1923
-1924
-1925
-1926
-1927
-1928
-1929
-1930
-1931
-1932
-1933
-1934
-1935
-1936
-1937
-1938
-1939
-1940
-1941
-1942
-1943
-1944
-1945
-1946
-1947
-1948
-1949
-1950
-1951
-1952
-1953
-1954
-1955
-1956
-1957
-1958
-1959
-1960
-1961
-1962
-1963
-1964
-1965
-1966
-1967
-1968
-1969
-1970
-1971
-1972
-1973
-1974
-1975
-1976
-1977
-1978
-1979
-1980
-1981
-1982
-1983
-1984
-1985
-1986
-1987
-1988
-1989
-1990
-1991
-1992
-1993
-1994
-1995
-1996
-1997
-1998
-1999
-2000
-2001
-2002
-2003
-2004
-2005
-2006
-2007
-2008
-2009
-2010
-2011
-2012
-2013
-2014
-2015
-2016
-2017
-2018
-2019
-2020
-2021
-2022
-2023
-2024
-2025
-2026
-2027
-2028
-2029
-2030
-2031
-2032
-2033
-2034
-2035
-2036
-2037
-2038
-2039
-2040
-2041
-2042
-2043
-2044
-2045
-2046
-2047
-2048
-2049
-2050
-2051
-2052
-2053
-2054
-2055
-2056
-2057
-2058
-2059
-2060
-2061
-2062
-2063
-2064
-2065
-2066
-2067
-2068
-2069
-2070
-2071
-2072
-2073
-2074
-2075
-2076
-2077
-2078
-2079
-2080
-2081
-2082
-2083
-2084
-2085
-2086
-2087
-2088
-2089
-2090
-2091
-2092
-2093
-2094
-2095
-2096
-2097
-2098
-2099
-2100
-2101
-2102
-2103
-2104
-2105
-2106
-2107
-2108
-2109
-2110
-2111
-2112
-2113
-2114
-2115
-2116
-2117
-2118
-2119
-2120
-2121
-2122
-2123
-2124
-2125
-2126
-2127
-2128
-2129
-2130
-2131
-2132
-2133
-2134
-2135
-2136
-2137
-2138
-2139
-2140
-2141
-2142
-2143
-2144
-2145
-2146
-2147
-2148
-2149
-2150
-2151
-2152
-2153
-2154
-2155
-2156
-2157
-2158
-2159
-2160
-2161
-2162
-2163
-2164
-2165
-2166
-2167
-2168
-2169
-2170
-2171
-2172
-2173
-2174
-2175
-2176
-2177
-2178
-2179
-2180
-2181
-2182
-2183
-2184
-2185
-2186
-2187
-2188
-2189
-2190
-2191
-2192
-2193
-2194
-2195
-2196
-2197
-2198
-2199
-2200
-2201
-2202
-2203
-2204
-2205
-2206
-2207
-2208
-2209
-2210
-2211
-2212
-2213
-2214
-2215
-2216
-2217
-2218
-2219
-2220
-2221
-2222
-2223
-2224
-2225
-2226
-2227
-2228
-2229
-2230
-2231
-2232
-2233
-2234
-2235
-2236
-2237
-2238
-2239
-2240
-2241
-2242
-2243
-2244
-2245
-2246
-2247
-2248
-2249
-2250
-2251
-2252
-2253
-2254
-2255
-2256
-2257
-2258
-2259
-2260
-2261
-2262
-2263
-2264
-2265
-2266
-2267
-2268
-2269
-2270
-2271
-2272
-2273
-2274
-2275
-2276
-2277
-2278
-2279
-2280
-2281
-2282
-2283
-2284
-2285
-2286
-2287
-2288
-2289
-2290
-2291
-2292
-2293
-2294
-2295
-2296
-2297
-2298
-2299
-2300
-2301
-2302
-2303
-2304
-2305
-2306
-2307
-2308
-2309
-2310
-2311
-2312
-2313
-2314
-2315
-2316
-2317
-2318
-2319
-2320
-2321
-2322
-2323
-2324
-2325
-2326
-2327
-2328
-2329
-2330
-2331
-2332
-2333
-2334
-2335
-2336
-2337
-2338
-2339
-2340
-2341
-2342
-2343
-2344
-2345
-2346
-2347
-2348
-2349
-2350
-2351
-2352
-2353
-2354
-2355
-2356
-2357
-2358
-2359
-2360
-2361
-2362
-2363
-2364
-2365
-2366
-2367
-2368
-2369
-2370
-2371
-2372
-2373
-2374
-2375
-2376
-2377
-2378
-2379
-2380
-2381
-2382
-2383
-2384
-2385
-2386
-2387
-2388
-2389
-2390
-2391
-2392
-2393
-2394
-2395
-2396
-2397
-2398
-2399
-2400
-2401
-2402
-2403
-2404
-2405
-2406
-2407
-2408
-2409
-2410
-2411
-2412
-2413
-2414
-2415
-2416
-2417
-2418
-2419
-2420
-2421
-2422
-2423
-2424
-2425
-2426
-2427
-2428
-2429
-2430
-2431
-2432
-2433
-2434
-2435
-2436
-2437
-2438
-2439
-2440
-2441
-2442
-2443
-2444
-2445
-2446
-2447
-2448
-2449
-2450
-2451
-2452
-2453
-2454
-2455
-2456
-2457
-2458
-2459
-2460
-2461
-2462
-2463
-2464
-2465
-2466
-2467
-2468
-2469
-2470
-2471
-2472
-2473
-2474
-2475
-2476
-2477
-2478
-2479
-2480
-2481
-2482
-2483
-2484
-2485
-2486
-2487
-2488
-2489
-2490
-2491
-2492
-2493
-2494
-2495
-2496
-2497
-2498
-2499
-2500
-2501
-2502
-2503
-2504
-2505
-2506
-2507
-2508
-2509
-2510
-2511
-2512
-2513
-2514
-2515
-2516
-2517
-2518
-2519
-2520
-2521
-2522
-2523
-2524
-2525
-2526
-2527
-2528
-2529
-2530
-2531
-2532
-2533
-2534
-2535
-2536
-2537
-2538
-2539
-2540
-2541
-2542
-2543
-2544
-2545
-2546
-2547
-2548
-2549
-2550
-2551
-2552
-2553
-2554
-2555
-2556
-2557
-2558
-2559
-2560
-2561
-2562
-2563
-2564
-2565
-2566
-2567
-2568
-2569
-2570
-2571
-2572
-2573
-2574
-2575
-2576
-2577
-2578
-2579
-2580
-2581
-2582
-2583
-2584
-2585
-2586
-2587
-2588
-2589
-2590
-2591
-2592
-2593
-2594
-2595
-2596
-2597
-2598
-2599
-2600
-2601
-2602
-2603
-2604
-2605
-2606
-2607
-2608
-2609
-2610
-2611
-2612
-2613
-2614
-2615
-2616
-2617
-2618
-2619
-2620
-2621
-2622
-2623
-2624
-2625
-2626
-2627
-2628
-2629
-2630
-2631
-2632
-2633
-2634
-2635
-2636
-2637
-2638
-2639
-2640
-2641
-2642
-2643
-2644
-2645
-2646
-2647
-2648
-2649
-2650
-2651
-2652
-2653
-2654
-2655
-2656
-2657
-2658
-2659
-2660
-2661
-2662
-2663
-2664
-2665
-2666
-2667
-2668
-2669
-2670
-2671
-2672
-2673
-2674
-2675
-2676
-2677
-2678
-2679
-2680
-2681
-2682
-2683
-2684
-2685
-2686
-2687
-2688
-2689
-2690
-2691
-2692
-2693
-2694
-2695
-2696
-2697
-2698
-2699
-2700
-2701
-2702
-2703
-2704
-2705
-2706
-2707
-2708
-2709
-2710
-2711
-2712
-2713
-2714
-2715
-2716
-2717
-2718
-2719
-2720
-2721
-2722
-2723
-2724
-2725
-2726
-2727
-2728
-2729
-2730
-2731
-2732
-2733
-2734
-2735
-2736
-2737
-2738
-2739
-2740
-2741
-2742
-2743
-2744
-2745
-2746
-2747
-2748
-2749
-2750
-2751
-2752
-2753
-2754
-2755
-2756
-2757
-2758
-2759
-2760
-2761
-2762
-2763
-2764
-2765
-2766
-2767
-2768
-2769
-2770
-2771
-2772
-2773
-2774
-2775
-2776
-2777
-2778
-2779
-2780
-2781
-2782
-2783
-2784
-2785
-2786
-2787
-2788
-2789
-2790
-2791
-2792
-2793
-2794
-2795
-2796
-2797
-2798
-2799
-2800
-2801
-2802
-2803
-2804
-2805
-2806
-2807
-2808
-2809
-2810
-2811
-2812
-2813
-2814
-2815
-2816
-2817
-2818
-2819
-2820
-2821
-2822
-2823
-2824
-2825
-2826
-2827
-2828
-2829
-2830
-2831
-2832
-2833
-2834
-2835
-2836
-2837
-2838
-2839
-2840
-2841
-2842
-2843
-2844
-2845
-2846
-2847
-2848
-2849
-2850
-2851
-2852
-2853
-2854
-2855
-2856
-2857
-2858
-2859
-2860
-2861
-2862
-2863
-2864
-2865
-2866
-2867
-2868
-2869
-2870
-2871
-2872
-2873
-2874
-2875
-2876
-2877
-2878
-2879
-2880
-2881
-2882
-2883
-2884
-2885
-2886
-2887
-2888
-2889
-2890
-2891
-2892
-2893
-2894
-2895
-2896
-2897
-2898
-2899
-2900
-2901
-2902
-2903
-2904
-2905
-2906
-2907
-2908
-2909
-2910
-2911
-2912
-2913
-2914
-2915
-2916
-2917
-2918
-2919
-2920
-2921
-2922
-2923
-2924
-2925
-2926
-2927
-2928
-2929
-2930
-2931
-2932
-2933
-2934
-2935
-2936
-2937
-2938
-2939
-2940
-2941
-2942
-2943
-2944
-2945
-2946
-2947
-2948
-2949
-2950
-2951
-2952
-2953
-2954
-2955
-2956
-2957
-2958
-2959
-2960
-2961
-2962
-2963
-2964
-2965
-2966
-2967
-2968
-2969
-2970
-2971
-2972
-2973
-2974
-2975
-2976
-2977
-2978
-2979
-2980
-2981
-2982
-2983
-2984
-2985
-2986
-2987
-2988
-2989
-2990
-2991
-2992
-2993
-2994
-2995
-2996
-2997
-2998
-2999
-3000
-3001
-3002
-3003
-3004
-3005
-3006
-3007
-3008
-3009
-3010
-3011
-3012
-3013
-3014
-3015
-3016
-3017
-3018
-3019
-3020
-3021
-3022
-3023
-3024
-3025
-3026
-3027
-3028
-3029
-3030
-3031
-3032
-3033
-3034
-3035
-3036
-3037
-3038
-3039
-3040
-3041
-3042
-3043
-3044
-3045
-3046
-3047
-3048
-3049
-3050
-3051
-3052
-3053
-3054
-3055
-3056
-3057
-3058
-3059
-3060
-3061
-3062
-3063
-3064
-3065
-3066
-3067
-3068
-3069
-3070
-3071
-3072
-3073
-3074
-3075
-3076
-3077
-3078
-3079
-3080
-3081
-3082
-3083
-3084
-3085
-3086
-3087
-3088
-3089
-3090
-3091
-3092
-3093
-3094
-3095
-3096
-3097
-3098
-3099
-3100
-3101
-3102
-3103
-3104
-3105
-3106
-3107
-3108
-3109
-3110
-3111
-3112
-3113
-3114
-3115
-3116
-3117
-3118
-3119
-3120
-3121
-3122
-3123
-3124
-3125
-3126
-3127
-3128
-3129
-3130
-3131
-3132
-3133
-3134
-3135
-3136
-3137
-3138
-3139
-3140
-3141
-3142
-3143
-3144
-3145
-3146
-3147
-3148
-3149
-3150
-3151
-3152
-3153
-3154
-3155
-3156
-3157
-3158
-3159
-3160
-3161
-3162
-3163
-3164
-3165
-3166
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jeremiah Peschka <jeremiah.peschka@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) cpio svgz webm somegroup nlink rmvb xspf tabsize dired
-
-use clap::{
-    builder::{NonEmptyStringValueParser, ValueParser},
-    crate_version, Arg, ArgAction, Command,
-};
-use glob::{MatchOptions, Pattern};
-use is_terminal::IsTerminal;
-use lscolors::LsColors;
-use number_prefix::NumberPrefix;
-use once_cell::unsync::OnceCell;
-use std::collections::HashSet;
-use std::num::IntErrorKind;
-
-#[cfg(windows)]
-use std::os::windows::fs::MetadataExt;
-use std::{
-    cmp::Reverse,
-    error::Error,
-    ffi::{OsStr, OsString},
-    fmt::{Display, Write as FmtWrite},
-    fs::{self, DirEntry, FileType, Metadata, ReadDir},
-    io::{stdout, BufWriter, ErrorKind, Stdout, Write},
-    path::{Path, PathBuf},
-    time::{SystemTime, UNIX_EPOCH},
-};
-#[cfg(unix)]
-use std::{
-    collections::HashMap,
-    os::unix::fs::{FileTypeExt, MetadataExt},
-    time::Duration,
-};
-use term_grid::{Cell, Direction, Filling, Grid, GridOptions};
-use unicode_width::UnicodeWidthStr;
-#[cfg(any(
-    target_os = "linux",
-    target_os = "macos",
-    target_os = "android",
-    target_os = "ios",
-    target_os = "freebsd",
-    target_os = "dragonfly",
-    target_os = "netbsd",
-    target_os = "openbsd",
-    target_os = "illumos",
-    target_os = "solaris"
-))]
-use uucore::libc::{dev_t, major, minor};
-#[cfg(unix)]
-use uucore::libc::{S_IXGRP, S_IXOTH, S_IXUSR};
-use uucore::line_ending::LineEnding;
-use uucore::quoting_style::{escape_name, QuotingStyle};
-use uucore::{
-    display::Quotable,
-    error::{set_exit_code, UError, UResult},
-    format_usage,
-    fs::display_permissions,
-    parse_size::parse_size,
-    version_cmp::version_cmp,
-};
-use uucore::{help_about, help_section, help_usage, parse_glob, show, show_error, show_warning};
-
-#[cfg(not(feature = "selinux"))]
-static CONTEXT_HELP_TEXT: &str = "print any security context of each file (not enabled)";
-#[cfg(feature = "selinux")]
-static CONTEXT_HELP_TEXT: &str = "print any security context of each file";
-
-const ABOUT: &str = help_about!("ls.md");
-const AFTER_HELP: &str = help_section!("after help", "ls.md");
-const USAGE: &str = help_usage!("ls.md");
-
-pub mod options {
-    pub mod format {
-        pub static ONE_LINE: &str = "1";
-        pub static LONG: &str = "long";
-        pub static COLUMNS: &str = "C";
-        pub static ACROSS: &str = "x";
-        pub static TAB_SIZE: &str = "tabsize"; // silently ignored (see #3624)
-        pub static COMMAS: &str = "m";
-        pub static LONG_NO_OWNER: &str = "g";
-        pub static LONG_NO_GROUP: &str = "o";
-        pub static LONG_NUMERIC_UID_GID: &str = "numeric-uid-gid";
-    }
-
-    pub mod files {
-        pub static ALL: &str = "all";
-        pub static ALMOST_ALL: &str = "almost-all";
-    }
-
-    pub mod sort {
-        pub static SIZE: &str = "S";
-        pub static TIME: &str = "t";
-        pub static NONE: &str = "U";
-        pub static VERSION: &str = "v";
-        pub static EXTENSION: &str = "X";
-    }
-
-    pub mod time {
-        pub static ACCESS: &str = "u";
-        pub static CHANGE: &str = "c";
-    }
-
-    pub mod size {
-        pub static ALLOCATION_SIZE: &str = "size";
-        pub static BLOCK_SIZE: &str = "block-size";
-        pub static HUMAN_READABLE: &str = "human-readable";
-        pub static SI: &str = "si";
-        pub static KIBIBYTES: &str = "kibibytes";
-    }
-
-    pub mod quoting {
-        pub static ESCAPE: &str = "escape";
-        pub static LITERAL: &str = "literal";
-        pub static C: &str = "quote-name";
-    }
-
-    pub mod indicator_style {
-        pub static SLASH: &str = "p";
-        pub static FILE_TYPE: &str = "file-type";
-        pub static CLASSIFY: &str = "classify";
-    }
-
-    pub mod dereference {
-        pub static ALL: &str = "dereference";
-        pub static ARGS: &str = "dereference-command-line";
-        pub static DIR_ARGS: &str = "dereference-command-line-symlink-to-dir";
-    }
-
-    pub static HELP: &str = "help";
-    pub static QUOTING_STYLE: &str = "quoting-style";
-    pub static HIDE_CONTROL_CHARS: &str = "hide-control-chars";
-    pub static SHOW_CONTROL_CHARS: &str = "show-control-chars";
-    pub static WIDTH: &str = "width";
-    pub static AUTHOR: &str = "author";
-    pub static NO_GROUP: &str = "no-group";
-    pub static FORMAT: &str = "format";
-    pub static SORT: &str = "sort";
-    pub static TIME: &str = "time";
-    pub static IGNORE_BACKUPS: &str = "ignore-backups";
-    pub static DIRECTORY: &str = "directory";
-    pub static INODE: &str = "inode";
-    pub static REVERSE: &str = "reverse";
-    pub static RECURSIVE: &str = "recursive";
-    pub static COLOR: &str = "color";
-    pub static PATHS: &str = "paths";
-    pub static INDICATOR_STYLE: &str = "indicator-style";
-    pub static TIME_STYLE: &str = "time-style";
-    pub static FULL_TIME: &str = "full-time";
-    pub static HIDE: &str = "hide";
-    pub static IGNORE: &str = "ignore";
-    pub static CONTEXT: &str = "context";
-    pub static GROUP_DIRECTORIES_FIRST: &str = "group-directories-first";
-    pub static ZERO: &str = "zero";
-    pub static DIRED: &str = "dired";
-}
-
-const DEFAULT_TERM_WIDTH: u16 = 80;
-const POSIXLY_CORRECT_BLOCK_SIZE: u64 = 512;
-#[cfg(unix)]
-const DEFAULT_BLOCK_SIZE: u64 = 1024;
-
-#[derive(Debug)]
-enum LsError {
-    InvalidLineWidth(String),
-    IOError(std::io::Error),
-    IOErrorContext(std::io::Error, PathBuf, bool),
-    BlockSizeParseError(String),
-    AlreadyListedError(PathBuf),
-    TimeStyleParseError(String, Vec<String>),
-}
-
-impl UError for LsError {
-    fn code(&self) -> i32 {
-        match self {
-            Self::InvalidLineWidth(_) => 2,
-            Self::IOError(_) => 1,
-            Self::IOErrorContext(_, _, false) => 1,
-            Self::IOErrorContext(_, _, true) => 2,
-            Self::BlockSizeParseError(_) => 1,
-            Self::AlreadyListedError(_) => 2,
-            Self::TimeStyleParseError(_, _) => 1,
-        }
-    }
-}
-
-impl Error for LsError {}
-
-impl Display for LsError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::BlockSizeParseError(s) => {
-                write!(f, "invalid --block-size argument {}", s.quote())
-            }
-            Self::TimeStyleParseError(s, possible_time_styles) => {
-                write!(
-                    f,
-                    "invalid --time-style argument {}\nPossible values are: {:?}\n\nFor more information try --help",
-                    s.quote(),
-                    possible_time_styles
-                )
-            }
-            Self::InvalidLineWidth(s) => write!(f, "invalid line width: {}", s.quote()),
-            Self::IOError(e) => write!(f, "general io error: {e}"),
-            Self::IOErrorContext(e, p, _) => {
-                let error_kind = e.kind();
-                let errno = e.raw_os_error().unwrap_or(1i32);
-
-                match error_kind {
-                    // No such file or directory
-                    ErrorKind::NotFound => {
-                        write!(
-                            f,
-                            "cannot access '{}': No such file or directory",
-                            p.to_string_lossy(),
-                        )
-                    }
-                    // Permission denied and Operation not permitted
-                    ErrorKind::PermissionDenied =>
-                    {
-                        #[allow(clippy::wildcard_in_or_patterns)]
-                        match errno {
-                            1i32 => {
-                                write!(
-                                    f,
-                                    "cannot access '{}': Operation not permitted",
-                                    p.to_string_lossy(),
-                                )
-                            }
-                            13i32 | _ => {
-                                if p.is_dir() {
-                                    write!(
-                                        f,
-                                        "cannot open directory '{}': Permission denied",
-                                        p.to_string_lossy(),
-                                    )
-                                } else {
-                                    write!(
-                                        f,
-                                        "cannot open file '{}': Permission denied",
-                                        p.to_string_lossy(),
-                                    )
-                                }
-                            }
-                        }
-                    }
-                    _ => match errno {
-                        9i32 => {
-                            // only should ever occur on a read_dir on a bad fd
-                            write!(
-                                f,
-                                "cannot open directory '{}': Bad file descriptor",
-                                p.to_string_lossy(),
-                            )
-                        }
-                        _ => {
-                            write!(
-                                f,
-                                "unknown io error: '{:?}', '{:?}'",
-                                p.to_string_lossy(),
-                                e
-                            )
-                        }
-                    },
-                }
-            }
-            Self::AlreadyListedError(path) => {
-                write!(
-                    f,
-                    "{}: not listing already-listed directory",
-                    path.to_string_lossy()
-                )
-            }
-        }
-    }
-}
-
-#[derive(PartialEq, Eq, Debug)]
-pub enum Format {
-    Columns,
-    Long,
-    OneLine,
-    Across,
-    Commas,
-}
-
-#[derive(PartialEq, Eq)]
-enum Sort {
-    None,
-    Name,
-    Size,
-    Time,
-    Version,
-    Extension,
-    Width,
-}
-
-#[derive(PartialEq)]
-enum SizeFormat {
-    Bytes,
-    Binary,  // Powers of 1024, --human-readable, -h
-    Decimal, // Powers of 1000, --si
-}
-
-#[derive(PartialEq, Eq)]
-enum Files {
-    All,
-    AlmostAll,
-    Normal,
-}
-
-enum Time {
-    Modification,
-    Access,
-    Change,
-    Birth,
-}
-
-#[derive(Debug)]
-enum TimeStyle {
-    FullIso,
-    LongIso,
-    Iso,
-    Locale,
-    Format(String),
-}
-
-fn parse_time_style(options: &clap::ArgMatches) -> Result<TimeStyle, LsError> {
-    let possible_time_styles = vec![
-        "full-iso".to_string(),
-        "long-iso".to_string(),
-        "iso".to_string(),
-        "locale".to_string(),
-        "+FORMAT (e.g., +%H:%M) for a 'date'-style format".to_string(),
-    ];
-    if let Some(field) = options.get_one::<String>(options::TIME_STYLE) {
-        //If both FULL_TIME and TIME_STYLE are present
-        //The one added last is dominant
-        if options.get_flag(options::FULL_TIME)
-            && options.indices_of(options::FULL_TIME).unwrap().last()
-                > options.indices_of(options::TIME_STYLE).unwrap().last()
-        {
-            Ok(TimeStyle::FullIso)
-        } else {
-            match field.as_str() {
-                "full-iso" => Ok(TimeStyle::FullIso),
-                "long-iso" => Ok(TimeStyle::LongIso),
-                "iso" => Ok(TimeStyle::Iso),
-                "locale" => Ok(TimeStyle::Locale),
-                _ => match field.chars().next().unwrap() {
-                    '+' => Ok(TimeStyle::Format(String::from(&field[1..]))),
-                    _ => Err(LsError::TimeStyleParseError(
-                        String::from(field),
-                        possible_time_styles,
-                    )),
-                },
-            }
-        }
-    } else if options.get_flag(options::FULL_TIME) {
-        Ok(TimeStyle::FullIso)
-    } else {
-        Ok(TimeStyle::Locale)
-    }
-}
-
-enum Dereference {
-    None,
-    DirArgs,
-    Args,
-    All,
-}
-
-#[derive(PartialEq, Eq)]
-enum IndicatorStyle {
-    None,
-    Slash,
-    FileType,
-    Classify,
-}
-
-pub struct Config {
-    // Dir and vdir needs access to this field
-    pub format: Format,
-    files: Files,
-    sort: Sort,
-    recursive: bool,
-    reverse: bool,
-    dereference: Dereference,
-    ignore_patterns: Vec<Pattern>,
-    size_format: SizeFormat,
-    directory: bool,
-    time: Time,
-    #[cfg(unix)]
-    inode: bool,
-    color: Option<LsColors>,
-    long: LongFormat,
-    alloc_size: bool,
-    block_size: Option<u64>,
-    width: u16,
-    // Dir and vdir needs access to this field
-    pub quoting_style: QuotingStyle,
-    indicator_style: IndicatorStyle,
-    time_style: TimeStyle,
-    context: bool,
-    selinux_supported: bool,
-    group_directories_first: bool,
-    line_ending: LineEnding,
-}
-
-// Fields that can be removed or added to the long format
-struct LongFormat {
-    author: bool,
-    group: bool,
-    owner: bool,
-    #[cfg(unix)]
-    numeric_uid_gid: bool,
-}
-
-struct PaddingCollection {
-    #[cfg(unix)]
-    inode: usize,
-    link_count: usize,
-    uname: usize,
-    group: usize,
-    context: usize,
-    size: usize,
-    #[cfg(unix)]
-    major: usize,
-    #[cfg(unix)]
-    minor: usize,
-    block_size: usize,
-}
-
-/// Extracts the format to display the information based on the options provided.
-///
-/// # Returns
-///
-/// A tuple containing the Format variant and an Option containing a &'static str
-/// which corresponds to the option used to define the format.
-fn extract_format(options: &clap::ArgMatches) -> (Format, Option<&'static str>) {
-    if let Some(format_) = options.get_one::<String>(options::FORMAT) {
-        (
-            match format_.as_str() {
-                "long" | "verbose" => Format::Long,
-                "single-column" => Format::OneLine,
-                "columns" | "vertical" => Format::Columns,
-                "across" | "horizontal" => Format::Across,
-                "commas" => Format::Commas,
-                // below should never happen as clap already restricts the values.
-                _ => unreachable!("Invalid field for --format"),
-            },
-            Some(options::FORMAT),
-        )
-    } else if options.get_flag(options::format::LONG) {
-        (Format::Long, Some(options::format::LONG))
-    } else if options.get_flag(options::format::ACROSS) {
-        (Format::Across, Some(options::format::ACROSS))
-    } else if options.get_flag(options::format::COMMAS) {
-        (Format::Commas, Some(options::format::COMMAS))
-    } else if options.get_flag(options::format::COLUMNS) {
-        (Format::Columns, Some(options::format::COLUMNS))
-    } else if std::io::stdout().is_terminal() {
-        (Format::Columns, None)
-    } else {
-        (Format::OneLine, None)
-    }
-}
-
-/// Extracts the type of files to display
-///
-/// # Returns
-///
-/// A Files variant representing the type of files to display.
-fn extract_files(options: &clap::ArgMatches) -> Files {
-    if options.get_flag(options::files::ALL) {
-        Files::All
-    } else if options.get_flag(options::files::ALMOST_ALL) {
-        Files::AlmostAll
-    } else {
-        Files::Normal
-    }
-}
-
-/// Extracts the sorting method to use based on the options provided.
-///
-/// # Returns
-///
-/// A Sort variant representing the sorting method to use.
-fn extract_sort(options: &clap::ArgMatches) -> Sort {
-    if let Some(field) = options.get_one::<String>(options::SORT) {
-        match field.as_str() {
-            "none" => Sort::None,
-            "name" => Sort::Name,
-            "time" => Sort::Time,
-            "size" => Sort::Size,
-            "version" => Sort::Version,
-            "extension" => Sort::Extension,
-            "width" => Sort::Width,
-            // below should never happen as clap already restricts the values.
-            _ => unreachable!("Invalid field for --sort"),
-        }
-    } else if options.get_flag(options::sort::TIME) {
-        Sort::Time
-    } else if options.get_flag(options::sort::SIZE) {
-        Sort::Size
-    } else if options.get_flag(options::sort::NONE) {
-        Sort::None
-    } else if options.get_flag(options::sort::VERSION) {
-        Sort::Version
-    } else if options.get_flag(options::sort::EXTENSION) {
-        Sort::Extension
-    } else {
-        Sort::Name
-    }
-}
-
-/// Extracts the time to use based on the options provided.
-///
-/// # Returns
-///
-/// A Time variant representing the time to use.
-fn extract_time(options: &clap::ArgMatches) -> Time {
-    if let Some(field) = options.get_one::<String>(options::TIME) {
-        match field.as_str() {
-            "ctime" | "status" => Time::Change,
-            "access" | "atime" | "use" => Time::Access,
-            "birth" | "creation" => Time::Birth,
-            // below should never happen as clap already restricts the values.
-            _ => unreachable!("Invalid field for --time"),
-        }
-    } else if options.get_flag(options::time::ACCESS) {
-        Time::Access
-    } else if options.get_flag(options::time::CHANGE) {
-        Time::Change
-    } else {
-        Time::Modification
-    }
-}
-
-/// Extracts the color option to use based on the options provided.
-///
-/// # Returns
-///
-/// A boolean representing whether or not to use color.
-fn extract_color(options: &clap::ArgMatches) -> bool {
-    match options.get_one::<String>(options::COLOR) {
-        None => options.contains_id(options::COLOR),
-        Some(val) => match val.as_str() {
-            "" | "always" | "yes" | "force" => true,
-            "auto" | "tty" | "if-tty" => std::io::stdout().is_terminal(),
-            /* "never" | "no" | "none" | */ _ => false,
-        },
-    }
-}
-
-/// Extracts the quoting style to use based on the options provided.
-///
-/// # Arguments
-///
-/// * `options` - A reference to a clap::ArgMatches object containing command line arguments.
-/// * `show_control` - A boolean value representing whether or not to show control characters.
-///
-/// # Returns
-///
-/// A QuotingStyle variant representing the quoting style to use.
-fn extract_quoting_style(options: &clap::ArgMatches, show_control: bool) -> QuotingStyle {
-    let opt_quoting_style = options
-        .get_one::<String>(options::QUOTING_STYLE)
-        .map(|cmd_line_qs| cmd_line_qs.to_owned());
-
-    if let Some(style) = opt_quoting_style {
-        match style.as_str() {
-            "literal" => QuotingStyle::Literal { show_control },
-            "shell" => QuotingStyle::Shell {
-                escape: false,
-                always_quote: false,
-                show_control,
-            },
-            "shell-always" => QuotingStyle::Shell {
-                escape: false,
-                always_quote: true,
-                show_control,
-            },
-            "shell-escape" => QuotingStyle::Shell {
-                escape: true,
-                always_quote: false,
-                show_control,
-            },
-            "shell-escape-always" => QuotingStyle::Shell {
-                escape: true,
-                always_quote: true,
-                show_control,
-            },
-            "c" => QuotingStyle::C {
-                quotes: quoting_style::Quotes::Double,
-            },
-            "escape" => QuotingStyle::C {
-                quotes: quoting_style::Quotes::None,
-            },
-            _ => unreachable!("Should have been caught by Clap"),
-        }
-    } else if options.get_flag(options::quoting::LITERAL) {
-        QuotingStyle::Literal { show_control }
-    } else if options.get_flag(options::quoting::ESCAPE) {
-        QuotingStyle::C {
-            quotes: quoting_style::Quotes::None,
-        }
-    } else if options.get_flag(options::quoting::C) {
-        QuotingStyle::C {
-            quotes: quoting_style::Quotes::Double,
-        }
-    } else {
-        // TODO: use environment variable if available
-        QuotingStyle::Shell {
-            escape: true,
-            always_quote: false,
-            show_control,
-        }
-    }
-}
-
-/// Extracts the indicator style to use based on the options provided.
-///
-/// # Returns
-///
-/// An IndicatorStyle variant representing the indicator style to use.
-fn extract_indicator_style(options: &clap::ArgMatches) -> IndicatorStyle {
-    if let Some(field) = options.get_one::<String>(options::INDICATOR_STYLE) {
-        match field.as_str() {
-            "none" => IndicatorStyle::None,
-            "file-type" => IndicatorStyle::FileType,
-            "classify" => IndicatorStyle::Classify,
-            "slash" => IndicatorStyle::Slash,
-            &_ => IndicatorStyle::None,
-        }
-    } else if let Some(field) = options.get_one::<String>(options::indicator_style::CLASSIFY) {
-        match field.as_str() {
-            "never" | "no" | "none" => IndicatorStyle::None,
-            "always" | "yes" | "force" => IndicatorStyle::Classify,
-            "auto" | "tty" | "if-tty" => {
-                if std::io::stdout().is_terminal() {
-                    IndicatorStyle::Classify
-                } else {
-                    IndicatorStyle::None
-                }
-            }
-            &_ => IndicatorStyle::None,
-        }
-    } else if options.get_flag(options::indicator_style::SLASH) {
-        IndicatorStyle::Slash
-    } else if options.get_flag(options::indicator_style::FILE_TYPE) {
-        IndicatorStyle::FileType
-    } else {
-        IndicatorStyle::None
-    }
-}
-
-fn parse_width(s: &str) -> Result<u16, LsError> {
-    let radix = match s.starts_with('0') && s.len() > 1 {
-        true => 8,
-        false => 10,
-    };
-    match u16::from_str_radix(s, radix) {
-        Ok(x) => Ok(x),
-        Err(e) => match e.kind() {
-            IntErrorKind::PosOverflow => Ok(u16::MAX),
-            _ => Err(LsError::InvalidLineWidth(s.into())),
-        },
-    }
-}
-impl Config {
-    #[allow(clippy::cognitive_complexity)]
-    pub fn from(options: &clap::ArgMatches) -> UResult<Self> {
-        let context = options.get_flag(options::CONTEXT);
-        let (mut format, opt) = extract_format(options);
-        let files = extract_files(options);
-
-        // The -o, -n and -g options are tricky. They cannot override with each
-        // other because it's possible to combine them. For example, the option
-        // -og should hide both owner and group. Furthermore, they are not
-        // reset if -l or --format=long is used. So these should just show the
-        // group: -gl or "-g --format=long". Finally, they are also not reset
-        // when switching to a different format option in-between like this:
-        // -ogCl or "-og --format=vertical --format=long".
-        //
-        // -1 has a similar issue: it does nothing if the format is long. This
-        // actually makes it distinct from the --format=singe-column option,
-        // which always applies.
-        //
-        // The idea here is to not let these options override with the other
-        // options, but manually whether they have an index that's greater than
-        // the other format options. If so, we set the appropriate format.
-        if format != Format::Long {
-            let idx = opt
-                .and_then(|opt| options.indices_of(opt).map(|x| x.max().unwrap()))
-                .unwrap_or(0);
-            if [
-                options::format::LONG_NO_OWNER,
-                options::format::LONG_NO_GROUP,
-                options::format::LONG_NUMERIC_UID_GID,
-                options::FULL_TIME,
-            ]
-            .iter()
-            .flat_map(|opt| {
-                if options.value_source(opt) == Some(clap::parser::ValueSource::CommandLine) {
-                    options.indices_of(opt)
-                } else {
-                    None
-                }
-            })
-            .flatten()
-            .any(|i| i >= idx)
-            {
-                format = Format::Long;
-            } else if let Some(mut indices) = options.indices_of(options::format::ONE_LINE) {
-                if options.value_source(options::format::ONE_LINE)
-                    == Some(clap::parser::ValueSource::CommandLine)
-                    && indices.any(|i| i > idx)
-                {
-                    format = Format::OneLine;
-                }
-            }
-        }
-
-        let sort = extract_sort(options);
-
-        let time = extract_time(options);
-
-        let mut needs_color = extract_color(options);
-
-        let cmd_line_bs = options.get_one::<String>(options::size::BLOCK_SIZE);
-        let opt_si = cmd_line_bs.is_some()
-            && options
-                .get_one::<String>(options::size::BLOCK_SIZE)
-                .unwrap()
-                .eq("si")
-            || options.get_flag(options::size::SI);
-        let opt_hr = (cmd_line_bs.is_some()
-            && options
-                .get_one::<String>(options::size::BLOCK_SIZE)
-                .unwrap()
-                .eq("human-readable"))
-            || options.get_flag(options::size::HUMAN_READABLE);
-        let opt_kb = options.get_flag(options::size::KIBIBYTES);
-
-        let bs_env_var = std::env::var_os("BLOCK_SIZE");
-        let ls_bs_env_var = std::env::var_os("LS_BLOCK_SIZE");
-        let pc_env_var = std::env::var_os("POSIXLY_CORRECT");
-
-        let size_format = if opt_si {
-            SizeFormat::Decimal
-        } else if opt_hr {
-            SizeFormat::Binary
-        } else {
-            SizeFormat::Bytes
-        };
-
-        let raw_bs = if let Some(cmd_line_bs) = cmd_line_bs {
-            OsString::from(cmd_line_bs)
-        } else if !opt_kb {
-            if let Some(ls_bs_env_var) = ls_bs_env_var {
-                ls_bs_env_var
-            } else if let Some(bs_env_var) = bs_env_var {
-                bs_env_var
-            } else {
-                OsString::from("")
-            }
-        } else {
-            OsString::from("")
-        };
-
-        let block_size: Option<u64> = if !opt_si && !opt_hr && !raw_bs.is_empty() {
-            match parse_size(&raw_bs.to_string_lossy()) {
-                Ok(size) => Some(size),
-                Err(_) => {
-                    show!(LsError::BlockSizeParseError(
-                        cmd_line_bs.unwrap().to_owned()
-                    ));
-                    None
-                }
-            }
-        } else if let Some(pc) = pc_env_var {
-            if pc.as_os_str() == OsStr::new("true") || pc == OsStr::new("1") {
-                Some(POSIXLY_CORRECT_BLOCK_SIZE)
-            } else {
-                None
-            }
-        } else {
-            None
-        };
-
-        let long = {
-            let author = options.get_flag(options::AUTHOR);
-            let group = !options.get_flag(options::NO_GROUP)
-                && !options.get_flag(options::format::LONG_NO_GROUP);
-            let owner = !options.get_flag(options::format::LONG_NO_OWNER);
-            #[cfg(unix)]
-            let numeric_uid_gid = options.get_flag(options::format::LONG_NUMERIC_UID_GID);
-            LongFormat {
-                author,
-                group,
-                owner,
-                #[cfg(unix)]
-                numeric_uid_gid,
-            }
-        };
-
-        let width = match options.get_one::<String>(options::WIDTH) {
-            Some(x) => parse_width(x)?,
-            None => match terminal_size::terminal_size() {
-                Some((width, _)) => width.0,
-                None => match std::env::var_os("COLUMNS") {
-                    Some(columns) => match columns.to_str().and_then(|s| s.parse().ok()) {
-                        Some(columns) => columns,
-                        None => {
-                            show_error!(
-                                "ignoring invalid width in environment variable COLUMNS: {}",
-                                columns.quote()
-                            );
-                            DEFAULT_TERM_WIDTH
-                        }
-                    },
-                    None => DEFAULT_TERM_WIDTH,
-                },
-            },
-        };
-
-        #[allow(clippy::needless_bool)]
-        let mut show_control = if options.get_flag(options::HIDE_CONTROL_CHARS) {
-            false
-        } else if options.get_flag(options::SHOW_CONTROL_CHARS) {
-            true
-        } else {
-            !std::io::stdout().is_terminal()
-        };
-
-        let mut quoting_style = extract_quoting_style(options, show_control);
-        let indicator_style = extract_indicator_style(options);
-        let time_style = parse_time_style(options)?;
-
-        let mut ignore_patterns: Vec<Pattern> = Vec::new();
-
-        if options.get_flag(options::IGNORE_BACKUPS) {
-            ignore_patterns.push(Pattern::new("*~").unwrap());
-            ignore_patterns.push(Pattern::new(".*~").unwrap());
-        }
-
-        for pattern in options
-            .get_many::<String>(options::IGNORE)
-            .into_iter()
-            .flatten()
-        {
-            match parse_glob::from_str(pattern) {
-                Ok(p) => {
-                    ignore_patterns.push(p);
-                }
-                Err(_) => show_warning!("Invalid pattern for ignore: {}", pattern.quote()),
-            }
-        }
-
-        if files == Files::Normal {
-            for pattern in options
-                .get_many::<String>(options::HIDE)
-                .into_iter()
-                .flatten()
-            {
-                match parse_glob::from_str(pattern) {
-                    Ok(p) => {
-                        ignore_patterns.push(p);
-                    }
-                    Err(_) => show_warning!("Invalid pattern for hide: {}", pattern.quote()),
-                }
-            }
-        }
-
-        // According to ls info page, `--zero` implies the following flags:
-        //  - `--show-control-chars`
-        //  - `--format=single-column`
-        //  - `--color=none`
-        //  - `--quoting-style=literal`
-        // Current GNU ls implementation allows `--zero` Behavior to be
-        // overridden by later flags.
-        let zero_formats_opts = [
-            options::format::ACROSS,
-            options::format::COLUMNS,
-            options::format::COMMAS,
-            options::format::LONG,
-            options::format::LONG_NO_GROUP,
-            options::format::LONG_NO_OWNER,
-            options::format::LONG_NUMERIC_UID_GID,
-            options::format::ONE_LINE,
-            options::FORMAT,
-        ];
-        let zero_colors_opts = [options::COLOR];
-        let zero_show_control_opts = [options::HIDE_CONTROL_CHARS, options::SHOW_CONTROL_CHARS];
-        let zero_quoting_style_opts = [
-            options::QUOTING_STYLE,
-            options::quoting::C,
-            options::quoting::ESCAPE,
-            options::quoting::LITERAL,
-        ];
-        let get_last = |flag: &str| -> usize {
-            if options.value_source(flag) == Some(clap::parser::ValueSource::CommandLine) {
-                options.index_of(flag).unwrap_or(0)
-            } else {
-                0
-            }
-        };
-        if get_last(options::ZERO)
-            > zero_formats_opts
-                .into_iter()
-                .map(get_last)
-                .max()
-                .unwrap_or(0)
-        {
-            format = if format == Format::Long {
-                format
-            } else {
-                Format::OneLine
-            };
-        }
-        if get_last(options::ZERO)
-            > zero_colors_opts
-                .into_iter()
-                .map(get_last)
-                .max()
-                .unwrap_or(0)
-        {
-            needs_color = false;
-        }
-        if get_last(options::ZERO)
-            > zero_show_control_opts
-                .into_iter()
-                .map(get_last)
-                .max()
-                .unwrap_or(0)
-        {
-            show_control = true;
-        }
-        if get_last(options::ZERO)
-            > zero_quoting_style_opts
-                .into_iter()
-                .map(get_last)
-                .max()
-                .unwrap_or(0)
-        {
-            quoting_style = QuotingStyle::Literal { show_control };
-        }
-
-        let color = if needs_color {
-            Some(LsColors::from_env().unwrap_or_default())
-        } else {
-            None
-        };
-
-        let dereference = if options.get_flag(options::dereference::ALL) {
-            Dereference::All
-        } else if options.get_flag(options::dereference::ARGS) {
-            Dereference::Args
-        } else if options.get_flag(options::dereference::DIR_ARGS) {
-            Dereference::DirArgs
-        } else if options.get_flag(options::DIRECTORY)
-            || indicator_style == IndicatorStyle::Classify
-            || format == Format::Long
-        {
-            Dereference::None
-        } else {
-            Dereference::DirArgs
-        };
-
-        Ok(Self {
-            format,
-            files,
-            sort,
-            recursive: options.get_flag(options::RECURSIVE),
-            reverse: options.get_flag(options::REVERSE),
-            dereference,
-            ignore_patterns,
-            size_format,
-            directory: options.get_flag(options::DIRECTORY),
-            time,
-            color,
-            #[cfg(unix)]
-            inode: options.get_flag(options::INODE),
-            long,
-            alloc_size: options.get_flag(options::size::ALLOCATION_SIZE),
-            block_size,
-            width,
-            quoting_style,
-            indicator_style,
-            time_style,
-            context,
-            selinux_supported: {
-                #[cfg(feature = "selinux")]
-                {
-                    selinux::kernel_support() != selinux::KernelSupport::Unsupported
-                }
-                #[cfg(not(feature = "selinux"))]
-                {
-                    false
-                }
-            },
-            group_directories_first: options.get_flag(options::GROUP_DIRECTORIES_FIRST),
-            line_ending: LineEnding::from_zero_flag(options.get_flag(options::ZERO)),
-        })
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let command = uu_app();
-
-    let matches = command.get_matches_from(args);
-
-    let config = Config::from(&matches)?;
-
-    let locs = matches
-        .get_many::<OsString>(options::PATHS)
-        .map(|v| v.map(Path::new).collect())
-        .unwrap_or_else(|| vec![Path::new(".")]);
-
-    list(locs, &config)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help),
-        )
-        // Format arguments
-        .arg(
-            Arg::new(options::FORMAT)
-                .long(options::FORMAT)
-                .help("Set the display format.")
-                .value_parser([
-                    "long",
-                    "verbose",
-                    "single-column",
-                    "columns",
-                    "vertical",
-                    "across",
-                    "horizontal",
-                    "commas",
-                ])
-                .hide_possible_values(true)
-                .require_equals(true)
-                .overrides_with_all([
-                    options::FORMAT,
-                    options::format::COLUMNS,
-                    options::format::LONG,
-                    options::format::ACROSS,
-                    options::format::COLUMNS,
-                ]),
-        )
-        .arg(
-            Arg::new(options::format::COLUMNS)
-                .short('C')
-                .help("Display the files in columns.")
-                .overrides_with_all([
-                    options::FORMAT,
-                    options::format::COLUMNS,
-                    options::format::LONG,
-                    options::format::ACROSS,
-                    options::format::COLUMNS,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::format::LONG)
-                .short('l')
-                .long(options::format::LONG)
-                .help("Display detailed information.")
-                .overrides_with_all([
-                    options::FORMAT,
-                    options::format::COLUMNS,
-                    options::format::LONG,
-                    options::format::ACROSS,
-                    options::format::COLUMNS,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::format::ACROSS)
-                .short('x')
-                .help("List entries in rows instead of in columns.")
-                .overrides_with_all([
-                    options::FORMAT,
-                    options::format::COLUMNS,
-                    options::format::LONG,
-                    options::format::ACROSS,
-                    options::format::COLUMNS,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            // silently ignored (see #3624)
-            Arg::new(options::format::TAB_SIZE)
-                .short('T')
-                .long(options::format::TAB_SIZE)
-                .env("TABSIZE")
-                .value_name("COLS")
-                .help("Assume tab stops at each COLS instead of 8 (unimplemented)"),
-        )
-        .arg(
-            Arg::new(options::format::COMMAS)
-                .short('m')
-                .help("List entries separated by commas.")
-                .overrides_with_all([
-                    options::FORMAT,
-                    options::format::COLUMNS,
-                    options::format::LONG,
-                    options::format::ACROSS,
-                    options::format::COLUMNS,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ZERO)
-                .long(options::ZERO)
-                .conflicts_with(options::DIRED)
-                .overrides_with(options::ZERO)
-                .help("List entries separated by ASCII NUL characters.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DIRED)
-                .long(options::DIRED)
-                .short('D')
-                .hide(true)
-                .action(ArgAction::SetTrue),
-        )
-        // The next four arguments do not override with the other format
-        // options, see the comment in Config::from for the reason.
-        // Ideally, they would use Arg::override_with, with their own name
-        // but that doesn't seem to work in all cases. Example:
-        // ls -1g1
-        // even though `ls -11` and `ls -1 -g -1` work.
-        .arg(
-            Arg::new(options::format::ONE_LINE)
-                .short('1')
-                .help("List one file per line.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::format::LONG_NO_GROUP)
-                .short('o')
-                .help(
-                    "Long format without group information. \
-                        Identical to --format=long with --no-group.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::format::LONG_NO_OWNER)
-                .short('g')
-                .help("Long format without owner information.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::format::LONG_NUMERIC_UID_GID)
-                .short('n')
-                .long(options::format::LONG_NUMERIC_UID_GID)
-                .help("-l with numeric UIDs and GIDs.")
-                .action(ArgAction::SetTrue),
-        )
-        // Quoting style
-        .arg(
-            Arg::new(options::QUOTING_STYLE)
-                .long(options::QUOTING_STYLE)
-                .help("Set quoting style.")
-                .value_parser([
-                    "literal",
-                    "shell",
-                    "shell-always",
-                    "shell-escape",
-                    "shell-escape-always",
-                    "c",
-                    "escape",
-                ])
-                .overrides_with_all([
-                    options::QUOTING_STYLE,
-                    options::quoting::LITERAL,
-                    options::quoting::ESCAPE,
-                    options::quoting::C,
-                ]),
-        )
-        .arg(
-            Arg::new(options::quoting::LITERAL)
-                .short('N')
-                .long(options::quoting::LITERAL)
-                .alias("l")
-                .help("Use literal quoting style. Equivalent to `--quoting-style=literal`")
-                .overrides_with_all([
-                    options::QUOTING_STYLE,
-                    options::quoting::LITERAL,
-                    options::quoting::ESCAPE,
-                    options::quoting::C,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::quoting::ESCAPE)
-                .short('b')
-                .long(options::quoting::ESCAPE)
-                .help("Use escape quoting style. Equivalent to `--quoting-style=escape`")
-                .overrides_with_all([
-                    options::QUOTING_STYLE,
-                    options::quoting::LITERAL,
-                    options::quoting::ESCAPE,
-                    options::quoting::C,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::quoting::C)
-                .short('Q')
-                .long(options::quoting::C)
-                .help("Use C quoting style. Equivalent to `--quoting-style=c`")
-                .overrides_with_all([
-                    options::QUOTING_STYLE,
-                    options::quoting::LITERAL,
-                    options::quoting::ESCAPE,
-                    options::quoting::C,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        // Control characters
-        .arg(
-            Arg::new(options::HIDE_CONTROL_CHARS)
-                .short('q')
-                .long(options::HIDE_CONTROL_CHARS)
-                .help("Replace control characters with '?' if they are not escaped.")
-                .overrides_with_all([options::HIDE_CONTROL_CHARS, options::SHOW_CONTROL_CHARS])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SHOW_CONTROL_CHARS)
-                .long(options::SHOW_CONTROL_CHARS)
-                .help("Show control characters 'as is' if they are not escaped.")
-                .overrides_with_all([options::HIDE_CONTROL_CHARS, options::SHOW_CONTROL_CHARS])
-                .action(ArgAction::SetTrue),
-        )
-        // Time arguments
-        .arg(
-            Arg::new(options::TIME)
-                .long(options::TIME)
-                .help(
-                    "Show time in <field>:\n\
-                        \taccess time (-u): atime, access, use;\n\
-                        \tchange time (-t): ctime, status.\n\
-                        \tbirth time: birth, creation;",
-                )
-                .value_name("field")
-                .value_parser([
-                    "atime", "access", "use", "ctime", "status", "birth", "creation",
-                ])
-                .hide_possible_values(true)
-                .require_equals(true)
-                .overrides_with_all([options::TIME, options::time::ACCESS, options::time::CHANGE]),
-        )
-        .arg(
-            Arg::new(options::time::CHANGE)
-                .short('c')
-                .help(
-                    "If the long listing format (e.g., -l, -o) is being used, print the \
-                        status change time (the 'ctime' in the inode) instead of the modification \
-                        time. When explicitly sorting by time (--sort=time or -t) or when not \
-                        using a long listing format, sort according to the status change time.",
-                )
-                .overrides_with_all([options::TIME, options::time::ACCESS, options::time::CHANGE])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::time::ACCESS)
-                .short('u')
-                .help(
-                    "If the long listing format (e.g., -l, -o) is being used, print the \
-                        status access time instead of the modification time. When explicitly \
-                        sorting by time (--sort=time or -t) or when not using a long listing \
-                        format, sort according to the access time.",
-                )
-                .overrides_with_all([options::TIME, options::time::ACCESS, options::time::CHANGE])
-                .action(ArgAction::SetTrue),
-        )
-        // Hide and ignore
-        .arg(
-            Arg::new(options::HIDE)
-                .long(options::HIDE)
-                .action(ArgAction::Append)
-                .value_name("PATTERN")
-                .help(
-                    "do not list implied entries matching shell PATTERN (overridden by -a or -A)",
-                ),
-        )
-        .arg(
-            Arg::new(options::IGNORE)
-                .short('I')
-                .long(options::IGNORE)
-                .action(ArgAction::Append)
-                .value_name("PATTERN")
-                .help("do not list implied entries matching shell PATTERN"),
-        )
-        .arg(
-            Arg::new(options::IGNORE_BACKUPS)
-                .short('B')
-                .long(options::IGNORE_BACKUPS)
-                .help("Ignore entries which end with ~.")
-                .action(ArgAction::SetTrue),
-        )
-        // Sort arguments
-        .arg(
-            Arg::new(options::SORT)
-                .long(options::SORT)
-                .help("Sort by <field>: name, none (-U), time (-t), size (-S), extension (-X) or width")
-                .value_name("field")
-                .value_parser(["name", "none", "time", "size", "version", "extension", "width"])
-                .require_equals(true)
-                .overrides_with_all([
-                    options::SORT,
-                    options::sort::SIZE,
-                    options::sort::TIME,
-                    options::sort::NONE,
-                    options::sort::VERSION,
-                    options::sort::EXTENSION,
-                ]),
-        )
-        .arg(
-            Arg::new(options::sort::SIZE)
-                .short('S')
-                .help("Sort by file size, largest first.")
-                .overrides_with_all([
-                    options::SORT,
-                    options::sort::SIZE,
-                    options::sort::TIME,
-                    options::sort::NONE,
-                    options::sort::VERSION,
-                    options::sort::EXTENSION,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::sort::TIME)
-                .short('t')
-                .help("Sort by modification time (the 'mtime' in the inode), newest first.")
-                .overrides_with_all([
-                    options::SORT,
-                    options::sort::SIZE,
-                    options::sort::TIME,
-                    options::sort::NONE,
-                    options::sort::VERSION,
-                    options::sort::EXTENSION,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::sort::VERSION)
-                .short('v')
-                .help("Natural sort of (version) numbers in the filenames.")
-                .overrides_with_all([
-                    options::SORT,
-                    options::sort::SIZE,
-                    options::sort::TIME,
-                    options::sort::NONE,
-                    options::sort::VERSION,
-                    options::sort::EXTENSION,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::sort::EXTENSION)
-                .short('X')
-                .help("Sort alphabetically by entry extension.")
-                .overrides_with_all([
-                    options::SORT,
-                    options::sort::SIZE,
-                    options::sort::TIME,
-                    options::sort::NONE,
-                    options::sort::VERSION,
-                    options::sort::EXTENSION,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::sort::NONE)
-                .short('U')
-                .help(
-                    "Do not sort; list the files in whatever order they are stored in the \
-                    directory.  This is especially useful when listing very large directories, \
-                    since not doing any sorting can be noticeably faster.",
-                )
-                .overrides_with_all([
-                    options::SORT,
-                    options::sort::SIZE,
-                    options::sort::TIME,
-                    options::sort::NONE,
-                    options::sort::VERSION,
-                    options::sort::EXTENSION,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        // Dereferencing
-        .arg(
-            Arg::new(options::dereference::ALL)
-                .short('L')
-                .long(options::dereference::ALL)
-                .help(
-                    "When showing file information for a symbolic link, show information for the \
-                    file the link references rather than the link itself.",
-                )
-                .overrides_with_all([
-                    options::dereference::ALL,
-                    options::dereference::DIR_ARGS,
-                    options::dereference::ARGS,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::dereference::DIR_ARGS)
-                .long(options::dereference::DIR_ARGS)
-                .help(
-                    "Do not follow symlinks except when they link to directories and are \
-                    given as command line arguments.",
-                )
-                .overrides_with_all([
-                    options::dereference::ALL,
-                    options::dereference::DIR_ARGS,
-                    options::dereference::ARGS,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::dereference::ARGS)
-                .short('H')
-                .long(options::dereference::ARGS)
-                .help("Do not follow symlinks except when given as command line arguments.")
-                .overrides_with_all([
-                    options::dereference::ALL,
-                    options::dereference::DIR_ARGS,
-                    options::dereference::ARGS,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        // Long format options
-        .arg(
-            Arg::new(options::NO_GROUP)
-                .long(options::NO_GROUP)
-                .short('G')
-                .help("Do not show group in long format.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(Arg::new(options::AUTHOR).long(options::AUTHOR).help(
-            "Show author in long format. On the supported platforms, \
-            the author always matches the file owner.",
-        ).action(ArgAction::SetTrue))
-        // Other Flags
-        .arg(
-            Arg::new(options::files::ALL)
-                .short('a')
-                .long(options::files::ALL)
-                // Overrides -A (as the order matters)
-                .overrides_with_all([options::files::ALL, options::files::ALMOST_ALL])
-                .help("Do not ignore hidden files (files with names that start with '.').")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::files::ALMOST_ALL)
-                .short('A')
-                .long(options::files::ALMOST_ALL)
-                // Overrides -a (as the order matters)
-                .overrides_with_all([options::files::ALL, options::files::ALMOST_ALL])
-                .help(
-                    "In a directory, do not ignore all file names that start with '.', \
-                    only ignore '.' and '..'.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DIRECTORY)
-                .short('d')
-                .long(options::DIRECTORY)
-                .help(
-                    "Only list the names of directories, rather than listing directory contents. \
-                    This will not follow symbolic links unless one of `--dereference-command-line \
-                    (-H)`, `--dereference (-L)`, or `--dereference-command-line-symlink-to-dir` is \
-                    specified.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::size::HUMAN_READABLE)
-                .short('h')
-                .long(options::size::HUMAN_READABLE)
-                .help("Print human readable file sizes (e.g. 1K 234M 56G).")
-                .overrides_with(options::size::SI)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::size::KIBIBYTES)
-                .short('k')
-                .long(options::size::KIBIBYTES)
-                .help(
-                    "default to 1024-byte blocks for file system usage; used only with -s and per \
-                    directory totals",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::size::SI)
-                .long(options::size::SI)
-                .help("Print human readable file sizes using powers of 1000 instead of 1024.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::size::BLOCK_SIZE)
-                .long(options::size::BLOCK_SIZE)
-                .require_equals(true)
-                .value_name("BLOCK_SIZE")
-                .help("scale sizes by BLOCK_SIZE when printing them"),
-        )
-        .arg(
-            Arg::new(options::INODE)
-                .short('i')
-                .long(options::INODE)
-                .help("print the index number of each file")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::REVERSE)
-                .short('r')
-                .long(options::REVERSE)
-                .help(
-                    "Reverse whatever the sorting method is e.g., list files in reverse \
-            alphabetical order, youngest first, smallest first, or whatever.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::RECURSIVE)
-                .short('R')
-                .long(options::RECURSIVE)
-                .help("List the contents of all directories recursively.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::WIDTH)
-                .long(options::WIDTH)
-                .short('w')
-                .help("Assume that the terminal is COLS columns wide.")
-                .value_name("COLS"),
-        )
-        .arg(
-            Arg::new(options::size::ALLOCATION_SIZE)
-                .short('s')
-                .long(options::size::ALLOCATION_SIZE)
-                .help("print the allocated size of each file, in blocks")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::COLOR)
-                .long(options::COLOR)
-                .help("Color output based on file type.")
-                .value_parser([
-                    "always", "yes", "force", "auto", "tty", "if-tty", "never", "no", "none",
-                ])
-                .require_equals(true)
-                .num_args(0..=1),
-        )
-        .arg(
-            Arg::new(options::INDICATOR_STYLE)
-                .long(options::INDICATOR_STYLE)
-                .help(
-                    "Append indicator with style WORD to entry names: \
-                none (default),  slash (-p), file-type (--file-type), classify (-F)",
-                )
-                .value_parser(["none", "slash", "file-type", "classify"])
-                .overrides_with_all([
-                    options::indicator_style::FILE_TYPE,
-                    options::indicator_style::SLASH,
-                    options::indicator_style::CLASSIFY,
-                    options::INDICATOR_STYLE,
-                ]),
-        )
-        .arg(
-            // The --classify flag can take an optional when argument to
-            // control its behavior from version 9 of GNU coreutils.
-            // There is currently an inconsistency where GNU coreutils allows only
-            // the long form of the flag to take the argument while we allow it
-            // for both the long and short form of the flag.
-            Arg::new(options::indicator_style::CLASSIFY)
-                .short('F')
-                .long(options::indicator_style::CLASSIFY)
-                .help(
-                    "Append a character to each file name indicating the file type. Also, for \
-                    regular files that are executable, append '*'. The file type indicators are \
-                    '/' for directories, '@' for symbolic links, '|' for FIFOs, '=' for sockets, \
-                    '>' for doors, and nothing for regular files. when may be omitted, or one of:\n\
-                        \tnone - Do not classify. This is the default.\n\
-                        \tauto - Only classify if standard output is a terminal.\n\
-                        \talways - Always classify.\n\
-                    Specifying --classify and no when is equivalent to --classify=always. This will \
-                    not follow symbolic links listed on the command line unless the \
-                    --dereference-command-line (-H), --dereference (-L), or \
-                    --dereference-command-line-symlink-to-dir options are specified.",
-                )
-                .value_name("when")
-                .value_parser([
-                    "always", "yes", "force", "auto", "tty", "if-tty", "never", "no", "none",
-                ])
-                .default_missing_value("always")
-                .require_equals(true)
-                .num_args(0..=1)
-                .overrides_with_all([
-                    options::indicator_style::FILE_TYPE,
-                    options::indicator_style::SLASH,
-                    options::indicator_style::CLASSIFY,
-                    options::INDICATOR_STYLE,
-                ]),
-        )
-        .arg(
-            Arg::new(options::indicator_style::FILE_TYPE)
-                .long(options::indicator_style::FILE_TYPE)
-                .help("Same as --classify, but do not append '*'")
-                .overrides_with_all([
-                    options::indicator_style::FILE_TYPE,
-                    options::indicator_style::SLASH,
-                    options::indicator_style::CLASSIFY,
-                    options::INDICATOR_STYLE,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::indicator_style::SLASH)
-                .short('p')
-                .help("Append / indicator to directories.")
-                .overrides_with_all([
-                    options::indicator_style::FILE_TYPE,
-                    options::indicator_style::SLASH,
-                    options::indicator_style::CLASSIFY,
-                    options::INDICATOR_STYLE,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            //This still needs support for posix-*
-            Arg::new(options::TIME_STYLE)
-                .long(options::TIME_STYLE)
-                .help("time/date format with -l; see TIME_STYLE below")
-                .value_name("TIME_STYLE")
-                .env("TIME_STYLE")
-                .value_parser(NonEmptyStringValueParser::new())
-                .overrides_with_all([options::TIME_STYLE]),
-        )
-        .arg(
-            Arg::new(options::FULL_TIME)
-                .long(options::FULL_TIME)
-                .overrides_with(options::FULL_TIME)
-                .help("like -l --time-style=full-iso")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::CONTEXT)
-                .short('Z')
-                .long(options::CONTEXT)
-                .help(CONTEXT_HELP_TEXT)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::GROUP_DIRECTORIES_FIRST)
-                .long(options::GROUP_DIRECTORIES_FIRST)
-                .help(
-                    "group directories before files; can be augmented with \
-                    a --sort option, but any use of --sort=none (-U) disables grouping",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        // Positional arguments
-        .arg(
-            Arg::new(options::PATHS)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath)
-                .value_parser(ValueParser::os_string()),
-        )
-        .after_help(AFTER_HELP)
-}
-
-/// Represents a Path along with it's associated data.
-/// Any data that will be reused several times makes sense to be added to this structure.
-/// Caching data here helps eliminate redundant syscalls to fetch same information.
-#[derive(Debug)]
-struct PathData {
-    // Result<MetaData> got from symlink_metadata() or metadata() based on config
-    md: OnceCell<Option<Metadata>>,
-    ft: OnceCell<Option<FileType>>,
-    de: Option<DirEntry>,
-    // Name of the file - will be empty for . or ..
-    display_name: OsString,
-    // PathBuf that all above data corresponds to
-    p_buf: PathBuf,
-    must_dereference: bool,
-    security_context: String,
-    command_line: bool,
-}
-
-impl PathData {
-    fn new(
-        p_buf: PathBuf,
-        dir_entry: Option<std::io::Result<DirEntry>>,
-        file_name: Option<OsString>,
-        config: &Config,
-        command_line: bool,
-    ) -> Self {
-        // We cannot use `Path::ends_with` or `Path::Components`, because they remove occurrences of '.'
-        // For '..', the filename is None
-        let display_name = if let Some(name) = file_name {
-            name
-        } else if command_line {
-            p_buf.clone().into()
-        } else {
-            p_buf
-                .file_name()
-                .unwrap_or_else(|| p_buf.iter().next_back().unwrap())
-                .to_owned()
-        };
-        let must_dereference = match &config.dereference {
-            Dereference::All => true,
-            Dereference::Args => command_line,
-            Dereference::DirArgs => {
-                if command_line {
-                    if let Ok(md) = p_buf.metadata() {
-                        md.is_dir()
-                    } else {
-                        false
-                    }
-                } else {
-                    false
-                }
-            }
-            Dereference::None => false,
-        };
-
-        let de: Option<DirEntry> = match dir_entry {
-            Some(de) => de.ok(),
-            None => None,
-        };
-
-        // Why prefer to check the DirEntry file_type()?  B/c the call is
-        // nearly free compared to a metadata() call on a Path
-        fn get_file_type(
-            de: &DirEntry,
-            p_buf: &Path,
-            must_dereference: bool,
-        ) -> OnceCell<Option<FileType>> {
-            if must_dereference {
-                if let Ok(md_pb) = p_buf.metadata() {
-                    return OnceCell::from(Some(md_pb.file_type()));
-                }
-            }
-            if let Ok(ft_de) = de.file_type() {
-                OnceCell::from(Some(ft_de))
-            } else if let Ok(md_pb) = p_buf.symlink_metadata() {
-                OnceCell::from(Some(md_pb.file_type()))
-            } else {
-                OnceCell::new()
-            }
-        }
-        let ft = match de {
-            Some(ref de) => get_file_type(de, &p_buf, must_dereference),
-            None => OnceCell::new(),
-        };
-
-        let security_context = if config.context {
-            get_security_context(config, &p_buf, must_dereference)
-        } else {
-            String::new()
-        };
-
-        Self {
-            md: OnceCell::new(),
-            ft,
-            de,
-            display_name,
-            p_buf,
-            must_dereference,
-            security_context,
-            command_line,
-        }
-    }
-
-    fn md(&self, out: &mut BufWriter<Stdout>) -> Option<&Metadata> {
-        self.md
-            .get_or_init(|| {
-                // check if we can use DirEntry metadata
-                if !self.must_dereference {
-                    if let Some(dir_entry) = &self.de {
-                        return dir_entry.metadata().ok();
-                    }
-                }
-
-                // if not, check if we can use Path metadata
-                match get_metadata(self.p_buf.as_path(), self.must_dereference) {
-                    Err(err) => {
-                        // FIXME: A bit tricky to propagate the result here
-                        out.flush().unwrap();
-                        let errno = err.raw_os_error().unwrap_or(1i32);
-                        // a bad fd will throw an error when dereferenced,
-                        // but GNU will not throw an error until a bad fd "dir"
-                        // is entered, here we match that GNU behavior, by handing
-                        // back the non-dereferenced metadata upon an EBADF
-                        if self.must_dereference && errno == 9i32 {
-                            if let Some(dir_entry) = &self.de {
-                                return dir_entry.metadata().ok();
-                            }
-                        }
-                        show!(LsError::IOErrorContext(
-                            err,
-                            self.p_buf.clone(),
-                            self.command_line
-                        ));
-                        None
-                    }
-                    Ok(md) => Some(md),
-                }
-            })
-            .as_ref()
-    }
-
-    fn file_type(&self, out: &mut BufWriter<Stdout>) -> Option<&FileType> {
-        self.ft
-            .get_or_init(|| self.md(out).map(|md| md.file_type()))
-            .as_ref()
-    }
-}
-
-pub fn list(locs: Vec<&Path>, config: &Config) -> UResult<()> {
-    let mut files = Vec::<PathData>::new();
-    let mut dirs = Vec::<PathData>::new();
-    let mut out = BufWriter::new(stdout());
-    let initial_locs_len = locs.len();
-
-    for loc in locs {
-        let path_data = PathData::new(PathBuf::from(loc), None, None, config, true);
-
-        // Getting metadata here is no big deal as it's just the CWD
-        // and we really just want to know if the strings exist as files/dirs
-        //
-        // Proper GNU handling is don't show if dereferenced symlink DNE
-        // but only for the base dir, for a child dir show, and print ?s
-        // in long format
-        if path_data.md(&mut out).is_none() {
-            continue;
-        }
-
-        let show_dir_contents = match path_data.file_type(&mut out) {
-            Some(ft) => !config.directory && ft.is_dir(),
-            None => {
-                set_exit_code(1);
-                false
-            }
-        };
-
-        if show_dir_contents {
-            dirs.push(path_data);
-        } else {
-            files.push(path_data);
-        }
-    }
-
-    sort_entries(&mut files, config, &mut out);
-    sort_entries(&mut dirs, config, &mut out);
-
-    display_items(&files, config, &mut out)?;
-
-    for (pos, path_data) in dirs.iter().enumerate() {
-        // Do read_dir call here to match GNU semantics by printing
-        // read_dir errors before directory headings, names and totals
-        let read_dir = match fs::read_dir(&path_data.p_buf) {
-            Err(err) => {
-                // flush stdout buffer before the error to preserve formatting and order
-                out.flush()?;
-                show!(LsError::IOErrorContext(
-                    err,
-                    path_data.p_buf.clone(),
-                    path_data.command_line
-                ));
-                continue;
-            }
-            Ok(rd) => rd,
-        };
-
-        // Print dir heading - name... 'total' comes after error display
-        if initial_locs_len > 1 || config.recursive {
-            if pos.eq(&0usize) && files.is_empty() {
-                writeln!(out, "{}:", path_data.p_buf.display())?;
-            } else {
-                writeln!(out, "\n{}:", path_data.p_buf.display())?;
-            }
-        }
-        let mut listed_ancestors = HashSet::new();
-        listed_ancestors.insert(FileInformation::from_path(
-            &path_data.p_buf,
-            path_data.must_dereference,
-        )?);
-        enter_directory(path_data, read_dir, config, &mut out, &mut listed_ancestors)?;
-    }
-
-    Ok(())
-}
-
-fn sort_entries(entries: &mut [PathData], config: &Config, out: &mut BufWriter<Stdout>) {
-    match config.sort {
-        Sort::Time => entries.sort_by_key(|k| {
-            Reverse(
-                k.md(out)
-                    .and_then(|md| get_system_time(md, config))
-                    .unwrap_or(UNIX_EPOCH),
-            )
-        }),
-        Sort::Size => entries.sort_by_key(|k| Reverse(k.md(out).map(|md| md.len()).unwrap_or(0))),
-        // The default sort in GNU ls is case insensitive
-        Sort::Name => entries.sort_by(|a, b| a.display_name.cmp(&b.display_name)),
-        Sort::Version => entries.sort_by(|a, b| {
-            version_cmp(&a.p_buf.to_string_lossy(), &b.p_buf.to_string_lossy())
-                .then(a.p_buf.to_string_lossy().cmp(&b.p_buf.to_string_lossy()))
-        }),
-        Sort::Extension => entries.sort_by(|a, b| {
-            a.p_buf
-                .extension()
-                .cmp(&b.p_buf.extension())
-                .then(a.p_buf.file_stem().cmp(&b.p_buf.file_stem()))
-        }),
-        Sort::Width => entries.sort_by(|a, b| {
-            a.display_name
-                .len()
-                .cmp(&b.display_name.len())
-                .then(a.display_name.cmp(&b.display_name))
-        }),
-        Sort::None => {}
-    }
-
-    if config.reverse {
-        entries.reverse();
-    }
-
-    if config.group_directories_first && config.sort != Sort::None {
-        entries.sort_by_key(|p| {
-            let md = {
-                // We will always try to deref symlinks to group directories, so PathData.md
-                // is not always useful.
-                if p.must_dereference {
-                    p.md.get()
-                } else {
-                    None
-                }
-            };
-
-            !match md {
-                None | Some(None) => {
-                    // If it metadata cannot be determined, treat as a file.
-                    get_metadata(p.p_buf.as_path(), true).map_or_else(|_| false, |m| m.is_dir())
-                }
-                Some(Some(m)) => m.is_dir(),
-            }
-        });
-    }
-}
-
-fn is_hidden(file_path: &DirEntry) -> bool {
-    #[cfg(windows)]
-    {
-        let metadata = file_path.metadata().unwrap();
-        let attr = metadata.file_attributes();
-        (attr & 0x2) > 0
-    }
-    #[cfg(not(windows))]
-    {
-        file_path
-            .file_name()
-            .to_str()
-            .map(|res| res.starts_with('.'))
-            .unwrap_or(false)
-    }
-}
-
-fn should_display(entry: &DirEntry, config: &Config) -> bool {
-    // check if hidden
-    if config.files == Files::Normal && is_hidden(entry) {
-        return false;
-    }
-
-    // check if it is among ignore_patterns
-    let options = MatchOptions {
-        // setting require_literal_leading_dot to match behavior in GNU ls
-        require_literal_leading_dot: true,
-        require_literal_separator: false,
-        case_sensitive: true,
-    };
-    let file_name = entry.file_name();
-    // If the decoding fails, still show an incorrect rendering
-    let file_name = match file_name.to_str() {
-        Some(s) => s.to_string(),
-        None => file_name.to_string_lossy().into_owned(),
-    };
-    !config
-        .ignore_patterns
-        .iter()
-        .any(|p| p.matches_with(&file_name, options))
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn enter_directory(
-    path_data: &PathData,
-    read_dir: ReadDir,
-    config: &Config,
-    out: &mut BufWriter<Stdout>,
-    listed_ancestors: &mut HashSet<FileInformation>,
-) -> UResult<()> {
-    // Create vec of entries with initial dot files
-    let mut entries: Vec<PathData> = if config.files == Files::All {
-        vec![
-            PathData::new(
-                path_data.p_buf.clone(),
-                None,
-                Some(".".into()),
-                config,
-                false,
-            ),
-            PathData::new(
-                path_data.p_buf.join(".."),
-                None,
-                Some("..".into()),
-                config,
-                false,
-            ),
-        ]
-    } else {
-        vec![]
-    };
-
-    // Convert those entries to the PathData struct
-    for raw_entry in read_dir {
-        let dir_entry = match raw_entry {
-            Ok(path) => path,
-            Err(err) => {
-                out.flush()?;
-                show!(LsError::IOError(err));
-                continue;
-            }
-        };
-
-        if should_display(&dir_entry, config) {
-            let entry_path_data =
-                PathData::new(dir_entry.path(), Some(Ok(dir_entry)), None, config, false);
-            entries.push(entry_path_data);
-        };
-    }
-
-    sort_entries(&mut entries, config, out);
-
-    // Print total after any error display
-    if config.format == Format::Long || config.alloc_size {
-        display_total(&entries, config, out)?;
-    }
-
-    display_items(&entries, config, out)?;
-
-    if config.recursive {
-        for e in entries
-            .iter()
-            .skip(if config.files == Files::All { 2 } else { 0 })
-            .filter(|p| p.ft.get().is_some())
-            .filter(|p| p.ft.get().unwrap().is_some())
-            .filter(|p| p.ft.get().unwrap().unwrap().is_dir())
-        {
-            match fs::read_dir(&e.p_buf) {
-                Err(err) => {
-                    out.flush()?;
-                    show!(LsError::IOErrorContext(
-                        err,
-                        e.p_buf.clone(),
-                        e.command_line
-                    ));
-                    continue;
-                }
-                Ok(rd) => {
-                    if listed_ancestors
-                        .insert(FileInformation::from_path(&e.p_buf, e.must_dereference)?)
-                    {
-                        writeln!(out, "\n{}:", e.p_buf.display())?;
-                        enter_directory(e, rd, config, out, listed_ancestors)?;
-                        listed_ancestors
-                            .remove(&FileInformation::from_path(&e.p_buf, e.must_dereference)?);
-                    } else {
-                        out.flush()?;
-                        show!(LsError::AlreadyListedError(e.p_buf.clone()));
-                    }
-                }
-            }
-        }
-    }
-
-    Ok(())
-}
-
-fn get_metadata(p_buf: &Path, dereference: bool) -> std::io::Result<Metadata> {
-    if dereference {
-        p_buf.metadata()
-    } else {
-        p_buf.symlink_metadata()
-    }
-}
-
-fn display_dir_entry_size(
-    entry: &PathData,
-    config: &Config,
-    out: &mut BufWriter<std::io::Stdout>,
-) -> (usize, usize, usize, usize, usize, usize) {
-    // TODO: Cache/memorize the display_* results so we don't have to recalculate them.
-    if let Some(md) = entry.md(out) {
-        let (size_len, major_len, minor_len) = match display_len_or_rdev(md, config) {
-            SizeOrDeviceId::Device(major, minor) => (
-                (major.len() + minor.len() + 2usize),
-                major.len(),
-                minor.len(),
-            ),
-            SizeOrDeviceId::Size(size) => (size.len(), 0usize, 0usize),
-        };
-        (
-            display_symlink_count(md).len(),
-            display_uname(md, config).len(),
-            display_group(md, config).len(),
-            size_len,
-            major_len,
-            minor_len,
-        )
-    } else {
-        (0, 0, 0, 0, 0, 0)
-    }
-}
-
-fn pad_left(string: &str, count: usize) -> String {
-    format!("{string:>count$}")
-}
-
-fn pad_right(string: &str, count: usize) -> String {
-    format!("{string:<count$}")
-}
-
-fn display_total(items: &[PathData], config: &Config, out: &mut BufWriter<Stdout>) -> UResult<()> {
-    let mut total_size = 0;
-    for item in items {
-        total_size += item
-            .md(out)
-            .as_ref()
-            .map_or(0, |md| get_block_size(md, config));
-    }
-    write!(
-        out,
-        "total {}{}",
-        display_size(total_size, config),
-        config.line_ending
-    )?;
-    Ok(())
-}
-
-fn display_additional_leading_info(
-    item: &PathData,
-    padding: &PaddingCollection,
-    config: &Config,
-    out: &mut BufWriter<Stdout>,
-) -> UResult<String> {
-    let mut result = String::new();
-    #[cfg(unix)]
-    {
-        if config.inode {
-            let i = if let Some(md) = item.md(out) {
-                get_inode(md)
-            } else {
-                "?".to_owned()
-            };
-            write!(result, "{} ", pad_left(&i, padding.inode)).unwrap();
-        }
-    }
-
-    if config.alloc_size {
-        let s = if let Some(md) = item.md(out) {
-            display_size(get_block_size(md, config), config)
-        } else {
-            "?".to_owned()
-        };
-        // extra space is insert to align the sizes, as needed for all formats, except for the comma format.
-        if config.format == Format::Commas {
-            write!(result, "{s} ").unwrap();
-        } else {
-            write!(result, "{} ", pad_left(&s, padding.block_size)).unwrap();
-        };
-    }
-    Ok(result)
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn display_items(items: &[PathData], config: &Config, out: &mut BufWriter<Stdout>) -> UResult<()> {
-    // `-Z`, `--context`:
-    // Display the SELinux security context or '?' if none is found. When used with the `-l`
-    // option, print the security context to the left of the size column.
-
-    if config.format == Format::Long {
-        let padding_collection = calculate_padding_collection(items, config, out);
-
-        for item in items {
-            #[cfg(unix)]
-            if config.inode || config.alloc_size {
-                let more_info =
-                    display_additional_leading_info(item, &padding_collection, config, out)?;
-                write!(out, "{more_info}")?;
-            }
-            #[cfg(not(unix))]
-            if config.alloc_size {
-                let more_info =
-                    display_additional_leading_info(item, &padding_collection, config, out)?;
-                write!(out, "{more_info}")?;
-            }
-            display_item_long(item, &padding_collection, config, out)?;
-        }
-    } else {
-        let mut longest_context_len = 1;
-        let prefix_context = if config.context {
-            for item in items {
-                let context_len = item.security_context.len();
-                longest_context_len = context_len.max(longest_context_len);
-            }
-            Some(longest_context_len)
-        } else {
-            None
-        };
-
-        let padding = calculate_padding_collection(items, config, out);
-
-        let mut names_vec = Vec::new();
-
-        for i in items {
-            let more_info = display_additional_leading_info(i, &padding, config, out)?;
-            let cell = display_file_name(i, config, prefix_context, more_info, out);
-            names_vec.push(cell);
-        }
-
-        let names = names_vec.into_iter();
-
-        match config.format {
-            Format::Columns => display_grid(names, config.width, Direction::TopToBottom, out)?,
-            Format::Across => display_grid(names, config.width, Direction::LeftToRight, out)?,
-            Format::Commas => {
-                let mut current_col = 0;
-                let mut names = names;
-                if let Some(name) = names.next() {
-                    write!(out, "{}", name.contents)?;
-                    current_col = name.width as u16 + 2;
-                }
-                for name in names {
-                    let name_width = name.width as u16;
-                    // If the width is 0 we print one single line
-                    if config.width != 0 && current_col + name_width + 1 > config.width {
-                        current_col = name_width + 2;
-                        write!(out, ",\n{}", name.contents)?;
-                    } else {
-                        current_col += name_width + 2;
-                        write!(out, ", {}", name.contents)?;
-                    }
-                }
-                // Current col is never zero again if names have been printed.
-                // So we print a newline.
-                if current_col > 0 {
-                    write!(out, "{}", config.line_ending)?;
-                }
-            }
-            _ => {
-                for name in names {
-                    write!(out, "{}{}", name.contents, config.line_ending)?;
-                }
-            }
-        };
-    }
-
-    Ok(())
-}
-
-#[allow(unused_variables)]
-fn get_block_size(md: &Metadata, config: &Config) -> u64 {
-    /* GNU ls will display sizes in terms of block size
-       md.len() will differ from this value when the file has some holes
-    */
-    #[cfg(unix)]
-    {
-        let raw_blocks = if md.file_type().is_char_device() || md.file_type().is_block_device() {
-            0u64
-        } else {
-            md.blocks() * 512
-        };
-        match config.size_format {
-            SizeFormat::Binary | SizeFormat::Decimal => raw_blocks,
-            SizeFormat::Bytes => {
-                if cfg!(unix) {
-                    if let Some(user_block_size) = config.block_size {
-                        raw_blocks / user_block_size
-                    } else {
-                        raw_blocks / DEFAULT_BLOCK_SIZE
-                    }
-                } else {
-                    raw_blocks
-                }
-            }
-        }
-    }
-    #[cfg(not(unix))]
-    {
-        // no way to get block size for windows, fall-back to file size
-        md.len()
-    }
-}
-
-fn display_grid(
-    names: impl Iterator<Item = Cell>,
-    width: u16,
-    direction: Direction,
-    out: &mut BufWriter<Stdout>,
-) -> UResult<()> {
-    if width == 0 {
-        // If the width is 0 we print one single line
-        let mut printed_something = false;
-        for name in names {
-            if printed_something {
-                write!(out, "  ")?;
-            }
-            printed_something = true;
-            write!(out, "{}", name.contents)?;
-        }
-        if printed_something {
-            writeln!(out)?;
-        }
-    } else {
-        let mut grid = Grid::new(GridOptions {
-            filling: Filling::Spaces(2),
-            direction,
-        });
-
-        for name in names {
-            grid.add(name);
-        }
-
-        match grid.fit_into_width(width as usize) {
-            Some(output) => {
-                write!(out, "{output}")?;
-            }
-            // Width is too small for the grid, so we fit it in one column
-            None => {
-                write!(out, "{}", grid.fit_into_columns(1))?;
-            }
-        }
-    }
-    Ok(())
-}
-
-/// This writes to the BufWriter out a single string of the output of `ls -l`.
-///
-/// It writes the following keys, in order:
-/// * `inode` ([`get_inode`], config-optional)
-/// * `permissions` ([`display_permissions`])
-/// * `symlink_count` ([`display_symlink_count`])
-/// * `owner` ([`display_uname`], config-optional)
-/// * `group` ([`display_group`], config-optional)
-/// * `author` ([`display_uname`], config-optional)
-/// * `size / rdev` ([`display_len_or_rdev`])
-/// * `system_time` ([`get_system_time`])
-/// * `file_name` ([`display_file_name`])
-///
-/// This function needs to display information in columns:
-/// * permissions and system_time are already guaranteed to be pre-formatted in fixed length.
-/// * file_name is the last column and is left-aligned.
-/// * Everything else needs to be padded using [`pad_left`].
-///
-/// That's why we have the parameters:
-/// ```txt
-///    longest_link_count_len: usize,
-///    longest_uname_len: usize,
-///    longest_group_len: usize,
-///    longest_context_len: usize,
-///    longest_size_len: usize,
-/// ```
-/// that decide the maximum possible character count of each field.
-#[allow(clippy::write_literal)]
-#[allow(clippy::cognitive_complexity)]
-fn display_item_long(
-    item: &PathData,
-    padding: &PaddingCollection,
-    config: &Config,
-    out: &mut BufWriter<Stdout>,
-) -> UResult<()> {
-    if let Some(md) = item.md(out) {
-        write!(
-            out,
-            "{}{} {}",
-            display_permissions(md, true),
-            if item.security_context.len() > 1 {
-                // GNU `ls` uses a "." character to indicate a file with a security context,
-                // but not other alternate access method.
-                "."
-            } else {
-                ""
-            },
-            pad_left(&display_symlink_count(md), padding.link_count)
-        )?;
-
-        if config.long.owner {
-            write!(
-                out,
-                " {}",
-                pad_right(&display_uname(md, config), padding.uname)
-            )?;
-        }
-
-        if config.long.group {
-            write!(
-                out,
-                " {}",
-                pad_right(&display_group(md, config), padding.group)
-            )?;
-        }
-
-        if config.context {
-            write!(
-                out,
-                " {}",
-                pad_right(&item.security_context, padding.context)
-            )?;
-        }
-
-        // Author is only different from owner on GNU/Hurd, so we reuse
-        // the owner, since GNU/Hurd is not currently supported by Rust.
-        if config.long.author {
-            write!(
-                out,
-                " {}",
-                pad_right(&display_uname(md, config), padding.uname)
-            )?;
-        }
-
-        match display_len_or_rdev(md, config) {
-            SizeOrDeviceId::Size(size) => {
-                write!(out, " {}", pad_left(&size, padding.size))?;
-            }
-            SizeOrDeviceId::Device(major, minor) => {
-                write!(
-                    out,
-                    " {}, {}",
-                    pad_left(
-                        &major,
-                        #[cfg(not(unix))]
-                        0usize,
-                        #[cfg(unix)]
-                        padding.major.max(
-                            padding
-                                .size
-                                .saturating_sub(padding.minor.saturating_add(2usize))
-                        ),
-                    ),
-                    pad_left(
-                        &minor,
-                        #[cfg(not(unix))]
-                        0usize,
-                        #[cfg(unix)]
-                        padding.minor,
-                    ),
-                )?;
-            }
-        };
-
-        let dfn = display_file_name(item, config, None, String::new(), out).contents;
-
-        write!(
-            out,
-            " {} {}{}",
-            display_date(md, config),
-            dfn,
-            config.line_ending
-        )?;
-    } else {
-        #[cfg(unix)]
-        let leading_char = {
-            if let Some(Some(ft)) = item.ft.get() {
-                if ft.is_char_device() {
-                    "c"
-                } else if ft.is_block_device() {
-                    "b"
-                } else if ft.is_symlink() {
-                    "l"
-                } else if ft.is_dir() {
-                    "d"
-                } else {
-                    "-"
-                }
-            } else {
-                "-"
-            }
-        };
-        #[cfg(not(unix))]
-        let leading_char = {
-            if let Some(Some(ft)) = item.ft.get() {
-                if ft.is_symlink() {
-                    "l"
-                } else if ft.is_dir() {
-                    "d"
-                } else {
-                    "-"
-                }
-            } else {
-                "-"
-            }
-        };
-
-        write!(
-            out,
-            "{}{} {}",
-            format_args!("{leading_char}?????????"),
-            if item.security_context.len() > 1 {
-                // GNU `ls` uses a "." character to indicate a file with a security context,
-                // but not other alternate access method.
-                "."
-            } else {
-                ""
-            },
-            pad_left("?", padding.link_count)
-        )?;
-
-        if config.long.owner {
-            write!(out, " {}", pad_right("?", padding.uname))?;
-        }
-
-        if config.long.group {
-            write!(out, " {}", pad_right("?", padding.group))?;
-        }
-
-        if config.context {
-            write!(
-                out,
-                " {}",
-                pad_right(&item.security_context, padding.context)
-            )?;
-        }
-
-        // Author is only different from owner on GNU/Hurd, so we reuse
-        // the owner, since GNU/Hurd is not currently supported by Rust.
-        if config.long.author {
-            write!(out, " {}", pad_right("?", padding.uname))?;
-        }
-
-        let dfn = display_file_name(item, config, None, String::new(), out).contents;
-        let date_len = 12;
-
-        writeln!(
-            out,
-            " {} {} {}",
-            pad_left("?", padding.size),
-            pad_left("?", date_len),
-            dfn,
-        )?;
-    }
-
-    Ok(())
-}
-
-#[cfg(unix)]
-fn get_inode(metadata: &Metadata) -> String {
-    format!("{}", metadata.ino())
-}
-
-// Currently getpwuid is `linux` target only. If it's broken out into
-// a posix-compliant attribute this can be updated...
-#[cfg(unix)]
-use once_cell::sync::Lazy;
-#[cfg(unix)]
-use std::sync::Mutex;
-#[cfg(unix)]
-use uucore::entries;
-use uucore::fs::FileInformation;
-use uucore::quoting_style;
-
-#[cfg(unix)]
-fn cached_uid2usr(uid: u32) -> String {
-    static UID_CACHE: Lazy<Mutex<HashMap<u32, String>>> = Lazy::new(|| Mutex::new(HashMap::new()));
-
-    let mut uid_cache = UID_CACHE.lock().unwrap();
-    uid_cache
-        .entry(uid)
-        .or_insert_with(|| entries::uid2usr(uid).unwrap_or_else(|_| uid.to_string()))
-        .clone()
-}
-
-#[cfg(unix)]
-fn display_uname(metadata: &Metadata, config: &Config) -> String {
-    if config.long.numeric_uid_gid {
-        metadata.uid().to_string()
-    } else {
-        cached_uid2usr(metadata.uid())
-    }
-}
-
-#[cfg(all(unix, not(target_os = "redox")))]
-fn cached_gid2grp(gid: u32) -> String {
-    static GID_CACHE: Lazy<Mutex<HashMap<u32, String>>> = Lazy::new(|| Mutex::new(HashMap::new()));
-
-    let mut gid_cache = GID_CACHE.lock().unwrap();
-    gid_cache
-        .entry(gid)
-        .or_insert_with(|| entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string()))
-        .clone()
-}
-
-#[cfg(all(unix, not(target_os = "redox")))]
-fn display_group(metadata: &Metadata, config: &Config) -> String {
-    if config.long.numeric_uid_gid {
-        metadata.gid().to_string()
-    } else {
-        cached_gid2grp(metadata.gid())
-    }
-}
-
-#[cfg(target_os = "redox")]
-fn display_group(metadata: &Metadata, config: &Config) -> String {
-    metadata.gid().to_string()
-}
-
-#[cfg(not(unix))]
-fn display_uname(_metadata: &Metadata, _config: &Config) -> String {
-    "somebody".to_string()
-}
-
-#[cfg(not(unix))]
-fn display_group(_metadata: &Metadata, _config: &Config) -> String {
-    "somegroup".to_string()
-}
-
-// The implementations for get_time are separated because some options, such
-// as ctime will not be available
-#[cfg(unix)]
-fn get_system_time(md: &Metadata, config: &Config) -> Option<SystemTime> {
-    match config.time {
-        Time::Change => Some(UNIX_EPOCH + Duration::new(md.ctime() as u64, md.ctime_nsec() as u32)),
-        Time::Modification => md.modified().ok(),
-        Time::Access => md.accessed().ok(),
-        Time::Birth => md.created().ok(),
-    }
-}
-
-#[cfg(not(unix))]
-fn get_system_time(md: &Metadata, config: &Config) -> Option<SystemTime> {
-    match config.time {
-        Time::Modification => md.modified().ok(),
-        Time::Access => md.accessed().ok(),
-        Time::Birth => md.created().ok(),
-        _ => None,
-    }
-}
-
-fn get_time(md: &Metadata, config: &Config) -> Option<chrono::DateTime<chrono::Local>> {
-    let time = get_system_time(md, config)?;
-    Some(time.into())
-}
-
-fn display_date(metadata: &Metadata, config: &Config) -> String {
-    match get_time(metadata, config) {
-        Some(time) => {
-            //Date is recent if from past 6 months
-            //According to GNU a Gregorian year has 365.2425 * 24 * 60 * 60 == 31556952 seconds on the average.
-            let recent = time + chrono::Duration::seconds(31_556_952 / 2) > chrono::Local::now();
-
-            match &config.time_style {
-                TimeStyle::FullIso => time.format("%Y-%m-%d %H:%M:%S.%f %z"),
-                TimeStyle::LongIso => time.format("%Y-%m-%d %H:%M"),
-                TimeStyle::Iso => time.format(if recent { "%m-%d %H:%M" } else { "%Y-%m-%d " }),
-                TimeStyle::Locale => {
-                    let fmt = if recent { "%b %e %H:%M" } else { "%b %e  %Y" };
-
-                    // spell-checker:ignore (word) datetime
-                    //In this version of chrono translating can be done
-                    //The function is chrono::datetime::DateTime::format_localized
-                    //However it's currently still hard to get the current pure-rust-locale
-                    //So it's not yet implemented
-
-                    time.format(fmt)
-                }
-                TimeStyle::Format(e) => time.format(e),
-            }
-            .to_string()
-        }
-        None => "???".into(),
-    }
-}
-
-// There are a few peculiarities to how GNU formats the sizes:
-// 1. One decimal place is given if and only if the size is smaller than 10
-// 2. It rounds sizes up.
-// 3. The human-readable format uses powers for 1024, but does not display the "i"
-//    that is commonly used to denote Kibi, Mebi, etc.
-// 4. Kibi and Kilo are denoted differently ("k" and "K", respectively)
-fn format_prefixed(prefixed: &NumberPrefix<f64>) -> String {
-    match prefixed {
-        NumberPrefix::Standalone(bytes) => bytes.to_string(),
-        NumberPrefix::Prefixed(prefix, bytes) => {
-            // Remove the "i" from "Ki", "Mi", etc. if present
-            let prefix_str = prefix.symbol().trim_end_matches('i');
-
-            // Check whether we get more than 10 if we round up to the first decimal
-            // because we want do display 9.81 as "9.9", not as "10".
-            if (10.0 * bytes).ceil() >= 100.0 {
-                format!("{:.0}{}", bytes.ceil(), prefix_str)
-            } else {
-                format!("{:.1}{}", (10.0 * bytes).ceil() / 10.0, prefix_str)
-            }
-        }
-    }
-}
-
-#[allow(dead_code)]
-enum SizeOrDeviceId {
-    Size(String),
-    Device(String, String),
-}
-
-fn display_len_or_rdev(metadata: &Metadata, config: &Config) -> SizeOrDeviceId {
-    #[cfg(any(
-        target_os = "linux",
-        target_os = "macos",
-        target_os = "android",
-        target_os = "ios",
-        target_os = "freebsd",
-        target_os = "dragonfly",
-        target_os = "netbsd",
-        target_os = "openbsd",
-        target_os = "illumos",
-        target_os = "solaris"
-    ))]
-    {
-        let ft = metadata.file_type();
-        if ft.is_char_device() || ft.is_block_device() {
-            // A type cast is needed here as the `dev_t` type varies across OSes.
-            let dev = metadata.rdev() as dev_t;
-            let major = unsafe { major(dev) };
-            let minor = unsafe { minor(dev) };
-            return SizeOrDeviceId::Device(major.to_string(), minor.to_string());
-        }
-    }
-    // Reported file len only adjusted for block_size when block_size is set
-    if let Some(user_block_size) = config.block_size {
-        // ordinary division of unsigned integers rounds down,
-        // this is similar to the Rust API for division that rounds up,
-        // currently in nightly only, however once
-        // https://github.com/rust-lang/rust/pull/88582 : "div_ceil"
-        // is stable we should use that instead
-        let len_adjusted = {
-            let d = metadata.len() / user_block_size;
-            let r = metadata.len() % user_block_size;
-            if r == 0 {
-                d
-            } else {
-                d + 1
-            }
-        };
-        SizeOrDeviceId::Size(display_size(len_adjusted, config))
-    } else {
-        SizeOrDeviceId::Size(display_size(metadata.len(), config))
-    }
-}
-
-fn display_size(size: u64, config: &Config) -> String {
-    // NOTE: The human-readable behavior deviates from the GNU ls.
-    // The GNU ls uses binary prefixes by default.
-    match config.size_format {
-        SizeFormat::Binary => format_prefixed(&NumberPrefix::binary(size as f64)),
-        SizeFormat::Decimal => format_prefixed(&NumberPrefix::decimal(size as f64)),
-        SizeFormat::Bytes => size.to_string(),
-    }
-}
-
-#[cfg(unix)]
-fn file_is_executable(md: &Metadata) -> bool {
-    // Mode always returns u32, but the flags might not be, based on the platform
-    // e.g. linux has u32, mac has u16.
-    // S_IXUSR -> user has execute permission
-    // S_IXGRP -> group has execute permission
-    // S_IXOTH -> other users have execute permission
-    #[allow(clippy::unnecessary_cast)]
-    return md.mode() & ((S_IXUSR | S_IXGRP | S_IXOTH) as u32) != 0;
-}
-
-fn classify_file(path: &PathData, out: &mut BufWriter<Stdout>) -> Option<char> {
-    let file_type = path.file_type(out)?;
-
-    if file_type.is_dir() {
-        Some('/')
-    } else if file_type.is_symlink() {
-        Some('@')
-    } else {
-        #[cfg(unix)]
-        {
-            if file_type.is_socket() {
-                Some('=')
-            } else if file_type.is_fifo() {
-                Some('|')
-            } else if file_type.is_file() && file_is_executable(path.md(out).as_ref().unwrap()) {
-                Some('*')
-            } else {
-                None
-            }
-        }
-        #[cfg(not(unix))]
-        None
-    }
-}
-
-/// Takes a [`PathData`] struct and returns a cell with a name ready for displaying.
-///
-/// This function relies on the following parameters in the provided `&Config`:
-/// * `config.quoting_style` to decide how we will escape `name` using [`escape_name`].
-/// * `config.inode` decides whether to display inode numbers beside names using [`get_inode`].
-/// * `config.color` decides whether it's going to color `name` using [`color_name`].
-/// * `config.indicator_style` to append specific characters to `name` using [`classify_file`].
-/// * `config.format` to display symlink targets if `Format::Long`. This function is also
-///   responsible for coloring symlink target names if `config.color` is specified.
-/// * `config.context` to prepend security context to `name` if compiled with `feat_selinux`.
-///
-/// Note that non-unicode sequences in symlink targets are dealt with using
-/// [`std::path::Path::to_string_lossy`].
-#[allow(unused_variables)]
-#[allow(clippy::cognitive_complexity)]
-fn display_file_name(
-    path: &PathData,
-    config: &Config,
-    prefix_context: Option<usize>,
-    more_info: String,
-    out: &mut BufWriter<Stdout>,
-) -> Cell {
-    // This is our return value. We start by `&path.display_name` and modify it along the way.
-    let mut name = escape_name(&path.display_name, &config.quoting_style);
-
-    // We need to keep track of the width ourselves instead of letting term_grid
-    // infer it because the color codes mess up term_grid's width calculation.
-    let mut width = name.width();
-
-    if let Some(ls_colors) = &config.color {
-        let md = path.md(out);
-        name = if md.is_some() {
-            color_name(name, &path.p_buf, md, ls_colors)
-        } else {
-            color_name(
-                name,
-                &path.p_buf,
-                path.p_buf.symlink_metadata().ok().as_ref(),
-                ls_colors,
-            )
-        };
-    }
-
-    if config.format != Format::Long && !more_info.is_empty() {
-        // increment width here b/c name was given colors and name.width() is now the wrong
-        // size for display
-        width += more_info.width();
-        name = more_info + &name;
-    }
-
-    if config.indicator_style != IndicatorStyle::None {
-        let sym = classify_file(path, out);
-
-        let char_opt = match config.indicator_style {
-            IndicatorStyle::Classify => sym,
-            IndicatorStyle::FileType => {
-                // Don't append an asterisk.
-                match sym {
-                    Some('*') => None,
-                    _ => sym,
-                }
-            }
-            IndicatorStyle::Slash => {
-                // Append only a slash.
-                match sym {
-                    Some('/') => Some('/'),
-                    _ => None,
-                }
-            }
-            IndicatorStyle::None => None,
-        };
-
-        if let Some(c) = char_opt {
-            name.push(c);
-            width += 1;
-        }
-    }
-
-    if config.format == Format::Long
-        && path.file_type(out).is_some()
-        && path.file_type(out).unwrap().is_symlink()
-        && !path.must_dereference
-    {
-        if let Ok(target) = path.p_buf.read_link() {
-            name.push_str(" -> ");
-
-            // We might as well color the symlink output after the arrow.
-            // This makes extra system calls, but provides important information that
-            // people run `ls -l --color` are very interested in.
-            if let Some(ls_colors) = &config.color {
-                // We get the absolute path to be able to construct PathData with valid Metadata.
-                // This is because relative symlinks will fail to get_metadata.
-                let mut absolute_target = target.clone();
-                if target.is_relative() {
-                    if let Some(parent) = path.p_buf.parent() {
-                        absolute_target = parent.join(absolute_target);
-                    }
-                }
-
-                let target_data = PathData::new(absolute_target, None, None, config, false);
-
-                // If we have a symlink to a valid file, we use the metadata of said file.
-                // Because we use an absolute path, we can assume this is guaranteed to exist.
-                // Otherwise, we use path.md(), which will guarantee we color to the same
-                // color of non-existent symlinks according to style_for_path_with_metadata.
-                if path.md(out).is_none()
-                    && get_metadata(target_data.p_buf.as_path(), target_data.must_dereference)
-                        .is_err()
-                {
-                    name.push_str(&path.p_buf.read_link().unwrap().to_string_lossy());
-                } else {
-                    // Use fn get_metadata instead of md() here and above because ls
-                    // should not exit with an err, if we are unable to obtain the target_metadata
-                    let target_metadata = match get_metadata(
-                        target_data.p_buf.as_path(),
-                        target_data.must_dereference,
-                    ) {
-                        Ok(md) => md,
-                        Err(_) => path.md(out).unwrap().to_owned(),
-                    };
-
-                    name.push_str(&color_name(
-                        escape_name(target.as_os_str(), &config.quoting_style),
-                        &target_data.p_buf,
-                        Some(&target_metadata),
-                        ls_colors,
-                    ));
-                }
-            } else {
-                // If no coloring is required, we just use target as is.
-                // Apply the right quoting
-                name.push_str(&escape_name(target.as_os_str(), &config.quoting_style));
-            }
-        }
-    }
-
-    // Prepend the security context to the `name` and adjust `width` in order
-    // to get correct alignment from later calls to`display_grid()`.
-    if config.context {
-        if let Some(pad_count) = prefix_context {
-            let security_context = if matches!(config.format, Format::Commas) {
-                path.security_context.to_owned()
-            } else {
-                pad_left(&path.security_context, pad_count)
-            };
-            name = format!("{security_context} {name}");
-            width += security_context.len() + 1;
-        }
-    }
-
-    Cell {
-        contents: name,
-        width,
-    }
-}
-
-fn color_name(name: String, path: &Path, md: Option<&Metadata>, ls_colors: &LsColors) -> String {
-    match ls_colors.style_for_path_with_metadata(path, md) {
-        Some(style) => {
-            return style.to_nu_ansi_term_style().paint(name).to_string();
-        }
-        None => name,
-    }
-}
-
-#[cfg(not(unix))]
-fn display_symlink_count(_metadata: &Metadata) -> String {
-    // Currently not sure of how to get this on Windows, so I'm punting.
-    // Git Bash looks like it may do the same thing.
-    String::from("1")
-}
-
-#[cfg(unix)]
-fn display_symlink_count(metadata: &Metadata) -> String {
-    metadata.nlink().to_string()
-}
-
-#[cfg(unix)]
-fn display_inode(metadata: &Metadata) -> String {
-    get_inode(metadata)
-}
-
-// This returns the SELinux security context as UTF8 `String`.
-// In the long term this should be changed to `OsStr`, see discussions at #2621/#2656
-#[allow(unused_variables)]
-fn get_security_context(config: &Config, p_buf: &Path, must_dereference: bool) -> String {
-    let substitute_string = "?".to_string();
-    // If we must dereference, ensure that the symlink is actually valid even if the system
-    // does not support SELinux.
-    // Conforms to the GNU coreutils where a dangling symlink results in exit code 1.
-    if must_dereference {
-        match get_metadata(p_buf, must_dereference) {
-            Err(err) => {
-                // The Path couldn't be dereferenced, so return early and set exit code 1
-                // to indicate a minor error
-                show!(LsError::IOErrorContext(err, p_buf.to_path_buf(), false));
-                return substitute_string;
-            }
-            Ok(md) => (),
-        }
-    }
-    if config.selinux_supported {
-        #[cfg(feature = "selinux")]
-        {
-            match selinux::SecurityContext::of_path(p_buf, must_dereference.to_owned(), false) {
-                Err(_r) => {
-                    // TODO: show the actual reason why it failed
-                    show_warning!("failed to get security context of: {}", p_buf.quote());
-                    substitute_string
-                }
-                Ok(None) => substitute_string,
-                Ok(Some(context)) => {
-                    let context = context.as_bytes();
-
-                    let context = context.strip_suffix(&[0]).unwrap_or(context);
-                    String::from_utf8(context.to_vec()).unwrap_or_else(|e| {
-                        show_warning!(
-                            "getting security context of: {}: {}",
-                            p_buf.quote(),
-                            e.to_string()
-                        );
-                        String::from_utf8_lossy(context).into_owned()
-                    })
-                }
-            }
-        }
-        #[cfg(not(feature = "selinux"))]
-        {
-            substitute_string
-        }
-    } else {
-        substitute_string
-    }
-}
-
-#[cfg(unix)]
-fn calculate_padding_collection(
-    items: &[PathData],
-    config: &Config,
-    out: &mut BufWriter<Stdout>,
-) -> PaddingCollection {
-    let mut padding_collections = PaddingCollection {
-        inode: 1,
-        link_count: 1,
-        uname: 1,
-        group: 1,
-        context: 1,
-        size: 1,
-        major: 1,
-        minor: 1,
-        block_size: 1,
-    };
-
-    for item in items {
-        #[cfg(unix)]
-        if config.inode {
-            let inode_len = if let Some(md) = item.md(out) {
-                display_inode(md).len()
-            } else {
-                continue;
-            };
-            padding_collections.inode = inode_len.max(padding_collections.inode);
-        }
-
-        if config.alloc_size {
-            if let Some(md) = item.md(out) {
-                let block_size_len = display_size(get_block_size(md, config), config).len();
-                padding_collections.block_size = block_size_len.max(padding_collections.block_size);
-            }
-        }
-
-        if config.format == Format::Long {
-            let context_len = item.security_context.len();
-            let (link_count_len, uname_len, group_len, size_len, major_len, minor_len) =
-                display_dir_entry_size(item, config, out);
-            padding_collections.link_count = link_count_len.max(padding_collections.link_count);
-            padding_collections.uname = uname_len.max(padding_collections.uname);
-            padding_collections.group = group_len.max(padding_collections.group);
-            if config.context {
-                padding_collections.context = context_len.max(padding_collections.context);
-            }
-            if items.len() == 1usize {
-                padding_collections.size = 0usize;
-                padding_collections.major = 0usize;
-                padding_collections.minor = 0usize;
-            } else {
-                padding_collections.major = major_len.max(padding_collections.major);
-                padding_collections.minor = minor_len.max(padding_collections.minor);
-                padding_collections.size = size_len
-                    .max(padding_collections.size)
-                    .max(padding_collections.major + padding_collections.minor + 2usize);
-            }
-        }
-    }
-
-    padding_collections
-}
-
-#[cfg(not(unix))]
-fn calculate_padding_collection(
-    items: &[PathData],
-    config: &Config,
-    out: &mut BufWriter<Stdout>,
-) -> PaddingCollection {
-    let mut padding_collections = PaddingCollection {
-        link_count: 1,
-        uname: 1,
-        group: 1,
-        context: 1,
-        size: 1,
-        block_size: 1,
-    };
-
-    for item in items {
-        if config.alloc_size {
-            if let Some(md) = item.md(out) {
-                let block_size_len = display_size(get_block_size(md, config), config).len();
-                padding_collections.block_size = block_size_len.max(padding_collections.block_size);
-            }
-        }
-
-        let context_len = item.security_context.len();
-        let (link_count_len, uname_len, group_len, size_len, _major_len, _minor_len) =
-            display_dir_entry_size(item, config, out);
-        padding_collections.link_count = link_count_len.max(padding_collections.link_count);
-        padding_collections.uname = uname_len.max(padding_collections.uname);
-        padding_collections.group = group_len.max(padding_collections.group);
-        if config.context {
-            padding_collections.context = context_len.max(padding_collections.context);
-        }
-        padding_collections.size = size_len.max(padding_collections.size);
-    }
-
-    padding_collections
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_mkdir/mkdir.rs.html b/coreutils/dev/src/uu_mkdir/mkdir.rs.html deleted file mode 100644 index 20eacf415..000000000 --- a/coreutils/dev/src/uu_mkdir/mkdir.rs.html +++ /dev/null @@ -1,447 +0,0 @@ -mkdir.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Nicholas Juszczak <juszczakn@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) ugoa cmode
-
-use clap::builder::ValueParser;
-use clap::parser::ValuesRef;
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-use std::ffi::OsString;
-use std::path::{Path, PathBuf};
-#[cfg(not(windows))]
-use uucore::error::FromIo;
-use uucore::error::{UResult, USimpleError};
-#[cfg(not(windows))]
-use uucore::mode;
-use uucore::{display::Quotable, fs::dir_strip_dot_for_creation};
-use uucore::{format_usage, help_about, help_section, help_usage, show, show_if_err};
-
-static DEFAULT_PERM: u32 = 0o777;
-
-const ABOUT: &str = help_about!("mkdir.md");
-const USAGE: &str = help_usage!("mkdir.md");
-const AFTER_HELP: &str = help_section!("after help", "mkdir.md");
-
-mod options {
-    pub const MODE: &str = "mode";
-    pub const PARENTS: &str = "parents";
-    pub const VERBOSE: &str = "verbose";
-    pub const DIRS: &str = "dirs";
-}
-
-#[cfg(windows)]
-fn get_mode(_matches: &ArgMatches, _mode_had_minus_prefix: bool) -> Result<u32, String> {
-    Ok(DEFAULT_PERM)
-}
-
-#[cfg(not(windows))]
-fn get_mode(matches: &ArgMatches, mode_had_minus_prefix: bool) -> Result<u32, String> {
-    let digits: &[char] = &['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
-    // Translate a ~str in octal form to u16, default to 777
-    // Not tested on Windows
-    let mut new_mode = DEFAULT_PERM;
-    match matches.get_one::<String>(options::MODE) {
-        Some(m) => {
-            for mode in m.split(',') {
-                if mode.contains(digits) {
-                    new_mode = mode::parse_numeric(new_mode, m, true)?;
-                } else {
-                    let cmode = if mode_had_minus_prefix {
-                        // clap parsing is finished, now put prefix back
-                        format!("-{mode}")
-                    } else {
-                        mode.to_string()
-                    };
-                    new_mode = mode::parse_symbolic(new_mode, &cmode, mode::get_umask(), true)?;
-                }
-            }
-            Ok(new_mode)
-        }
-        None => {
-            // If no mode argument is specified return the mode derived from umask
-            Ok(!mode::get_umask() & 0o0777)
-        }
-    }
-}
-
-#[cfg(windows)]
-fn strip_minus_from_mode(_args: &mut [String]) -> bool {
-    false
-}
-
-#[cfg(not(windows))]
-fn strip_minus_from_mode(args: &mut Vec<String>) -> bool {
-    mode::strip_minus_from_mode(args)
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let mut args = args.collect_lossy();
-
-    // Before we can parse 'args' with clap (and previously getopts),
-    // a possible MODE prefix '-' needs to be removed (e.g. "chmod -x FILE").
-    let mode_had_minus_prefix = strip_minus_from_mode(&mut args);
-
-    // Linux-specific options, not implemented
-    // opts.optflag("Z", "context", "set SELinux security context" +
-    // " of each created directory to CTX"),
-    let matches = uu_app().after_help(AFTER_HELP).try_get_matches_from(args)?;
-
-    let dirs = matches
-        .get_many::<OsString>(options::DIRS)
-        .unwrap_or_default();
-    let verbose = matches.get_flag(options::VERBOSE);
-    let recursive = matches.get_flag(options::PARENTS);
-
-    match get_mode(&matches, mode_had_minus_prefix) {
-        Ok(mode) => exec(dirs, recursive, mode, verbose),
-        Err(f) => Err(USimpleError::new(1, f)),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::MODE)
-                .short('m')
-                .long(options::MODE)
-                .help("set file mode (not implemented on windows)"),
-        )
-        .arg(
-            Arg::new(options::PARENTS)
-                .short('p')
-                .long(options::PARENTS)
-                .help("make parent directories as needed")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::VERBOSE)
-                .short('v')
-                .long(options::VERBOSE)
-                .help("print a message for each printed directory")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DIRS)
-                .action(ArgAction::Append)
-                .num_args(1..)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::DirPath),
-        )
-}
-
-/**
- * Create the list of new directories
- */
-fn exec(dirs: ValuesRef<OsString>, recursive: bool, mode: u32, verbose: bool) -> UResult<()> {
-    for dir in dirs {
-        // Special case to match GNU's behavior:
-        // mkdir -p foo/. should work and just create foo/
-        // std::fs::create_dir("foo/."); fails in pure Rust
-        let path = if recursive {
-            dir_strip_dot_for_creation(&PathBuf::from(dir))
-        } else {
-            // Normal case
-            PathBuf::from(dir)
-        };
-        show_if_err!(mkdir(path.as_path(), recursive, mode, verbose));
-    }
-    Ok(())
-}
-
-fn mkdir(path: &Path, recursive: bool, mode: u32, verbose: bool) -> UResult<()> {
-    create_dir(path, recursive, verbose, false)?;
-    chmod(path, mode)
-}
-
-#[cfg(any(unix, target_os = "redox"))]
-fn chmod(path: &Path, mode: u32) -> UResult<()> {
-    use std::fs::{set_permissions, Permissions};
-    use std::os::unix::fs::PermissionsExt;
-
-    let mode = Permissions::from_mode(mode);
-
-    set_permissions(path, mode)
-        .map_err_context(|| format!("cannot set permissions {}", path.quote()))
-}
-
-#[cfg(windows)]
-fn chmod(_path: &Path, _mode: u32) -> UResult<()> {
-    // chmod on Windows only sets the readonly flag, which isn't even honored on directories
-    Ok(())
-}
-
-// `is_parent` argument is not used on windows
-#[allow(unused_variables)]
-fn create_dir(path: &Path, recursive: bool, verbose: bool, is_parent: bool) -> UResult<()> {
-    if path.exists() && !recursive {
-        return Err(USimpleError::new(
-            1,
-            format!("{}: File exists", path.display()),
-        ));
-    }
-    if path == Path::new("") {
-        return Ok(());
-    }
-
-    if recursive {
-        match path.parent() {
-            Some(p) => create_dir(p, recursive, verbose, true)?,
-            None => {
-                USimpleError::new(1, "failed to create whole tree");
-            }
-        }
-    }
-    match std::fs::create_dir(path) {
-        Ok(()) => {
-            if verbose {
-                println!(
-                    "{}: created directory {}",
-                    uucore::util_name(),
-                    path.quote()
-                );
-            }
-            #[cfg(not(windows))]
-            if is_parent {
-                // directories created by -p have permission bits set to '=rwx,u+wx',
-                // which is umask modified by 'u+wx'
-                chmod(path, (!mode::get_umask() & 0o0777) | 0o0300)?;
-            }
-            Ok(())
-        }
-        Err(_) if path.is_dir() => Ok(()),
-        Err(e) => Err(e.into()),
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_mkfifo/mkfifo.rs.html b/coreutils/dev/src/uu_mkfifo/mkfifo.rs.html deleted file mode 100644 index 84214384e..000000000 --- a/coreutils/dev/src/uu_mkfifo/mkfifo.rs.html +++ /dev/null @@ -1,205 +0,0 @@ -mkfifo.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Michael Gehring <mg@ebfe.org>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use libc::mkfifo;
-use std::ffi::CString;
-use uucore::display::Quotable;
-use uucore::error::{UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage, show};
-
-static USAGE: &str = help_usage!("mkfifo.md");
-static ABOUT: &str = help_about!("mkfifo.md");
-
-mod options {
-    pub static MODE: &str = "mode";
-    pub static SE_LINUX_SECURITY_CONTEXT: &str = "Z";
-    pub static CONTEXT: &str = "context";
-    pub static FIFO: &str = "fifo";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    if matches.contains_id(options::CONTEXT) {
-        return Err(USimpleError::new(1, "--context is not implemented"));
-    }
-    if matches.get_flag(options::SE_LINUX_SECURITY_CONTEXT) {
-        return Err(USimpleError::new(1, "-Z is not implemented"));
-    }
-
-    let mode = match matches.get_one::<String>(options::MODE) {
-        Some(m) => match usize::from_str_radix(m, 8) {
-            Ok(m) => m,
-            Err(e) => return Err(USimpleError::new(1, format!("invalid mode: {e}"))),
-        },
-        None => 0o666,
-    };
-
-    let fifos: Vec<String> = match matches.get_many::<String>(options::FIFO) {
-        Some(v) => v.clone().map(|s| s.to_owned()).collect(),
-        None => return Err(USimpleError::new(1, "missing operand")),
-    };
-
-    for f in fifos {
-        let err = unsafe {
-            let name = CString::new(f.as_bytes()).unwrap();
-            mkfifo(name.as_ptr(), mode as libc::mode_t)
-        };
-        if err == -1 {
-            show!(USimpleError::new(
-                1,
-                format!("cannot create fifo {}: File exists", f.quote())
-            ));
-        }
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::MODE)
-                .short('m')
-                .long(options::MODE)
-                .help("file permissions for the fifo")
-                .default_value("0666")
-                .value_name("MODE"),
-        )
-        .arg(
-            Arg::new(options::SE_LINUX_SECURITY_CONTEXT)
-                .short('Z')
-                .help("set the SELinux security context to default type")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::CONTEXT)
-                .long(options::CONTEXT)
-                .value_name("CTX")
-                .help(
-                    "like -Z, or if CTX is specified then set the SELinux \
-                    or SMACK security context to CTX",
-                ),
-        )
-        .arg(
-            Arg::new(options::FIFO)
-                .hide(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_mknod/mknod.rs.html b/coreutils/dev/src/uu_mknod/mknod.rs.html deleted file mode 100644 index 4b669fb6a..000000000 --- a/coreutils/dev/src/uu_mknod/mknod.rs.html +++ /dev/null @@ -1,387 +0,0 @@ -mknod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) parsemode makedev sysmacros perror IFBLK IFCHR IFIFO
-
-use clap::{crate_version, value_parser, Arg, ArgMatches, Command};
-use libc::{dev_t, mode_t};
-use libc::{S_IFBLK, S_IFCHR, S_IFIFO, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IWUSR};
-use std::ffi::CString;
-
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, UResult, USimpleError, UUsageError};
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-const ABOUT: &str = help_about!("mknod.md");
-const USAGE: &str = help_usage!("mknod.md");
-const AFTER_HELP: &str = help_section!("after help", "mknod.md");
-
-const MODE_RW_UGO: mode_t = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-
-#[inline(always)]
-fn makedev(maj: u64, min: u64) -> dev_t {
-    // pick up from <sys/sysmacros.h>
-    ((min & 0xff) | ((maj & 0xfff) << 8) | ((min & !0xff) << 12) | ((maj & !0xfff) << 32)) as dev_t
-}
-
-#[cfg(windows)]
-fn _mknod(file_name: &str, mode: mode_t, dev: dev_t) -> i32 {
-    panic!("Unsupported for windows platform")
-}
-
-#[derive(Clone, PartialEq)]
-enum FileType {
-    Block,
-    Character,
-    Fifo,
-}
-
-#[cfg(unix)]
-fn _mknod(file_name: &str, mode: mode_t, dev: dev_t) -> i32 {
-    let c_str = CString::new(file_name).expect("Failed to convert to CString");
-
-    // the user supplied a mode
-    let set_umask = mode & MODE_RW_UGO != MODE_RW_UGO;
-
-    unsafe {
-        // store prev umask
-        let last_umask = if set_umask { libc::umask(0) } else { 0 };
-
-        let errno = libc::mknod(c_str.as_ptr(), mode, dev);
-
-        // set umask back to original value
-        if set_umask {
-            libc::umask(last_umask);
-        }
-
-        if errno == -1 {
-            let c_str = CString::new(uucore::execution_phrase().as_bytes())
-                .expect("Failed to convert to CString");
-            // shows the error from the mknod syscall
-            libc::perror(c_str.as_ptr());
-        }
-        errno
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-    // Linux-specific options, not implemented
-    // opts.optflag("Z", "", "set the SELinux security context to default type");
-    // opts.optopt("", "context", "like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX");
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let mode = get_mode(&matches).map_err(|e| USimpleError::new(1, e))?;
-
-    let file_name = matches
-        .get_one::<String>("name")
-        .expect("Missing argument 'NAME'");
-
-    let file_type = matches.get_one::<FileType>("type").unwrap();
-
-    if *file_type == FileType::Fifo {
-        if matches.contains_id("major") || matches.contains_id("minor") {
-            Err(UUsageError::new(
-                1,
-                "Fifos do not have major and minor device numbers.",
-            ))
-        } else {
-            let exit_code = _mknod(file_name, S_IFIFO | mode, 0);
-            set_exit_code(exit_code);
-            Ok(())
-        }
-    } else {
-        match (
-            matches.get_one::<u64>("major"),
-            matches.get_one::<u64>("minor"),
-        ) {
-            (_, None) | (None, _) => {
-                return Err(UUsageError::new(
-                    1,
-                    "Special files require major and minor device numbers.",
-                ));
-            }
-            (Some(&major), Some(&minor)) => {
-                let dev = makedev(major, minor);
-                let exit_code = match file_type {
-                    FileType::Block => _mknod(file_name, S_IFBLK | mode, dev),
-                    FileType::Character => _mknod(file_name, S_IFCHR | mode, dev),
-                    _ => unreachable!("file_type was validated to be only block or character"),
-                };
-                set_exit_code(exit_code);
-                Ok(())
-            }
-        }
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .after_help(AFTER_HELP)
-        .about(ABOUT)
-        .infer_long_args(true)
-        .arg(
-            Arg::new("mode")
-                .short('m')
-                .long("mode")
-                .value_name("MODE")
-                .help("set file permission bits to MODE, not a=rw - umask"),
-        )
-        .arg(
-            Arg::new("name")
-                .value_name("NAME")
-                .help("name of the new file")
-                .required(true)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-        .arg(
-            Arg::new("type")
-                .value_name("TYPE")
-                .help("type of the new file (b, c, u or p)")
-                .required(true)
-                .value_parser(parse_type),
-        )
-        .arg(
-            Arg::new("major")
-                .value_name("MAJOR")
-                .help("major file type")
-                .value_parser(value_parser!(u64)),
-        )
-        .arg(
-            Arg::new("minor")
-                .value_name("MINOR")
-                .help("minor file type")
-                .value_parser(value_parser!(u64)),
-        )
-}
-
-fn get_mode(matches: &ArgMatches) -> Result<mode_t, String> {
-    match matches.get_one::<String>("mode") {
-        None => Ok(MODE_RW_UGO),
-        Some(str_mode) => uucore::mode::parse_mode(str_mode)
-            .map_err(|e| format!("invalid mode ({e})"))
-            .and_then(|mode| {
-                if mode > 0o777 {
-                    Err("mode must specify only file permission bits".to_string())
-                } else {
-                    Ok(mode)
-                }
-            }),
-    }
-}
-
-fn parse_type(tpe: &str) -> Result<FileType, String> {
-    // Only check the first character, to allow mnemonic usage like
-    // 'mknod /dev/rst0 character 18 0'.
-    tpe.chars()
-        .next()
-        .ok_or_else(|| "missing device type".to_string())
-        .and_then(|first_char| match first_char {
-            'b' => Ok(FileType::Block),
-            'c' | 'u' => Ok(FileType::Character),
-            'p' => Ok(FileType::Fifo),
-            _ => Err(format!("invalid device type {}", tpe.quote())),
-        })
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_mktemp/mktemp.rs.html b/coreutils/dev/src/uu_mktemp/mktemp.rs.html deleted file mode 100644 index da7761be8..000000000 --- a/coreutils/dev/src/uu_mktemp/mktemp.rs.html +++ /dev/null @@ -1,1143 +0,0 @@ -mktemp.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-
// This file is part of the uutils coreutils package.
-//
-// (c) Sunrin SHIMURA
-// Collaborator: Jian Zeng
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (paths) GPGHome findxs
-
-use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command};
-use uucore::display::{println_verbatim, Quotable};
-use uucore::error::{FromIo, UError, UResult, UUsageError};
-use uucore::{format_usage, help_about, help_usage};
-
-use std::env;
-use std::error::Error;
-use std::fmt::Display;
-use std::io::ErrorKind;
-use std::iter;
-use std::path::{Path, PathBuf, MAIN_SEPARATOR};
-
-#[cfg(unix)]
-use std::fs;
-#[cfg(unix)]
-use std::os::unix::prelude::PermissionsExt;
-
-use rand::Rng;
-use tempfile::Builder;
-
-const ABOUT: &str = help_about!("mktemp.md");
-const USAGE: &str = help_usage!("mktemp.md");
-
-static DEFAULT_TEMPLATE: &str = "tmp.XXXXXXXXXX";
-
-static OPT_DIRECTORY: &str = "directory";
-static OPT_DRY_RUN: &str = "dry-run";
-static OPT_QUIET: &str = "quiet";
-static OPT_SUFFIX: &str = "suffix";
-static OPT_TMPDIR: &str = "tmpdir";
-static OPT_P: &str = "p";
-static OPT_T: &str = "t";
-
-static ARG_TEMPLATE: &str = "template";
-
-#[cfg(not(windows))]
-const TMPDIR_ENV_VAR: &str = "TMPDIR";
-#[cfg(windows)]
-const TMPDIR_ENV_VAR: &str = "TMP";
-
-#[derive(Debug)]
-enum MkTempError {
-    PersistError(PathBuf),
-    MustEndInX(String),
-    TooFewXs(String),
-
-    /// The template prefix contains a path separator (e.g. `"a/bXXX"`).
-    PrefixContainsDirSeparator(String),
-
-    /// The template suffix contains a path separator (e.g. `"XXXa/b"`).
-    SuffixContainsDirSeparator(String),
-    InvalidTemplate(String),
-    TooManyTemplates,
-
-    /// When a specified temporary directory could not be found.
-    NotFound(String, String),
-}
-
-impl UError for MkTempError {
-    fn usage(&self) -> bool {
-        matches!(self, Self::TooManyTemplates)
-    }
-}
-
-impl Error for MkTempError {}
-
-impl Display for MkTempError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        use MkTempError::*;
-        match self {
-            PersistError(p) => write!(f, "could not persist file {}", p.quote()),
-            MustEndInX(s) => write!(f, "with --suffix, template {} must end in X", s.quote()),
-            TooFewXs(s) => write!(f, "too few X's in template {}", s.quote()),
-            PrefixContainsDirSeparator(s) => {
-                write!(
-                    f,
-                    "invalid template, {}, contains directory separator",
-                    s.quote()
-                )
-            }
-            SuffixContainsDirSeparator(s) => {
-                write!(
-                    f,
-                    "invalid suffix {}, contains directory separator",
-                    s.quote()
-                )
-            }
-            InvalidTemplate(s) => write!(
-                f,
-                "invalid template, {}; with --tmpdir, it may not be absolute",
-                s.quote()
-            ),
-            TooManyTemplates => {
-                write!(f, "too many templates")
-            }
-            NotFound(template_type, s) => write!(
-                f,
-                "failed to create {} via template {}: No such file or directory",
-                template_type,
-                s.quote()
-            ),
-        }
-    }
-}
-
-/// Options parsed from the command-line.
-///
-/// This provides a layer of indirection between the application logic
-/// and the argument parsing library `clap`, allowing each to vary
-/// independently.
-struct Options {
-    /// Whether to create a temporary directory instead of a file.
-    directory: bool,
-
-    /// Whether to just print the name of a file that would have been created.
-    dry_run: bool,
-
-    /// Whether to suppress file creation error messages.
-    quiet: bool,
-
-    /// The directory in which to create the temporary file.
-    ///
-    /// If `None`, the file will be created in the current directory.
-    tmpdir: Option<PathBuf>,
-
-    /// The suffix to append to the temporary file, if any.
-    suffix: Option<String>,
-
-    /// Whether to treat the template argument as a single file path component.
-    treat_as_template: bool,
-
-    /// The template to use for the name of the temporary file.
-    template: String,
-}
-
-impl Options {
-    fn from(matches: &ArgMatches) -> Self {
-        let tmpdir = matches
-            .get_one::<PathBuf>(OPT_TMPDIR)
-            .or_else(|| matches.get_one::<PathBuf>(OPT_P))
-            .cloned();
-        let (tmpdir, template) = match matches.get_one::<String>(ARG_TEMPLATE) {
-            // If no template argument is given, `--tmpdir` is implied.
-            None => {
-                let tmpdir = Some(tmpdir.unwrap_or_else(env::temp_dir));
-                let template = DEFAULT_TEMPLATE;
-                (tmpdir, template.to_string())
-            }
-            Some(template) => {
-                let tmpdir = if env::var(TMPDIR_ENV_VAR).is_ok() && matches.get_flag(OPT_T) {
-                    env::var_os(TMPDIR_ENV_VAR).map(|t| t.into())
-                } else if tmpdir.is_some() {
-                    tmpdir
-                } else if matches.get_flag(OPT_T) || matches.contains_id(OPT_TMPDIR) {
-                    // If --tmpdir is given without an argument, or -t is given
-                    // export in TMPDIR
-                    Some(env::temp_dir())
-                } else {
-                    None
-                };
-                (tmpdir, template.to_string())
-            }
-        };
-        Self {
-            directory: matches.get_flag(OPT_DIRECTORY),
-            dry_run: matches.get_flag(OPT_DRY_RUN),
-            quiet: matches.get_flag(OPT_QUIET),
-            tmpdir,
-            suffix: matches.get_one::<String>(OPT_SUFFIX).map(String::from),
-            treat_as_template: matches.get_flag(OPT_T),
-            template,
-        }
-    }
-}
-
-/// Parameters that control the path to and name of the temporary file.
-///
-/// The temporary file will be created at
-///
-/// ```text
-/// {directory}/{prefix}{XXX}{suffix}
-/// ```
-///
-/// where `{XXX}` is a sequence of random characters whose length is
-/// `num_rand_chars`.
-struct Params {
-    /// The directory that will contain the temporary file.
-    directory: String,
-
-    /// The (non-random) prefix of the temporary file.
-    prefix: String,
-
-    /// The number of random characters in the name of the temporary file.
-    num_rand_chars: usize,
-
-    /// The (non-random) suffix of the temporary file.
-    suffix: String,
-}
-
-/// Find the start and end indices of the last contiguous block of Xs.
-///
-/// If no contiguous block of at least three Xs could be found, this
-/// function returns `None`.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// assert_eq!(find_last_contiguous_block_of_xs("XXX_XXX"), Some((4, 7)));
-/// assert_eq!(find_last_contiguous_block_of_xs("aXbXcX"), None);
-/// ```
-fn find_last_contiguous_block_of_xs(s: &str) -> Option<(usize, usize)> {
-    let j = s.rfind("XXX")? + 3;
-    let i = s[..j].rfind(|c| c != 'X').map_or(0, |i| i + 1);
-    Some((i, j))
-}
-
-impl Params {
-    fn from(options: Options) -> Result<Self, MkTempError> {
-        // The template argument must end in 'X' if a suffix option is given.
-        if options.suffix.is_some() && !options.template.ends_with('X') {
-            return Err(MkTempError::MustEndInX(options.template));
-        }
-
-        // Get the start and end indices of the randomized part of the template.
-        //
-        // For example, if the template is "abcXXXXyz", then `i` is 3 and `j` is 7.
-        let (i, j) = match find_last_contiguous_block_of_xs(&options.template) {
-            None => {
-                let s = match options.suffix {
-                    None => options.template,
-                    Some(s) => format!("{}{}", options.template, s),
-                };
-                return Err(MkTempError::TooFewXs(s));
-            }
-            Some(indices) => indices,
-        };
-
-        // Combine the directory given as an option and the prefix of the template.
-        //
-        // For example, if `tmpdir` is "a/b" and the template is "c/dXXX",
-        // then `prefix` is "a/b/c/d".
-        let tmpdir = options.tmpdir;
-        let prefix_from_option = tmpdir.clone().unwrap_or_default();
-        let prefix_from_template = &options.template[..i];
-        let prefix = Path::new(&prefix_from_option)
-            .join(prefix_from_template)
-            .display()
-            .to_string();
-        if options.treat_as_template && prefix_from_template.contains(MAIN_SEPARATOR) {
-            return Err(MkTempError::PrefixContainsDirSeparator(options.template));
-        }
-        if tmpdir.is_some() && Path::new(prefix_from_template).is_absolute() {
-            return Err(MkTempError::InvalidTemplate(options.template));
-        }
-
-        // Split the parent directory from the file part of the prefix.
-        //
-        // For example, if `prefix` is "a/b/c/d", then `directory` is
-        // "a/b/c" is `prefix` gets reassigned to "d".
-        let (directory, prefix) = if prefix.ends_with(MAIN_SEPARATOR) {
-            (prefix, String::new())
-        } else {
-            let path = Path::new(&prefix);
-            let directory = match path.parent() {
-                None => String::new(),
-                Some(d) => d.display().to_string(),
-            };
-            let prefix = match path.file_name() {
-                None => String::new(),
-                Some(f) => f.to_str().unwrap().to_string(),
-            };
-            (directory, prefix)
-        };
-
-        // Combine the suffix from the template with the suffix given as an option.
-        //
-        // For example, if the suffix command-line argument is ".txt" and
-        // the template is "XXXabc", then `suffix` is "abc.txt".
-        let suffix_from_option = options.suffix.unwrap_or_default();
-        let suffix_from_template = &options.template[j..];
-        let suffix = format!("{suffix_from_template}{suffix_from_option}");
-        if suffix.contains(MAIN_SEPARATOR) {
-            return Err(MkTempError::SuffixContainsDirSeparator(suffix));
-        }
-
-        // The number of random characters in the template.
-        //
-        // For example, if the template is "abcXXXXyz", then the number of
-        // random characters is four.
-        let num_rand_chars = j - i;
-
-        Ok(Self {
-            directory,
-            prefix,
-            num_rand_chars,
-            suffix,
-        })
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = match uu_app().try_get_matches_from(&args) {
-        Ok(m) => m,
-        Err(e) => {
-            if e.kind() == clap::error::ErrorKind::TooManyValues
-                && e.context().any(|(kind, val)| {
-                    kind == clap::error::ContextKind::InvalidArg
-                        && val == &clap::error::ContextValue::String("[template]".into())
-                })
-            {
-                return Err(UUsageError::new(1, "too many templates"));
-            }
-            return Err(e.into());
-        }
-    };
-
-    // Parse command-line options into a format suitable for the
-    // application logic.
-    let options = Options::from(&matches);
-
-    if env::var("POSIXLY_CORRECT").is_ok() {
-        // If POSIXLY_CORRECT was set, template MUST be the last argument.
-        if matches.contains_id(ARG_TEMPLATE) {
-            // Template argument was provided, check if was the last one.
-            if args.last().unwrap() != &options.template {
-                return Err(Box::new(MkTempError::TooManyTemplates));
-            }
-        }
-    }
-
-    let dry_run = options.dry_run;
-    let suppress_file_err = options.quiet;
-    let make_dir = options.directory;
-
-    // Parse file path parameters from the command-line options.
-    let Params {
-        directory: tmpdir,
-        prefix,
-        num_rand_chars: rand,
-        suffix,
-    } = Params::from(options)?;
-
-    // Create the temporary file or directory, or simulate creating it.
-    let res = if dry_run {
-        dry_exec(&tmpdir, &prefix, rand, &suffix)
-    } else {
-        exec(&tmpdir, &prefix, rand, &suffix, make_dir)
-    };
-
-    if suppress_file_err {
-        // Mapping all UErrors to ExitCodes prevents the errors from being printed
-        res.map_err(|e| e.code().into())
-    } else {
-        res
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_DIRECTORY)
-                .short('d')
-                .long(OPT_DIRECTORY)
-                .help("Make a directory instead of a file")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_DRY_RUN)
-                .short('u')
-                .long(OPT_DRY_RUN)
-                .help("do not create anything; merely print a name (unsafe)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_QUIET)
-                .short('q')
-                .long("quiet")
-                .help("Fail silently if an error occurs.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_SUFFIX)
-                .long(OPT_SUFFIX)
-                .help(
-                    "append SUFFIX to TEMPLATE; SUFFIX must not contain a path separator. \
-                     This option is implied if TEMPLATE does not end with X.",
-                )
-                .value_name("SUFFIX"),
-        )
-        .arg(
-            Arg::new(OPT_P)
-                .short('p')
-                .help("short form of --tmpdir")
-                .value_name("DIR")
-                .num_args(1)
-                .value_parser(ValueParser::path_buf())
-                .value_hint(clap::ValueHint::DirPath),
-        )
-        .arg(
-            Arg::new(OPT_TMPDIR)
-                .long(OPT_TMPDIR)
-                .help(
-                    "interpret TEMPLATE relative to DIR; if DIR is not specified, use \
-                     $TMPDIR ($TMP on windows) if set, else /tmp. With this option, \
-                     TEMPLATE must not be an absolute name; unlike with -t, TEMPLATE \
-                     may contain slashes, but mktemp creates only the final component",
-                )
-                .value_name("DIR")
-                // Allows use of default argument just by setting --tmpdir. Else,
-                // use provided input to generate tmpdir
-                .num_args(0..=1)
-                // Require an equals to avoid ambiguity if no tmpdir is supplied
-                .require_equals(true)
-                .overrides_with(OPT_P)
-                .value_parser(ValueParser::path_buf())
-                .value_hint(clap::ValueHint::DirPath),
-        )
-        .arg(
-            Arg::new(OPT_T)
-                .short('t')
-                .help(
-                    "Generate a template (using the supplied prefix and TMPDIR \
-                (TMP on windows) if set) to create a filename template [deprecated]",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(Arg::new(ARG_TEMPLATE).num_args(..=1))
-}
-
-pub fn dry_exec(tmpdir: &str, prefix: &str, rand: usize, suffix: &str) -> UResult<()> {
-    let len = prefix.len() + suffix.len() + rand;
-    let mut buf = Vec::with_capacity(len);
-    buf.extend(prefix.as_bytes());
-    buf.extend(iter::repeat(b'X').take(rand));
-    buf.extend(suffix.as_bytes());
-
-    // Randomize.
-    let bytes = &mut buf[prefix.len()..prefix.len() + rand];
-    rand::thread_rng().fill(bytes);
-    for byte in bytes.iter_mut() {
-        *byte = match *byte % 62 {
-            v @ 0..=9 => v + b'0',
-            v @ 10..=35 => v - 10 + b'a',
-            v @ 36..=61 => v - 36 + b'A',
-            _ => unreachable!(),
-        }
-    }
-    // We guarantee utf8.
-    let buf = String::from_utf8(buf).unwrap();
-    let tmpdir = Path::new(tmpdir).join(buf);
-    println_verbatim(tmpdir).map_err_context(|| "failed to print directory name".to_owned())
-}
-
-/// Create a temporary directory with the given parameters.
-///
-/// This function creates a temporary directory as a subdirectory of
-/// `dir`. The name of the directory is the concatenation of `prefix`,
-/// a string of `rand` random characters, and `suffix`. The
-/// permissions of the directory are set to `u+rwx`
-///
-/// # Errors
-///
-/// If the temporary directory could not be written to disk or if the
-/// given directory `dir` does not exist.
-fn make_temp_dir(dir: &str, prefix: &str, rand: usize, suffix: &str) -> UResult<PathBuf> {
-    let mut builder = Builder::new();
-    builder.prefix(prefix).rand_bytes(rand).suffix(suffix);
-    match builder.tempdir_in(dir) {
-        Ok(d) => {
-            // `into_path` consumes the TempDir without removing it
-            let path = d.into_path();
-            #[cfg(not(windows))]
-            fs::set_permissions(&path, fs::Permissions::from_mode(0o700))?;
-            Ok(path)
-        }
-        Err(e) if e.kind() == ErrorKind::NotFound => {
-            let filename = format!("{}{}{}", prefix, "X".repeat(rand), suffix);
-            let path = Path::new(dir).join(filename);
-            let s = path.display().to_string();
-            Err(MkTempError::NotFound("directory".to_string(), s).into())
-        }
-        Err(e) => Err(e.into()),
-    }
-}
-
-/// Create a temporary file with the given parameters.
-///
-/// This function creates a temporary file in the directory `dir`. The
-/// name of the file is the concatenation of `prefix`, a string of
-/// `rand` random characters, and `suffix`. The permissions of the
-/// file are set to `u+rw`.
-///
-/// # Errors
-///
-/// If the file could not be written to disk or if the directory does
-/// not exist.
-fn make_temp_file(dir: &str, prefix: &str, rand: usize, suffix: &str) -> UResult<PathBuf> {
-    let mut builder = Builder::new();
-    builder.prefix(prefix).rand_bytes(rand).suffix(suffix);
-    match builder.tempfile_in(dir) {
-        // `keep` ensures that the file is not deleted
-        Ok(named_tempfile) => match named_tempfile.keep() {
-            Ok((_, pathbuf)) => Ok(pathbuf),
-            Err(e) => Err(MkTempError::PersistError(e.file.path().to_path_buf()).into()),
-        },
-        Err(e) if e.kind() == ErrorKind::NotFound => {
-            let filename = format!("{}{}{}", prefix, "X".repeat(rand), suffix);
-            let path = Path::new(dir).join(filename);
-            let s = path.display().to_string();
-            Err(MkTempError::NotFound("file".to_string(), s).into())
-        }
-        Err(e) => Err(e.into()),
-    }
-}
-
-fn exec(dir: &str, prefix: &str, rand: usize, suffix: &str, make_dir: bool) -> UResult<()> {
-    let path = if make_dir {
-        make_temp_dir(dir, prefix, rand, suffix)?
-    } else {
-        make_temp_file(dir, prefix, rand, suffix)?
-    };
-
-    // Get just the last component of the path to the created
-    // temporary file or directory.
-    let filename = path.file_name();
-    let filename = filename.unwrap().to_str().unwrap();
-
-    // Join the directory to the path to get the path to print. We
-    // cannot use the path returned by the `Builder` because it gives
-    // the absolute path and we need to return a filename that matches
-    // the template given on the command-line which might be a
-    // relative path.
-    let path = Path::new(dir).join(filename);
-
-    println_verbatim(path).map_err_context(|| "failed to print directory name".to_owned())
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::find_last_contiguous_block_of_xs as findxs;
-
-    #[test]
-    fn test_find_last_contiguous_block_of_xs() {
-        assert_eq!(findxs("XXX"), Some((0, 3)));
-        assert_eq!(findxs("XXX_XXX"), Some((4, 7)));
-        assert_eq!(findxs("XXX_XXX_XXX"), Some((8, 11)));
-        assert_eq!(findxs("aaXXXbb"), Some((2, 5)));
-        assert_eq!(findxs(""), None);
-        assert_eq!(findxs("X"), None);
-        assert_eq!(findxs("XX"), None);
-        assert_eq!(findxs("aXbXcX"), None);
-        assert_eq!(findxs("aXXbXXcXX"), None);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_more/more.rs.html b/coreutils/dev/src/uu_more/more.rs.html deleted file mode 100644 index 228934ba7..000000000 --- a/coreutils/dev/src/uu_more/more.rs.html +++ /dev/null @@ -1,1363 +0,0 @@ -more.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Martin Kysel <code@martinkysel.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE file
-//  * that was distributed with this source code.
-
-// spell-checker:ignore (methods) isnt
-
-use std::{
-    fs::File,
-    io::{stdin, stdout, BufReader, Read, Stdout, Write},
-    path::Path,
-    time::Duration,
-};
-
-use clap::{crate_version, value_parser, Arg, ArgAction, ArgMatches, Command};
-use crossterm::event::KeyEventKind;
-use crossterm::{
-    cursor::{MoveTo, MoveUp},
-    event::{self, Event, KeyCode, KeyEvent, KeyModifiers},
-    execute, queue,
-    style::Attribute,
-    terminal::{self, Clear, ClearType},
-};
-
-use is_terminal::IsTerminal;
-use unicode_segmentation::UnicodeSegmentation;
-use unicode_width::UnicodeWidthStr;
-use uucore::display::Quotable;
-use uucore::error::{UResult, USimpleError, UUsageError};
-use uucore::{format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("more.md");
-const USAGE: &str = help_usage!("more.md");
-const BELL: &str = "\x07";
-
-pub mod options {
-    pub const SILENT: &str = "silent";
-    pub const LOGICAL: &str = "logical";
-    pub const NO_PAUSE: &str = "no-pause";
-    pub const PRINT_OVER: &str = "print-over";
-    pub const CLEAN_PRINT: &str = "clean-print";
-    pub const SQUEEZE: &str = "squeeze";
-    pub const PLAIN: &str = "plain";
-    pub const LINES: &str = "lines";
-    pub const NUMBER: &str = "number";
-    pub const PATTERN: &str = "pattern";
-    pub const FROM_LINE: &str = "from-line";
-    pub const FILES: &str = "files";
-}
-
-const MULTI_FILE_TOP_PROMPT: &str = "\r::::::::::::::\n\r{}\n\r::::::::::::::\n";
-
-struct Options {
-    clean_print: bool,
-    from_line: usize,
-    lines: Option<u16>,
-    print_over: bool,
-    silent: bool,
-    squeeze: bool,
-}
-
-impl Options {
-    fn from(matches: &ArgMatches) -> Self {
-        let lines = match (
-            matches.get_one::<u16>(options::LINES).copied(),
-            matches.get_one::<u16>(options::NUMBER).copied(),
-        ) {
-            // We add 1 to the number of lines to display because the last line
-            // is used for the banner
-            (Some(number), _) if number > 0 => Some(number + 1),
-            (None, Some(number)) if number > 0 => Some(number + 1),
-            (_, _) => None,
-        };
-        let from_line = match matches.get_one::<usize>(options::FROM_LINE).copied() {
-            Some(number) if number > 1 => number - 1,
-            _ => 0,
-        };
-        Self {
-            clean_print: matches.get_flag(options::CLEAN_PRINT),
-            from_line,
-            lines,
-            print_over: matches.get_flag(options::PRINT_OVER),
-            silent: matches.get_flag(options::SILENT),
-            squeeze: matches.get_flag(options::SQUEEZE),
-        }
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-    let matches = match uu_app().try_get_matches_from(&args) {
-        Ok(m) => m,
-        Err(e) => return Err(e.into()),
-    };
-
-    let mut options = Options::from(&matches);
-
-    let mut buff = String::new();
-
-    if let Some(files) = matches.get_many::<String>(options::FILES) {
-        let mut stdout = setup_term();
-        let length = files.len();
-
-        let mut files_iter = files.map(|s| s.as_str()).peekable();
-        while let (Some(file), next_file) = (files_iter.next(), files_iter.peek()) {
-            let file = Path::new(file);
-            if file.is_dir() {
-                terminal::disable_raw_mode().unwrap();
-                return Err(UUsageError::new(
-                    1,
-                    format!("{} is a directory.", file.quote()),
-                ));
-            }
-            if !file.exists() {
-                terminal::disable_raw_mode().unwrap();
-                return Err(USimpleError::new(
-                    1,
-                    format!("cannot open {}: No such file or directory", file.quote()),
-                ));
-            }
-            let opened_file = match File::open(file) {
-                Err(why) => {
-                    terminal::disable_raw_mode().unwrap();
-                    return Err(USimpleError::new(
-                        1,
-                        format!("cannot open {}: {}", file.quote(), why.kind()),
-                    ));
-                }
-                Ok(opened_file) => opened_file,
-            };
-            let mut reader = BufReader::new(opened_file);
-            reader.read_to_string(&mut buff).unwrap();
-            more(
-                &buff,
-                &mut stdout,
-                length > 1,
-                file.to_str(),
-                next_file.copied(),
-                &mut options,
-            )?;
-            buff.clear();
-        }
-        reset_term(&mut stdout);
-    } else if !std::io::stdin().is_terminal() {
-        stdin().read_to_string(&mut buff).unwrap();
-        let mut stdout = setup_term();
-        more(&buff, &mut stdout, false, None, None, &mut options)?;
-        reset_term(&mut stdout);
-    } else {
-        return Err(UUsageError::new(1, "bad usage"));
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .version(crate_version!())
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::PRINT_OVER)
-                .short('c')
-                .long(options::PRINT_OVER)
-                .help("Do not scroll, display text and clean line ends")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SILENT)
-                .short('d')
-                .long(options::SILENT)
-                .help("Display help instead of ringing bell")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::CLEAN_PRINT)
-                .short('p')
-                .long(options::CLEAN_PRINT)
-                .help("Do not scroll, clean screen and display text")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SQUEEZE)
-                .short('s')
-                .long(options::SQUEEZE)
-                .help("Squeeze multiple blank lines into one")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PLAIN)
-                .short('u')
-                .long(options::PLAIN)
-                .action(ArgAction::SetTrue)
-                .hide(true),
-        )
-        .arg(
-            Arg::new(options::FROM_LINE)
-                .short('F')
-                .long(options::FROM_LINE)
-                .num_args(1)
-                .value_name("number")
-                .value_parser(value_parser!(usize))
-                .help("Display file beginning from line number"),
-        )
-        .arg(
-            Arg::new(options::LINES)
-                .short('n')
-                .long(options::LINES)
-                .value_name("number")
-                .num_args(1)
-                .value_parser(value_parser!(u16).range(0..))
-                .help("The number of lines per screen full"),
-        )
-        .arg(
-            Arg::new(options::NUMBER)
-                .long(options::NUMBER)
-                .num_args(1)
-                .value_parser(value_parser!(u16).range(0..))
-                .help("Same as --lines"),
-        )
-        // The commented arguments below are unimplemented:
-        /*
-        .arg(
-            Arg::new(options::LOGICAL)
-                .short('f')
-                .long(options::LOGICAL)
-                .help("Count logical rather than screen lines"),
-        )
-        .arg(
-            Arg::new(options::NO_PAUSE)
-                .short('l')
-                .long(options::NO_PAUSE)
-                .help("Suppress pause after form feed"),
-        )
-        .arg(
-            Arg::new(options::PATTERN)
-                .short('P')
-                .allow_hyphen_values(true)
-                .required(false)
-                .takes_value(true)
-                .help("Display file beginning from pattern match"),
-        )
-        */
-        .arg(
-            Arg::new(options::FILES)
-                .required(false)
-                .action(ArgAction::Append)
-                .help("Path to the files to be read")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-#[cfg(not(target_os = "fuchsia"))]
-fn setup_term() -> std::io::Stdout {
-    let stdout = stdout();
-    terminal::enable_raw_mode().unwrap();
-    stdout
-}
-
-#[cfg(target_os = "fuchsia")]
-#[inline(always)]
-fn setup_term() -> usize {
-    0
-}
-
-#[cfg(not(target_os = "fuchsia"))]
-fn reset_term(stdout: &mut std::io::Stdout) {
-    terminal::disable_raw_mode().unwrap();
-    // Clear the prompt
-    queue!(stdout, terminal::Clear(ClearType::CurrentLine)).unwrap();
-    // Move cursor to the beginning without printing new line
-    print!("\r");
-    stdout.flush().unwrap();
-}
-
-#[cfg(target_os = "fuchsia")]
-#[inline(always)]
-fn reset_term(_: &mut usize) {}
-
-fn more(
-    buff: &str,
-    stdout: &mut Stdout,
-    multiple_file: bool,
-    file: Option<&str>,
-    next_file: Option<&str>,
-    options: &mut Options,
-) -> UResult<()> {
-    let (cols, mut rows) = terminal::size().unwrap();
-    if let Some(number) = options.lines {
-        rows = number;
-    }
-
-    let lines = break_buff(buff, usize::from(cols));
-
-    let mut pager = Pager::new(rows, lines, next_file, options);
-
-    if multiple_file {
-        execute!(stdout, terminal::Clear(terminal::ClearType::CurrentLine)).unwrap();
-        stdout.write_all(
-            MULTI_FILE_TOP_PROMPT
-                .replace("{}", file.unwrap_or_default())
-                .as_bytes(),
-        )?;
-        pager.content_rows -= 3;
-    }
-    pager.draw(stdout, None);
-    if multiple_file {
-        options.from_line = 0;
-        pager.content_rows += 3;
-    }
-
-    if pager.should_close() && next_file.is_none() {
-        return Ok(());
-    }
-
-    loop {
-        let mut wrong_key = None;
-        if event::poll(Duration::from_millis(10)).unwrap() {
-            match event::read().unwrap() {
-                Event::Key(KeyEvent {
-                    kind: KeyEventKind::Release,
-                    ..
-                }) => continue,
-                Event::Key(KeyEvent {
-                    code: KeyCode::Char('q'),
-                    modifiers: KeyModifiers::NONE,
-                    kind: KeyEventKind::Press,
-                    ..
-                })
-                | Event::Key(KeyEvent {
-                    code: KeyCode::Char('c'),
-                    modifiers: KeyModifiers::CONTROL,
-                    kind: KeyEventKind::Press,
-                    ..
-                }) => {
-                    reset_term(stdout);
-                    std::process::exit(0);
-                }
-                Event::Key(KeyEvent {
-                    code: KeyCode::Down,
-                    modifiers: KeyModifiers::NONE,
-                    ..
-                })
-                | Event::Key(KeyEvent {
-                    code: KeyCode::PageDown,
-                    modifiers: KeyModifiers::NONE,
-                    ..
-                })
-                | Event::Key(KeyEvent {
-                    code: KeyCode::Char(' '),
-                    modifiers: KeyModifiers::NONE,
-                    ..
-                }) => {
-                    if pager.should_close() {
-                        return Ok(());
-                    } else {
-                        pager.page_down();
-                    }
-                }
-                Event::Key(KeyEvent {
-                    code: KeyCode::Up,
-                    modifiers: KeyModifiers::NONE,
-                    ..
-                })
-                | Event::Key(KeyEvent {
-                    code: KeyCode::PageUp,
-                    modifiers: KeyModifiers::NONE,
-                    ..
-                }) => {
-                    pager.page_up();
-                    paging_add_back_message(options, stdout)?;
-                }
-                Event::Key(KeyEvent {
-                    code: KeyCode::Char('j'),
-                    modifiers: KeyModifiers::NONE,
-                    ..
-                }) => {
-                    if pager.should_close() {
-                        return Ok(());
-                    } else {
-                        pager.next_line();
-                    }
-                }
-                Event::Key(KeyEvent {
-                    code: KeyCode::Char('k'),
-                    modifiers: KeyModifiers::NONE,
-                    ..
-                }) => {
-                    pager.prev_line();
-                }
-                Event::Resize(col, row) => {
-                    pager.page_resize(col, row, options.lines);
-                }
-                Event::Key(KeyEvent {
-                    code: KeyCode::Char(k),
-                    ..
-                }) => wrong_key = Some(k),
-                _ => continue,
-            }
-
-            if options.print_over {
-                execute!(
-                    std::io::stdout(),
-                    MoveTo(0, 0),
-                    Clear(ClearType::FromCursorDown)
-                )
-                .unwrap();
-            } else if options.clean_print {
-                execute!(std::io::stdout(), Clear(ClearType::All), MoveTo(0, 0)).unwrap();
-            }
-            pager.draw(stdout, wrong_key);
-        }
-    }
-}
-
-struct Pager<'a> {
-    // The current line at the top of the screen
-    upper_mark: usize,
-    // The number of rows that fit on the screen
-    content_rows: u16,
-    lines: Vec<String>,
-    next_file: Option<&'a str>,
-    line_count: usize,
-    silent: bool,
-    squeeze: bool,
-    line_squeezed: usize,
-}
-
-impl<'a> Pager<'a> {
-    fn new(rows: u16, lines: Vec<String>, next_file: Option<&'a str>, options: &Options) -> Self {
-        let line_count = lines.len();
-        Self {
-            upper_mark: options.from_line,
-            content_rows: rows.saturating_sub(1),
-            lines,
-            next_file,
-            line_count,
-            silent: options.silent,
-            squeeze: options.squeeze,
-            line_squeezed: 0,
-        }
-    }
-
-    fn should_close(&mut self) -> bool {
-        self.upper_mark
-            .saturating_add(self.content_rows.into())
-            .ge(&self.line_count)
-    }
-
-    fn page_down(&mut self) {
-        // If the next page down position __after redraw__ is greater than the total line count,
-        // the upper mark must not grow past top of the screen at the end of the open file.
-        if self
-            .upper_mark
-            .saturating_add(self.content_rows as usize * 2)
-            .ge(&self.line_count)
-        {
-            self.upper_mark = self.line_count - self.content_rows as usize;
-            return;
-        }
-
-        self.upper_mark = self.upper_mark.saturating_add(self.content_rows.into());
-    }
-
-    fn page_up(&mut self) {
-        let content_row_usize: usize = self.content_rows.into();
-        self.upper_mark = self
-            .upper_mark
-            .saturating_sub(content_row_usize.saturating_add(self.line_squeezed));
-
-        if self.squeeze {
-            let iter = self.lines.iter().take(self.upper_mark).rev();
-            for line in iter {
-                if line.is_empty() {
-                    self.upper_mark = self.upper_mark.saturating_sub(1);
-                } else {
-                    break;
-                }
-            }
-        }
-    }
-
-    fn next_line(&mut self) {
-        self.upper_mark = self.upper_mark.saturating_add(1);
-    }
-
-    fn prev_line(&mut self) {
-        self.upper_mark = self.upper_mark.saturating_sub(1);
-    }
-
-    // TODO: Deal with column size changes.
-    fn page_resize(&mut self, _: u16, row: u16, option_line: Option<u16>) {
-        if option_line.is_none() {
-            self.content_rows = row.saturating_sub(1);
-        };
-    }
-
-    fn draw(&mut self, stdout: &mut std::io::Stdout, wrong_key: Option<char>) {
-        self.draw_lines(stdout);
-        let lower_mark = self
-            .line_count
-            .min(self.upper_mark.saturating_add(self.content_rows.into()));
-        self.draw_prompt(stdout, lower_mark, wrong_key);
-        stdout.flush().unwrap();
-    }
-
-    fn draw_lines(&mut self, stdout: &mut std::io::Stdout) {
-        execute!(stdout, terminal::Clear(terminal::ClearType::CurrentLine)).unwrap();
-
-        self.line_squeezed = 0;
-        let mut previous_line_blank = false;
-        let mut displayed_lines = Vec::new();
-        let mut iter = self.lines.iter().skip(self.upper_mark);
-
-        while displayed_lines.len() < self.content_rows as usize {
-            match iter.next() {
-                Some(line) => {
-                    if self.squeeze {
-                        match (line.is_empty(), previous_line_blank) {
-                            (true, false) => {
-                                previous_line_blank = true;
-                                displayed_lines.push(line);
-                            }
-                            (false, true) => {
-                                previous_line_blank = false;
-                                displayed_lines.push(line);
-                            }
-                            (false, false) => displayed_lines.push(line),
-                            (true, true) => {
-                                self.line_squeezed += 1;
-                                self.upper_mark += 1;
-                            }
-                        }
-                    } else {
-                        displayed_lines.push(line);
-                    }
-                }
-                // if none the end of the file is reached
-                None => {
-                    self.upper_mark = self.line_count;
-                    break;
-                }
-            }
-        }
-
-        for line in displayed_lines {
-            stdout.write_all(format!("\r{line}\n").as_bytes()).unwrap();
-        }
-    }
-
-    fn draw_prompt(&self, stdout: &mut Stdout, lower_mark: usize, wrong_key: Option<char>) {
-        let status_inner = if lower_mark == self.line_count {
-            format!("Next file: {}", self.next_file.unwrap_or_default())
-        } else {
-            format!(
-                "{}%",
-                (lower_mark as f64 / self.line_count as f64 * 100.0).round() as u16
-            )
-        };
-
-        let status = format!("--More--({status_inner})");
-        let banner = match (self.silent, wrong_key) {
-            (true, Some(key)) => format!(
-                "{status} [Unknown key: '{key}'. Press 'h' for instructions. (unimplemented)]"
-            ),
-            (true, None) => format!("{status}[Press space to continue, 'q' to quit.]"),
-            (false, Some(_)) => format!("{status}{BELL}"),
-            (false, None) => status,
-        };
-
-        write!(
-            stdout,
-            "\r{}{}{}",
-            Attribute::Reverse,
-            banner,
-            Attribute::Reset
-        )
-        .unwrap();
-    }
-}
-
-fn paging_add_back_message(options: &Options, stdout: &mut std::io::Stdout) -> UResult<()> {
-    if options.lines.is_some() {
-        execute!(stdout, MoveUp(1))?;
-        stdout.write_all("\n\r...back 1 page\n".as_bytes())?;
-    }
-    Ok(())
-}
-
-// Break the lines on the cols of the terminal
-fn break_buff(buff: &str, cols: usize) -> Vec<String> {
-    let mut lines = Vec::with_capacity(buff.lines().count());
-
-    for l in buff.lines() {
-        lines.append(&mut break_line(l, cols));
-    }
-    lines
-}
-
-fn break_line(line: &str, cols: usize) -> Vec<String> {
-    let width = UnicodeWidthStr::width(line);
-    let mut lines = Vec::new();
-    if width < cols {
-        lines.push(line.to_string());
-        return lines;
-    }
-
-    let gr_idx = UnicodeSegmentation::grapheme_indices(line, true);
-    let mut last_index = 0;
-    let mut total_width = 0;
-    for (index, grapheme) in gr_idx {
-        let width = UnicodeWidthStr::width(grapheme);
-        total_width += width;
-
-        if total_width > cols {
-            lines.push(line[last_index..index].to_string());
-            last_index = index;
-            total_width = width;
-        }
-    }
-
-    if last_index != line.len() {
-        lines.push(line[last_index..].to_string());
-    }
-    lines
-}
-
-#[cfg(test)]
-mod tests {
-    use super::break_line;
-    use unicode_width::UnicodeWidthStr;
-
-    #[test]
-    fn test_break_lines_long() {
-        let mut test_string = String::with_capacity(100);
-        for _ in 0..200 {
-            test_string.push('#');
-        }
-
-        let lines = break_line(&test_string, 80);
-        let widths: Vec<usize> = lines
-            .iter()
-            .map(|s| UnicodeWidthStr::width(&s[..]))
-            .collect();
-
-        assert_eq!((80, 80, 40), (widths[0], widths[1], widths[2]));
-    }
-
-    #[test]
-    fn test_break_lines_short() {
-        let mut test_string = String::with_capacity(100);
-        for _ in 0..20 {
-            test_string.push('#');
-        }
-
-        let lines = break_line(&test_string, 80);
-
-        assert_eq!(20, lines[0].len());
-    }
-
-    #[test]
-    fn test_break_line_zwj() {
-        let mut test_string = String::with_capacity(1100);
-        for _ in 0..20 {
-            test_string.push_str("👩🏻‍🔬");
-        }
-
-        let lines = break_line(&test_string, 80);
-
-        let widths: Vec<usize> = lines
-            .iter()
-            .map(|s| UnicodeWidthStr::width(&s[..]))
-            .collect();
-
-        // Each 👩🏻‍🔬 is 6 character width it break line to the closest number to 80 => 6 * 13 = 78
-        assert_eq!((78, 42), (widths[0], widths[1]));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_mv/error.rs.html b/coreutils/dev/src/uu_mv/error.rs.html deleted file mode 100644 index d5acbdc0d..000000000 --- a/coreutils/dev/src/uu_mv/error.rs.html +++ /dev/null @@ -1,85 +0,0 @@ -error.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-
// This file is part of the uutils coreutils package.
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-use std::error::Error;
-use std::fmt::{Display, Formatter, Result};
-
-use uucore::error::UError;
-
-#[derive(Debug)]
-pub enum MvError {
-    NoSuchFile(String),
-    SameFile(String, String),
-    SelfSubdirectory(String),
-    DirectoryToNonDirectory(String),
-    NonDirectoryToDirectory(String, String),
-    NotADirectory(String),
-    TargetNotADirectory(String),
-}
-
-impl Error for MvError {}
-impl UError for MvError {}
-impl Display for MvError {
-    fn fmt(&self, f: &mut Formatter) -> Result {
-        match self {
-            Self::NoSuchFile(s) => write!(f, "cannot stat {s}: No such file or directory"),
-            Self::SameFile(s, t) => write!(f, "{s} and {t} are the same file"),
-            Self::SelfSubdirectory(s) => write!(
-                f,
-                "cannot move '{s}' to a subdirectory of itself, '{s}/{s}'"
-            ),
-            Self::DirectoryToNonDirectory(t) => {
-                write!(f, "cannot overwrite directory {t} with non-directory")
-            }
-            Self::NonDirectoryToDirectory(s, t) => {
-                write!(f, "cannot overwrite non-directory {t} with directory {s}")
-            }
-            Self::NotADirectory(t) => write!(f, "target {t}: Not a directory"),
-            Self::TargetNotADirectory(t) => write!(f, "target directory {t}: Not a directory"),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_mv/mv.rs.html b/coreutils/dev/src/uu_mv/mv.rs.html deleted file mode 100644 index 634cdd610..000000000 --- a/coreutils/dev/src/uu_mv/mv.rs.html +++ /dev/null @@ -1,1261 +0,0 @@ -mv.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-
// This file is part of the uutils coreutils package.
-//
-// (c) Orvar Segerström <orvarsegerstrom@gmail.com>
-// (c) Sokovikov Evgeniy  <skv-headless@yandex.ru>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) sourcepath targetpath
-
-mod error;
-
-use clap::builder::ValueParser;
-use clap::{crate_version, error::ErrorKind, Arg, ArgAction, ArgMatches, Command};
-use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
-use std::env;
-use std::ffi::OsString;
-use std::fs;
-use std::io;
-#[cfg(unix)]
-use std::os::unix;
-#[cfg(windows)]
-use std::os::windows;
-use std::path::{Path, PathBuf};
-use uucore::backup_control::{self, source_is_target_backup, BackupMode};
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, FromIo, UError, UResult, USimpleError, UUsageError};
-use uucore::fs::{are_hardlinks_or_one_way_symlink_to_same_file, are_hardlinks_to_same_file};
-use uucore::update_control::{self, UpdateMode};
-use uucore::{format_usage, help_about, help_section, help_usage, prompt_yes, show};
-
-use fs_extra::dir::{
-    get_size as dir_get_size, move_dir, move_dir_with_progress, CopyOptions as DirCopyOptions,
-    TransitProcess, TransitProcessResult,
-};
-
-use crate::error::MvError;
-
-pub struct Behavior {
-    overwrite: OverwriteMode,
-    backup: BackupMode,
-    suffix: String,
-    update: UpdateMode,
-    target_dir: Option<OsString>,
-    no_target_dir: bool,
-    verbose: bool,
-    strip_slashes: bool,
-    progress_bar: bool,
-}
-
-#[derive(Clone, Eq, PartialEq)]
-pub enum OverwriteMode {
-    NoClobber,
-    Interactive,
-    Force,
-}
-
-const ABOUT: &str = help_about!("mv.md");
-const USAGE: &str = help_usage!("mv.md");
-const AFTER_HELP: &str = help_section!("after help", "mv.md");
-
-static OPT_FORCE: &str = "force";
-static OPT_INTERACTIVE: &str = "interactive";
-static OPT_NO_CLOBBER: &str = "no-clobber";
-static OPT_STRIP_TRAILING_SLASHES: &str = "strip-trailing-slashes";
-static OPT_TARGET_DIRECTORY: &str = "target-directory";
-static OPT_NO_TARGET_DIRECTORY: &str = "no-target-directory";
-static OPT_VERBOSE: &str = "verbose";
-static OPT_PROGRESS: &str = "progress";
-static ARG_FILES: &str = "files";
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let mut app = uu_app();
-    let matches = app.try_get_matches_from_mut(args)?;
-
-    if !matches.contains_id(OPT_TARGET_DIRECTORY)
-        && matches
-            .get_many::<OsString>(ARG_FILES)
-            .map(|f| f.len())
-            .unwrap_or(0)
-            == 1
-    {
-        app.error(
-            ErrorKind::TooFewValues,
-            format!(
-                "The argument '<{ARG_FILES}>...' requires at least 2 values, but only 1 was provided"
-            ),
-        )
-        .exit();
-    }
-
-    let files: Vec<OsString> = matches
-        .get_many::<OsString>(ARG_FILES)
-        .unwrap_or_default()
-        .map(|v| v.to_os_string())
-        .collect();
-
-    let overwrite_mode = determine_overwrite_mode(&matches);
-    let backup_mode = backup_control::determine_backup_mode(&matches)?;
-    let update_mode = update_control::determine_update_mode(&matches);
-
-    if overwrite_mode == OverwriteMode::NoClobber && backup_mode != BackupMode::NoBackup {
-        return Err(UUsageError::new(
-            1,
-            "options --backup and --no-clobber are mutually exclusive",
-        ));
-    }
-
-    let backup_suffix = backup_control::determine_backup_suffix(&matches);
-
-    let target_dir = matches
-        .get_one::<OsString>(OPT_TARGET_DIRECTORY)
-        .map(OsString::from);
-
-    if let Some(ref maybe_dir) = target_dir {
-        if !Path::new(&maybe_dir).is_dir() {
-            return Err(MvError::TargetNotADirectory(maybe_dir.quote().to_string()).into());
-        }
-    }
-
-    let behavior = Behavior {
-        overwrite: overwrite_mode,
-        backup: backup_mode,
-        suffix: backup_suffix,
-        update: update_mode,
-        target_dir,
-        no_target_dir: matches.get_flag(OPT_NO_TARGET_DIRECTORY),
-        verbose: matches.get_flag(OPT_VERBOSE),
-        strip_slashes: matches.get_flag(OPT_STRIP_TRAILING_SLASHES),
-        progress_bar: matches.get_flag(OPT_PROGRESS),
-    };
-
-    exec(&files[..], &behavior)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .after_help(format!(
-            "{AFTER_HELP}\n\n{}",
-            backup_control::BACKUP_CONTROL_LONG_HELP
-        ))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_FORCE)
-                .short('f')
-                .long(OPT_FORCE)
-                .help("do not prompt before overwriting")
-                .overrides_with_all([OPT_INTERACTIVE, OPT_NO_CLOBBER])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_INTERACTIVE)
-                .short('i')
-                .long(OPT_INTERACTIVE)
-                .help("prompt before override")
-                .overrides_with_all([OPT_FORCE, OPT_NO_CLOBBER])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_NO_CLOBBER)
-                .short('n')
-                .long(OPT_NO_CLOBBER)
-                .help("do not overwrite an existing file")
-                .overrides_with_all([OPT_FORCE, OPT_INTERACTIVE])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_STRIP_TRAILING_SLASHES)
-                .long(OPT_STRIP_TRAILING_SLASHES)
-                .help("remove any trailing slashes from each SOURCE argument")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(backup_control::arguments::backup())
-        .arg(backup_control::arguments::backup_no_args())
-        .arg(backup_control::arguments::suffix())
-        .arg(update_control::arguments::update())
-        .arg(update_control::arguments::update_no_args())
-        .arg(
-            Arg::new(OPT_TARGET_DIRECTORY)
-                .short('t')
-                .long(OPT_TARGET_DIRECTORY)
-                .help("move all SOURCE arguments into DIRECTORY")
-                .value_name("DIRECTORY")
-                .value_hint(clap::ValueHint::DirPath)
-                .conflicts_with(OPT_NO_TARGET_DIRECTORY)
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(OPT_NO_TARGET_DIRECTORY)
-                .short('T')
-                .long(OPT_NO_TARGET_DIRECTORY)
-                .help("treat DEST as a normal file")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_VERBOSE)
-                .short('v')
-                .long(OPT_VERBOSE)
-                .help("explain what is being done")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_PROGRESS)
-                .short('g')
-                .long(OPT_PROGRESS)
-                .help(
-                    "Display a progress bar. \n\
-                Note: this feature is not supported by GNU coreutils.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .num_args(1..)
-                .required(true)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
-fn determine_overwrite_mode(matches: &ArgMatches) -> OverwriteMode {
-    // This does not exactly match the GNU implementation:
-    // The GNU mv defaults to Force, but if more than one of the
-    // overwrite options are supplied, only the last takes effect.
-    // To default to no-clobber in that situation seems safer:
-    //
-    if matches.get_flag(OPT_NO_CLOBBER) {
-        OverwriteMode::NoClobber
-    } else if matches.get_flag(OPT_INTERACTIVE) {
-        OverwriteMode::Interactive
-    } else {
-        OverwriteMode::Force
-    }
-}
-
-fn parse_paths(files: &[OsString], b: &Behavior) -> Vec<PathBuf> {
-    let paths = files.iter().map(Path::new);
-
-    if b.strip_slashes {
-        paths
-            .map(|p| p.components().as_path().to_owned())
-            .collect::<Vec<PathBuf>>()
-    } else {
-        paths.map(|p| p.to_owned()).collect::<Vec<PathBuf>>()
-    }
-}
-
-fn handle_two_paths(source: &Path, target: &Path, b: &Behavior) -> UResult<()> {
-    if b.backup == BackupMode::SimpleBackup && source_is_target_backup(source, target, &b.suffix) {
-        return Err(io::Error::new(
-            io::ErrorKind::NotFound,
-            format!(
-                "backing up {} might destroy source;  {} not moved",
-                target.quote(),
-                source.quote()
-            ),
-        )
-        .into());
-    }
-    if source.symlink_metadata().is_err() {
-        return Err(MvError::NoSuchFile(source.quote().to_string()).into());
-    }
-
-    if (source.eq(target)
-        || are_hardlinks_to_same_file(source, target)
-        || are_hardlinks_or_one_way_symlink_to_same_file(source, target))
-        && b.backup == BackupMode::NoBackup
-    {
-        if source.eq(Path::new(".")) || source.ends_with("/.") || source.is_file() {
-            return Err(
-                MvError::SameFile(source.quote().to_string(), target.quote().to_string()).into(),
-            );
-        } else {
-            return Err(MvError::SelfSubdirectory(source.display().to_string()).into());
-        }
-    }
-
-    if target.is_dir() {
-        if b.no_target_dir {
-            if source.is_dir() {
-                rename(source, target, b, None).map_err_context(|| {
-                    format!("cannot move {} to {}", source.quote(), target.quote())
-                })
-            } else {
-                Err(MvError::DirectoryToNonDirectory(target.quote().to_string()).into())
-            }
-        } else {
-            move_files_into_dir(&[source.to_path_buf()], target, b)
-        }
-    } else if target.exists() && source.is_dir() {
-        match b.overwrite {
-            OverwriteMode::NoClobber => return Ok(()),
-            OverwriteMode::Interactive => {
-                if !prompt_yes!("overwrite {}? ", target.quote()) {
-                    return Err(io::Error::new(io::ErrorKind::Other, "").into());
-                }
-            }
-            OverwriteMode::Force => {}
-        };
-        Err(MvError::NonDirectoryToDirectory(
-            source.quote().to_string(),
-            target.quote().to_string(),
-        )
-        .into())
-    } else {
-        rename(source, target, b, None).map_err(|e| USimpleError::new(1, format!("{e}")))
-    }
-}
-
-fn handle_multiple_paths(paths: &[PathBuf], b: &Behavior) -> UResult<()> {
-    if b.no_target_dir {
-        return Err(UUsageError::new(
-            1,
-            format!("mv: extra operand {}", paths[2].quote()),
-        ));
-    }
-    let target_dir = paths.last().unwrap();
-    let sources = &paths[..paths.len() - 1];
-
-    move_files_into_dir(sources, target_dir, b)
-}
-
-fn exec(files: &[OsString], b: &Behavior) -> UResult<()> {
-    let paths = parse_paths(files, b);
-
-    if let Some(ref name) = b.target_dir {
-        return move_files_into_dir(&paths, &PathBuf::from(name), b);
-    }
-
-    match paths.len() {
-        2 => handle_two_paths(&paths[0], &paths[1], b),
-        _ => handle_multiple_paths(&paths, b),
-    }
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, b: &Behavior) -> UResult<()> {
-    if !target_dir.is_dir() {
-        return Err(MvError::NotADirectory(target_dir.quote().to_string()).into());
-    }
-
-    let canonized_target_dir = target_dir
-        .canonicalize()
-        .unwrap_or_else(|_| target_dir.to_path_buf());
-
-    let multi_progress = b.progress_bar.then(MultiProgress::new);
-
-    let count_progress = if let Some(ref multi_progress) = multi_progress {
-        if files.len() > 1 {
-            Some(multi_progress.add(
-                ProgressBar::new(files.len().try_into().unwrap()).with_style(
-                    ProgressStyle::with_template("moving {msg} {wide_bar} {pos}/{len}").unwrap(),
-                ),
-            ))
-        } else {
-            None
-        }
-    } else {
-        None
-    };
-
-    for sourcepath in files.iter() {
-        if let Some(ref pb) = count_progress {
-            pb.set_message(sourcepath.to_string_lossy().to_string());
-        }
-
-        let targetpath = match sourcepath.file_name() {
-            Some(name) => target_dir.join(name),
-            None => {
-                show!(MvError::NoSuchFile(sourcepath.quote().to_string()));
-                continue;
-            }
-        };
-
-        // Check if we have mv dir1 dir2 dir2
-        // And generate an error if this is the case
-        if let Ok(canonized_source) = sourcepath.canonicalize() {
-            if canonized_source == canonized_target_dir {
-                // User tried to move directory to itself, warning is shown
-                // and process of moving files is continued.
-                show!(USimpleError::new(
-                    1,
-                    format!(
-                        "cannot move '{}' to a subdirectory of itself, '{}/{}'",
-                        sourcepath.display(),
-                        target_dir.display(),
-                        canonized_target_dir.components().last().map_or_else(
-                            || target_dir.display().to_string(),
-                            |dir| { PathBuf::from(dir.as_os_str()).display().to_string() }
-                        )
-                    )
-                ));
-                continue;
-            }
-        }
-
-        match rename(sourcepath, &targetpath, b, multi_progress.as_ref()) {
-            Err(e) if e.to_string().is_empty() => set_exit_code(1),
-            Err(e) => {
-                let e = e.map_err_context(|| {
-                    format!(
-                        "cannot move {} to {}",
-                        sourcepath.quote(),
-                        targetpath.quote()
-                    )
-                });
-                match multi_progress {
-                    Some(ref pb) => pb.suspend(|| show!(e)),
-                    None => show!(e),
-                };
-            }
-            Ok(()) => (),
-        }
-
-        if let Some(ref pb) = count_progress {
-            pb.inc(1);
-        }
-    }
-    Ok(())
-}
-
-fn rename(
-    from: &Path,
-    to: &Path,
-    b: &Behavior,
-    multi_progress: Option<&MultiProgress>,
-) -> io::Result<()> {
-    let mut backup_path = None;
-
-    if to.exists() {
-        if b.update == UpdateMode::ReplaceIfOlder && b.overwrite == OverwriteMode::Interactive {
-            // `mv -i --update old new` when `new` exists doesn't move anything
-            // and exit with 0
-            return Ok(());
-        }
-
-        if b.update == UpdateMode::ReplaceNone {
-            return Ok(());
-        }
-
-        if (b.update == UpdateMode::ReplaceIfOlder)
-            && fs::metadata(from)?.modified()? <= fs::metadata(to)?.modified()?
-        {
-            return Ok(());
-        }
-
-        match b.overwrite {
-            OverwriteMode::NoClobber => {
-                let err_msg = if b.verbose {
-                    println!("skipped {}", to.quote());
-                    String::new()
-                } else {
-                    format!("not replacing {}", to.quote())
-                };
-                return Err(io::Error::new(io::ErrorKind::Other, err_msg));
-            }
-            OverwriteMode::Interactive => {
-                if !prompt_yes!("overwrite {}?", to.quote()) {
-                    if b.verbose {
-                        println!("skipped {}", to.quote());
-                    }
-                    return Err(io::Error::new(io::ErrorKind::Other, ""));
-                }
-            }
-            OverwriteMode::Force => {}
-        };
-
-        backup_path = backup_control::get_backup_path(b.backup, to, &b.suffix);
-        if let Some(ref backup_path) = backup_path {
-            rename_with_fallback(to, backup_path, multi_progress)?;
-        }
-    }
-
-    // "to" may no longer exist if it was backed up
-    if to.exists() && to.is_dir() {
-        // normalize behavior between *nix and windows
-        if from.is_dir() {
-            if is_empty_dir(to) {
-                fs::remove_dir(to)?;
-            } else {
-                return Err(io::Error::new(io::ErrorKind::Other, "Directory not empty"));
-            }
-        }
-    }
-
-    rename_with_fallback(from, to, multi_progress)?;
-
-    if b.verbose {
-        let message = match backup_path {
-            Some(path) => format!(
-                "renamed {} -> {} (backup: {})",
-                from.quote(),
-                to.quote(),
-                path.quote()
-            ),
-            None => format!("renamed {} -> {}", from.quote(), to.quote()),
-        };
-
-        match multi_progress {
-            Some(pb) => pb.suspend(|| {
-                println!("{message}");
-            }),
-            None => println!("{message}"),
-        };
-    }
-    Ok(())
-}
-
-/// A wrapper around `fs::rename`, so that if it fails, we try falling back on
-/// copying and removing.
-fn rename_with_fallback(
-    from: &Path,
-    to: &Path,
-    multi_progress: Option<&MultiProgress>,
-) -> io::Result<()> {
-    if fs::rename(from, to).is_err() {
-        // Get metadata without following symlinks
-        let metadata = from.symlink_metadata()?;
-        let file_type = metadata.file_type();
-
-        if file_type.is_symlink() {
-            rename_symlink_fallback(from, to)?;
-        } else if file_type.is_dir() {
-            // We remove the destination directory if it exists to match the
-            // behavior of `fs::rename`. As far as I can tell, `fs_extra`'s
-            // `move_dir` would otherwise behave differently.
-            if to.exists() {
-                fs::remove_dir_all(to)?;
-            }
-            let options = DirCopyOptions {
-                // From the `fs_extra` documentation:
-                // "Recursively copy a directory with a new name or place it
-                // inside the destination. (same behaviors like cp -r in Unix)"
-                copy_inside: true,
-                ..DirCopyOptions::new()
-            };
-
-            // Calculate total size of directory
-            // Silently degrades:
-            //    If finding the total size fails for whatever reason,
-            //    the progress bar wont be shown for this file / dir.
-            //    (Move will probably fail due to permission error later?)
-            let total_size = dir_get_size(from).ok();
-
-            let progress_bar =
-                if let (Some(multi_progress), Some(total_size)) = (multi_progress, total_size) {
-                    let bar = ProgressBar::new(total_size).with_style(
-                        ProgressStyle::with_template(
-                            "{msg}: [{elapsed_precise}] {wide_bar} {bytes:>7}/{total_bytes:7}",
-                        )
-                        .unwrap(),
-                    );
-
-                    Some(multi_progress.add(bar))
-                } else {
-                    None
-                };
-
-            let result = if let Some(ref pb) = progress_bar {
-                move_dir_with_progress(from, to, &options, |process_info: TransitProcess| {
-                    pb.set_position(process_info.copied_bytes);
-                    pb.set_message(process_info.file_name);
-                    TransitProcessResult::ContinueOrAbort
-                })
-            } else {
-                move_dir(from, to, &options)
-            };
-
-            if let Err(err) = result {
-                return match err.kind {
-                    fs_extra::error::ErrorKind::PermissionDenied => Err(io::Error::new(
-                        io::ErrorKind::PermissionDenied,
-                        "Permission denied",
-                    )),
-                    _ => Err(io::Error::new(io::ErrorKind::Other, format!("{err:?}"))),
-                };
-            }
-        } else {
-            fs::copy(from, to).and_then(|_| fs::remove_file(from))?;
-        }
-    }
-    Ok(())
-}
-
-/// Move the given symlink to the given destination. On Windows, dangling
-/// symlinks return an error.
-#[inline]
-fn rename_symlink_fallback(from: &Path, to: &Path) -> io::Result<()> {
-    let path_symlink_points_to = fs::read_link(from)?;
-    #[cfg(unix)]
-    {
-        unix::fs::symlink(path_symlink_points_to, to).and_then(|_| fs::remove_file(from))?;
-    }
-    #[cfg(windows)]
-    {
-        if path_symlink_points_to.exists() {
-            if path_symlink_points_to.is_dir() {
-                windows::fs::symlink_dir(&path_symlink_points_to, to)?;
-            } else {
-                windows::fs::symlink_file(&path_symlink_points_to, to)?;
-            }
-            fs::remove_file(from)?;
-        } else {
-            return Err(io::Error::new(
-                io::ErrorKind::NotFound,
-                "can't determine symlink type, since it is dangling",
-            ));
-        }
-    }
-    #[cfg(not(any(windows, unix)))]
-    {
-        return Err(io::Error::new(
-            io::ErrorKind::Other,
-            "your operating system does not support symlinks",
-        ));
-    }
-    Ok(())
-}
-
-fn is_empty_dir(path: &Path) -> bool {
-    match fs::read_dir(path) {
-        Ok(contents) => contents.peekable().peek().is_none(),
-        Err(_e) => false,
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_nice/nice.rs.html b/coreutils/dev/src/uu_nice/nice.rs.html deleted file mode 100644 index b0780c173..000000000 --- a/coreutils/dev/src/uu_nice/nice.rs.html +++ /dev/null @@ -1,423 +0,0 @@ -nice.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) getpriority execvp setpriority nstr PRIO cstrs ENOENT
-
-use libc::{c_char, c_int, execvp, PRIO_PROCESS};
-use std::ffi::{CString, OsString};
-use std::io::{Error, Write};
-use std::ptr;
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use uucore::{
-    error::{set_exit_code, UClapError, UResult, USimpleError, UUsageError},
-    format_usage, help_about, help_usage, show_error,
-};
-
-pub mod options {
-    pub static ADJUSTMENT: &str = "adjustment";
-    pub static COMMAND: &str = "COMMAND";
-}
-
-const ABOUT: &str = help_about!("nice.md");
-const USAGE: &str = help_usage!("nice.md");
-
-fn is_prefix_of(maybe_prefix: &str, target: &str, min_match: usize) -> bool {
-    if maybe_prefix.len() < min_match || maybe_prefix.len() > target.len() {
-        return false;
-    }
-
-    &target[0..maybe_prefix.len()] == maybe_prefix
-}
-
-/// Transform legacy arguments into a standardized form.
-///
-/// The following are all legal argument sequences to GNU nice:
-/// - "-1"
-/// - "-n1"
-/// - "-+1"
-/// - "--1"
-/// - "-n -1"
-///
-/// It looks initially like we could add handling for "-{i}", "--{i}"
-/// and "-+{i}" for integers {i} and process them normally using clap.
-/// However, the meaning of "-1", for example, changes depending on
-/// its context with legacy argument parsing. clap will not prioritize
-/// hyphenated values to previous arguments over matching a known
-/// argument.  So "-n" "-1" in this case is picked up as two
-/// arguments, not one argument with a value.
-///
-/// Given this context dependency, and the deep hole we end up digging
-/// with clap in this case, it's much simpler to just normalize the
-/// arguments to nice before clap starts work. Here, we insert a
-/// prefix of "-n" onto all arguments of the form "-{i}", "--{i}" and
-/// "-+{i}" which are not already preceded by "-n".
-fn standardize_nice_args(mut args: impl uucore::Args) -> impl uucore::Args {
-    let mut v = Vec::<OsString>::new();
-    let mut saw_n = false;
-    let mut saw_command = false;
-    if let Some(cmd) = args.next() {
-        v.push(cmd);
-    }
-    for s in args {
-        if saw_command {
-            v.push(s);
-        } else if saw_n {
-            let mut new_arg: OsString = "-n".into();
-            new_arg.push(s);
-            v.push(new_arg);
-            saw_n = false;
-        } else if s.to_str() == Some("-n")
-            || s.to_str()
-                .map(|s| is_prefix_of(s, "--adjustment", "--a".len()))
-                .unwrap_or_default()
-        {
-            saw_n = true;
-        } else if let Ok(s) = s.clone().into_string() {
-            if let Some(stripped) = s.strip_prefix('-') {
-                match stripped.parse::<i64>() {
-                    Ok(ix) => {
-                        let mut new_arg: OsString = "-n".into();
-                        new_arg.push(ix.to_string());
-                        v.push(new_arg);
-                    }
-                    Err(_) => {
-                        v.push(s.into());
-                    }
-                }
-            } else {
-                saw_command = true;
-                v.push(s.into());
-            }
-        } else {
-            saw_command = true;
-            v.push(s);
-        }
-    }
-    if saw_n {
-        v.push("-n".into());
-    }
-
-    v.into_iter()
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = standardize_nice_args(args);
-
-    let matches = uu_app().try_get_matches_from(args).with_exit_code(125)?;
-
-    nix::errno::Errno::clear();
-    let mut niceness = unsafe { libc::getpriority(PRIO_PROCESS, 0) };
-    if Error::last_os_error().raw_os_error().unwrap() != 0 {
-        return Err(USimpleError::new(
-            125,
-            format!("getpriority: {}", Error::last_os_error()),
-        ));
-    }
-
-    let adjustment = match matches.get_one::<String>(options::ADJUSTMENT) {
-        Some(nstr) => {
-            if !matches.contains_id(options::COMMAND) {
-                return Err(UUsageError::new(
-                    125,
-                    "A command must be given with an adjustment.",
-                ));
-            }
-            match nstr.parse() {
-                Ok(num) => num,
-                Err(e) => {
-                    return Err(USimpleError::new(
-                        125,
-                        format!("\"{nstr}\" is not a valid number: {e}"),
-                    ))
-                }
-            }
-        }
-        None => {
-            if !matches.contains_id(options::COMMAND) {
-                println!("{niceness}");
-                return Ok(());
-            }
-            10_i32
-        }
-    };
-
-    niceness += adjustment;
-    // We can't use `show_warning` because that will panic if stderr
-    // isn't writable. The GNU test suite checks specifically that the
-    // exit code when failing to write the advisory is 125, but Rust
-    // will produce an exit code of 101 when it panics.
-    if unsafe { libc::setpriority(PRIO_PROCESS, 0, niceness) } == -1
-        && write!(
-            std::io::stderr(),
-            "{}: warning: setpriority: {}",
-            uucore::util_name(),
-            Error::last_os_error()
-        )
-        .is_err()
-    {
-        set_exit_code(125);
-        return Ok(());
-    }
-
-    let cstrs: Vec<CString> = matches
-        .get_many::<String>(options::COMMAND)
-        .unwrap()
-        .map(|x| CString::new(x.as_bytes()).unwrap())
-        .collect();
-
-    let mut args: Vec<*const c_char> = cstrs.iter().map(|s| s.as_ptr()).collect();
-    args.push(ptr::null::<c_char>());
-    unsafe {
-        execvp(args[0], args.as_mut_ptr());
-    }
-
-    show_error!("execvp: {}", Error::last_os_error());
-    let exit_code = if Error::last_os_error().raw_os_error().unwrap() as c_int == libc::ENOENT {
-        127
-    } else {
-        126
-    };
-    set_exit_code(exit_code);
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .trailing_var_arg(true)
-        .infer_long_args(true)
-        .version(crate_version!())
-        .arg(
-            Arg::new(options::ADJUSTMENT)
-                .short('n')
-                .long(options::ADJUSTMENT)
-                .help("add N to the niceness (default is 10)")
-                .action(ArgAction::Set)
-                .overrides_with(options::ADJUSTMENT)
-                .allow_hyphen_values(true),
-        )
-        .arg(
-            Arg::new(options::COMMAND)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::CommandName),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_nl/helper.rs.html b/coreutils/dev/src/uu_nl/helper.rs.html deleted file mode 100644 index 593804c69..000000000 --- a/coreutils/dev/src/uu_nl/helper.rs.html +++ /dev/null @@ -1,135 +0,0 @@ -helper.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-
// spell-checker:ignore (ToDO) conv
-
-use crate::options;
-
-// parse_options loads the options into the settings, returning an array of
-// error messages.
-#[allow(clippy::cognitive_complexity)]
-pub fn parse_options(settings: &mut crate::Settings, opts: &clap::ArgMatches) -> Vec<String> {
-    // This vector holds error messages encountered.
-    let mut errs: Vec<String> = vec![];
-    settings.renumber = opts.get_flag(options::NO_RENUMBER);
-    if let Some(val) = opts.get_one::<String>(options::NUMBER_SEPARATOR) {
-        settings.number_separator = val.to_owned();
-    }
-    settings.number_format = opts
-        .get_one::<String>(options::NUMBER_FORMAT)
-        .map(Into::into)
-        .unwrap_or_default();
-    match opts
-        .get_one::<String>(options::HEADER_NUMBERING)
-        .map(String::as_str)
-        .map(TryInto::try_into)
-    {
-        None => {}
-        Some(Ok(style)) => settings.header_numbering = style,
-        Some(Err(message)) => errs.push(message.to_string()),
-    }
-    match opts
-        .get_one::<String>(options::BODY_NUMBERING)
-        .map(String::as_str)
-        .map(TryInto::try_into)
-    {
-        None => {}
-        Some(Ok(style)) => settings.body_numbering = style,
-        Some(Err(message)) => errs.push(message.to_string()),
-    }
-    match opts
-        .get_one::<String>(options::FOOTER_NUMBERING)
-        .map(String::as_str)
-        .map(TryInto::try_into)
-    {
-        None => {}
-        Some(Ok(style)) => settings.footer_numbering = style,
-        Some(Err(message)) => errs.push(message.to_string()),
-    }
-    match opts.get_one::<usize>(options::NUMBER_WIDTH) {
-        None => {}
-        Some(num) if *num > 0 => settings.number_width = *num,
-        Some(_) => errs.push(String::from(
-            "Invalid line number field width: ‘0’: Numerical result out of range",
-        )),
-    }
-    match opts.get_one::<u64>(options::JOIN_BLANK_LINES) {
-        None => {}
-        Some(num) if *num > 0 => settings.join_blank_lines = *num,
-        Some(_) => errs.push(String::from(
-            "Invalid line number of blank lines: ‘0’: Numerical result out of range",
-        )),
-    }
-    if let Some(num) = opts.get_one::<i64>(options::LINE_INCREMENT) {
-        settings.line_increment = *num;
-    }
-    if let Some(num) = opts.get_one::<i64>(options::STARTING_LINE_NUMBER) {
-        settings.starting_line_number = *num;
-    }
-    errs
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_nl/nl.rs.html b/coreutils/dev/src/uu_nl/nl.rs.html deleted file mode 100644 index ef57803e1..000000000 --- a/coreutils/dev/src/uu_nl/nl.rs.html +++ /dev/null @@ -1,763 +0,0 @@ -nl.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Tobias Bohumir Schottdorf <tobias.schottdorf@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-//  *
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::fs::File;
-use std::io::{stdin, BufRead, BufReader, Read};
-use std::path::Path;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-mod helper;
-
-const ABOUT: &str = help_about!("nl.md");
-const AFTER_HELP: &str = help_section!("after help", "nl.md");
-const USAGE: &str = help_usage!("nl.md");
-
-// Settings store options used by nl to produce its output.
-pub struct Settings {
-    // The variables corresponding to the options -h, -b, and -f.
-    header_numbering: NumberingStyle,
-    body_numbering: NumberingStyle,
-    footer_numbering: NumberingStyle,
-    // The variable corresponding to -d
-    section_delimiter: [char; 2],
-    // The variables corresponding to the options -v, -i, -l, -w.
-    starting_line_number: i64,
-    line_increment: i64,
-    join_blank_lines: u64,
-    number_width: usize, // Used with String::from_char, hence usize.
-    // The format of the number and the (default value for)
-    // renumbering each page.
-    number_format: NumberFormat,
-    renumber: bool,
-    // The string appended to each line number output.
-    number_separator: String,
-}
-
-impl Default for Settings {
-    fn default() -> Self {
-        Self {
-            header_numbering: NumberingStyle::None,
-            body_numbering: NumberingStyle::NonEmpty,
-            footer_numbering: NumberingStyle::None,
-            section_delimiter: ['\\', ':'],
-            starting_line_number: 1,
-            line_increment: 1,
-            join_blank_lines: 1,
-            number_width: 6,
-            number_format: NumberFormat::Right,
-            renumber: true,
-            number_separator: String::from("\t"),
-        }
-    }
-}
-
-// NumberingStyle stores which lines are to be numbered.
-// The possible options are:
-// 1. Number all lines
-// 2. Number only nonempty lines
-// 3. Don't number any lines at all
-// 4. Number all lines that match a basic regular expression.
-enum NumberingStyle {
-    All,
-    NonEmpty,
-    None,
-    Regex(Box<regex::Regex>),
-}
-
-impl TryFrom<&str> for NumberingStyle {
-    type Error = String;
-
-    fn try_from(s: &str) -> Result<Self, Self::Error> {
-        match s {
-            "a" => Ok(Self::All),
-            "t" => Ok(Self::NonEmpty),
-            "n" => Ok(Self::None),
-            _ if s.starts_with('p') => match regex::Regex::new(&s[1..]) {
-                Ok(re) => Ok(Self::Regex(Box::new(re))),
-                Err(_) => Err(String::from("invalid regular expression")),
-            },
-            _ => Err(format!("invalid numbering style: '{s}'")),
-        }
-    }
-}
-
-// NumberFormat specifies how line numbers are output within their allocated
-// space. They are justified to the left or right, in the latter case with
-// the option of having all unused space to its left turned into leading zeroes.
-#[derive(Default)]
-enum NumberFormat {
-    Left,
-    #[default]
-    Right,
-    RightZero,
-}
-
-impl<T: AsRef<str>> From<T> for NumberFormat {
-    fn from(s: T) -> Self {
-        match s.as_ref() {
-            "ln" => Self::Left,
-            "rn" => Self::Right,
-            "rz" => Self::RightZero,
-            _ => unreachable!("Should have been caught by clap"),
-        }
-    }
-}
-
-impl NumberFormat {
-    // Turns a line number into a `String` with at least `min_width` chars,
-    // formatted according to the `NumberFormat`s variant.
-    fn format(&self, number: i64, min_width: usize) -> String {
-        match self {
-            Self::Left => format!("{number:<min_width$}"),
-            Self::Right => format!("{number:>min_width$}"),
-            Self::RightZero if number < 0 => format!("-{0:0>1$}", number.abs(), min_width - 1),
-            Self::RightZero => format!("{number:0>min_width$}"),
-        }
-    }
-}
-
-pub mod options {
-    pub const HELP: &str = "help";
-    pub const FILE: &str = "file";
-    pub const BODY_NUMBERING: &str = "body-numbering";
-    pub const SECTION_DELIMITER: &str = "section-delimiter";
-    pub const FOOTER_NUMBERING: &str = "footer-numbering";
-    pub const HEADER_NUMBERING: &str = "header-numbering";
-    pub const LINE_INCREMENT: &str = "line-increment";
-    pub const JOIN_BLANK_LINES: &str = "join-blank-lines";
-    pub const NUMBER_FORMAT: &str = "number-format";
-    pub const NO_RENUMBER: &str = "no-renumber";
-    pub const NUMBER_SEPARATOR: &str = "number-separator";
-    pub const STARTING_LINE_NUMBER: &str = "starting-line-number";
-    pub const NUMBER_WIDTH: &str = "number-width";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let mut settings = Settings::default();
-
-    // Update the settings from the command line options, and terminate the
-    // program if some options could not successfully be parsed.
-    let parse_errors = helper::parse_options(&mut settings, &matches);
-    if !parse_errors.is_empty() {
-        return Err(USimpleError::new(
-            1,
-            format!("Invalid arguments supplied.\n{}", parse_errors.join("\n")),
-        ));
-    }
-
-    let mut read_stdin = false;
-    let files: Vec<String> = match matches.get_many::<String>(options::FILE) {
-        Some(v) => v.clone().map(|v| v.to_owned()).collect(),
-        None => vec!["-".to_owned()],
-    };
-
-    for file in &files {
-        if file == "-" {
-            // If both file names and '-' are specified, we choose to treat first all
-            // regular files, and then read from stdin last.
-            read_stdin = true;
-            continue;
-        }
-        let path = Path::new(file);
-        let reader = File::open(path).map_err_context(|| file.to_string())?;
-        let mut buffer = BufReader::new(reader);
-        nl(&mut buffer, &settings)?;
-    }
-
-    if read_stdin {
-        let mut buffer = BufReader::new(stdin());
-        nl(&mut buffer, &settings)?;
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .about(ABOUT)
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .after_help(AFTER_HELP)
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::BODY_NUMBERING)
-                .short('b')
-                .long(options::BODY_NUMBERING)
-                .help("use STYLE for numbering body lines")
-                .value_name("STYLE"),
-        )
-        .arg(
-            Arg::new(options::SECTION_DELIMITER)
-                .short('d')
-                .long(options::SECTION_DELIMITER)
-                .help("use CC for separating logical pages")
-                .value_name("CC"),
-        )
-        .arg(
-            Arg::new(options::FOOTER_NUMBERING)
-                .short('f')
-                .long(options::FOOTER_NUMBERING)
-                .help("use STYLE for numbering footer lines")
-                .value_name("STYLE"),
-        )
-        .arg(
-            Arg::new(options::HEADER_NUMBERING)
-                .short('h')
-                .long(options::HEADER_NUMBERING)
-                .help("use STYLE for numbering header lines")
-                .value_name("STYLE"),
-        )
-        .arg(
-            Arg::new(options::LINE_INCREMENT)
-                .short('i')
-                .long(options::LINE_INCREMENT)
-                .help("line number increment at each line")
-                .value_name("NUMBER")
-                .value_parser(clap::value_parser!(i64)),
-        )
-        .arg(
-            Arg::new(options::JOIN_BLANK_LINES)
-                .short('l')
-                .long(options::JOIN_BLANK_LINES)
-                .help("group of NUMBER empty lines counted as one")
-                .value_name("NUMBER")
-                .value_parser(clap::value_parser!(u64)),
-        )
-        .arg(
-            Arg::new(options::NUMBER_FORMAT)
-                .short('n')
-                .long(options::NUMBER_FORMAT)
-                .help("insert line numbers according to FORMAT")
-                .value_name("FORMAT")
-                .value_parser(["ln", "rn", "rz"]),
-        )
-        .arg(
-            Arg::new(options::NO_RENUMBER)
-                .short('p')
-                .long(options::NO_RENUMBER)
-                .help("do not reset line numbers at logical pages")
-                .action(ArgAction::SetFalse),
-        )
-        .arg(
-            Arg::new(options::NUMBER_SEPARATOR)
-                .short('s')
-                .long(options::NUMBER_SEPARATOR)
-                .help("add STRING after (possible) line number")
-                .value_name("STRING"),
-        )
-        .arg(
-            Arg::new(options::STARTING_LINE_NUMBER)
-                .short('v')
-                .long(options::STARTING_LINE_NUMBER)
-                .help("first line number on each logical page")
-                .value_name("NUMBER")
-                .value_parser(clap::value_parser!(i64)),
-        )
-        .arg(
-            Arg::new(options::NUMBER_WIDTH)
-                .short('w')
-                .long(options::NUMBER_WIDTH)
-                .help("use NUMBER columns for line numbers")
-                .value_name("NUMBER")
-                .value_parser(clap::value_parser!(usize)),
-        )
-}
-
-// nl implements the main functionality for an individual buffer.
-fn nl<T: Read>(reader: &mut BufReader<T>, settings: &Settings) -> UResult<()> {
-    let mut current_numbering_style = &settings.body_numbering;
-    let mut line_no = settings.starting_line_number;
-    let mut consecutive_empty_lines = 0;
-
-    for line in reader.lines() {
-        let line = line.map_err_context(|| "could not read line".to_string())?;
-
-        if line.is_empty() {
-            consecutive_empty_lines += 1;
-        } else {
-            consecutive_empty_lines = 0;
-        };
-
-        // FIXME section delimiters are hardcoded and settings.section_delimiter is ignored
-        // because --section-delimiter is not correctly implemented yet
-        let _ = settings.section_delimiter; // XXX suppress "field never read" warning
-        let new_numbering_style = match line.as_str() {
-            "\\:\\:\\:" => Some(&settings.header_numbering),
-            "\\:\\:" => Some(&settings.body_numbering),
-            "\\:" => Some(&settings.footer_numbering),
-            _ => None,
-        };
-
-        if let Some(new_style) = new_numbering_style {
-            current_numbering_style = new_style;
-            if settings.renumber {
-                line_no = settings.starting_line_number;
-            }
-            println!();
-        } else {
-            let is_line_numbered = match current_numbering_style {
-                // consider $join_blank_lines consecutive empty lines to be one logical line
-                // for numbering, and only number the last one
-                NumberingStyle::All
-                    if line.is_empty()
-                        && consecutive_empty_lines % settings.join_blank_lines != 0 =>
-                {
-                    false
-                }
-                NumberingStyle::All => true,
-                NumberingStyle::NonEmpty => !line.is_empty(),
-                NumberingStyle::None => false,
-                NumberingStyle::Regex(re) => re.is_match(&line),
-            };
-
-            if is_line_numbered {
-                println!(
-                    "{}{}{}",
-                    settings
-                        .number_format
-                        .format(line_no, settings.number_width),
-                    settings.number_separator,
-                    line
-                );
-                // update line number for the potential next line
-                match line_no.checked_add(settings.line_increment) {
-                    Some(new_line_no) => line_no = new_line_no,
-                    None => return Err(USimpleError::new(1, "line number overflow")),
-                }
-            } else {
-                let spaces = " ".repeat(settings.number_width + 1);
-                println!("{spaces}{line}");
-            }
-        }
-    }
-    Ok(())
-}
-
-#[cfg(test)]
-mod test {
-    use super::*;
-
-    #[test]
-    fn test_format() {
-        assert_eq!(NumberFormat::Left.format(12, 1), "12");
-        assert_eq!(NumberFormat::Left.format(-12, 1), "-12");
-        assert_eq!(NumberFormat::Left.format(12, 4), "12  ");
-        assert_eq!(NumberFormat::Left.format(-12, 4), "-12 ");
-
-        assert_eq!(NumberFormat::Right.format(12, 1), "12");
-        assert_eq!(NumberFormat::Right.format(-12, 1), "-12");
-        assert_eq!(NumberFormat::Right.format(12, 4), "  12");
-        assert_eq!(NumberFormat::Right.format(-12, 4), " -12");
-
-        assert_eq!(NumberFormat::RightZero.format(12, 1), "12");
-        assert_eq!(NumberFormat::RightZero.format(-12, 1), "-12");
-        assert_eq!(NumberFormat::RightZero.format(12, 4), "0012");
-        assert_eq!(NumberFormat::RightZero.format(-12, 4), "-012");
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_nohup/nohup.rs.html b/coreutils/dev/src/uu_nohup/nohup.rs.html deleted file mode 100644 index 933e1ac93..000000000 --- a/coreutils/dev/src/uu_nohup/nohup.rs.html +++ /dev/null @@ -1,419 +0,0 @@ -nohup.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) 2014 Vsevolod Velichko <torkvemada@sorokdva.net>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) execvp SIGHUP cproc vprocmgr cstrs homeout
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use is_terminal::IsTerminal;
-use libc::{c_char, dup2, execvp, signal};
-use libc::{SIGHUP, SIG_IGN};
-use std::env;
-use std::ffi::CString;
-use std::fmt::{Display, Formatter};
-use std::fs::{File, OpenOptions};
-use std::io::Error;
-use std::os::unix::prelude::*;
-use std::path::{Path, PathBuf};
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, UClapError, UError, UResult};
-use uucore::{format_usage, help_about, help_section, help_usage, show_error};
-
-const ABOUT: &str = help_about!("nohup.md");
-const AFTER_HELP: &str = help_section!("after help", "nohup.md");
-const USAGE: &str = help_usage!("nohup.md");
-static NOHUP_OUT: &str = "nohup.out";
-// exit codes that match the GNU implementation
-static EXIT_CANCELED: i32 = 125;
-static EXIT_CANNOT_INVOKE: i32 = 126;
-static EXIT_ENOENT: i32 = 127;
-static POSIX_NOHUP_FAILURE: i32 = 127;
-
-mod options {
-    pub const CMD: &str = "cmd";
-}
-
-#[derive(Debug)]
-enum NohupError {
-    CannotDetach,
-    CannotReplace(&'static str, std::io::Error),
-    OpenFailed(i32, std::io::Error),
-    OpenFailed2(i32, std::io::Error, String, std::io::Error),
-}
-
-impl std::error::Error for NohupError {}
-
-impl UError for NohupError {
-    fn code(&self) -> i32 {
-        match self {
-            Self::OpenFailed(code, _) | Self::OpenFailed2(code, _, _, _) => *code,
-            _ => 2,
-        }
-    }
-}
-
-impl Display for NohupError {
-    fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
-        match self {
-            Self::CannotDetach => write!(f, "Cannot detach from console"),
-            Self::CannotReplace(s, e) => write!(f, "Cannot replace {s}: {e}"),
-            Self::OpenFailed(_, e) => {
-                write!(f, "failed to open {}: {}", NOHUP_OUT.quote(), e)
-            }
-            Self::OpenFailed2(_, e1, s, e2) => write!(
-                f,
-                "failed to open {}: {}\nfailed to open {}: {}",
-                NOHUP_OUT.quote(),
-                e1,
-                s.quote(),
-                e2
-            ),
-        }
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args).with_exit_code(125)?;
-
-    replace_fds()?;
-
-    unsafe { signal(SIGHUP, SIG_IGN) };
-
-    if unsafe { !_vprocmgr_detach_from_console(0).is_null() } {
-        return Err(NohupError::CannotDetach.into());
-    };
-
-    let cstrs: Vec<CString> = matches
-        .get_many::<String>(options::CMD)
-        .unwrap()
-        .map(|x| CString::new(x.as_bytes()).unwrap())
-        .collect();
-    let mut args: Vec<*const c_char> = cstrs.iter().map(|s| s.as_ptr()).collect();
-    args.push(std::ptr::null());
-
-    let ret = unsafe { execvp(args[0], args.as_mut_ptr()) };
-    match ret {
-        libc::ENOENT => set_exit_code(EXIT_ENOENT),
-        _ => set_exit_code(EXIT_CANNOT_INVOKE),
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .arg(
-            Arg::new(options::CMD)
-                .hide(true)
-                .required(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::CommandName),
-        )
-        .trailing_var_arg(true)
-        .infer_long_args(true)
-}
-
-fn replace_fds() -> UResult<()> {
-    if std::io::stdin().is_terminal() {
-        let new_stdin = File::open(Path::new("/dev/null"))
-            .map_err(|e| NohupError::CannotReplace("STDIN", e))?;
-        if unsafe { dup2(new_stdin.as_raw_fd(), 0) } != 0 {
-            return Err(NohupError::CannotReplace("STDIN", Error::last_os_error()).into());
-        }
-    }
-
-    if std::io::stdout().is_terminal() {
-        let new_stdout = find_stdout()?;
-        let fd = new_stdout.as_raw_fd();
-
-        if unsafe { dup2(fd, 1) } != 1 {
-            return Err(NohupError::CannotReplace("STDOUT", Error::last_os_error()).into());
-        }
-    }
-
-    if std::io::stderr().is_terminal() && unsafe { dup2(1, 2) } != 2 {
-        return Err(NohupError::CannotReplace("STDERR", Error::last_os_error()).into());
-    }
-    Ok(())
-}
-
-fn find_stdout() -> UResult<File> {
-    let internal_failure_code = match std::env::var("POSIXLY_CORRECT") {
-        Ok(_) => POSIX_NOHUP_FAILURE,
-        Err(_) => EXIT_CANCELED,
-    };
-
-    match OpenOptions::new()
-        .write(true)
-        .create(true)
-        .append(true)
-        .open(Path::new(NOHUP_OUT))
-    {
-        Ok(t) => {
-            show_error!(
-                "ignoring input and appending output to {}",
-                NOHUP_OUT.quote()
-            );
-            Ok(t)
-        }
-        Err(e1) => {
-            let home = match env::var("HOME") {
-                Err(_) => return Err(NohupError::OpenFailed(internal_failure_code, e1).into()),
-                Ok(h) => h,
-            };
-            let mut homeout = PathBuf::from(home);
-            homeout.push(NOHUP_OUT);
-            let homeout_str = homeout.to_str().unwrap();
-            match OpenOptions::new()
-                .write(true)
-                .create(true)
-                .append(true)
-                .open(&homeout)
-            {
-                Ok(t) => {
-                    show_error!(
-                        "ignoring input and appending output to {}",
-                        homeout_str.quote()
-                    );
-                    Ok(t)
-                }
-                Err(e2) => Err(NohupError::OpenFailed2(
-                    internal_failure_code,
-                    e1,
-                    homeout_str.to_string(),
-                    e2,
-                )
-                .into()),
-            }
-        }
-    }
-}
-
-#[cfg(target_vendor = "apple")]
-extern "C" {
-    fn _vprocmgr_detach_from_console(flags: u32) -> *const libc::c_int;
-}
-
-#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd"))]
-unsafe fn _vprocmgr_detach_from_console(_: u32) -> *const libc::c_int {
-    std::ptr::null()
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_nproc/nproc.rs.html b/coreutils/dev/src/uu_nproc/nproc.rs.html deleted file mode 100644 index 57b034ab8..000000000 --- a/coreutils/dev/src/uu_nproc/nproc.rs.html +++ /dev/null @@ -1,309 +0,0 @@ -nproc.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Michael Gehring <mg@ebfe.org>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) NPROCESSORS nprocs numstr threadstr sysconf
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::{env, thread};
-use uucore::display::Quotable;
-use uucore::error::{UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage};
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-pub const _SC_NPROCESSORS_CONF: libc::c_int = 83;
-#[cfg(target_vendor = "apple")]
-pub const _SC_NPROCESSORS_CONF: libc::c_int = libc::_SC_NPROCESSORS_CONF;
-#[cfg(target_os = "freebsd")]
-pub const _SC_NPROCESSORS_CONF: libc::c_int = 57;
-#[cfg(target_os = "netbsd")]
-pub const _SC_NPROCESSORS_CONF: libc::c_int = 1001;
-
-static OPT_ALL: &str = "all";
-static OPT_IGNORE: &str = "ignore";
-
-const ABOUT: &str = help_about!("nproc.md");
-const USAGE: &str = help_usage!("nproc.md");
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let ignore = match matches.get_one::<String>(OPT_IGNORE) {
-        Some(numstr) => match numstr.trim().parse() {
-            Ok(num) => num,
-            Err(e) => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("{} is not a valid number: {}", numstr.quote(), e),
-                ));
-            }
-        },
-        None => 0,
-    };
-
-    let limit = match env::var("OMP_THREAD_LIMIT") {
-        // Uses the OpenMP variable to limit the number of threads
-        // If the parsing fails, returns the max size (so, no impact)
-        // If OMP_THREAD_LIMIT=0, rejects the value
-        Ok(threadstr) => match threadstr.parse() {
-            Ok(0) | Err(_) => usize::MAX,
-            Ok(n) => n,
-        },
-        // the variable 'OMP_THREAD_LIMIT' doesn't exist
-        // fallback to the max
-        Err(_) => usize::MAX,
-    };
-
-    let mut cores = if matches.get_flag(OPT_ALL) {
-        num_cpus_all()
-    } else {
-        // OMP_NUM_THREADS doesn't have an impact on --all
-        match env::var("OMP_NUM_THREADS") {
-            // Uses the OpenMP variable to force the number of threads
-            // If the parsing fails, returns the number of CPU
-            Ok(threadstr) => {
-                // In some cases, OMP_NUM_THREADS can be "x,y,z"
-                // In this case, only take the first one (like GNU)
-                // If OMP_NUM_THREADS=0, rejects the value
-                let thread: Vec<&str> = threadstr.split_terminator(',').collect();
-                match &thread[..] {
-                    [] => available_parallelism(),
-                    [s, ..] => match s.parse() {
-                        Ok(0) | Err(_) => available_parallelism(),
-                        Ok(n) => n,
-                    },
-                }
-            }
-            // the variable 'OMP_NUM_THREADS' doesn't exist
-            // fallback to the regular CPU detection
-            Err(_) => available_parallelism(),
-        }
-    };
-
-    cores = std::cmp::min(limit, cores);
-    if cores <= ignore {
-        cores = 1;
-    } else {
-        cores -= ignore;
-    }
-    println!("{cores}");
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_ALL)
-                .long(OPT_ALL)
-                .help("print the number of cores available to the system")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_IGNORE)
-                .long(OPT_IGNORE)
-                .value_name("N")
-                .help("ignore up to N cores"),
-        )
-}
-
-#[cfg(any(
-    target_os = "linux",
-    target_vendor = "apple",
-    target_os = "freebsd",
-    target_os = "netbsd"
-))]
-fn num_cpus_all() -> usize {
-    let nprocs = unsafe { libc::sysconf(_SC_NPROCESSORS_CONF) };
-    if nprocs == 1 {
-        // In some situation, /proc and /sys are not mounted, and sysconf returns 1.
-        // However, we want to guarantee that `nproc --all` >= `nproc`.
-        available_parallelism()
-    } else if nprocs > 0 {
-        nprocs as usize
-    } else {
-        1
-    }
-}
-
-// Other platforms (e.g., windows), available_parallelism() directly.
-#[cfg(not(any(
-    target_os = "linux",
-    target_vendor = "apple",
-    target_os = "freebsd",
-    target_os = "netbsd"
-)))]
-fn num_cpus_all() -> usize {
-    available_parallelism()
-}
-
-// In some cases, thread::available_parallelism() may return an Err
-// In this case, we will return 1 (like GNU)
-fn available_parallelism() -> usize {
-    match thread::available_parallelism() {
-        Ok(n) => n.get(),
-        Err(_) => 1,
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_numfmt/errors.rs.html b/coreutils/dev/src/uu_numfmt/errors.rs.html deleted file mode 100644 index c5320a453..000000000 --- a/coreutils/dev/src/uu_numfmt/errors.rs.html +++ /dev/null @@ -1,79 +0,0 @@ -errors.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use std::{
-    error::Error,
-    fmt::{Debug, Display},
-};
-use uucore::error::UError;
-
-#[derive(Debug)]
-pub enum NumfmtError {
-    IoError(String),
-    IllegalArgument(String),
-    FormattingError(String),
-}
-
-impl UError for NumfmtError {
-    fn code(&self) -> i32 {
-        match self {
-            Self::IoError(_) => 1,
-            Self::IllegalArgument(_) => 1,
-            Self::FormattingError(_) => 2,
-        }
-    }
-}
-
-impl Error for NumfmtError {}
-
-impl Display for NumfmtError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::IoError(s) | Self::IllegalArgument(s) | Self::FormattingError(s) => {
-                write!(f, "{s}")
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_numfmt/format.rs.html b/coreutils/dev/src/uu_numfmt/format.rs.html deleted file mode 100644 index b496b4ff2..000000000 --- a/coreutils/dev/src/uu_numfmt/format.rs.html +++ /dev/null @@ -1,919 +0,0 @@ -format.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-
// spell-checker:ignore powf
-use uucore::display::Quotable;
-
-use crate::options::{NumfmtOptions, RoundMethod, TransformOptions};
-use crate::units::{DisplayableSuffix, RawSuffix, Result, Suffix, Unit, IEC_BASES, SI_BASES};
-
-/// Iterate over a line's fields, where each field is a contiguous sequence of
-/// non-whitespace, optionally prefixed with one or more characters of leading
-/// whitespace. Fields are returned as tuples of `(prefix, field)`.
-///
-/// # Examples:
-///
-/// ```
-/// let mut fields = uu_numfmt::format::WhitespaceSplitter { s: Some("    1234 5") };
-///
-/// assert_eq!(Some(("    ", "1234")), fields.next());
-/// assert_eq!(Some((" ", "5")), fields.next());
-/// assert_eq!(None, fields.next());
-/// ```
-///
-/// Delimiters are included in the results; `prefix` will be empty only for
-/// the first field of the line (including the case where the input line is
-/// empty):
-///
-/// ```
-/// let mut fields = uu_numfmt::format::WhitespaceSplitter { s: Some("first second") };
-///
-/// assert_eq!(Some(("", "first")), fields.next());
-/// assert_eq!(Some((" ", "second")), fields.next());
-///
-/// let mut fields = uu_numfmt::format::WhitespaceSplitter { s: Some("") };
-///
-/// assert_eq!(Some(("", "")), fields.next());
-/// ```
-pub struct WhitespaceSplitter<'a> {
-    pub s: Option<&'a str>,
-}
-
-impl<'a> Iterator for WhitespaceSplitter<'a> {
-    type Item = (&'a str, &'a str);
-
-    /// Yield the next field in the input string as a tuple `(prefix, field)`.
-    fn next(&mut self) -> Option<Self::Item> {
-        let haystack = self.s?;
-
-        let (prefix, field) = haystack.split_at(
-            haystack
-                .find(|c: char| !c.is_whitespace())
-                .unwrap_or(haystack.len()),
-        );
-
-        let (field, rest) = field.split_at(
-            field
-                .find(|c: char| c.is_whitespace())
-                .unwrap_or(field.len()),
-        );
-
-        self.s = if rest.is_empty() { None } else { Some(rest) };
-
-        Some((prefix, field))
-    }
-}
-
-fn parse_suffix(s: &str) -> Result<(f64, Option<Suffix>)> {
-    if s.is_empty() {
-        return Err("invalid number: ''".to_string());
-    }
-
-    let with_i = s.ends_with('i');
-    let mut iter = s.chars();
-    if with_i {
-        iter.next_back();
-    }
-    let suffix = match iter.next_back() {
-        Some('K') => Some((RawSuffix::K, with_i)),
-        Some('M') => Some((RawSuffix::M, with_i)),
-        Some('G') => Some((RawSuffix::G, with_i)),
-        Some('T') => Some((RawSuffix::T, with_i)),
-        Some('P') => Some((RawSuffix::P, with_i)),
-        Some('E') => Some((RawSuffix::E, with_i)),
-        Some('Z') => Some((RawSuffix::Z, with_i)),
-        Some('Y') => Some((RawSuffix::Y, with_i)),
-        Some('0'..='9') if !with_i => None,
-        _ => return Err(format!("invalid suffix in input: {}", s.quote())),
-    };
-
-    let suffix_len = match suffix {
-        None => 0,
-        Some((_, false)) => 1,
-        Some((_, true)) => 2,
-    };
-
-    let number = s[..s.len() - suffix_len]
-        .parse::<f64>()
-        .map_err(|_| format!("invalid number: {}", s.quote()))?;
-
-    Ok((number, suffix))
-}
-
-// Returns the implicit precision of a number, which is the count of digits after the dot. For
-// example, 1.23 has an implicit precision of 2.
-fn parse_implicit_precision(s: &str) -> usize {
-    match s.split_once('.') {
-        Some((_, decimal_part)) => decimal_part
-            .chars()
-            .take_while(|c| c.is_ascii_digit())
-            .count(),
-        None => 0,
-    }
-}
-
-fn remove_suffix(i: f64, s: Option<Suffix>, u: &Unit) -> Result<f64> {
-    match (s, u) {
-        (Some((raw_suffix, false)), &Unit::Auto) | (Some((raw_suffix, false)), &Unit::Si) => {
-            match raw_suffix {
-                RawSuffix::K => Ok(i * 1e3),
-                RawSuffix::M => Ok(i * 1e6),
-                RawSuffix::G => Ok(i * 1e9),
-                RawSuffix::T => Ok(i * 1e12),
-                RawSuffix::P => Ok(i * 1e15),
-                RawSuffix::E => Ok(i * 1e18),
-                RawSuffix::Z => Ok(i * 1e21),
-                RawSuffix::Y => Ok(i * 1e24),
-            }
-        }
-        (Some((raw_suffix, false)), &Unit::Iec(false))
-        | (Some((raw_suffix, true)), &Unit::Auto)
-        | (Some((raw_suffix, true)), &Unit::Iec(true)) => match raw_suffix {
-            RawSuffix::K => Ok(i * IEC_BASES[1]),
-            RawSuffix::M => Ok(i * IEC_BASES[2]),
-            RawSuffix::G => Ok(i * IEC_BASES[3]),
-            RawSuffix::T => Ok(i * IEC_BASES[4]),
-            RawSuffix::P => Ok(i * IEC_BASES[5]),
-            RawSuffix::E => Ok(i * IEC_BASES[6]),
-            RawSuffix::Z => Ok(i * IEC_BASES[7]),
-            RawSuffix::Y => Ok(i * IEC_BASES[8]),
-        },
-        (None, &Unit::Iec(true)) => {
-            Err(format!("missing 'i' suffix in input: '{i}' (e.g Ki/Mi/Gi)"))
-        }
-        (Some((raw_suffix, false)), &Unit::Iec(true)) => Err(format!(
-            "missing 'i' suffix in input: '{i}{raw_suffix:?}' (e.g Ki/Mi/Gi)"
-        )),
-        (Some((raw_suffix, with_i)), &Unit::None) => Err(format!(
-            "rejecting suffix in input: '{}{:?}{}' (consider using --from)",
-            i,
-            raw_suffix,
-            if with_i { "i" } else { "" }
-        )),
-        (None, _) => Ok(i),
-        (_, _) => Err("This suffix is unsupported for specified unit".to_owned()),
-    }
-}
-
-fn transform_from(s: &str, opts: &TransformOptions) -> Result<f64> {
-    let (i, suffix) = parse_suffix(s)?;
-    let i = i * (opts.from_unit as f64);
-
-    remove_suffix(i, suffix, &opts.from).map(|n| {
-        // GNU numfmt doesn't round values if no --from argument is provided by the user
-        if opts.from == Unit::None {
-            if n == -0.0 {
-                0.0
-            } else {
-                n
-            }
-        } else if n < 0.0 {
-            -n.abs().ceil()
-        } else {
-            n.ceil()
-        }
-    })
-}
-
-/// Divide numerator by denominator, with rounding.
-///
-/// If the result of the division is less than 10.0, round to one decimal point.
-///
-/// Otherwise, round to an integer.
-///
-/// # Examples:
-///
-/// ```
-/// use uu_numfmt::format::div_round;
-/// use uu_numfmt::options::RoundMethod;
-///
-/// // Rounding methods:
-/// assert_eq!(div_round(1.01, 1.0, RoundMethod::FromZero), 1.1);
-/// assert_eq!(div_round(1.01, 1.0, RoundMethod::TowardsZero), 1.0);
-/// assert_eq!(div_round(1.01, 1.0, RoundMethod::Up), 1.1);
-/// assert_eq!(div_round(1.01, 1.0, RoundMethod::Down), 1.0);
-/// assert_eq!(div_round(1.01, 1.0, RoundMethod::Nearest), 1.0);
-///
-/// // Division:
-/// assert_eq!(div_round(999.1, 1000.0, RoundMethod::FromZero), 1.0);
-/// assert_eq!(div_round(1001., 10., RoundMethod::FromZero), 101.);
-/// assert_eq!(div_round(9991., 10., RoundMethod::FromZero), 1000.);
-/// assert_eq!(div_round(-12.34, 1.0, RoundMethod::FromZero), -13.0);
-/// assert_eq!(div_round(1000.0, -3.14, RoundMethod::FromZero), -319.0);
-/// assert_eq!(div_round(-271828.0, -271.0, RoundMethod::FromZero), 1004.0);
-/// ```
-pub fn div_round(n: f64, d: f64, method: RoundMethod) -> f64 {
-    let v = n / d;
-
-    if v.abs() < 10.0 {
-        method.round(10.0 * v) / 10.0
-    } else {
-        method.round(v)
-    }
-}
-
-// Rounds to the specified number of decimal points.
-fn round_with_precision(n: f64, method: RoundMethod, precision: usize) -> f64 {
-    let p = 10.0_f64.powf(precision as f64);
-
-    method.round(p * n) / p
-}
-
-fn consider_suffix(
-    n: f64,
-    u: &Unit,
-    round_method: RoundMethod,
-    precision: usize,
-) -> Result<(f64, Option<Suffix>)> {
-    use crate::units::RawSuffix::*;
-
-    let abs_n = n.abs();
-    let suffixes = [K, M, G, T, P, E, Z, Y];
-
-    let (bases, with_i) = match *u {
-        Unit::Si => (&SI_BASES, false),
-        Unit::Iec(with_i) => (&IEC_BASES, with_i),
-        Unit::Auto => return Err("Unit 'auto' isn't supported with --to options".to_owned()),
-        Unit::None => return Ok((n, None)),
-    };
-
-    let i = match abs_n {
-        _ if abs_n <= bases[1] - 1.0 => return Ok((n, None)),
-        _ if abs_n < bases[2] => 1,
-        _ if abs_n < bases[3] => 2,
-        _ if abs_n < bases[4] => 3,
-        _ if abs_n < bases[5] => 4,
-        _ if abs_n < bases[6] => 5,
-        _ if abs_n < bases[7] => 6,
-        _ if abs_n < bases[8] => 7,
-        _ if abs_n < bases[9] => 8,
-        _ => return Err("Number is too big and unsupported".to_string()),
-    };
-
-    let v = if precision > 0 {
-        round_with_precision(n / bases[i], round_method, precision)
-    } else {
-        div_round(n, bases[i], round_method)
-    };
-
-    // check if rounding pushed us into the next base
-    if v.abs() >= bases[1] {
-        Ok((v / bases[1], Some((suffixes[i], with_i))))
-    } else {
-        Ok((v, Some((suffixes[i - 1], with_i))))
-    }
-}
-
-fn transform_to(
-    s: f64,
-    opts: &TransformOptions,
-    round_method: RoundMethod,
-    precision: usize,
-) -> Result<String> {
-    let (i2, s) = consider_suffix(s, &opts.to, round_method, precision)?;
-    let i2 = i2 / (opts.to_unit as f64);
-    Ok(match s {
-        None => {
-            format!(
-                "{:.precision$}",
-                round_with_precision(i2, round_method, precision),
-                precision = precision
-            )
-        }
-        Some(s) if precision > 0 => {
-            format!(
-                "{:.precision$}{}",
-                i2,
-                DisplayableSuffix(s),
-                precision = precision
-            )
-        }
-        Some(s) if i2.abs() < 10.0 => format!("{:.1}{}", i2, DisplayableSuffix(s)),
-        Some(s) => format!("{:.0}{}", i2, DisplayableSuffix(s)),
-    })
-}
-
-fn format_string(
-    source: &str,
-    options: &NumfmtOptions,
-    implicit_padding: Option<isize>,
-) -> Result<String> {
-    // strip the (optional) suffix before applying any transformation
-    let source_without_suffix = match &options.suffix {
-        Some(suffix) => source.strip_suffix(suffix).unwrap_or(source),
-        None => source,
-    };
-
-    let precision = if let Some(p) = options.format.precision {
-        p
-    } else if options.transform.from == Unit::None && options.transform.to == Unit::None {
-        parse_implicit_precision(source_without_suffix)
-    } else {
-        0
-    };
-
-    let number = transform_to(
-        transform_from(source_without_suffix, &options.transform)?,
-        &options.transform,
-        options.round,
-        precision,
-    )?;
-
-    // bring back the suffix before applying padding
-    let number_with_suffix = match &options.suffix {
-        Some(suffix) => format!("{number}{suffix}"),
-        None => number,
-    };
-
-    let padding = options
-        .format
-        .padding
-        .unwrap_or_else(|| implicit_padding.unwrap_or(options.padding));
-
-    let padded_number = match padding {
-        0 => number_with_suffix,
-        p if p > 0 && options.format.zero_padding => {
-            let zero_padded = format!("{:0>padding$}", number_with_suffix, padding = p as usize);
-
-            match implicit_padding.unwrap_or(options.padding) {
-                0 => zero_padded,
-                p if p > 0 => format!("{:>padding$}", zero_padded, padding = p as usize),
-                p => format!("{:<padding$}", zero_padded, padding = p.unsigned_abs()),
-            }
-        }
-        p if p > 0 => format!("{:>padding$}", number_with_suffix, padding = p as usize),
-        p => format!(
-            "{:<padding$}",
-            number_with_suffix,
-            padding = p.unsigned_abs()
-        ),
-    };
-
-    Ok(format!(
-        "{}{}{}",
-        options.format.prefix, padded_number, options.format.suffix
-    ))
-}
-
-fn format_and_print_delimited(s: &str, options: &NumfmtOptions) -> Result<()> {
-    let delimiter = options.delimiter.as_ref().unwrap();
-
-    for (n, field) in (1..).zip(s.split(delimiter)) {
-        let field_selected = uucore::ranges::contain(&options.fields, n);
-
-        // print delimiter before second and subsequent fields
-        if n > 1 {
-            print!("{delimiter}");
-        }
-
-        if field_selected {
-            print!("{}", format_string(field.trim_start(), options, None)?);
-        } else {
-            // print unselected field without conversion
-            print!("{field}");
-        }
-    }
-
-    println!();
-
-    Ok(())
-}
-
-fn format_and_print_whitespace(s: &str, options: &NumfmtOptions) -> Result<()> {
-    for (n, (prefix, field)) in (1..).zip(WhitespaceSplitter { s: Some(s) }) {
-        let field_selected = uucore::ranges::contain(&options.fields, n);
-
-        if field_selected {
-            let empty_prefix = prefix.is_empty();
-
-            // print delimiter before second and subsequent fields
-            let prefix = if n > 1 {
-                print!(" ");
-                &prefix[1..]
-            } else {
-                prefix
-            };
-
-            let implicit_padding = if !empty_prefix && options.padding == 0 {
-                Some((prefix.len() + field.len()) as isize)
-            } else {
-                None
-            };
-
-            print!("{}", format_string(field, options, implicit_padding)?);
-        } else {
-            // print unselected field without conversion
-            print!("{prefix}{field}");
-        }
-    }
-
-    println!();
-
-    Ok(())
-}
-
-/// Format a line of text according to the selected options.
-///
-/// Given a line of text `s`, split the line into fields, transform and format
-/// any selected numeric fields, and print the result to stdout. Fields not
-/// selected for conversion are passed through unmodified.
-pub fn format_and_print(s: &str, options: &NumfmtOptions) -> Result<()> {
-    match &options.delimiter {
-        Some(_) => format_and_print_delimited(s, options),
-        None => format_and_print_whitespace(s, options),
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    fn test_round_with_precision() {
-        let rm = RoundMethod::FromZero;
-        assert_eq!(1.0, round_with_precision(0.12345, rm, 0));
-        assert_eq!(0.2, round_with_precision(0.12345, rm, 1));
-        assert_eq!(0.13, round_with_precision(0.12345, rm, 2));
-        assert_eq!(0.124, round_with_precision(0.12345, rm, 3));
-        assert_eq!(0.1235, round_with_precision(0.12345, rm, 4));
-        assert_eq!(0.12345, round_with_precision(0.12345, rm, 5));
-
-        let rm = RoundMethod::TowardsZero;
-        assert_eq!(0.0, round_with_precision(0.12345, rm, 0));
-        assert_eq!(0.1, round_with_precision(0.12345, rm, 1));
-        assert_eq!(0.12, round_with_precision(0.12345, rm, 2));
-        assert_eq!(0.123, round_with_precision(0.12345, rm, 3));
-        assert_eq!(0.1234, round_with_precision(0.12345, rm, 4));
-        assert_eq!(0.12345, round_with_precision(0.12345, rm, 5));
-    }
-
-    #[test]
-    fn test_parse_implicit_precision() {
-        assert_eq!(0, parse_implicit_precision(""));
-        assert_eq!(0, parse_implicit_precision("1"));
-        assert_eq!(1, parse_implicit_precision("1.2"));
-        assert_eq!(2, parse_implicit_precision("1.23"));
-        assert_eq!(3, parse_implicit_precision("1.234"));
-        assert_eq!(0, parse_implicit_precision("1K"));
-        assert_eq!(1, parse_implicit_precision("1.2K"));
-        assert_eq!(2, parse_implicit_precision("1.23K"));
-        assert_eq!(3, parse_implicit_precision("1.234K"));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_numfmt/numfmt.rs.html b/coreutils/dev/src/uu_numfmt/numfmt.rs.html deleted file mode 100644 index 42e595eca..000000000 --- a/coreutils/dev/src/uu_numfmt/numfmt.rs.html +++ /dev/null @@ -1,1133 +0,0 @@ -numfmt.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Yury Krivopalov <ykrivopalov@yandex.ru>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use crate::errors::*;
-use crate::format::format_and_print;
-use crate::options::*;
-use crate::units::{Result, Unit};
-use clap::{crate_version, parser::ValueSource, Arg, ArgAction, ArgMatches, Command};
-use std::io::{BufRead, Write};
-use std::str::FromStr;
-
-use units::{IEC_BASES, SI_BASES};
-use uucore::display::Quotable;
-use uucore::error::{UError, UResult};
-use uucore::ranges::Range;
-use uucore::{format_usage, help_about, help_section, help_usage, show, show_error};
-
-pub mod errors;
-pub mod format;
-pub mod options;
-mod units;
-
-const ABOUT: &str = help_about!("numfmt.md");
-const AFTER_HELP: &str = help_section!("after help", "numfmt.md");
-const USAGE: &str = help_usage!("numfmt.md");
-
-fn handle_args<'a>(args: impl Iterator<Item = &'a str>, options: &NumfmtOptions) -> UResult<()> {
-    for l in args {
-        format_and_handle_validation(l, options)?;
-    }
-    Ok(())
-}
-
-fn handle_buffer<R>(input: R, options: &NumfmtOptions) -> UResult<()>
-where
-    R: BufRead,
-{
-    for (idx, line_result) in input.lines().by_ref().enumerate() {
-        match line_result {
-            Ok(line) if idx < options.header => {
-                println!("{line}");
-                Ok(())
-            }
-            Ok(line) => format_and_handle_validation(line.as_ref(), options),
-            Err(err) => return Err(Box::new(NumfmtError::IoError(err.to_string()))),
-        }?;
-    }
-    Ok(())
-}
-
-fn format_and_handle_validation(input_line: &str, options: &NumfmtOptions) -> UResult<()> {
-    let handled_line = format_and_print(input_line, options);
-
-    if let Err(error_message) = handled_line {
-        match options.invalid {
-            InvalidModes::Abort => {
-                return Err(Box::new(NumfmtError::FormattingError(error_message)));
-            }
-            InvalidModes::Fail => {
-                show!(NumfmtError::FormattingError(error_message));
-            }
-            InvalidModes::Warn => {
-                show_error!("{}", error_message);
-            }
-            InvalidModes::Ignore => {}
-        };
-        println!("{}", input_line);
-    }
-
-    Ok(())
-}
-
-fn parse_unit(s: &str) -> Result<Unit> {
-    match s {
-        "auto" => Ok(Unit::Auto),
-        "si" => Ok(Unit::Si),
-        "iec" => Ok(Unit::Iec(false)),
-        "iec-i" => Ok(Unit::Iec(true)),
-        "none" => Ok(Unit::None),
-        _ => Err("Unsupported unit is specified".to_owned()),
-    }
-}
-
-// Parses a unit size. Suffixes are turned into their integer representations. For example, 'K'
-// will return `Ok(1000)`, and '2K' will return `Ok(2000)`.
-fn parse_unit_size(s: &str) -> Result<usize> {
-    let number: String = s.chars().take_while(char::is_ascii_digit).collect();
-    let suffix = &s[number.len()..];
-
-    if number.is_empty() || "0".repeat(number.len()) != number {
-        if let Some(multiplier) = parse_unit_size_suffix(suffix) {
-            if number.is_empty() {
-                return Ok(multiplier);
-            }
-
-            if let Ok(n) = number.parse::<usize>() {
-                return Ok(n * multiplier);
-            }
-        }
-    }
-
-    Err(format!("invalid unit size: {}", s.quote()))
-}
-
-// Parses a suffix of a unit size and returns the corresponding multiplier. For example,
-// the suffix 'K' will return `Some(1000)`, and 'Ki' will return `Some(1024)`.
-//
-// If the suffix is empty, `Some(1)` is returned.
-//
-// If the suffix is unknown, `None` is returned.
-fn parse_unit_size_suffix(s: &str) -> Option<usize> {
-    if s.is_empty() {
-        return Some(1);
-    }
-
-    let suffix = s.chars().next().unwrap();
-
-    if let Some(i) = ['K', 'M', 'G', 'T', 'P', 'E']
-        .iter()
-        .position(|&ch| ch == suffix)
-    {
-        return match s.len() {
-            1 => Some(SI_BASES[i + 1] as usize),
-            2 if s.ends_with('i') => Some(IEC_BASES[i + 1] as usize),
-            _ => None,
-        };
-    }
-
-    None
-}
-
-fn parse_options(args: &ArgMatches) -> Result<NumfmtOptions> {
-    let from = parse_unit(args.get_one::<String>(options::FROM).unwrap())?;
-    let to = parse_unit(args.get_one::<String>(options::TO).unwrap())?;
-    let from_unit = parse_unit_size(args.get_one::<String>(options::FROM_UNIT).unwrap())?;
-    let to_unit = parse_unit_size(args.get_one::<String>(options::TO_UNIT).unwrap())?;
-
-    let transform = TransformOptions {
-        from,
-        from_unit,
-        to,
-        to_unit,
-    };
-
-    let padding = match args.get_one::<String>(options::PADDING) {
-        Some(s) => s
-            .parse::<isize>()
-            .map_err(|_| s)
-            .and_then(|n| match n {
-                0 => Err(s),
-                _ => Ok(n),
-            })
-            .map_err(|s| format!("invalid padding value {}", s.quote())),
-        None => Ok(0),
-    }?;
-
-    let header = if args.value_source(options::HEADER) == Some(ValueSource::CommandLine) {
-        let value = args.get_one::<String>(options::HEADER).unwrap();
-
-        value
-            .parse::<usize>()
-            .map_err(|_| value)
-            .and_then(|n| match n {
-                0 => Err(value),
-                _ => Ok(n),
-            })
-            .map_err(|value| format!("invalid header value {}", value.quote()))
-    } else {
-        Ok(0)
-    }?;
-
-    let fields = args.get_one::<String>(options::FIELD).unwrap().as_str();
-    // a lone "-" means "all fields", even as part of a list of fields
-    let fields = if fields.split(&[',', ' ']).any(|x| x == "-") {
-        vec![Range {
-            low: 1,
-            high: std::usize::MAX,
-        }]
-    } else {
-        Range::from_list(fields)?
-    };
-
-    let format = match args.get_one::<String>(options::FORMAT) {
-        Some(s) => s.parse()?,
-        None => FormatOptions::default(),
-    };
-
-    if format.grouping && to != Unit::None {
-        return Err("grouping cannot be combined with --to".to_string());
-    }
-
-    let delimiter = args
-        .get_one::<String>(options::DELIMITER)
-        .map_or(Ok(None), |arg| {
-            if arg.len() == 1 {
-                Ok(Some(arg.to_string()))
-            } else {
-                Err("the delimiter must be a single character".to_string())
-            }
-        })?;
-
-    // unwrap is fine because the argument has a default value
-    let round = match args.get_one::<String>(options::ROUND).unwrap().as_str() {
-        "up" => RoundMethod::Up,
-        "down" => RoundMethod::Down,
-        "from-zero" => RoundMethod::FromZero,
-        "towards-zero" => RoundMethod::TowardsZero,
-        "nearest" => RoundMethod::Nearest,
-        _ => unreachable!("Should be restricted by clap"),
-    };
-
-    let suffix = args
-        .get_one::<String>(options::SUFFIX)
-        .map(|s| s.to_owned());
-
-    let invalid =
-        InvalidModes::from_str(args.get_one::<String>(options::INVALID).unwrap()).unwrap();
-
-    Ok(NumfmtOptions {
-        transform,
-        padding,
-        header,
-        fields,
-        delimiter,
-        round,
-        suffix,
-        format,
-        invalid,
-    })
-}
-
-// If the --format argument and its value are provided separately, they are concatenated to avoid a
-// potential clap error. For example: "--format --%f--" is changed to "--format=--%f--".
-fn concat_format_arg_and_value(args: &[String]) -> Vec<String> {
-    let mut processed_args: Vec<String> = Vec::with_capacity(args.len());
-    let mut iter = args.iter().peekable();
-
-    while let Some(arg) = iter.next() {
-        if arg == "--format" && iter.peek().is_some() {
-            processed_args.push(format!("--format={}", iter.peek().unwrap()));
-            iter.next();
-        } else {
-            processed_args.push(arg.to_string());
-        }
-    }
-
-    processed_args
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(concat_format_arg_and_value(&args))?;
-
-    let options = parse_options(&matches).map_err(NumfmtError::IllegalArgument)?;
-
-    let result = match matches.get_many::<String>(options::NUMBER) {
-        Some(values) => handle_args(values.map(|s| s.as_str()), &options),
-        None => {
-            let stdin = std::io::stdin();
-            let mut locked_stdin = stdin.lock();
-            handle_buffer(&mut locked_stdin, &options)
-        }
-    };
-
-    match result {
-        Err(e) => {
-            std::io::stdout().flush().expect("error flushing stdout");
-            Err(e)
-        }
-        _ => Ok(()),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .allow_negative_numbers(true)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::DELIMITER)
-                .short('d')
-                .long(options::DELIMITER)
-                .value_name("X")
-                .help("use X instead of whitespace for field delimiter"),
-        )
-        .arg(
-            Arg::new(options::FIELD)
-                .long(options::FIELD)
-                .help("replace the numbers in these input fields; see FIELDS below")
-                .value_name("FIELDS")
-                .allow_hyphen_values(true)
-                .default_value(options::FIELD_DEFAULT),
-        )
-        .arg(
-            Arg::new(options::FORMAT)
-                .long(options::FORMAT)
-                .help("use printf style floating-point FORMAT; see FORMAT below for details")
-                .value_name("FORMAT"),
-        )
-        .arg(
-            Arg::new(options::FROM)
-                .long(options::FROM)
-                .help("auto-scale input numbers to UNITs; see UNIT below")
-                .value_name("UNIT")
-                .default_value(options::FROM_DEFAULT),
-        )
-        .arg(
-            Arg::new(options::FROM_UNIT)
-                .long(options::FROM_UNIT)
-                .help("specify the input unit size")
-                .value_name("N")
-                .default_value(options::FROM_UNIT_DEFAULT),
-        )
-        .arg(
-            Arg::new(options::TO)
-                .long(options::TO)
-                .help("auto-scale output numbers to UNITs; see UNIT below")
-                .value_name("UNIT")
-                .default_value(options::TO_DEFAULT),
-        )
-        .arg(
-            Arg::new(options::TO_UNIT)
-                .long(options::TO_UNIT)
-                .help("the output unit size")
-                .value_name("N")
-                .default_value(options::TO_UNIT_DEFAULT),
-        )
-        .arg(
-            Arg::new(options::PADDING)
-                .long(options::PADDING)
-                .help(
-                    "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",
-                )
-                .value_name("N"),
-        )
-        .arg(
-            Arg::new(options::HEADER)
-                .long(options::HEADER)
-                .help(
-                    "print (without converting) the first N header lines; \
-                     N defaults to 1 if not specified",
-                )
-                .num_args(..=1)
-                .value_name("N")
-                .default_missing_value(options::HEADER_DEFAULT)
-                .hide_default_value(true),
-        )
-        .arg(
-            Arg::new(options::ROUND)
-                .long(options::ROUND)
-                .help("use METHOD for rounding when scaling")
-                .value_name("METHOD")
-                .default_value("from-zero")
-                .value_parser(["up", "down", "from-zero", "towards-zero", "nearest"]),
-        )
-        .arg(
-            Arg::new(options::SUFFIX)
-                .long(options::SUFFIX)
-                .help(
-                    "print SUFFIX after each formatted number, and accept \
-                    inputs optionally ending with SUFFIX",
-                )
-                .value_name("SUFFIX"),
-        )
-        .arg(
-            Arg::new(options::INVALID)
-                .long(options::INVALID)
-                .help("set the failure mode for invalid input")
-                .default_value("abort")
-                .value_parser(["abort", "fail", "warn", "ignore"])
-                .value_name("INVALID"),
-        )
-        .arg(
-            Arg::new(options::NUMBER)
-                .hide(true)
-                .action(ArgAction::Append),
-        )
-}
-
-#[cfg(test)]
-mod tests {
-    use uucore::error::get_exit_code;
-
-    use super::{
-        handle_args, handle_buffer, parse_unit_size, parse_unit_size_suffix, FormatOptions,
-        InvalidModes, NumfmtOptions, Range, RoundMethod, TransformOptions, Unit,
-    };
-    use std::io::{BufReader, Error, ErrorKind, Read};
-    struct MockBuffer {}
-
-    impl Read for MockBuffer {
-        fn read(&mut self, _: &mut [u8]) -> Result<usize, Error> {
-            Err(Error::new(ErrorKind::BrokenPipe, "broken pipe"))
-        }
-    }
-
-    fn get_valid_options() -> NumfmtOptions {
-        NumfmtOptions {
-            transform: TransformOptions {
-                from: Unit::None,
-                from_unit: 1,
-                to: Unit::None,
-                to_unit: 1,
-            },
-            padding: 10,
-            header: 1,
-            fields: vec![Range { low: 0, high: 1 }],
-            delimiter: None,
-            round: RoundMethod::Nearest,
-            suffix: None,
-            format: FormatOptions::default(),
-            invalid: InvalidModes::Abort,
-        }
-    }
-
-    #[test]
-    fn broken_buffer_returns_io_error() {
-        let mock_buffer = MockBuffer {};
-        let result = handle_buffer(BufReader::new(mock_buffer), &get_valid_options())
-            .expect_err("returned Ok after receiving IO error");
-        let result_debug = format!("{result:?}");
-        let result_display = format!("{result}");
-        assert_eq!(result_debug, "IoError(\"broken pipe\")");
-        assert_eq!(result_display, "broken pipe");
-        assert_eq!(result.code(), 1);
-    }
-
-    #[test]
-    fn broken_buffer_returns_io_error_after_header() {
-        let mock_buffer = MockBuffer {};
-        let mut options = get_valid_options();
-        options.header = 0;
-        let result = handle_buffer(BufReader::new(mock_buffer), &options)
-            .expect_err("returned Ok after receiving IO error");
-        let result_debug = format!("{:?}", result);
-        let result_display = format!("{}", result);
-        assert_eq!(result_debug, "IoError(\"broken pipe\")");
-        assert_eq!(result_display, "broken pipe");
-        assert_eq!(result.code(), 1);
-    }
-
-    #[test]
-    fn non_numeric_returns_formatting_error() {
-        let input_value = b"135\nhello";
-        let result = handle_buffer(BufReader::new(&input_value[..]), &get_valid_options())
-            .expect_err("returned Ok after receiving improperly formatted input");
-        let result_debug = format!("{result:?}");
-        let result_display = format!("{result}");
-        assert_eq!(
-            result_debug,
-            "FormattingError(\"invalid suffix in input: 'hello'\")"
-        );
-        assert_eq!(result_display, "invalid suffix in input: 'hello'");
-        assert_eq!(result.code(), 2);
-    }
-
-    #[test]
-    fn valid_input_returns_ok() {
-        let input_value = b"165\n100\n300\n500";
-        let result = handle_buffer(BufReader::new(&input_value[..]), &get_valid_options());
-        assert!(result.is_ok(), "did not return Ok for valid input");
-    }
-
-    #[test]
-    fn warn_returns_ok_for_invalid_input() {
-        let input_value = b"5\n4Q\n";
-        let mut options = get_valid_options();
-        options.invalid = InvalidModes::Warn;
-        let result = handle_buffer(BufReader::new(&input_value[..]), &options);
-        assert!(result.is_ok(), "did not return Ok for invalid input");
-    }
-
-    #[test]
-    fn ignore_returns_ok_for_invalid_input() {
-        let input_value = b"5\n4Q\n";
-        let mut options = get_valid_options();
-        options.invalid = InvalidModes::Ignore;
-        let result = handle_buffer(BufReader::new(&input_value[..]), &options);
-        assert!(result.is_ok(), "did not return Ok for invalid input");
-    }
-
-    #[test]
-    fn buffer_fail_returns_status_2_for_invalid_input() {
-        let input_value = b"5\n4Q\n";
-        let mut options = get_valid_options();
-        options.invalid = InvalidModes::Fail;
-        handle_buffer(BufReader::new(&input_value[..]), &options).unwrap();
-        assert!(
-            get_exit_code() == 2,
-            "should set exit code 2 for formatting errors"
-        );
-    }
-
-    #[test]
-    fn abort_returns_status_2_for_invalid_input() {
-        let input_value = b"5\n4Q\n";
-        let mut options = get_valid_options();
-        options.invalid = InvalidModes::Abort;
-        let result = handle_buffer(BufReader::new(&input_value[..]), &options);
-        assert!(result.is_err(), "did not return err for invalid input");
-    }
-
-    #[test]
-    fn args_fail_returns_status_2_for_invalid_input() {
-        let input_value = ["5", "4Q"].into_iter();
-        let mut options = get_valid_options();
-        options.invalid = InvalidModes::Fail;
-        handle_args(input_value, &options).unwrap();
-        assert!(
-            get_exit_code() == 2,
-            "should set exit code 2 for formatting errors"
-        );
-    }
-
-    #[test]
-    fn args_warn_returns_status_0_for_invalid_input() {
-        let input_value = ["5", "4Q"].into_iter();
-        let mut options = get_valid_options();
-        options.invalid = InvalidModes::Warn;
-        let result = handle_args(input_value, &options);
-        assert!(result.is_ok(), "did not return ok for invalid input");
-    }
-
-    #[test]
-    fn test_parse_unit_size() {
-        assert_eq!(1, parse_unit_size("1").unwrap());
-        assert_eq!(1, parse_unit_size("01").unwrap());
-        assert!(parse_unit_size("1.1").is_err());
-        assert!(parse_unit_size("0").is_err());
-        assert!(parse_unit_size("-1").is_err());
-        assert!(parse_unit_size("A").is_err());
-        assert!(parse_unit_size("18446744073709551616").is_err());
-    }
-
-    #[test]
-    fn test_parse_unit_size_with_suffix() {
-        assert_eq!(1000, parse_unit_size("K").unwrap());
-        assert_eq!(1024, parse_unit_size("Ki").unwrap());
-        assert_eq!(2000, parse_unit_size("2K").unwrap());
-        assert_eq!(2048, parse_unit_size("2Ki").unwrap());
-        assert!(parse_unit_size("0K").is_err());
-    }
-
-    #[test]
-    fn test_parse_unit_size_suffix() {
-        assert_eq!(1, parse_unit_size_suffix("").unwrap());
-        assert_eq!(1000, parse_unit_size_suffix("K").unwrap());
-        assert_eq!(1024, parse_unit_size_suffix("Ki").unwrap());
-        assert_eq!(1000 * 1000, parse_unit_size_suffix("M").unwrap());
-        assert_eq!(1024 * 1024, parse_unit_size_suffix("Mi").unwrap());
-        assert!(parse_unit_size_suffix("Kii").is_none());
-        assert!(parse_unit_size_suffix("A").is_none());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_numfmt/options.rs.html b/coreutils/dev/src/uu_numfmt/options.rs.html deleted file mode 100644 index 9012ab829..000000000 --- a/coreutils/dev/src/uu_numfmt/options.rs.html +++ /dev/null @@ -1,761 +0,0 @@ -options.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-
use std::str::FromStr;
-
-use crate::units::Unit;
-use uucore::ranges::Range;
-
-pub const DELIMITER: &str = "delimiter";
-pub const FIELD: &str = "field";
-pub const FIELD_DEFAULT: &str = "1";
-pub const FORMAT: &str = "format";
-pub const FROM: &str = "from";
-pub const FROM_DEFAULT: &str = "none";
-pub const FROM_UNIT: &str = "from-unit";
-pub const FROM_UNIT_DEFAULT: &str = "1";
-pub const HEADER: &str = "header";
-pub const HEADER_DEFAULT: &str = "1";
-pub const INVALID: &str = "invalid";
-pub const NUMBER: &str = "NUMBER";
-pub const PADDING: &str = "padding";
-pub const ROUND: &str = "round";
-pub const SUFFIX: &str = "suffix";
-pub const TO: &str = "to";
-pub const TO_DEFAULT: &str = "none";
-pub const TO_UNIT: &str = "to-unit";
-pub const TO_UNIT_DEFAULT: &str = "1";
-
-pub struct TransformOptions {
-    pub from: Unit,
-    pub from_unit: usize,
-    pub to: Unit,
-    pub to_unit: usize,
-}
-
-#[derive(Debug, PartialEq, Eq)]
-pub enum InvalidModes {
-    Abort,
-    Fail,
-    Warn,
-    Ignore,
-}
-
-pub struct NumfmtOptions {
-    pub transform: TransformOptions,
-    pub padding: isize,
-    pub header: usize,
-    pub fields: Vec<Range>,
-    pub delimiter: Option<String>,
-    pub round: RoundMethod,
-    pub suffix: Option<String>,
-    pub format: FormatOptions,
-    pub invalid: InvalidModes,
-}
-
-#[derive(Clone, Copy)]
-pub enum RoundMethod {
-    Up,
-    Down,
-    FromZero,
-    TowardsZero,
-    Nearest,
-}
-
-impl RoundMethod {
-    pub fn round(&self, f: f64) -> f64 {
-        match self {
-            Self::Up => f.ceil(),
-            Self::Down => f.floor(),
-            Self::FromZero => {
-                if f < 0.0 {
-                    f.floor()
-                } else {
-                    f.ceil()
-                }
-            }
-            Self::TowardsZero => {
-                if f < 0.0 {
-                    f.ceil()
-                } else {
-                    f.floor()
-                }
-            }
-            Self::Nearest => f.round(),
-        }
-    }
-}
-
-// Represents the options extracted from the --format argument provided by the user.
-#[derive(Debug, Default, PartialEq, Eq)]
-pub struct FormatOptions {
-    pub grouping: bool,
-    pub padding: Option<isize>,
-    pub precision: Option<usize>,
-    pub prefix: String,
-    pub suffix: String,
-    pub zero_padding: bool,
-}
-
-impl FromStr for FormatOptions {
-    type Err = String;
-
-    // The recognized format is: [PREFIX]%[0]['][-][N][.][N]f[SUFFIX]
-    //
-    // The format defines the printing of a floating point argument '%f'.
-    // An optional quote (%'f) enables --grouping.
-    // An optional width value (%10f) will pad the number.
-    // An optional zero (%010f) will zero pad the number.
-    // An optional negative value (%-10f) will left align.
-    // An optional precision (%.1f) determines the precision of the number.
-    #[allow(clippy::cognitive_complexity)]
-    fn from_str(s: &str) -> Result<Self, Self::Err> {
-        let mut iter = s.chars().peekable();
-        let mut options = Self::default();
-
-        let mut padding = String::new();
-        let mut precision = String::new();
-        let mut double_percentage_counter = 0;
-
-        // '%' chars in the prefix, if any, must appear in blocks of even length, for example: "%%%%" and
-        // "%% %%" are ok, "%%% %" is not ok. A single '%' is treated as the beginning of the
-        // floating point argument.
-        while let Some(c) = iter.next() {
-            match c {
-                '%' if iter.peek() == Some(&'%') => {
-                    iter.next();
-                    double_percentage_counter += 1;
-
-                    for _ in 0..2 {
-                        options.prefix.push('%');
-                    }
-                }
-                '%' => break,
-                _ => options.prefix.push(c),
-            }
-        }
-
-        // GNU numfmt drops a char from the prefix for every '%%' in the prefix, so we do the same
-        for _ in 0..double_percentage_counter {
-            options.prefix.pop();
-        }
-
-        if iter.peek().is_none() {
-            return if options.prefix == s {
-                Err(format!("format '{s}' has no % directive"))
-            } else {
-                Err(format!("format '{s}' ends in %"))
-            };
-        }
-
-        // GNU numfmt allows to mix the characters " ", "'", and "0" in any way, so we do the same
-        while matches!(iter.peek(), Some(' ' | '\'' | '0')) {
-            match iter.next().unwrap() {
-                ' ' => (),
-                '\'' => options.grouping = true,
-                '0' => options.zero_padding = true,
-                _ => unreachable!(),
-            }
-        }
-
-        if let Some('-') = iter.peek() {
-            iter.next();
-
-            match iter.peek() {
-                Some(c) if c.is_ascii_digit() => padding.push('-'),
-                _ => {
-                    return Err(format!(
-                        "invalid format '{s}', directive must be %[0]['][-][N][.][N]f"
-                    ))
-                }
-            }
-        }
-
-        while let Some(c) = iter.peek() {
-            if c.is_ascii_digit() {
-                padding.push(*c);
-                iter.next();
-            } else {
-                break;
-            }
-        }
-
-        if !padding.is_empty() {
-            if let Ok(p) = padding.parse() {
-                options.padding = Some(p);
-            } else {
-                return Err(format!("invalid format '{s}' (width overflow)"));
-            }
-        }
-
-        if let Some('.') = iter.peek() {
-            iter.next();
-
-            if matches!(iter.peek(), Some(' ' | '+' | '-')) {
-                return Err(format!("invalid precision in format '{s}'"));
-            }
-
-            while let Some(c) = iter.peek() {
-                if c.is_ascii_digit() {
-                    precision.push(*c);
-                    iter.next();
-                } else {
-                    break;
-                }
-            }
-
-            if precision.is_empty() {
-                options.precision = Some(0);
-            } else if let Ok(p) = precision.parse() {
-                options.precision = Some(p);
-            } else {
-                return Err(format!("invalid precision in format '{s}'"));
-            }
-        }
-
-        if let Some('f') = iter.peek() {
-            iter.next();
-        } else {
-            return Err(format!(
-                "invalid format '{s}', directive must be %[0]['][-][N][.][N]f"
-            ));
-        }
-
-        // '%' chars in the suffix, if any, must appear in blocks of even length, otherwise
-        // it is an error. For example: "%%%%" and "%% %%" are ok, "%%% %" is not ok.
-        while let Some(c) = iter.next() {
-            if c != '%' {
-                options.suffix.push(c);
-            } else if iter.peek() == Some(&'%') {
-                for _ in 0..2 {
-                    options.suffix.push('%');
-                }
-                iter.next();
-            } else {
-                return Err(format!("format '{s}' has too many % directives"));
-            }
-        }
-
-        Ok(options)
-    }
-}
-
-impl FromStr for InvalidModes {
-    type Err = String;
-
-    fn from_str(s: &str) -> Result<Self, Self::Err> {
-        match s.to_lowercase().as_str() {
-            "abort" => Ok(Self::Abort),
-            "fail" => Ok(Self::Fail),
-            "warn" => Ok(Self::Warn),
-            "ignore" => Ok(Self::Ignore),
-            unknown => Err(format!("Unknown invalid mode: {unknown}")),
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    fn test_parse_format() {
-        assert_eq!(FormatOptions::default(), "%f".parse().unwrap());
-        assert_eq!(FormatOptions::default(), "%  f".parse().unwrap());
-    }
-
-    #[test]
-    fn test_parse_format_with_invalid_formats() {
-        assert!("".parse::<FormatOptions>().is_err());
-        assert!("hello".parse::<FormatOptions>().is_err());
-        assert!("hello%".parse::<FormatOptions>().is_err());
-        assert!("%-f".parse::<FormatOptions>().is_err());
-        assert!("%d".parse::<FormatOptions>().is_err());
-        assert!("%4 f".parse::<FormatOptions>().is_err());
-        assert!("%f%".parse::<FormatOptions>().is_err());
-        assert!("%f%%%".parse::<FormatOptions>().is_err());
-        assert!("%%f".parse::<FormatOptions>().is_err());
-        assert!("%%%%f".parse::<FormatOptions>().is_err());
-        assert!("%.-1f".parse::<FormatOptions>().is_err());
-        assert!("%. 1f".parse::<FormatOptions>().is_err());
-        assert!("%18446744073709551616f".parse::<FormatOptions>().is_err());
-        assert!("%.18446744073709551616f".parse::<FormatOptions>().is_err());
-    }
-
-    #[test]
-    fn test_parse_format_with_prefix_and_suffix() {
-        let formats = vec![
-            ("--%f", "--", ""),
-            ("%f::", "", "::"),
-            ("--%f::", "--", "::"),
-            ("%f%%", "", "%%"),
-            ("%%%f", "%", ""),
-            ("%% %f", "%%", ""),
-        ];
-
-        for (format, expected_prefix, expected_suffix) in formats {
-            let options: FormatOptions = format.parse().unwrap();
-            assert_eq!(expected_prefix, options.prefix);
-            assert_eq!(expected_suffix, options.suffix);
-        }
-    }
-
-    #[test]
-    fn test_parse_format_with_padding() {
-        let mut expected_options = FormatOptions::default();
-        let formats = vec![("%12f", Some(12)), ("%-12f", Some(-12))];
-
-        for (format, expected_padding) in formats {
-            expected_options.padding = expected_padding;
-            assert_eq!(expected_options, format.parse().unwrap());
-        }
-    }
-
-    #[test]
-    fn test_parse_format_with_precision() {
-        let mut expected_options = FormatOptions::default();
-        let formats = vec![
-            ("%6.2f", Some(6), Some(2)),
-            ("%6.f", Some(6), Some(0)),
-            ("%.2f", None, Some(2)),
-            ("%.f", None, Some(0)),
-        ];
-
-        for (format, expected_padding, expected_precision) in formats {
-            expected_options.padding = expected_padding;
-            expected_options.precision = expected_precision;
-            assert_eq!(expected_options, format.parse().unwrap());
-        }
-    }
-
-    #[test]
-    fn test_parse_format_with_grouping() {
-        let expected_options = FormatOptions {
-            grouping: true,
-            ..Default::default()
-        };
-        assert_eq!(expected_options, "%'f".parse().unwrap());
-        assert_eq!(expected_options, "% ' f".parse().unwrap());
-        assert_eq!(expected_options, "%'''''''f".parse().unwrap());
-    }
-
-    #[test]
-    fn test_parse_format_with_zero_padding() {
-        let expected_options = FormatOptions {
-            padding: Some(10),
-            zero_padding: true,
-            ..Default::default()
-        };
-        assert_eq!(expected_options, "%010f".parse().unwrap());
-        assert_eq!(expected_options, "% 0 10f".parse().unwrap());
-        assert_eq!(expected_options, "%0000000010f".parse().unwrap());
-    }
-
-    #[test]
-    fn test_parse_format_with_grouping_and_zero_padding() {
-        let expected_options = FormatOptions {
-            grouping: true,
-            zero_padding: true,
-            ..Default::default()
-        };
-        assert_eq!(expected_options, "%0'f".parse().unwrap());
-        assert_eq!(expected_options, "%'0f".parse().unwrap());
-        assert_eq!(expected_options, "%0'0'0'f".parse().unwrap());
-        assert_eq!(expected_options, "%'0'0'0f".parse().unwrap());
-    }
-
-    #[test]
-    fn test_set_invalid_mode() {
-        assert_eq!(Ok(InvalidModes::Abort), InvalidModes::from_str("abort"));
-        assert_eq!(Ok(InvalidModes::Abort), InvalidModes::from_str("ABORT"));
-
-        assert_eq!(Ok(InvalidModes::Fail), InvalidModes::from_str("fail"));
-        assert_eq!(Ok(InvalidModes::Fail), InvalidModes::from_str("FAIL"));
-
-        assert_eq!(Ok(InvalidModes::Ignore), InvalidModes::from_str("ignore"));
-        assert_eq!(Ok(InvalidModes::Ignore), InvalidModes::from_str("IGNORE"));
-
-        assert_eq!(Ok(InvalidModes::Warn), InvalidModes::from_str("warn"));
-        assert_eq!(Ok(InvalidModes::Warn), InvalidModes::from_str("WARN"));
-
-        assert!(InvalidModes::from_str("something unknown").is_err());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_numfmt/units.rs.html b/coreutils/dev/src/uu_numfmt/units.rs.html deleted file mode 100644 index c8903e233..000000000 --- a/coreutils/dev/src/uu_numfmt/units.rs.html +++ /dev/null @@ -1,129 +0,0 @@ -units.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-
use std::fmt;
-
-pub const SI_BASES: [f64; 10] = [1., 1e3, 1e6, 1e9, 1e12, 1e15, 1e18, 1e21, 1e24, 1e27];
-
-pub const IEC_BASES: [f64; 10] = [
-    1.,
-    1_024.,
-    1_048_576.,
-    1_073_741_824.,
-    1_099_511_627_776.,
-    1_125_899_906_842_624.,
-    1_152_921_504_606_846_976.,
-    1_180_591_620_717_411_303_424.,
-    1_208_925_819_614_629_174_706_176.,
-    1_237_940_039_285_380_274_899_124_224.,
-];
-
-pub type WithI = bool;
-
-#[derive(Clone, Copy, PartialEq, Eq)]
-pub enum Unit {
-    Auto,
-    Si,
-    Iec(WithI),
-    None,
-}
-
-pub type Result<T> = std::result::Result<T, String>;
-
-#[derive(Clone, Copy, Debug)]
-pub enum RawSuffix {
-    K,
-    M,
-    G,
-    T,
-    P,
-    E,
-    Z,
-    Y,
-}
-
-pub type Suffix = (RawSuffix, WithI);
-
-pub struct DisplayableSuffix(pub Suffix);
-
-impl fmt::Display for DisplayableSuffix {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        let Self((ref raw_suffix, ref with_i)) = *self;
-        match raw_suffix {
-            RawSuffix::K => write!(f, "K"),
-            RawSuffix::M => write!(f, "M"),
-            RawSuffix::G => write!(f, "G"),
-            RawSuffix::T => write!(f, "T"),
-            RawSuffix::P => write!(f, "P"),
-            RawSuffix::E => write!(f, "E"),
-            RawSuffix::Z => write!(f, "Z"),
-            RawSuffix::Y => write!(f, "Y"),
-        }
-        .and_then(|()| match with_i {
-            true => write!(f, "i"),
-            false => Ok(()),
-        })
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/byteorder_io.rs.html b/coreutils/dev/src/uu_od/byteorder_io.rs.html deleted file mode 100644 index 283240461..000000000 --- a/coreutils/dev/src/uu_od/byteorder_io.rs.html +++ /dev/null @@ -1,105 +0,0 @@ -byteorder_io.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-
// spell-checker:ignore (ToDO) byteorder
-
-// workaround until https://github.com/BurntSushi/byteorder/issues/41 has been fixed
-// based on: https://github.com/netvl/immeta/blob/4460ee/src/utils.rs#L76
-
-use byteorder::ByteOrder as ByteOrderTrait;
-use byteorder::{BigEndian, LittleEndian, NativeEndian};
-
-#[derive(Copy, Clone, Debug, Eq, PartialEq)]
-pub enum ByteOrder {
-    Little,
-    Big,
-    Native,
-}
-
-macro_rules! gen_byte_order_ops {
-    ($($read_name:ident, $write_name:ident -> $tpe:ty),+) => {
-        impl ByteOrder {
-            $(
-            #[allow(dead_code)]
-            #[inline]
-            pub fn $read_name(self, source: &[u8]) -> $tpe {
-                match self {
-                    ByteOrder::Little => LittleEndian::$read_name(source),
-                    ByteOrder::Big => BigEndian::$read_name(source),
-                    ByteOrder::Native => NativeEndian::$read_name(source),
-                }
-            }
-
-            #[allow(dead_code)]
-            pub fn $write_name(self, target: &mut [u8], n: $tpe) {
-                match self {
-                    ByteOrder::Little => LittleEndian::$write_name(target, n),
-                    ByteOrder::Big => BigEndian::$write_name(target, n),
-                    ByteOrder::Native => NativeEndian::$write_name(target, n),
-                }
-            }
-            )+
-        }
-    }
-}
-
-gen_byte_order_ops! {
-    read_u16, write_u16 -> u16,
-    read_u32, write_u32 -> u32,
-    read_u64, write_u64 -> u64,
-    read_i16, write_i16 -> i16,
-    read_i32, write_i32 -> i32,
-    read_i64, write_i64 -> i64,
-    read_f32, write_f32 -> f32,
-    read_f64, write_f64 -> f64
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/formatteriteminfo.rs.html b/coreutils/dev/src/uu_od/formatteriteminfo.rs.html deleted file mode 100644 index 2b23abfe9..000000000 --- a/coreutils/dev/src/uu_od/formatteriteminfo.rs.html +++ /dev/null @@ -1,119 +0,0 @@ -formatteriteminfo.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-
// spell-checker:ignore (ToDO) formatteriteminfo
-
-use std::fmt;
-
-#[allow(clippy::enum_variant_names)]
-#[derive(Copy)]
-pub enum FormatWriter {
-    IntWriter(fn(u64) -> String),
-    FloatWriter(fn(f64) -> String),
-    MultibyteWriter(fn(&[u8]) -> String),
-}
-
-impl Clone for FormatWriter {
-    #[inline]
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-
-impl PartialEq for FormatWriter {
-    fn eq(&self, other: &Self) -> bool {
-        use crate::formatteriteminfo::FormatWriter::*;
-
-        match (self, other) {
-            (IntWriter(a), IntWriter(b)) => a == b,
-            (FloatWriter(a), FloatWriter(b)) => a == b,
-            (MultibyteWriter(a), MultibyteWriter(b)) => *a as usize == *b as usize,
-            _ => false,
-        }
-    }
-}
-
-impl Eq for FormatWriter {}
-
-impl fmt::Debug for FormatWriter {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match *self {
-            Self::IntWriter(ref p) => {
-                f.write_str("IntWriter:")?;
-                fmt::Pointer::fmt(p, f)
-            }
-            Self::FloatWriter(ref p) => {
-                f.write_str("FloatWriter:")?;
-                fmt::Pointer::fmt(p, f)
-            }
-            Self::MultibyteWriter(ref p) => {
-                f.write_str("MultibyteWriter:")?;
-                fmt::Pointer::fmt(&(*p as *const ()), f)
-            }
-        }
-    }
-}
-
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
-pub struct FormatterItemInfo {
-    pub byte_size: usize,
-    pub print_width: usize, // including a space in front of the text
-    pub formatter: FormatWriter,
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/inputdecoder.rs.html b/coreutils/dev/src/uu_od/inputdecoder.rs.html deleted file mode 100644 index 2eb4803bb..000000000 --- a/coreutils/dev/src/uu_od/inputdecoder.rs.html +++ /dev/null @@ -1,393 +0,0 @@ -inputdecoder.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-
use half::f16;
-use std::io;
-
-use crate::byteorder_io::ByteOrder;
-use crate::multifilereader::HasError;
-use crate::peekreader::PeekRead;
-
-/// Processes an input and provides access to the data read in various formats
-///
-/// Currently only useful if the input implements `PeekRead`.
-pub struct InputDecoder<'a, I>
-where
-    I: 'a,
-{
-    /// The input from which data is read
-    input: &'a mut I,
-
-    /// A memory buffer, it's size is set in `new`.
-    data: Vec<u8>,
-    /// The number of bytes in the buffer reserved for the peek data from `PeekRead`.
-    reserved_peek_length: usize,
-
-    /// The number of (valid) bytes in the buffer.
-    used_normal_length: usize,
-    /// The number of peek bytes in the buffer.
-    used_peek_length: usize,
-
-    /// Byte order used to read data from the buffer.
-    byte_order: ByteOrder,
-}
-
-impl<'a, I> InputDecoder<'a, I> {
-    /// Creates a new `InputDecoder` with an allocated buffer of `normal_length` + `peek_length` bytes.
-    /// `byte_order` determines how to read multibyte formats from the buffer.
-    pub fn new(
-        input: &mut I,
-        normal_length: usize,
-        peek_length: usize,
-        byte_order: ByteOrder,
-    ) -> InputDecoder<I> {
-        let bytes = vec![0; normal_length + peek_length];
-
-        InputDecoder {
-            input,
-            data: bytes,
-            reserved_peek_length: peek_length,
-            used_normal_length: 0,
-            used_peek_length: 0,
-            byte_order,
-        }
-    }
-}
-
-impl<'a, I> InputDecoder<'a, I>
-where
-    I: PeekRead,
-{
-    /// calls `peek_read` on the internal stream to (re)fill the buffer. Returns a
-    /// `MemoryDecoder` providing access to the result or returns an i/o error.
-    pub fn peek_read(&mut self) -> io::Result<MemoryDecoder> {
-        match self
-            .input
-            .peek_read(self.data.as_mut_slice(), self.reserved_peek_length)
-        {
-            Ok((n, p)) => {
-                self.used_normal_length = n;
-                self.used_peek_length = p;
-                Ok(MemoryDecoder {
-                    data: &mut self.data,
-                    used_normal_length: self.used_normal_length,
-                    used_peek_length: self.used_peek_length,
-                    byte_order: self.byte_order,
-                })
-            }
-            Err(e) => Err(e),
-        }
-    }
-}
-
-impl<'a, I> HasError for InputDecoder<'a, I>
-where
-    I: HasError,
-{
-    /// calls `has_error` on the internal stream.
-    fn has_error(&self) -> bool {
-        self.input.has_error()
-    }
-}
-
-/// Provides access to the internal data in various formats
-pub struct MemoryDecoder<'a> {
-    /// A reference to the parents' data
-    data: &'a mut Vec<u8>,
-    /// The number of (valid) bytes in the buffer.
-    used_normal_length: usize,
-    /// The number of peek bytes in the buffer.
-    used_peek_length: usize,
-    /// Byte order used to read data from the buffer.
-    byte_order: ByteOrder,
-}
-
-impl<'a> MemoryDecoder<'a> {
-    /// Set a part of the internal buffer to zero.
-    /// access to the whole buffer is possible, not just to the valid data.
-    pub fn zero_out_buffer(&mut self, start: usize, end: usize) {
-        for i in start..end {
-            self.data[i] = 0;
-        }
-    }
-
-    /// Returns the current length of the buffer. (ie. how much valid data it contains.)
-    pub fn length(&self) -> usize {
-        self.used_normal_length
-    }
-
-    /// Creates a clone of the internal buffer. The clone only contain the valid data.
-    pub fn clone_buffer(&self, other: &mut Vec<u8>) {
-        other.clone_from(self.data);
-        other.resize(self.used_normal_length, 0);
-    }
-
-    /// Returns a slice to the internal buffer starting at `start`.
-    pub fn get_buffer(&self, start: usize) -> &[u8] {
-        &self.data[start..self.used_normal_length]
-    }
-
-    /// Returns a slice to the internal buffer including the peek data starting at `start`.
-    pub fn get_full_buffer(&self, start: usize) -> &[u8] {
-        &self.data[start..self.used_normal_length + self.used_peek_length]
-    }
-
-    /// Returns a u8/u16/u32/u64 from the internal buffer at position `start`.
-    pub fn read_uint(&self, start: usize, byte_size: usize) -> u64 {
-        match byte_size {
-            1 => u64::from(self.data[start]),
-            2 => u64::from(self.byte_order.read_u16(&self.data[start..start + 2])),
-            4 => u64::from(self.byte_order.read_u32(&self.data[start..start + 4])),
-            8 => self.byte_order.read_u64(&self.data[start..start + 8]),
-            _ => panic!("Invalid byte_size: {byte_size}"),
-        }
-    }
-
-    /// Returns a f32/f64 from the internal buffer at position `start`.
-    pub fn read_float(&self, start: usize, byte_size: usize) -> f64 {
-        match byte_size {
-            2 => f64::from(f16::from_bits(
-                self.byte_order.read_u16(&self.data[start..start + 2]),
-            )),
-            4 => f64::from(self.byte_order.read_f32(&self.data[start..start + 4])),
-            8 => self.byte_order.read_f64(&self.data[start..start + 8]),
-            _ => panic!("Invalid byte_size: {byte_size}"),
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use crate::byteorder_io::ByteOrder;
-    use crate::peekreader::PeekReader;
-    use std::io::Cursor;
-
-    #[test]
-    #[allow(clippy::float_cmp)]
-    fn smoke_test() {
-        let data = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xff, 0xff];
-        let mut input = PeekReader::new(Cursor::new(&data));
-        let mut sut = InputDecoder::new(&mut input, 8, 2, ByteOrder::Little);
-
-        // Peek normal length
-        let mut mem = sut.peek_read().unwrap();
-
-        assert_eq!(8, mem.length());
-
-        assert_eq!(-2.0, mem.read_float(0, 8));
-        assert_eq!(-2.0, mem.read_float(4, 4));
-        assert_eq!(0xc000000000000000, mem.read_uint(0, 8));
-        assert_eq!(0xc0000000, mem.read_uint(4, 4));
-        assert_eq!(0xc000, mem.read_uint(6, 2));
-        assert_eq!(0xc0, mem.read_uint(7, 1));
-        assert_eq!(&[0, 0xc0], mem.get_buffer(6));
-        assert_eq!(&[0, 0xc0, 0xff, 0xff], mem.get_full_buffer(6));
-
-        let mut copy: Vec<u8> = Vec::new();
-        mem.clone_buffer(&mut copy);
-        assert_eq!(vec![0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0], copy);
-
-        mem.zero_out_buffer(7, 8);
-        assert_eq!(&[0, 0, 0xff, 0xff], mem.get_full_buffer(6));
-
-        // Peek tail
-        let mem = sut.peek_read().unwrap();
-        assert_eq!(2, mem.length());
-        assert_eq!(0xffff, mem.read_uint(0, 2));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/inputoffset.rs.html b/coreutils/dev/src/uu_od/inputoffset.rs.html deleted file mode 100644 index a071ab7c8..000000000 --- a/coreutils/dev/src/uu_od/inputoffset.rs.html +++ /dev/null @@ -1,229 +0,0 @@ -inputoffset.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
-pub enum Radix {
-    Decimal,
-    Hexadecimal,
-    Octal,
-    NoPrefix,
-}
-
-/// provides the byte offset printed at the left margin
-pub struct InputOffset {
-    /// The radix to print the byte offset. NoPrefix will not print a byte offset.
-    radix: Radix,
-    /// The current position. Initialize at `new`, increase using `increase_position`.
-    byte_pos: u64,
-    /// An optional label printed in parentheses, typically different from `byte_pos`,
-    /// but will increase with the same value if `byte_pos` in increased.
-    label: Option<u64>,
-}
-
-impl InputOffset {
-    /// creates a new `InputOffset` using the provided values.
-    pub fn new(radix: Radix, byte_pos: u64, label: Option<u64>) -> Self {
-        Self {
-            radix,
-            byte_pos,
-            label,
-        }
-    }
-
-    /// Increase `byte_pos` and `label` if a label is used.
-    pub fn increase_position(&mut self, n: u64) {
-        self.byte_pos += n;
-        if let Some(l) = self.label {
-            self.label = Some(l + n);
-        }
-    }
-
-    #[cfg(test)]
-    fn set_radix(&mut self, radix: Radix) {
-        self.radix = radix;
-    }
-
-    /// returns a string with the current byte offset
-    pub fn format_byte_offset(&self) -> String {
-        match (self.radix, self.label) {
-            (Radix::Decimal, None) => format!("{:07}", self.byte_pos),
-            (Radix::Decimal, Some(l)) => format!("{:07} ({:07})", self.byte_pos, l),
-            (Radix::Hexadecimal, None) => format!("{:06X}", self.byte_pos),
-            (Radix::Hexadecimal, Some(l)) => format!("{:06X} ({:06X})", self.byte_pos, l),
-            (Radix::Octal, None) => format!("{:07o}", self.byte_pos),
-            (Radix::Octal, Some(l)) => format!("{:07o} ({:07o})", self.byte_pos, l),
-            (Radix::NoPrefix, None) => String::new(),
-            (Radix::NoPrefix, Some(l)) => format!("({l:07o})"),
-        }
-    }
-
-    /// Prints the byte offset followed by a newline, or nothing at all if
-    /// both `Radix::NoPrefix` was set and no label (--traditional) is used.
-    pub fn print_final_offset(&self) {
-        if self.radix != Radix::NoPrefix || self.label.is_some() {
-            println!("{}", self.format_byte_offset());
-        }
-    }
-}
-
-#[test]
-fn test_input_offset() {
-    let mut sut = InputOffset::new(Radix::Hexadecimal, 10, None);
-    assert_eq!("00000A", &sut.format_byte_offset());
-    sut.increase_position(10);
-    assert_eq!("000014", &sut.format_byte_offset());
-
-    // note normally the radix will not change after initialization
-    sut.set_radix(Radix::Decimal);
-    assert_eq!("0000020", &sut.format_byte_offset());
-
-    sut.set_radix(Radix::Hexadecimal);
-    assert_eq!("000014", &sut.format_byte_offset());
-
-    sut.set_radix(Radix::Octal);
-    assert_eq!("0000024", &sut.format_byte_offset());
-
-    sut.set_radix(Radix::NoPrefix);
-    assert_eq!("", &sut.format_byte_offset());
-
-    sut.increase_position(10);
-    sut.set_radix(Radix::Octal);
-    assert_eq!("0000036", &sut.format_byte_offset());
-}
-
-#[test]
-fn test_input_offset_with_label() {
-    let mut sut = InputOffset::new(Radix::Hexadecimal, 10, Some(20));
-    assert_eq!("00000A (000014)", &sut.format_byte_offset());
-    sut.increase_position(10);
-    assert_eq!("000014 (00001E)", &sut.format_byte_offset());
-
-    // note normally the radix will not change after initialization
-    sut.set_radix(Radix::Decimal);
-    assert_eq!("0000020 (0000030)", &sut.format_byte_offset());
-
-    sut.set_radix(Radix::Hexadecimal);
-    assert_eq!("000014 (00001E)", &sut.format_byte_offset());
-
-    sut.set_radix(Radix::Octal);
-    assert_eq!("0000024 (0000036)", &sut.format_byte_offset());
-
-    sut.set_radix(Radix::NoPrefix);
-    assert_eq!("(0000036)", &sut.format_byte_offset());
-
-    sut.increase_position(10);
-    sut.set_radix(Radix::Octal);
-    assert_eq!("0000036 (0000050)", &sut.format_byte_offset());
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/multifilereader.rs.html b/coreutils/dev/src/uu_od/multifilereader.rs.html deleted file mode 100644 index aa14132b8..000000000 --- a/coreutils/dev/src/uu_od/multifilereader.rs.html +++ /dev/null @@ -1,417 +0,0 @@ -multifilereader.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-
// spell-checker:ignore (ToDO) multifile curr fnames fname xfrd fillloop mockstream
-
-use std::fs::File;
-use std::io;
-use std::io::BufReader;
-use std::vec::Vec;
-
-use uucore::display::Quotable;
-use uucore::show_error;
-
-pub enum InputSource<'a> {
-    FileName(&'a str),
-    Stdin,
-    #[allow(dead_code)]
-    Stream(Box<dyn io::Read>),
-}
-
-// MultifileReader - concatenate all our input, file or stdin.
-pub struct MultifileReader<'a> {
-    ni: Vec<InputSource<'a>>,
-    curr_file: Option<Box<dyn io::Read>>,
-    any_err: bool,
-}
-
-pub trait HasError {
-    fn has_error(&self) -> bool;
-}
-
-impl<'b> MultifileReader<'b> {
-    pub fn new(fnames: Vec<InputSource>) -> MultifileReader {
-        let mut mf = MultifileReader {
-            ni: fnames,
-            curr_file: None, // normally this means done; call next_file()
-            any_err: false,
-        };
-        mf.next_file();
-        mf
-    }
-
-    fn next_file(&mut self) {
-        // loop retries with subsequent files if err - normally 'loops' once
-        loop {
-            if self.ni.is_empty() {
-                self.curr_file = None;
-                break;
-            }
-            match self.ni.remove(0) {
-                InputSource::Stdin => {
-                    self.curr_file = Some(Box::new(BufReader::new(std::io::stdin())));
-                    break;
-                }
-                InputSource::FileName(fname) => {
-                    match File::open(fname) {
-                        Ok(f) => {
-                            self.curr_file = Some(Box::new(BufReader::new(f)));
-                            break;
-                        }
-                        Err(e) => {
-                            // If any file can't be opened,
-                            // print an error at the time that the file is needed,
-                            // then move on the the next file.
-                            // This matches the behavior of the original `od`
-                            show_error!("{}: {}", fname.maybe_quote(), e);
-                            self.any_err = true;
-                        }
-                    }
-                }
-                InputSource::Stream(s) => {
-                    self.curr_file = Some(s);
-                    break;
-                }
-            }
-        }
-    }
-}
-
-impl<'b> io::Read for MultifileReader<'b> {
-    // Fill buf with bytes read from the list of files
-    // Returns Ok(<number of bytes read>)
-    // Handles io errors itself, thus always returns OK
-    // Fills the provided buffer completely, unless it has run out of input.
-    // If any call returns short (< buf.len()), all subsequent calls will return Ok<0>
-    fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
-        let mut xfrd = 0;
-        // while buffer we are filling is not full.. May go through several files.
-        'fillloop: while xfrd < buf.len() {
-            match self.curr_file {
-                None => break,
-                Some(ref mut curr_file) => {
-                    loop {
-                        // stdin may return on 'return' (enter), even though the buffer isn't full.
-                        xfrd += match curr_file.read(&mut buf[xfrd..]) {
-                            Ok(0) => break,
-                            Ok(n) => n,
-                            Err(e) => {
-                                show_error!("I/O: {}", e);
-                                self.any_err = true;
-                                break;
-                            }
-                        };
-                        if xfrd == buf.len() {
-                            // transferred all that was asked for.
-                            break 'fillloop;
-                        }
-                    }
-                }
-            }
-            self.next_file();
-        }
-        Ok(xfrd)
-    }
-}
-
-impl<'b> HasError for MultifileReader<'b> {
-    fn has_error(&self) -> bool {
-        self.any_err
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use crate::mockstream::*;
-    use std::io::{Cursor, ErrorKind, Read};
-
-    #[test]
-    fn test_multi_file_reader_one_read() {
-        let inputs = vec![
-            InputSource::Stream(Box::new(Cursor::new(&b"abcd"[..]))),
-            InputSource::Stream(Box::new(Cursor::new(&b"ABCD"[..]))),
-        ];
-        let mut v = [0; 10];
-
-        let mut sut = MultifileReader::new(inputs);
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 8);
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x41, 0x42, 0x43, 0x44, 0, 0]);
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 0);
-    }
-
-    #[test]
-    fn test_multi_file_reader_two_reads() {
-        let inputs = vec![
-            InputSource::Stream(Box::new(Cursor::new(&b"abcd"[..]))),
-            InputSource::Stream(Box::new(Cursor::new(&b"ABCD"[..]))),
-        ];
-        let mut v = [0; 5];
-
-        let mut sut = MultifileReader::new(inputs);
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 5);
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x41]);
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 3);
-        assert_eq!(v, [0x42, 0x43, 0x44, 0x64, 0x41]); // last two bytes are not overwritten
-    }
-
-    #[test]
-    fn test_multi_file_reader_read_error() {
-        let c = Cursor::new(&b"1234"[..])
-            .chain(FailingMockStream::new(ErrorKind::Other, "Failing", 1))
-            .chain(Cursor::new(&b"5678"[..]));
-        let inputs = vec![
-            InputSource::Stream(Box::new(c)),
-            InputSource::Stream(Box::new(Cursor::new(&b"ABCD"[..]))),
-        ];
-        let mut v = [0; 5];
-
-        let mut sut = MultifileReader::new(inputs);
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 5);
-        assert_eq!(v, [49, 50, 51, 52, 65]);
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 3);
-        assert_eq!(v, [66, 67, 68, 52, 65]); // last two bytes are not overwritten
-
-        // note: no retry on i/o error, so 5678 is missing
-    }
-
-    #[test]
-    fn test_multi_file_reader_read_error_at_start() {
-        let inputs = vec![
-            InputSource::Stream(Box::new(FailingMockStream::new(
-                ErrorKind::Other,
-                "Failing",
-                1,
-            ))),
-            InputSource::Stream(Box::new(Cursor::new(&b"abcd"[..]))),
-            InputSource::Stream(Box::new(FailingMockStream::new(
-                ErrorKind::Other,
-                "Failing",
-                1,
-            ))),
-            InputSource::Stream(Box::new(Cursor::new(&b"ABCD"[..]))),
-            InputSource::Stream(Box::new(FailingMockStream::new(
-                ErrorKind::Other,
-                "Failing",
-                1,
-            ))),
-        ];
-        let mut v = [0; 5];
-
-        let mut sut = MultifileReader::new(inputs);
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 5);
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x41]);
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 3);
-        assert_eq!(v, [0x42, 0x43, 0x44, 0x64, 0x41]); // last two bytes are not overwritten
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/od.rs.html b/coreutils/dev/src/uu_od/od.rs.html deleted file mode 100644 index 688404ec1..000000000 --- a/coreutils/dev/src/uu_od/od.rs.html +++ /dev/null @@ -1,1261 +0,0 @@ -od.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Ben Hirsch <benhirsch24@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (clap) dont
-// spell-checker:ignore (ToDO) formatteriteminfo inputdecoder inputoffset mockstream nrofbytes partialreader odfunc multifile exitcode
-
-mod byteorder_io;
-mod formatteriteminfo;
-mod inputdecoder;
-mod inputoffset;
-#[cfg(test)]
-mod mockstream;
-mod multifilereader;
-mod output_info;
-mod parse_formats;
-mod parse_inputs;
-mod parse_nrofbytes;
-mod partialreader;
-mod peekreader;
-mod prn_char;
-mod prn_float;
-mod prn_int;
-
-use std::cmp;
-use std::fmt::Write;
-
-use crate::byteorder_io::ByteOrder;
-use crate::formatteriteminfo::FormatWriter;
-use crate::inputdecoder::{InputDecoder, MemoryDecoder};
-use crate::inputoffset::{InputOffset, Radix};
-use crate::multifilereader::{HasError, InputSource, MultifileReader};
-use crate::output_info::OutputInfo;
-use crate::parse_formats::{parse_format_flags, ParsedFormatterItemInfo};
-use crate::parse_inputs::{parse_inputs, CommandLineInputs};
-use crate::parse_nrofbytes::parse_number_of_bytes;
-use crate::partialreader::PartialReader;
-use crate::peekreader::{PeekRead, PeekReader};
-use crate::prn_char::format_ascii_dump;
-use clap::ArgAction;
-use clap::{crate_version, parser::ValueSource, Arg, ArgMatches, Command};
-use uucore::display::Quotable;
-use uucore::error::{UResult, USimpleError};
-use uucore::parse_size::ParseSizeError;
-use uucore::{format_usage, help_about, help_section, help_usage, show_error, show_warning};
-
-const PEEK_BUFFER_SIZE: usize = 4; // utf-8 can be 4 bytes
-
-const ABOUT: &str = help_about!("od.md");
-const USAGE: &str = help_usage!("od.md");
-const AFTER_HELP: &str = help_section!("after help", "od.md");
-
-pub(crate) mod options {
-    pub const HELP: &str = "help";
-    pub const ADDRESS_RADIX: &str = "address-radix";
-    pub const SKIP_BYTES: &str = "skip-bytes";
-    pub const READ_BYTES: &str = "read-bytes";
-    pub const ENDIAN: &str = "endian";
-    pub const STRINGS: &str = "strings";
-    pub const FORMAT: &str = "format";
-    pub const OUTPUT_DUPLICATES: &str = "output-duplicates";
-    pub const TRADITIONAL: &str = "traditional";
-    pub const WIDTH: &str = "width";
-    pub const FILENAME: &str = "FILENAME";
-}
-
-struct OdOptions {
-    byte_order: ByteOrder,
-    skip_bytes: u64,
-    read_bytes: Option<u64>,
-    label: Option<u64>,
-    input_strings: Vec<String>,
-    formats: Vec<ParsedFormatterItemInfo>,
-    line_bytes: usize,
-    output_duplicates: bool,
-    radix: Radix,
-}
-
-impl OdOptions {
-    fn new(matches: &ArgMatches, args: &[String]) -> UResult<Self> {
-        let byte_order = if let Some(s) = matches.get_one::<String>(options::ENDIAN) {
-            match s.as_str() {
-                "little" => ByteOrder::Little,
-                "big" => ByteOrder::Big,
-                _ => {
-                    return Err(USimpleError::new(
-                        1,
-                        format!("Invalid argument --endian={s}"),
-                    ))
-                }
-            }
-        } else {
-            ByteOrder::Native
-        };
-
-        let mut skip_bytes = match matches.get_one::<String>(options::SKIP_BYTES) {
-            None => 0,
-            Some(s) => match parse_number_of_bytes(s) {
-                Ok(n) => n,
-                Err(e) => {
-                    return Err(USimpleError::new(
-                        1,
-                        format_error_message(&e, s, options::SKIP_BYTES),
-                    ))
-                }
-            },
-        };
-
-        let mut label: Option<u64> = None;
-
-        let parsed_input = parse_inputs(matches)
-            .map_err(|e| USimpleError::new(1, format!("Invalid inputs: {e}")))?;
-        let input_strings = match parsed_input {
-            CommandLineInputs::FileNames(v) => v,
-            CommandLineInputs::FileAndOffset((f, s, l)) => {
-                skip_bytes = s;
-                label = l;
-                vec![f]
-            }
-        };
-
-        let formats = parse_format_flags(args).map_err(|e| USimpleError::new(1, e))?;
-
-        let mut line_bytes = match matches.get_one::<String>(options::WIDTH) {
-            None => 16,
-            Some(s) => {
-                if matches.value_source(options::WIDTH) == Some(ValueSource::CommandLine) {
-                    match parse_number_of_bytes(s) {
-                        Ok(n) => usize::try_from(n)
-                            .map_err(|_| USimpleError::new(1, format!("‘{s}‘ is too large")))?,
-                        Err(e) => {
-                            return Err(USimpleError::new(
-                                1,
-                                format_error_message(&e, s, options::WIDTH),
-                            ))
-                        }
-                    }
-                } else {
-                    16
-                }
-            }
-        };
-
-        let min_bytes = formats.iter().fold(1, |max, next| {
-            cmp::max(max, next.formatter_item_info.byte_size)
-        });
-        if line_bytes == 0 || line_bytes % min_bytes != 0 {
-            show_warning!("invalid width {}; using {} instead", line_bytes, min_bytes);
-            line_bytes = min_bytes;
-        }
-
-        let output_duplicates = matches.get_flag(options::OUTPUT_DUPLICATES);
-
-        let read_bytes = match matches.get_one::<String>(options::READ_BYTES) {
-            None => None,
-            Some(s) => match parse_number_of_bytes(s) {
-                Ok(n) => Some(n),
-                Err(e) => {
-                    return Err(USimpleError::new(
-                        1,
-                        format_error_message(&e, s, options::READ_BYTES),
-                    ))
-                }
-            },
-        };
-
-        let radix = match matches.get_one::<String>(options::ADDRESS_RADIX) {
-            None => Radix::Octal,
-            Some(s) => {
-                let st = s.as_bytes();
-                if st.len() == 1 {
-                    let radix: char = *(st
-                        .first()
-                        .expect("byte string of length 1 lacks a 0th elem"))
-                        as char;
-                    match radix {
-                        'd' => Radix::Decimal,
-                        'x' => Radix::Hexadecimal,
-                        'o' => Radix::Octal,
-                        'n' => Radix::NoPrefix,
-                        _ => {
-                            return Err(USimpleError::new(
-                                1,
-                                "Radix must be one of [d, o, n, x]".to_string(),
-                            ))
-                        }
-                    }
-                } else {
-                    return Err(USimpleError::new(
-                        1,
-                        "Radix must be one of [d, o, n, x]".to_string(),
-                    ));
-                }
-            }
-        };
-
-        Ok(Self {
-            byte_order,
-            skip_bytes,
-            read_bytes,
-            label,
-            input_strings,
-            formats,
-            line_bytes,
-            output_duplicates,
-            radix,
-        })
-    }
-}
-
-/// parses and validates command line parameters, prepares data structures,
-/// opens the input and calls `odfunc` to process the input.
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let clap_opts = uu_app();
-
-    let clap_matches = clap_opts.try_get_matches_from(&args)?;
-
-    let od_options = OdOptions::new(&clap_matches, &args)?;
-
-    let mut input_offset =
-        InputOffset::new(od_options.radix, od_options.skip_bytes, od_options.label);
-
-    let mut input = open_input_peek_reader(
-        &od_options.input_strings,
-        od_options.skip_bytes,
-        od_options.read_bytes,
-    );
-    let mut input_decoder = InputDecoder::new(
-        &mut input,
-        od_options.line_bytes,
-        PEEK_BUFFER_SIZE,
-        od_options.byte_order,
-    );
-
-    let output_info = OutputInfo::new(
-        od_options.line_bytes,
-        &od_options.formats[..],
-        od_options.output_duplicates,
-    );
-
-    odfunc(&mut input_offset, &mut input_decoder, &output_info)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .after_help(AFTER_HELP)
-        .trailing_var_arg(true)
-        .dont_delimit_trailing_values(true)
-        .infer_long_args(true)
-        .args_override_self(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help)
-        )
-        .arg(
-            Arg::new(options::ADDRESS_RADIX)
-                .short('A')
-                .long(options::ADDRESS_RADIX)
-                .help("Select the base in which file offsets are printed.")
-                .value_name("RADIX"),
-        )
-        .arg(
-            Arg::new(options::SKIP_BYTES)
-                .short('j')
-                .long(options::SKIP_BYTES)
-                .help("Skip bytes input bytes before formatting and writing.")
-                .value_name("BYTES"),
-        )
-        .arg(
-            Arg::new(options::READ_BYTES)
-                .short('N')
-                .long(options::READ_BYTES)
-                .help("limit dump to BYTES input bytes")
-                .value_name("BYTES"),
-        )
-        .arg(
-            Arg::new(options::ENDIAN)
-                .long(options::ENDIAN)
-                .help("byte order to use for multi-byte formats")
-                .value_parser(["big", "little"])
-                .value_name("big|little"),
-        )
-        .arg(
-            Arg::new(options::STRINGS)
-                .short('S')
-                .long(options::STRINGS)
-                .help(
-                    "NotImplemented: output strings of at least BYTES graphic chars. 3 is assumed when \
-                     BYTES is not specified.",
-                )
-                .default_missing_value("3")
-                .value_name("BYTES"),
-        )
-        .arg(
-            Arg::new("a")
-                .short('a')
-                .help("named characters, ignoring high-order bit")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("b")
-                .short('b')
-                .help("octal bytes")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("c")
-                .short('c')
-                .help("ASCII characters or backslash escapes")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("d")
-                .short('d')
-                .help("unsigned decimal 2-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("D")
-                .short('D')
-                .help("unsigned decimal 4-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("o")
-                .short('o')
-                .help("octal 2-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("I")
-                .short('I')
-                .help("decimal 8-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("L")
-                .short('L')
-                .help("decimal 8-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("i")
-                .short('i')
-                .help("decimal 4-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("l")
-                .short('l')
-                .help("decimal 8-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("x")
-                .short('x')
-                .help("hexadecimal 2-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("h")
-                .short('h')
-                .help("hexadecimal 2-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("O")
-                .short('O')
-                .help("octal 4-byte units")
-                .action(ArgAction::SetTrue)
-        )
-        .arg(
-            Arg::new("s")
-                .short('s')
-                .help("decimal 2-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("X")
-                .short('X')
-                .help("hexadecimal 4-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("H")
-                .short('H')
-                .help("hexadecimal 4-byte units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("e")
-                .short('e')
-                .help("floating point double precision (64-bit) units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("f")
-                .short('f')
-                .help("floating point double precision (32-bit) units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new("F")
-                .short('F')
-                .help("floating point double precision (64-bit) units")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FORMAT)
-                .short('t')
-                .long("format")
-                .help("select output format or formats")
-                .action(ArgAction::Append)
-                .num_args(1)
-                .value_name("TYPE"),
-        )
-        .arg(
-            Arg::new(options::OUTPUT_DUPLICATES)
-                .short('v')
-                .long(options::OUTPUT_DUPLICATES)
-                .help("do not use * to mark line suppression")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::WIDTH)
-                .short('w')
-                .long(options::WIDTH)
-                .help(
-                    "output BYTES bytes per output line. 32 is implied when BYTES is not \
-                     specified.",
-                )
-                .default_missing_value("32")
-                .value_name("BYTES")
-                .num_args(..=1),
-        )
-        .arg(
-            Arg::new(options::TRADITIONAL)
-                .long(options::TRADITIONAL)
-                .help("compatibility mode with one input, offset and label.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILENAME)
-                .hide(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-/// Loops through the input line by line, calling `print_bytes` to take care of the output.
-fn odfunc<I>(
-    input_offset: &mut InputOffset,
-    input_decoder: &mut InputDecoder<I>,
-    output_info: &OutputInfo,
-) -> UResult<()>
-where
-    I: PeekRead + HasError,
-{
-    let mut duplicate_line = false;
-    let mut previous_bytes: Vec<u8> = Vec::new();
-    let line_bytes = output_info.byte_size_line;
-
-    loop {
-        // print each line data (or multi-format raster of several lines describing the same data).
-
-        match input_decoder.peek_read() {
-            Ok(mut memory_decoder) => {
-                let length = memory_decoder.length();
-
-                if length == 0 {
-                    input_offset.print_final_offset();
-                    break;
-                }
-
-                // not enough byte for a whole element, this should only happen on the last line.
-                if length != line_bytes {
-                    // set zero bytes in the part of the buffer that will be used, but is not filled.
-                    let mut max_used = length + output_info.byte_size_block;
-                    if max_used > line_bytes {
-                        max_used = line_bytes;
-                    }
-
-                    memory_decoder.zero_out_buffer(length, max_used);
-                }
-
-                if !output_info.output_duplicates
-                    && length == line_bytes
-                    && memory_decoder.get_buffer(0) == &previous_bytes[..]
-                {
-                    if !duplicate_line {
-                        duplicate_line = true;
-                        println!("*");
-                    }
-                } else {
-                    duplicate_line = false;
-                    if length == line_bytes {
-                        // save a copy of the input unless it is the last line
-                        memory_decoder.clone_buffer(&mut previous_bytes);
-                    }
-
-                    print_bytes(
-                        &input_offset.format_byte_offset(),
-                        &memory_decoder,
-                        output_info,
-                    );
-                }
-
-                input_offset.increase_position(length as u64);
-            }
-            Err(e) => {
-                show_error!("{}", e);
-                input_offset.print_final_offset();
-                return Err(1.into());
-            }
-        };
-    }
-
-    if input_decoder.has_error() {
-        Err(1.into())
-    } else {
-        Ok(())
-    }
-}
-
-/// Outputs a single line of input, into one or more lines human readable output.
-fn print_bytes(prefix: &str, input_decoder: &MemoryDecoder, output_info: &OutputInfo) {
-    let mut first = true; // First line of a multi-format raster.
-    for f in output_info.spaced_formatters_iter() {
-        let mut output_text = String::new();
-
-        let mut b = 0;
-        while b < input_decoder.length() {
-            write!(
-                output_text,
-                "{:>width$}",
-                "",
-                width = f.spacing[b % output_info.byte_size_block]
-            )
-            .unwrap();
-
-            match f.formatter_item_info.formatter {
-                FormatWriter::IntWriter(func) => {
-                    let p = input_decoder.read_uint(b, f.formatter_item_info.byte_size);
-                    output_text.push_str(&func(p));
-                }
-                FormatWriter::FloatWriter(func) => {
-                    let p = input_decoder.read_float(b, f.formatter_item_info.byte_size);
-                    output_text.push_str(&func(p));
-                }
-                FormatWriter::MultibyteWriter(func) => {
-                    output_text.push_str(&func(input_decoder.get_full_buffer(b)));
-                }
-            }
-
-            b += f.formatter_item_info.byte_size;
-        }
-
-        if f.add_ascii_dump {
-            let missing_spacing = output_info
-                .print_width_line
-                .saturating_sub(output_text.chars().count());
-            write!(
-                output_text,
-                "{:>width$}  {}",
-                "",
-                format_ascii_dump(input_decoder.get_buffer(0)),
-                width = missing_spacing
-            )
-            .unwrap();
-        }
-
-        if first {
-            print!("{prefix}"); // print offset
-                                // if printing in multiple formats offset is printed only once
-            first = false;
-        } else {
-            // this takes the space of the file offset on subsequent
-            // lines of multi-format rasters.
-            print!("{:>width$}", "", width = prefix.chars().count());
-        }
-        println!("{output_text}");
-    }
-}
-
-/// returns a reader implementing `PeekRead + Read + HasError` providing the combined input
-///
-/// `skip_bytes` is the number of bytes skipped from the input
-/// `read_bytes` is an optional limit to the number of bytes to read
-fn open_input_peek_reader(
-    input_strings: &[String],
-    skip_bytes: u64,
-    read_bytes: Option<u64>,
-) -> PeekReader<PartialReader<MultifileReader>> {
-    // should return  "impl PeekRead + Read + HasError" when supported in (stable) rust
-    let inputs = input_strings
-        .iter()
-        .map(|w| match w as &str {
-            "-" => InputSource::Stdin,
-            x => InputSource::FileName(x),
-        })
-        .collect::<Vec<_>>();
-
-    let mf = MultifileReader::new(inputs);
-    let pr = PartialReader::new(mf, skip_bytes, read_bytes);
-    PeekReader::new(pr)
-}
-
-fn format_error_message(error: &ParseSizeError, s: &str, option: &str) -> String {
-    // NOTE:
-    // GNU's od echos affected flag, -N or --read-bytes (-j or --skip-bytes, etc.), depending user's selection
-    match error {
-        ParseSizeError::InvalidSuffix(_) => {
-            format!("invalid suffix in --{} argument {}", option, s.quote())
-        }
-        ParseSizeError::ParseFailure(_) => format!("invalid --{} argument {}", option, s.quote()),
-        ParseSizeError::SizeTooBig(_) => format!("--{} argument {} too large", option, s.quote()),
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/output_info.rs.html b/coreutils/dev/src/uu_od/output_info.rs.html deleted file mode 100644 index b8b37d8da..000000000 --- a/coreutils/dev/src/uu_od/output_info.rs.html +++ /dev/null @@ -1,895 +0,0 @@ -output_info.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-
// spell-checker:ignore formatteriteminfo blocksize thisblock
-
-use std::cmp;
-use std::slice::Iter;
-
-use crate::formatteriteminfo::FormatterItemInfo;
-use crate::parse_formats::ParsedFormatterItemInfo;
-
-/// Size in bytes of the max datatype. ie set to 16 for 128-bit numbers.
-const MAX_BYTES_PER_UNIT: usize = 8;
-
-/// Contains information to output single output line in human readable form
-pub struct SpacedFormatterItemInfo {
-    /// Contains a function pointer to output data, and information about the output format.
-    pub formatter_item_info: FormatterItemInfo,
-    /// Contains the number of spaces to add to align data with other output formats.
-    ///
-    /// If the corresponding data is a single byte, each entry in this array contains
-    /// the number of spaces to insert when outputting each byte. If the corresponding
-    /// data is multi-byte, only the fist byte position is used. For example a 32-bit
-    /// datatype, could use positions 0, 4, 8, 12, ....
-    /// As each block is formatted identically, only the spacing for a single block is set.
-    pub spacing: [usize; MAX_BYTES_PER_UNIT],
-    /// if set adds a ascii dump at the end of the line
-    pub add_ascii_dump: bool,
-}
-
-/// Contains information about all output lines.
-pub struct OutputInfo {
-    /// The number of bytes of a line.
-    pub byte_size_line: usize,
-    /// The width of a line in human readable format.
-    pub print_width_line: usize,
-
-    /// The number of bytes in a block. (This is the size of the largest datatype in `spaced_formatters`.)
-    pub byte_size_block: usize,
-    /// The width of a block in human readable format. (The size of the largest format.)
-    pub print_width_block: usize,
-    /// All formats.
-    spaced_formatters: Vec<SpacedFormatterItemInfo>,
-    /// determines if duplicate output lines should be printed, or
-    /// skipped with a "*" showing one or more skipped lines.
-    pub output_duplicates: bool,
-}
-
-impl OutputInfo {
-    /// Returns an iterator over the `SpacedFormatterItemInfo` vector.
-    pub fn spaced_formatters_iter(&self) -> Iter<SpacedFormatterItemInfo> {
-        self.spaced_formatters.iter()
-    }
-
-    /// Creates a new `OutputInfo` based on the parameters
-    pub fn new(
-        line_bytes: usize,
-        formats: &[ParsedFormatterItemInfo],
-        output_duplicates: bool,
-    ) -> Self {
-        let byte_size_block = formats.iter().fold(1, |max, next| {
-            cmp::max(max, next.formatter_item_info.byte_size)
-        });
-        let print_width_block = formats.iter().fold(1, |max, next| {
-            cmp::max(
-                max,
-                next.formatter_item_info.print_width
-                    * (byte_size_block / next.formatter_item_info.byte_size),
-            )
-        });
-        let print_width_line = print_width_block * (line_bytes / byte_size_block);
-
-        let spaced_formatters =
-            Self::create_spaced_formatter_info(formats, byte_size_block, print_width_block);
-
-        Self {
-            byte_size_line: line_bytes,
-            print_width_line,
-            byte_size_block,
-            print_width_block,
-            spaced_formatters,
-            output_duplicates,
-        }
-    }
-
-    fn create_spaced_formatter_info(
-        formats: &[ParsedFormatterItemInfo],
-        byte_size_block: usize,
-        print_width_block: usize,
-    ) -> Vec<SpacedFormatterItemInfo> {
-        formats
-            .iter()
-            .map(|f| SpacedFormatterItemInfo {
-                formatter_item_info: f.formatter_item_info,
-                add_ascii_dump: f.add_ascii_dump,
-                spacing: Self::calculate_alignment(f, byte_size_block, print_width_block),
-            })
-            .collect()
-    }
-
-    /// calculates proper alignment for a single line of output
-    ///
-    /// Multiple representations of the same data, will be right-aligned for easy reading.
-    /// For example a 64 bit octal and a 32-bit decimal with a 16-bit hexadecimal looks like this:
-    /// ```ignore
-    /// 1777777777777777777777 1777777777777777777777
-    ///  4294967295 4294967295  4294967295 4294967295
-    ///   ffff ffff  ffff ffff   ffff ffff  ffff ffff
-    /// ```
-    /// In this example is additional spacing before the first and third decimal number,
-    /// and there is additional spacing before the 1st, 3rd, 5th and 7th hexadecimal number.
-    /// This way both the octal and decimal, as well as the decimal and hexadecimal numbers
-    /// left align. Note that the alignment below both octal numbers is identical.
-    ///
-    /// This function calculates the required spacing for a single line, given the size
-    /// of a block, and the width of a block. The size of a block is the largest type
-    /// and the width is width of the the type which needs the most space to print that
-    /// number of bytes. So both numbers might refer to different types. All widths
-    /// include a space at the front. For example the width of a 8-bit hexadecimal,
-    /// is 3 characters, for example " FF".
-    ///
-    /// This algorithm first calculates how many spaces needs to be added, based the
-    /// block size and the size of the type, and the widths of the block and the type.
-    /// The required spaces are spread across the available positions.
-    /// If the blocksize is 8, and the size of the type is 8 too, there will be just
-    /// one value in a block, so all spacing will be assigned to position 0.
-    /// If the blocksize is 8, and the size of the type is 2, the spacing will be
-    /// spread across position 0, 2, 4, 6. All 4 positions will get an additional
-    /// space as long as there are more then 4 spaces available. If there are 2
-    /// spaces available, they will be assigned to position 0 and 4. If there is
-    /// 1 space available, it will be assigned to position 0. This will be combined,
-    /// For example 7 spaces will be assigned to position 0, 2, 4, 6 like: 3, 1, 2, 1.
-    /// And 7 spaces with 2 positions will be assigned to position 0 and 4 like 4, 3.
-    ///
-    /// Here is another example showing the alignment of 64-bit unsigned decimal numbers,
-    /// 32-bit hexadecimal number, 16-bit octal numbers and 8-bit hexadecimal numbers:
-    /// ```ignore
-    ///        18446744073709551615        18446744073709551615
-    ///      ffffffff      ffffffff      ffffffff      ffffffff
-    /// 177777 177777 177777 177777 177777 177777 177777 177777
-    ///  ff ff  ff ff  ff ff  ff ff  ff ff  ff ff  ff ff  ff ff
-    /// ```
-    ///
-    /// This algorithm assumes the size of all types is a power of 2 (1, 2, 4, 8, 16, ...)
-    /// Increase `MAX_BYTES_PER_UNIT` to allow larger types.
-    fn calculate_alignment(
-        sf: &dyn TypeSizeInfo,
-        byte_size_block: usize,
-        print_width_block: usize,
-    ) -> [usize; MAX_BYTES_PER_UNIT] {
-        assert!(
-            byte_size_block <= MAX_BYTES_PER_UNIT,
-            "{}-bits types are unsupported. Current max={}-bits.",
-            8 * byte_size_block,
-            8 * MAX_BYTES_PER_UNIT
-        );
-        let mut spacing = [0; MAX_BYTES_PER_UNIT];
-
-        let mut byte_size = sf.byte_size();
-        let mut items_in_block = byte_size_block / byte_size;
-        let thisblock_width = sf.print_width() * items_in_block;
-        let mut missing_spacing = print_width_block - thisblock_width;
-
-        while items_in_block > 0 {
-            let avg_spacing: usize = missing_spacing / items_in_block;
-            for i in 0..items_in_block {
-                spacing[i * byte_size] += avg_spacing;
-                missing_spacing -= avg_spacing;
-            }
-
-            items_in_block /= 2;
-            byte_size *= 2;
-        }
-
-        spacing
-    }
-}
-
-trait TypeSizeInfo {
-    fn byte_size(&self) -> usize;
-    fn print_width(&self) -> usize;
-}
-
-impl TypeSizeInfo for ParsedFormatterItemInfo {
-    fn byte_size(&self) -> usize {
-        self.formatter_item_info.byte_size
-    }
-    fn print_width(&self) -> usize {
-        self.formatter_item_info.print_width
-    }
-}
-
-#[cfg(test)]
-struct TypeInfo {
-    byte_size: usize,
-    print_width: usize,
-}
-
-#[cfg(test)]
-impl TypeSizeInfo for TypeInfo {
-    fn byte_size(&self) -> usize {
-        self.byte_size
-    }
-    fn print_width(&self) -> usize {
-        self.print_width
-    }
-}
-
-#[test]
-fn test_calculate_alignment() {
-    // For this example `byte_size_block` is 8 and 'print_width_block' is 23:
-    // 1777777777777777777777 1777777777777777777777
-    //  4294967295 4294967295  4294967295 4294967295
-    //   ffff ffff  ffff ffff   ffff ffff  ffff ffff
-
-    // the first line has no additional spacing:
-    assert_eq!(
-        [0, 0, 0, 0, 0, 0, 0, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 8,
-                print_width: 23,
-            },
-            8,
-            23
-        )
-    );
-    // the second line a single space at the start of the block:
-    assert_eq!(
-        [1, 0, 0, 0, 0, 0, 0, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 4,
-                print_width: 11,
-            },
-            8,
-            23
-        )
-    );
-    // the third line two spaces at pos 0, and 1 space at pos 4:
-    assert_eq!(
-        [2, 0, 0, 0, 1, 0, 0, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 2,
-                print_width: 5,
-            },
-            8,
-            23
-        )
-    );
-
-    // For this example `byte_size_block` is 8 and 'print_width_block' is 28:
-    //        18446744073709551615        18446744073709551615
-    //      ffffffff      ffffffff      ffffffff      ffffffff
-    // 177777 177777 177777 177777 177777 177777 177777 177777
-    //  ff ff  ff ff  ff ff  ff ff  ff ff  ff ff  ff ff  ff ff
-
-    assert_eq!(
-        [7, 0, 0, 0, 0, 0, 0, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 8,
-                print_width: 21,
-            },
-            8,
-            28
-        )
-    );
-    assert_eq!(
-        [5, 0, 0, 0, 5, 0, 0, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 4,
-                print_width: 9,
-            },
-            8,
-            28
-        )
-    );
-    assert_eq!(
-        [0, 0, 0, 0, 0, 0, 0, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 2,
-                print_width: 7,
-            },
-            8,
-            28
-        )
-    );
-    assert_eq!(
-        [1, 0, 1, 0, 1, 0, 1, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 3,
-            },
-            8,
-            28
-        )
-    );
-
-    // 9 tests where 8 .. 16 spaces are spread across 8 positions
-    assert_eq!(
-        [1, 1, 1, 1, 1, 1, 1, 1],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 8
-        )
-    );
-    assert_eq!(
-        [2, 1, 1, 1, 1, 1, 1, 1],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 9
-        )
-    );
-    assert_eq!(
-        [2, 1, 1, 1, 2, 1, 1, 1],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 10
-        )
-    );
-    assert_eq!(
-        [3, 1, 1, 1, 2, 1, 1, 1],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 11
-        )
-    );
-    assert_eq!(
-        [2, 1, 2, 1, 2, 1, 2, 1],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 12
-        )
-    );
-    assert_eq!(
-        [3, 1, 2, 1, 2, 1, 2, 1],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 13
-        )
-    );
-    assert_eq!(
-        [3, 1, 2, 1, 3, 1, 2, 1],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 14
-        )
-    );
-    assert_eq!(
-        [4, 1, 2, 1, 3, 1, 2, 1],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 15
-        )
-    );
-    assert_eq!(
-        [2, 2, 2, 2, 2, 2, 2, 2],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 16
-        )
-    );
-
-    // 4 tests where 15 spaces are spread across 8, 4, 2 or 1 position(s)
-    assert_eq!(
-        [4, 1, 2, 1, 3, 1, 2, 1],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 1,
-                print_width: 2,
-            },
-            8,
-            16 + 15
-        )
-    );
-    assert_eq!(
-        [5, 0, 3, 0, 4, 0, 3, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 2,
-                print_width: 4,
-            },
-            8,
-            16 + 15
-        )
-    );
-    assert_eq!(
-        [8, 0, 0, 0, 7, 0, 0, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 4,
-                print_width: 8,
-            },
-            8,
-            16 + 15
-        )
-    );
-    assert_eq!(
-        [15, 0, 0, 0, 0, 0, 0, 0],
-        OutputInfo::calculate_alignment(
-            &TypeInfo {
-                byte_size: 8,
-                print_width: 16,
-            },
-            8,
-            16 + 15
-        )
-    );
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/parse_formats.rs.html b/coreutils/dev/src/uu_od/parse_formats.rs.html deleted file mode 100644 index a15ea9298..000000000 --- a/coreutils/dev/src/uu_od/parse_formats.rs.html +++ /dev/null @@ -1,1077 +0,0 @@ -parse_formats.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-
// spell-checker:ignore formatteriteminfo docopt fvox fvoxw vals acdx
-
-use uucore::display::Quotable;
-
-use crate::formatteriteminfo::FormatterItemInfo;
-use crate::prn_char::*;
-use crate::prn_float::*;
-use crate::prn_int::*;
-
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
-pub struct ParsedFormatterItemInfo {
-    pub formatter_item_info: FormatterItemInfo,
-    pub add_ascii_dump: bool,
-}
-
-impl ParsedFormatterItemInfo {
-    pub fn new(formatter_item_info: FormatterItemInfo, add_ascii_dump: bool) -> Self {
-        Self {
-            formatter_item_info,
-            add_ascii_dump,
-        }
-    }
-}
-
-fn od_argument_traditional_format(ch: char) -> Option<FormatterItemInfo> {
-    match ch {
-        'a' => Some(FORMAT_ITEM_A),
-        'B' => Some(FORMAT_ITEM_OCT16),
-        'b' => Some(FORMAT_ITEM_OCT8),
-        'c' => Some(FORMAT_ITEM_C),
-        'D' => Some(FORMAT_ITEM_DEC32U),
-        'd' => Some(FORMAT_ITEM_DEC16U),
-        'e' => Some(FORMAT_ITEM_F64),
-        'F' => Some(FORMAT_ITEM_F64),
-        'f' => Some(FORMAT_ITEM_F32),
-        'H' => Some(FORMAT_ITEM_HEX32),
-        'h' => Some(FORMAT_ITEM_HEX16),
-        'i' => Some(FORMAT_ITEM_DEC32S),
-        'I' => Some(FORMAT_ITEM_DEC64S),
-        'L' => Some(FORMAT_ITEM_DEC64S),
-        'l' => Some(FORMAT_ITEM_DEC64S),
-        'O' => Some(FORMAT_ITEM_OCT32),
-        'o' => Some(FORMAT_ITEM_OCT16),
-        's' => Some(FORMAT_ITEM_DEC16S),
-        'X' => Some(FORMAT_ITEM_HEX32),
-        'x' => Some(FORMAT_ITEM_HEX16),
-        _ => None,
-    }
-}
-
-fn od_format_type(type_char: FormatType, byte_size: u8) -> Option<FormatterItemInfo> {
-    match (type_char, byte_size) {
-        (FormatType::Ascii, _) => Some(FORMAT_ITEM_A),
-        (FormatType::Char, _) => Some(FORMAT_ITEM_C),
-
-        (FormatType::DecimalInt, 1) => Some(FORMAT_ITEM_DEC8S),
-        (FormatType::DecimalInt, 2) => Some(FORMAT_ITEM_DEC16S),
-        (FormatType::DecimalInt, 0 | 4) => Some(FORMAT_ITEM_DEC32S),
-        (FormatType::DecimalInt, 8) => Some(FORMAT_ITEM_DEC64S),
-
-        (FormatType::OctalInt, 1) => Some(FORMAT_ITEM_OCT8),
-        (FormatType::OctalInt, 2) => Some(FORMAT_ITEM_OCT16),
-        (FormatType::OctalInt, 0 | 4) => Some(FORMAT_ITEM_OCT32),
-        (FormatType::OctalInt, 8) => Some(FORMAT_ITEM_OCT64),
-
-        (FormatType::UnsignedInt, 1) => Some(FORMAT_ITEM_DEC8U),
-        (FormatType::UnsignedInt, 2) => Some(FORMAT_ITEM_DEC16U),
-        (FormatType::UnsignedInt, 0 | 4) => Some(FORMAT_ITEM_DEC32U),
-        (FormatType::UnsignedInt, 8) => Some(FORMAT_ITEM_DEC64U),
-
-        (FormatType::HexadecimalInt, 1) => Some(FORMAT_ITEM_HEX8),
-        (FormatType::HexadecimalInt, 2) => Some(FORMAT_ITEM_HEX16),
-        (FormatType::HexadecimalInt, 0 | 4) => Some(FORMAT_ITEM_HEX32),
-        (FormatType::HexadecimalInt, 8) => Some(FORMAT_ITEM_HEX64),
-
-        (FormatType::Float, 2) => Some(FORMAT_ITEM_F16),
-        (FormatType::Float, 0 | 4) => Some(FORMAT_ITEM_F32),
-        (FormatType::Float, 8) => Some(FORMAT_ITEM_F64),
-
-        _ => None,
-    }
-}
-
-fn od_argument_with_option(ch: char) -> bool {
-    matches!(ch, 'A' | 'j' | 'N' | 'S' | 'w')
-}
-
-/// Parses format flags from command line
-///
-/// getopts, docopt, clap don't seem suitable to parse the command line
-/// arguments used for formats. In particular arguments can appear
-/// multiple times and the order they appear in, is significant.
-///
-/// arguments like -f, -o, -x can appear separate or combined: -fox
-/// it can also be mixed with non format related flags like -v: -fvox
-/// arguments with parameters like -w16 can only appear at the end: -fvoxw16
-/// parameters of -t/--format specify 1 or more formats.
-/// if -- appears on the command line, parsing should stop.
-#[allow(clippy::cognitive_complexity)]
-pub fn parse_format_flags(args: &[String]) -> Result<Vec<ParsedFormatterItemInfo>, String> {
-    let mut formats = Vec::new();
-
-    // args[0] is the name of the binary
-    let arg_iter = args.iter().skip(1);
-    let mut expect_type_string = false;
-
-    for arg in arg_iter {
-        if expect_type_string {
-            let v = parse_type_string(arg)?;
-            formats.extend(v.into_iter());
-            expect_type_string = false;
-        } else if arg.starts_with("--") {
-            if arg.len() == 2 {
-                break;
-            }
-            if arg.starts_with("--format=") {
-                let params: String = arg.chars().skip_while(|c| *c != '=').skip(1).collect();
-                let v = parse_type_string(&params)?;
-                formats.extend(v.into_iter());
-            }
-            if arg == "--format" {
-                expect_type_string = true;
-            }
-        } else if arg.starts_with('-') {
-            let flags = arg.chars().skip(1);
-            let mut format_spec = String::new();
-            for c in flags {
-                if expect_type_string {
-                    format_spec.push(c);
-                } else if od_argument_with_option(c) {
-                    break;
-                } else if c == 't' {
-                    expect_type_string = true;
-                } else {
-                    // not every option is a format
-                    if let Some(r) = od_argument_traditional_format(c) {
-                        formats.push(ParsedFormatterItemInfo::new(r, false));
-                    }
-                }
-            }
-            if !format_spec.is_empty() {
-                let v = parse_type_string(&format_spec)?;
-                formats.extend(v.into_iter());
-                expect_type_string = false;
-            }
-        }
-    }
-    if expect_type_string {
-        return Err("missing format specification after '--format' / '-t'".to_string());
-    }
-
-    if formats.is_empty() {
-        formats.push(ParsedFormatterItemInfo::new(FORMAT_ITEM_OCT16, false)); // 2 byte octal is the default
-    }
-
-    Ok(formats)
-}
-
-#[derive(PartialEq, Eq, Debug, Copy, Clone)]
-enum FormatType {
-    Ascii,
-    Char,
-    DecimalInt,
-    OctalInt,
-    UnsignedInt,
-    HexadecimalInt,
-    Float,
-}
-
-#[derive(PartialEq, Eq, Debug, Copy, Clone)]
-enum FormatTypeCategory {
-    Char,
-    Integer,
-    Float,
-}
-
-fn format_type(ch: char) -> Option<FormatType> {
-    match ch {
-        'a' => Some(FormatType::Ascii),
-        'c' => Some(FormatType::Char),
-        'd' => Some(FormatType::DecimalInt),
-        'o' => Some(FormatType::OctalInt),
-        'u' => Some(FormatType::UnsignedInt),
-        'x' => Some(FormatType::HexadecimalInt),
-        'f' => Some(FormatType::Float),
-        _ => None,
-    }
-}
-
-fn format_type_category(t: FormatType) -> FormatTypeCategory {
-    match t {
-        FormatType::Ascii | FormatType::Char => FormatTypeCategory::Char,
-        FormatType::DecimalInt
-        | FormatType::OctalInt
-        | FormatType::UnsignedInt
-        | FormatType::HexadecimalInt => FormatTypeCategory::Integer,
-        FormatType::Float => FormatTypeCategory::Float,
-    }
-}
-
-fn is_format_size_char(
-    ch: Option<char>,
-    format_type: FormatTypeCategory,
-    byte_size: &mut u8,
-) -> bool {
-    match (format_type, ch) {
-        (FormatTypeCategory::Integer, Some('C')) => {
-            *byte_size = 1;
-            true
-        }
-        (FormatTypeCategory::Integer, Some('S')) => {
-            *byte_size = 2;
-            true
-        }
-        (FormatTypeCategory::Integer, Some('I')) => {
-            *byte_size = 4;
-            true
-        }
-        (FormatTypeCategory::Integer, Some('L')) => {
-            *byte_size = 8;
-            true
-        }
-
-        (FormatTypeCategory::Float, Some('F')) => {
-            *byte_size = 4;
-            true
-        }
-        (FormatTypeCategory::Float, Some('D')) => {
-            *byte_size = 8;
-            true
-        }
-        // FormatTypeCategory::Float, 'L' => *byte_size = 16, // TODO support f128
-        _ => false,
-    }
-}
-
-fn is_format_size_decimal(
-    ch: Option<char>,
-    format_type: FormatTypeCategory,
-    decimal_size: &mut String,
-) -> bool {
-    if format_type == FormatTypeCategory::Char {
-        return false;
-    }
-    match ch {
-        Some(d) if d.is_ascii_digit() => {
-            decimal_size.push(d);
-            true
-        }
-        _ => false,
-    }
-}
-
-fn is_format_dump_char(ch: Option<char>, show_ascii_dump: &mut bool) -> bool {
-    match ch {
-        Some('z') => {
-            *show_ascii_dump = true;
-            true
-        }
-        _ => false,
-    }
-}
-
-fn parse_type_string(params: &str) -> Result<Vec<ParsedFormatterItemInfo>, String> {
-    let mut formats = Vec::new();
-
-    let mut chars = params.chars();
-    let mut ch = chars.next();
-
-    while let Some(type_char) = ch {
-        let type_char = format_type(type_char).ok_or_else(|| {
-            format!(
-                "unexpected char '{}' in format specification {}",
-                type_char,
-                params.quote()
-            )
-        })?;
-
-        let type_cat = format_type_category(type_char);
-
-        ch = chars.next();
-
-        let mut byte_size = 0u8;
-        let mut show_ascii_dump = false;
-        if is_format_size_char(ch, type_cat, &mut byte_size) {
-            ch = chars.next();
-        } else {
-            let mut decimal_size = String::new();
-            while is_format_size_decimal(ch, type_cat, &mut decimal_size) {
-                ch = chars.next();
-            }
-            if !decimal_size.is_empty() {
-                byte_size = decimal_size.parse().map_err(|_| {
-                    format!(
-                        "invalid number {} in format specification {}",
-                        decimal_size.quote(),
-                        params.quote()
-                    )
-                })?;
-            }
-        }
-        if is_format_dump_char(ch, &mut show_ascii_dump) {
-            ch = chars.next();
-        }
-
-        let ft = od_format_type(type_char, byte_size).ok_or_else(|| {
-            format!(
-                "invalid size '{}' in format specification {}",
-                byte_size,
-                params.quote()
-            )
-        })?;
-        formats.push(ParsedFormatterItemInfo::new(ft, show_ascii_dump));
-    }
-
-    Ok(formats)
-}
-
-#[cfg(test)]
-pub fn parse_format_flags_str(args_str: &[&'static str]) -> Result<Vec<FormatterItemInfo>, String> {
-    let args: Vec<String> = args_str.iter().map(|s| s.to_string()).collect();
-    parse_format_flags(&args).map(|v| {
-        // tests using this function assume add_ascii_dump is not set
-        v.into_iter()
-            .inspect(|f| assert!(!f.add_ascii_dump))
-            .map(|f| f.formatter_item_info)
-            .collect()
-    })
-}
-
-#[test]
-fn test_no_options() {
-    assert_eq!(
-        parse_format_flags_str(&["od"]).unwrap(),
-        vec![FORMAT_ITEM_OCT16]
-    );
-}
-
-#[test]
-fn test_one_option() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "-F"]).unwrap(),
-        vec![FORMAT_ITEM_F64]
-    );
-}
-
-#[test]
-fn test_two_separate_options() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "-F", "-x"]).unwrap(),
-        vec![FORMAT_ITEM_F64, FORMAT_ITEM_HEX16]
-    );
-}
-
-#[test]
-fn test_two_combined_options() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "-Fx"]).unwrap(),
-        vec![FORMAT_ITEM_F64, FORMAT_ITEM_HEX16]
-    );
-}
-
-#[test]
-fn test_ignore_non_format_parameters() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "-d", "-Ax"]).unwrap(),
-        vec![FORMAT_ITEM_DEC16U]
-    );
-}
-
-#[test]
-fn test_ignore_separate_parameters() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "-I", "-A", "x"]).unwrap(),
-        vec![FORMAT_ITEM_DEC64S]
-    );
-}
-
-#[test]
-fn test_ignore_trailing_vals() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "-D", "--", "-x"]).unwrap(),
-        vec![FORMAT_ITEM_DEC32U]
-    );
-}
-
-#[test]
-fn test_invalid_long_format() {
-    parse_format_flags_str(&["od", "--format=X"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=xX"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=aC"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=fI"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=xD"]).unwrap_err();
-
-    parse_format_flags_str(&["od", "--format=xC1"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=x1C"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=xz1"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=xzC"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=xzz"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=xCC"]).unwrap_err();
-
-    parse_format_flags_str(&["od", "--format=c1"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=x256"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=d5"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format=f1"]).unwrap_err();
-}
-
-#[test]
-fn test_long_format_a() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "--format=a"]).unwrap(),
-        vec![FORMAT_ITEM_A]
-    );
-}
-
-#[test]
-fn test_long_format_cz() {
-    assert_eq!(
-        parse_format_flags(&["od".to_string(), "--format=cz".to_string()]).unwrap(),
-        vec![ParsedFormatterItemInfo::new(FORMAT_ITEM_C, true)]
-    );
-}
-
-#[test]
-fn test_long_format_d() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "--format=d8"]).unwrap(),
-        vec![FORMAT_ITEM_DEC64S]
-    );
-}
-
-#[test]
-fn test_long_format_d_default() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "--format=d"]).unwrap(),
-        vec![FORMAT_ITEM_DEC32S]
-    );
-}
-
-#[test]
-fn test_long_format_o_default() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "--format=o"]).unwrap(),
-        vec![FORMAT_ITEM_OCT32]
-    );
-}
-
-#[test]
-fn test_long_format_u_default() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "--format=u"]).unwrap(),
-        vec![FORMAT_ITEM_DEC32U]
-    );
-}
-
-#[test]
-fn test_long_format_x_default() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "--format=x"]).unwrap(),
-        vec![FORMAT_ITEM_HEX32]
-    );
-}
-
-#[test]
-fn test_long_format_f_default() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "--format=f"]).unwrap(),
-        vec![FORMAT_ITEM_F32]
-    );
-}
-
-#[test]
-fn test_long_format_next_arg() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "--format", "f8"]).unwrap(),
-        vec![FORMAT_ITEM_F64]
-    );
-}
-
-#[test]
-fn test_short_format_next_arg() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "-t", "x8"]).unwrap(),
-        vec![FORMAT_ITEM_HEX64]
-    );
-}
-
-#[test]
-fn test_short_format_combined_arg() {
-    assert_eq!(
-        parse_format_flags_str(&["od", "-tu8"]).unwrap(),
-        vec![FORMAT_ITEM_DEC64U]
-    );
-}
-
-#[test]
-fn test_format_next_arg_invalid() {
-    parse_format_flags_str(&["od", "--format", "-v"]).unwrap_err();
-    parse_format_flags_str(&["od", "--format"]).unwrap_err();
-    parse_format_flags_str(&["od", "-t", "-v"]).unwrap_err();
-    parse_format_flags_str(&["od", "-t"]).unwrap_err();
-}
-
-#[test]
-fn test_mixed_formats() {
-    assert_eq!(
-        parse_format_flags(&[
-            "od".to_string(),
-            "--skip-bytes=2".to_string(),
-            "-vItu1z".to_string(),
-            "-N".to_string(),
-            "1000".to_string(),
-            "-xt".to_string(),
-            "acdx1".to_string(),
-            "--format=u2c".to_string(),
-            "--format".to_string(),
-            "f".to_string(),
-            "-xAx".to_string(),
-            "--".to_string(),
-            "-h".to_string(),
-            "--format=f8".to_string(),
-        ])
-        .unwrap(),
-        vec![
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_DEC64S, false), // I
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_DEC8U, true),   // tu1z
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_HEX16, false),  // x
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_A, false),      // ta
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_C, false),      // tc
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_DEC32S, false), // td
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_HEX8, false),   // tx1
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_DEC16U, false), // tu2
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_C, false),      // tc
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_F32, false),    // tf
-            ParsedFormatterItemInfo::new(FORMAT_ITEM_HEX16, false),  // x
-        ]
-    );
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/parse_inputs.rs.html b/coreutils/dev/src/uu_od/parse_inputs.rs.html deleted file mode 100644 index e717df023..000000000 --- a/coreutils/dev/src/uu_od/parse_inputs.rs.html +++ /dev/null @@ -1,739 +0,0 @@ -parse_inputs.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-
use super::options;
-use clap::ArgMatches;
-
-/// Abstraction for getopts
-pub trait CommandLineOpts {
-    /// returns all command line parameters which do not belong to an option.
-    fn inputs(&self) -> Vec<&str>;
-    /// tests if any of the specified options is present.
-    fn opts_present(&self, _: &[&str]) -> bool;
-}
-
-/// Implementation for `getopts`
-impl CommandLineOpts for ArgMatches {
-    fn inputs(&self) -> Vec<&str> {
-        self.get_many::<String>(options::FILENAME)
-            .map(|values| values.map(|s| s.as_str()).collect())
-            .unwrap_or_default()
-    }
-
-    fn opts_present(&self, opts: &[&str]) -> bool {
-        opts.iter()
-            .any(|opt| self.value_source(opt) == Some(clap::parser::ValueSource::CommandLine))
-    }
-}
-
-/// Contains the Input filename(s) with an optional offset.
-///
-/// `FileNames` is used for one or more file inputs ("-" = stdin)
-/// `FileAndOffset` is used for a single file input, with an offset
-/// and an optional label. Offset and label are specified in bytes.
-/// `FileAndOffset` will be only used if an offset is specified,
-/// but it might be 0.
-#[derive(PartialEq, Eq, Debug)]
-pub enum CommandLineInputs {
-    FileNames(Vec<String>),
-    FileAndOffset((String, u64, Option<u64>)),
-}
-
-/// Interprets the command line inputs of od.
-///
-/// Returns either an unspecified number of filenames.
-/// Or it will return a single filename, with an offset and optional label.
-/// Offset and label are specified in bytes.
-/// '-' is used as filename if stdin is meant. This is also returned if
-/// there is no input, as stdin is the default input.
-pub fn parse_inputs(matches: &dyn CommandLineOpts) -> Result<CommandLineInputs, String> {
-    let mut input_strings = matches.inputs();
-
-    if matches.opts_present(&["traditional"]) {
-        return parse_inputs_traditional(&input_strings);
-    }
-
-    // test if command line contains: [file] <offset>
-    // fall-through if no (valid) offset is found
-    if input_strings.len() == 1 || input_strings.len() == 2 {
-        // if any of the options -A, -j, -N, -t, -v or -w are present there is no offset
-        if !matches.opts_present(&[
-            options::ADDRESS_RADIX,
-            options::READ_BYTES,
-            options::SKIP_BYTES,
-            options::FORMAT,
-            options::OUTPUT_DUPLICATES,
-            options::WIDTH,
-        ]) {
-            // test if the last input can be parsed as an offset.
-            let offset = parse_offset_operand(input_strings[input_strings.len() - 1]);
-            if let Ok(n) = offset {
-                // if there is just 1 input (stdin), an offset must start with '+'
-                if input_strings.len() == 1 && input_strings[0].starts_with('+') {
-                    return Ok(CommandLineInputs::FileAndOffset(("-".to_string(), n, None)));
-                }
-                if input_strings.len() == 2 {
-                    return Ok(CommandLineInputs::FileAndOffset((
-                        input_strings[0].to_string(),
-                        n,
-                        None,
-                    )));
-                }
-            }
-        }
-    }
-
-    if input_strings.is_empty() {
-        input_strings.push("-");
-    }
-    Ok(CommandLineInputs::FileNames(
-        input_strings.iter().map(|&s| s.to_string()).collect(),
-    ))
-}
-
-/// interprets inputs when --traditional is on the command line
-///
-/// normally returns `CommandLineInputs::FileAndOffset`, but if no offset is found,
-/// it returns `CommandLineInputs::FileNames` (also to differentiate from the offset == 0)
-pub fn parse_inputs_traditional(input_strings: &[&str]) -> Result<CommandLineInputs, String> {
-    match input_strings.len() {
-        0 => Ok(CommandLineInputs::FileNames(vec!["-".to_string()])),
-        1 => {
-            let offset0 = parse_offset_operand(input_strings[0]);
-            Ok(match offset0 {
-                Ok(n) => CommandLineInputs::FileAndOffset(("-".to_string(), n, None)),
-                _ => CommandLineInputs::FileNames(
-                    input_strings.iter().map(|&s| s.to_string()).collect(),
-                ),
-            })
-        }
-        2 => {
-            let offset0 = parse_offset_operand(input_strings[0]);
-            let offset1 = parse_offset_operand(input_strings[1]);
-            match (offset0, offset1) {
-                (Ok(n), Ok(m)) => Ok(CommandLineInputs::FileAndOffset((
-                    "-".to_string(),
-                    n,
-                    Some(m),
-                ))),
-                (_, Ok(m)) => Ok(CommandLineInputs::FileAndOffset((
-                    input_strings[0].to_string(),
-                    m,
-                    None,
-                ))),
-                _ => Err(format!("invalid offset: {}", input_strings[1])),
-            }
-        }
-        3 => {
-            let offset = parse_offset_operand(input_strings[1]);
-            let label = parse_offset_operand(input_strings[2]);
-            match (offset, label) {
-                (Ok(n), Ok(m)) => Ok(CommandLineInputs::FileAndOffset((
-                    input_strings[0].to_string(),
-                    n,
-                    Some(m),
-                ))),
-                (Err(_), _) => Err(format!("invalid offset: {}", input_strings[1])),
-                (_, Err(_)) => Err(format!("invalid label: {}", input_strings[2])),
-            }
-        }
-        _ => Err(format!(
-            "too many inputs after --traditional: {}",
-            input_strings[3]
-        )),
-    }
-}
-
-/// parses format used by offset and label on the command line
-pub fn parse_offset_operand(s: &str) -> Result<u64, &'static str> {
-    let mut start = 0;
-    let mut len = s.len();
-    let mut radix = 8;
-    let mut multiply = 1;
-
-    if s.starts_with('+') {
-        start += 1;
-    }
-
-    if s[start..len].starts_with("0x") || s[start..len].starts_with("0X") {
-        start += 2;
-        radix = 16;
-    } else {
-        if s[start..len].ends_with('b') {
-            len -= 1;
-            multiply = 512;
-        }
-        if s[start..len].ends_with('.') {
-            len -= 1;
-            radix = 10;
-        }
-    }
-    match u64::from_str_radix(&s[start..len], radix) {
-        Ok(i) => Ok(i * multiply),
-        Err(_) => Err("parse failed"),
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use crate::uu_app;
-
-    #[test]
-    fn test_parse_inputs_normal() {
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["-".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od"])).unwrap()
-        );
-
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["-".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "-"])).unwrap()
-        );
-
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["file1".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "file1"])).unwrap()
-        );
-
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["file1".to_string(), "file2".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "file1", "file2"])).unwrap()
-        );
-
-        assert_eq!(
-            CommandLineInputs::FileNames(vec![
-                "-".to_string(),
-                "file1".to_string(),
-                "file2".to_string(),
-            ]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "-", "file1", "file2"])).unwrap()
-        );
-    }
-
-    #[test]
-    fn test_parse_inputs_with_offset() {
-        // offset is found without filename, so stdin will be used.
-        assert_eq!(
-            CommandLineInputs::FileAndOffset(("-".to_string(), 8, None)),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "+10"])).unwrap()
-        );
-
-        // offset must start with "+" if no input is specified.
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["10".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "10"])).unwrap()
-        );
-
-        // offset is not valid, so it is considered a filename.
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["+10a".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "+10a"])).unwrap()
-        );
-
-        // if -j is included in the command line, there cannot be an offset.
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["+10".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "-j10", "+10"])).unwrap()
-        );
-
-        // if -v is included in the command line, there cannot be an offset.
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["+10".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "-o", "-v", "+10"])).unwrap()
-        );
-
-        assert_eq!(
-            CommandLineInputs::FileAndOffset(("file1".to_string(), 8, None)),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "file1", "+10"])).unwrap()
-        );
-
-        // offset does not need to start with "+" if a filename is included.
-        assert_eq!(
-            CommandLineInputs::FileAndOffset(("file1".to_string(), 8, None)),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "file1", "10"])).unwrap()
-        );
-
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["file1".to_string(), "+10a".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "file1", "+10a"])).unwrap()
-        );
-
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["file1".to_string(), "+10".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "-j10", "file1", "+10"])).unwrap()
-        );
-
-        // offset must be last on the command line
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["+10".to_string(), "file1".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "+10", "file1"])).unwrap()
-        );
-    }
-
-    #[test]
-    fn test_parse_inputs_traditional() {
-        // it should not return FileAndOffset to signal no offset was entered on the command line.
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["-".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "--traditional"])).unwrap()
-        );
-
-        assert_eq!(
-            CommandLineInputs::FileNames(vec!["file1".to_string()]),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "--traditional", "file1"])).unwrap()
-        );
-
-        // offset does not need to start with a +
-        assert_eq!(
-            CommandLineInputs::FileAndOffset(("-".to_string(), 8, None)),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "--traditional", "10"])).unwrap()
-        );
-
-        // valid offset and valid label
-        assert_eq!(
-            CommandLineInputs::FileAndOffset(("-".to_string(), 8, Some(8))),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "--traditional", "10", "10"]))
-                .unwrap()
-        );
-
-        assert_eq!(
-            CommandLineInputs::FileAndOffset(("file1".to_string(), 8, None)),
-            parse_inputs(&uu_app().get_matches_from(vec!["od", "--traditional", "file1", "10"]))
-                .unwrap()
-        );
-
-        // only one file is allowed, it must be the first
-        parse_inputs(&uu_app().get_matches_from(vec!["od", "--traditional", "10", "file1"]))
-            .unwrap_err();
-
-        assert_eq!(
-            CommandLineInputs::FileAndOffset(("file1".to_string(), 8, Some(8))),
-            parse_inputs(&uu_app().get_matches_from(vec![
-                "od",
-                "--traditional",
-                "file1",
-                "10",
-                "10"
-            ]))
-            .unwrap()
-        );
-
-        parse_inputs(&uu_app().get_matches_from(vec!["od", "--traditional", "10", "file1", "10"]))
-            .unwrap_err();
-
-        parse_inputs(&uu_app().get_matches_from(vec!["od", "--traditional", "10", "10", "file1"]))
-            .unwrap_err();
-
-        parse_inputs(&uu_app().get_matches_from(vec![
-            "od",
-            "--traditional",
-            "10",
-            "10",
-            "10",
-            "10",
-        ]))
-        .unwrap_err();
-    }
-
-    fn parse_offset_operand_str(s: &str) -> Result<u64, &'static str> {
-        parse_offset_operand(&String::from(s))
-    }
-
-    #[test]
-    fn test_parse_offset_operand_invalid() {
-        parse_offset_operand_str("").unwrap_err();
-        parse_offset_operand_str("a").unwrap_err();
-        parse_offset_operand_str("+").unwrap_err();
-        parse_offset_operand_str("+b").unwrap_err();
-        parse_offset_operand_str("0x1.").unwrap_err();
-        parse_offset_operand_str("0x1.b").unwrap_err();
-        parse_offset_operand_str("-").unwrap_err();
-        parse_offset_operand_str("-1").unwrap_err();
-        parse_offset_operand_str("1e10").unwrap_err();
-    }
-
-    #[test]
-    fn test_parse_offset_operand() {
-        assert_eq!(8, parse_offset_operand_str("10").unwrap()); // default octal
-        assert_eq!(0, parse_offset_operand_str("0").unwrap());
-        assert_eq!(8, parse_offset_operand_str("+10").unwrap()); // optional leading '+'
-        assert_eq!(16, parse_offset_operand_str("0x10").unwrap()); // hex
-        assert_eq!(16, parse_offset_operand_str("0X10").unwrap()); // hex
-        assert_eq!(16, parse_offset_operand_str("+0X10").unwrap()); // hex
-        assert_eq!(10, parse_offset_operand_str("10.").unwrap()); // decimal
-        assert_eq!(10, parse_offset_operand_str("+10.").unwrap()); // decimal
-        assert_eq!(4096, parse_offset_operand_str("10b").unwrap()); // b suffix = *512
-        assert_eq!(4096, parse_offset_operand_str("+10b").unwrap()); // b suffix = *512
-        assert_eq!(5120, parse_offset_operand_str("10.b").unwrap()); // b suffix = *512
-        assert_eq!(5120, parse_offset_operand_str("+10.b").unwrap()); // b suffix = *512
-        assert_eq!(267, parse_offset_operand_str("0x10b").unwrap()); // hex
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/parse_nrofbytes.rs.html b/coreutils/dev/src/uu_od/parse_nrofbytes.rs.html deleted file mode 100644 index ca1acf6bb..000000000 --- a/coreutils/dev/src/uu_od/parse_nrofbytes.rs.html +++ /dev/null @@ -1,185 +0,0 @@ -parse_nrofbytes.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-
use uucore::parse_size::{parse_size, ParseSizeError};
-
-pub fn parse_number_of_bytes(s: &str) -> Result<u64, ParseSizeError> {
-    let mut start = 0;
-    let mut len = s.len();
-    let mut radix = 16;
-    let mut multiply = 1;
-
-    if s.starts_with("0x") || s.starts_with("0X") {
-        start = 2;
-    } else if s.starts_with('0') {
-        radix = 8;
-    } else {
-        return parse_size(&s[start..]);
-    }
-
-    let mut ends_with = s.chars().rev();
-    match ends_with.next() {
-        Some('b') if radix != 16 => {
-            multiply = 512;
-            len -= 1;
-        }
-        Some('k' | 'K') => {
-            multiply = 1024;
-            len -= 1;
-        }
-        Some('m' | 'M') => {
-            multiply = 1024 * 1024;
-            len -= 1;
-        }
-        Some('G') => {
-            multiply = 1024 * 1024 * 1024;
-            len -= 1;
-        }
-        #[cfg(target_pointer_width = "64")]
-        Some('T') => {
-            multiply = 1024 * 1024 * 1024 * 1024;
-            len -= 1;
-        }
-        #[cfg(target_pointer_width = "64")]
-        Some('P') => {
-            multiply = 1024 * 1024 * 1024 * 1024 * 1024;
-            len -= 1;
-        }
-        #[cfg(target_pointer_width = "64")]
-        Some('E') if radix != 16 => {
-            multiply = 1024 * 1024 * 1024 * 1024 * 1024 * 1024;
-            len -= 1;
-        }
-        Some('B') if radix != 16 => {
-            len -= 2;
-            multiply = match ends_with.next() {
-                Some('k' | 'K') => 1000,
-                Some('m' | 'M') => 1000 * 1000,
-                Some('G') => 1000 * 1000 * 1000,
-                #[cfg(target_pointer_width = "64")]
-                Some('T') => 1000 * 1000 * 1000 * 1000,
-                #[cfg(target_pointer_width = "64")]
-                Some('P') => 1000 * 1000 * 1000 * 1000 * 1000,
-                #[cfg(target_pointer_width = "64")]
-                Some('E') => 1000 * 1000 * 1000 * 1000 * 1000 * 1000,
-                _ => return Err(ParseSizeError::ParseFailure(s.to_string())),
-            }
-        }
-        _ => {}
-    }
-
-    let factor = match u64::from_str_radix(&s[start..len], radix) {
-        Ok(f) => f,
-        Err(e) => return Err(ParseSizeError::ParseFailure(e.to_string())),
-    };
-    factor
-        .checked_mul(multiply)
-        .ok_or_else(|| ParseSizeError::SizeTooBig(s.to_string()))
-}
-
-#[test]
-fn test_parse_number_of_bytes() {
-    // octal input
-    assert_eq!(8, parse_number_of_bytes("010").unwrap());
-    assert_eq!(8 * 512, parse_number_of_bytes("010b").unwrap());
-    assert_eq!(8 * 1024, parse_number_of_bytes("010k").unwrap());
-    assert_eq!(8 * 1_048_576, parse_number_of_bytes("010m").unwrap());
-
-    // hex input
-    assert_eq!(15, parse_number_of_bytes("0xf").unwrap());
-    assert_eq!(14, parse_number_of_bytes("0XE").unwrap());
-    assert_eq!(15, parse_number_of_bytes("0XF").unwrap());
-    assert_eq!(27, parse_number_of_bytes("0x1b").unwrap());
-    assert_eq!(16 * 1024, parse_number_of_bytes("0x10k").unwrap());
-    assert_eq!(16 * 1_048_576, parse_number_of_bytes("0x10m").unwrap());
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/partialreader.rs.html b/coreutils/dev/src/uu_od/partialreader.rs.html deleted file mode 100644 index 367390416..000000000 --- a/coreutils/dev/src/uu_od/partialreader.rs.html +++ /dev/null @@ -1,429 +0,0 @@ -partialreader.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-
// spell-checker:ignore mockstream abcdefgh bcdefgh
-
-use std::cmp;
-use std::io;
-use std::io::Read;
-
-use crate::multifilereader::HasError;
-
-/// When a large number of bytes must be skipped, it will be read into a
-/// dynamically allocated buffer. The buffer will be limited to this size.
-const MAX_SKIP_BUFFER: usize = 16 * 1024;
-
-/// Wrapper for `std::io::Read` which can skip bytes at the beginning
-/// of the input, and it can limit the returned bytes to a particular
-/// number of bytes.
-pub struct PartialReader<R> {
-    inner: R,
-    skip: u64,
-    limit: Option<u64>,
-}
-
-impl<R> PartialReader<R> {
-    /// Create a new `PartialReader` wrapping `inner`, which will skip
-    /// `skip` bytes, and limits the output to `limit` bytes. Set `limit`
-    /// to `None` if there should be no limit.
-    pub fn new(inner: R, skip: u64, limit: Option<u64>) -> Self {
-        Self { inner, skip, limit }
-    }
-}
-
-impl<R: Read> Read for PartialReader<R> {
-    fn read(&mut self, out: &mut [u8]) -> io::Result<usize> {
-        if self.skip > 0 {
-            let mut bytes = [0; MAX_SKIP_BUFFER];
-
-            while self.skip > 0 {
-                let skip_count: usize = cmp::min(self.skip as usize, MAX_SKIP_BUFFER);
-
-                match self.inner.read(&mut bytes[..skip_count])? {
-                    0 => {
-                        // this is an error as we still have more to skip
-                        return Err(io::Error::new(
-                            io::ErrorKind::UnexpectedEof,
-                            "tried to skip past end of input",
-                        ));
-                    }
-                    n => self.skip -= n as u64,
-                }
-            }
-        }
-
-        match self.limit {
-            None => self.inner.read(out),
-            Some(0) => Ok(0),
-            Some(ref mut limit) => {
-                let slice = if *limit > (out.len() as u64) {
-                    out
-                } else {
-                    &mut out[0..(*limit as usize)]
-                };
-                match self.inner.read(slice) {
-                    Err(e) => Err(e),
-                    Ok(r) => {
-                        *limit -= r as u64;
-                        Ok(r)
-                    }
-                }
-            }
-        }
-    }
-}
-
-impl<R: HasError> HasError for PartialReader<R> {
-    fn has_error(&self) -> bool {
-        self.inner.has_error()
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use crate::mockstream::*;
-    use std::io::{Cursor, ErrorKind, Read};
-
-    #[test]
-    fn test_read_without_limits() {
-        let mut v = [0; 10];
-        let mut sut = PartialReader::new(Cursor::new(&b"abcdefgh"[..]), 0, None);
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 8);
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0, 0]);
-    }
-
-    #[test]
-    fn test_read_without_limits_with_error() {
-        let mut v = [0; 10];
-        let f = FailingMockStream::new(ErrorKind::PermissionDenied, "No access", 3);
-        let mut sut = PartialReader::new(f, 0, None);
-
-        let error = sut.read(v.as_mut()).unwrap_err();
-        assert_eq!(error.kind(), ErrorKind::PermissionDenied);
-        assert_eq!(error.to_string(), "No access");
-    }
-
-    #[test]
-    fn test_read_skipping_bytes() {
-        let mut v = [0; 10];
-        let mut sut = PartialReader::new(Cursor::new(&b"abcdefgh"[..]), 2, None);
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 6);
-        assert_eq!(v, [0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0, 0, 0, 0]);
-    }
-
-    #[test]
-    fn test_read_skipping_all() {
-        let mut v = [0; 10];
-        let mut sut = PartialReader::new(Cursor::new(&b"abcdefgh"[..]), 20, None);
-
-        let error = sut.read(v.as_mut()).unwrap_err();
-        assert_eq!(error.kind(), ErrorKind::UnexpectedEof);
-    }
-
-    #[test]
-    fn test_read_skipping_with_error() {
-        let mut v = [0; 10];
-        let f = FailingMockStream::new(ErrorKind::PermissionDenied, "No access", 3);
-        let mut sut = PartialReader::new(f, 2, None);
-
-        let error = sut.read(v.as_mut()).unwrap_err();
-        assert_eq!(error.kind(), ErrorKind::PermissionDenied);
-        assert_eq!(error.to_string(), "No access");
-    }
-
-    #[test]
-    fn test_read_skipping_with_two_reads_during_skip() {
-        let mut v = [0; 10];
-        let c = Cursor::new(&b"a"[..]).chain(Cursor::new(&b"bcdefgh"[..]));
-        let mut sut = PartialReader::new(c, 2, None);
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 6);
-        assert_eq!(v, [0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0, 0, 0, 0]);
-    }
-
-    #[test]
-    fn test_read_skipping_huge_number() {
-        let mut v = [0; 10];
-        // test if it does not eat all memory....
-        let mut sut = PartialReader::new(
-            Cursor::new(&b"abcdefgh"[..]),
-            usize::max_value() as u64,
-            None,
-        );
-
-        sut.read(v.as_mut()).unwrap_err();
-    }
-
-    #[test]
-    fn test_read_limiting_all() {
-        let mut v = [0; 10];
-        let mut sut = PartialReader::new(Cursor::new(&b"abcdefgh"[..]), 0, Some(0));
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 0);
-    }
-
-    #[test]
-    fn test_read_limiting() {
-        let mut v = [0; 10];
-        let mut sut = PartialReader::new(Cursor::new(&b"abcdefgh"[..]), 0, Some(6));
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 6);
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0, 0, 0, 0]);
-    }
-
-    #[test]
-    fn test_read_limiting_with_error() {
-        let mut v = [0; 10];
-        let f = FailingMockStream::new(ErrorKind::PermissionDenied, "No access", 3);
-        let mut sut = PartialReader::new(f, 0, Some(6));
-
-        let error = sut.read(v.as_mut()).unwrap_err();
-        assert_eq!(error.kind(), ErrorKind::PermissionDenied);
-        assert_eq!(error.to_string(), "No access");
-    }
-
-    #[test]
-    fn test_read_limiting_with_large_limit() {
-        let mut v = [0; 10];
-        let mut sut = PartialReader::new(Cursor::new(&b"abcdefgh"[..]), 0, Some(20));
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 8);
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0, 0]);
-    }
-
-    #[test]
-    fn test_read_limiting_with_multiple_reads() {
-        let mut v = [0; 3];
-        let mut sut = PartialReader::new(Cursor::new(&b"abcdefgh"[..]), 0, Some(6));
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 3);
-        assert_eq!(v, [0x61, 0x62, 0x63]);
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 3);
-        assert_eq!(v, [0x64, 0x65, 0x66]);
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 0);
-    }
-
-    #[test]
-    fn test_read_skipping_and_limiting() {
-        let mut v = [0; 10];
-        let mut sut = PartialReader::new(Cursor::new(&b"abcdefgh"[..]), 2, Some(4));
-
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 4);
-        assert_eq!(v, [0x63, 0x64, 0x65, 0x66, 0, 0, 0, 0, 0, 0]);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/peekreader.rs.html b/coreutils/dev/src/uu_od/peekreader.rs.html deleted file mode 100644 index 527b22fda..000000000 --- a/coreutils/dev/src/uu_od/peekreader.rs.html +++ /dev/null @@ -1,431 +0,0 @@ -peekreader.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-
// spell-checker:ignore (ToDO) tempbuffer abcdefgh abcdefghij
-
-//! Contains the trait `PeekRead` and type `PeekReader` implementing it.
-
-use std::io;
-use std::io::{Read, Write};
-
-use crate::multifilereader::HasError;
-
-/// A trait which supplies a function to peek into a stream without
-/// actually reading it.
-///
-/// Like `std::io::Read`, it allows to read data from a stream, with
-/// the additional possibility to reserve a part of the returned data
-/// with the data which will be read in subsequent calls.
-///
-pub trait PeekRead {
-    /// Reads data into a buffer.
-    ///
-    /// Fills `out` with data. The last `peek_size` bytes of `out` are
-    /// used for data which keeps available on subsequent calls.
-    /// `peek_size` must be smaller or equal to the size of `out`.
-    ///
-    /// Returns a tuple where the first number is the number of bytes
-    /// read from the stream, and the second number is the number of
-    /// bytes additionally read. Any of the numbers might be zero.
-    /// It can also return an error.
-    ///
-    /// A type implementing this trait, will typically also implement
-    /// `std::io::Read`.
-    ///
-    /// # Panics
-    /// Might panic if `peek_size` is larger then the size of `out`
-    fn peek_read(&mut self, out: &mut [u8], peek_size: usize) -> io::Result<(usize, usize)>;
-}
-
-/// Wrapper for `std::io::Read` allowing to peek into the data to be read.
-pub struct PeekReader<R> {
-    inner: R,
-    temp_buffer: Vec<u8>,
-}
-
-impl<R> PeekReader<R> {
-    /// Create a new `PeekReader` wrapping `inner`
-    pub fn new(inner: R) -> Self {
-        Self {
-            inner,
-            temp_buffer: Vec::new(),
-        }
-    }
-}
-
-impl<R: Read> PeekReader<R> {
-    fn read_from_tempbuffer(&mut self, mut out: &mut [u8]) -> usize {
-        match out.write(self.temp_buffer.as_mut_slice()) {
-            Ok(n) => {
-                self.temp_buffer.drain(..n);
-                n
-            }
-            Err(_) => 0,
-        }
-    }
-
-    fn write_to_tempbuffer(&mut self, bytes: &[u8]) {
-        // if temp_buffer is not empty, data has to be inserted in front
-        let org_buffer: Vec<_> = self.temp_buffer.drain(..).collect();
-        self.temp_buffer.write_all(bytes).unwrap();
-        self.temp_buffer.extend(org_buffer);
-    }
-}
-
-impl<R: Read> Read for PeekReader<R> {
-    fn read(&mut self, out: &mut [u8]) -> io::Result<usize> {
-        let start_pos = self.read_from_tempbuffer(out);
-        match self.inner.read(&mut out[start_pos..]) {
-            Err(e) => Err(e),
-            Ok(n) => Ok(n + start_pos),
-        }
-    }
-}
-
-impl<R: Read> PeekRead for PeekReader<R> {
-    /// Reads data into a buffer.
-    ///
-    /// See `PeekRead::peek_read`.
-    ///
-    /// # Panics
-    /// If `peek_size` is larger then the size of `out`
-    fn peek_read(&mut self, out: &mut [u8], peek_size: usize) -> io::Result<(usize, usize)> {
-        assert!(out.len() >= peek_size);
-        match self.read(out) {
-            Err(e) => Err(e),
-            Ok(bytes_in_buffer) => {
-                let unused = out.len() - bytes_in_buffer;
-                if peek_size <= unused {
-                    Ok((bytes_in_buffer, 0))
-                } else {
-                    let actual_peek_size = peek_size - unused;
-                    let real_size = bytes_in_buffer - actual_peek_size;
-                    self.write_to_tempbuffer(&out[real_size..bytes_in_buffer]);
-                    Ok((real_size, actual_peek_size))
-                }
-            }
-        }
-    }
-}
-
-impl<R: HasError> HasError for PeekReader<R> {
-    fn has_error(&self) -> bool {
-        self.inner.has_error()
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use std::io::{Cursor, Read};
-
-    #[test]
-    fn test_read_normal() {
-        let mut sut = PeekReader::new(Cursor::new(&b"abcdefgh"[..]));
-
-        let mut v = [0; 10];
-        assert_eq!(sut.read(v.as_mut()).unwrap(), 8);
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0, 0]);
-    }
-
-    #[test]
-    fn test_peek_read_without_buffer() {
-        let mut sut = PeekReader::new(Cursor::new(&b"abcdefgh"[..]));
-
-        let mut v = [0; 10];
-        assert_eq!(sut.peek_read(v.as_mut(), 0).unwrap(), (8, 0));
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0, 0]);
-    }
-
-    #[test]
-    fn test_peek_read_and_read() {
-        let mut sut = PeekReader::new(Cursor::new(&b"abcdefghij"[..]));
-
-        let mut v = [0; 8];
-        assert_eq!(sut.peek_read(v.as_mut(), 4).unwrap(), (4, 4));
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68]);
-
-        let mut v2 = [0; 8];
-        assert_eq!(sut.read(v2.as_mut()).unwrap(), 6);
-        assert_eq!(v2, [0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0, 0]);
-    }
-
-    #[test]
-    fn test_peek_read_multiple_times() {
-        let mut sut = PeekReader::new(Cursor::new(&b"abcdefghij"[..]));
-
-        let mut s1 = [0; 8];
-        assert_eq!(sut.peek_read(s1.as_mut(), 4).unwrap(), (4, 4));
-        assert_eq!(s1, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68]);
-
-        let mut s2 = [0; 8];
-        assert_eq!(sut.peek_read(s2.as_mut(), 4).unwrap(), (4, 2));
-        assert_eq!(s2, [0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0, 0]);
-
-        let mut s3 = [0; 8];
-        assert_eq!(sut.peek_read(s3.as_mut(), 4).unwrap(), (2, 0));
-        assert_eq!(s3, [0x69, 0x6a, 0, 0, 0, 0, 0, 0]);
-    }
-
-    #[test]
-    fn test_peek_read_and_read_with_small_buffer() {
-        let mut sut = PeekReader::new(Cursor::new(&b"abcdefghij"[..]));
-
-        let mut v = [0; 8];
-        assert_eq!(sut.peek_read(v.as_mut(), 4).unwrap(), (4, 4));
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68]);
-
-        let mut v2 = [0; 2];
-        assert_eq!(sut.read(v2.as_mut()).unwrap(), 2);
-        assert_eq!(v2, [0x65, 0x66]);
-        assert_eq!(sut.read(v2.as_mut()).unwrap(), 2);
-        assert_eq!(v2, [0x67, 0x68]);
-        assert_eq!(sut.read(v2.as_mut()).unwrap(), 2);
-        assert_eq!(v2, [0x69, 0x6a]);
-    }
-
-    #[test]
-    fn test_peek_read_with_smaller_buffer() {
-        let mut sut = PeekReader::new(Cursor::new(&b"abcdefghij"[..]));
-
-        let mut v = [0; 8];
-        assert_eq!(sut.peek_read(v.as_mut(), 4).unwrap(), (4, 4));
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68]);
-
-        let mut v2 = [0; 2];
-        assert_eq!(sut.peek_read(v2.as_mut(), 2).unwrap(), (0, 2));
-        assert_eq!(v2, [0x65, 0x66]);
-        assert_eq!(sut.peek_read(v2.as_mut(), 0).unwrap(), (2, 0));
-        assert_eq!(v2, [0x65, 0x66]);
-        assert_eq!(sut.peek_read(v2.as_mut(), 0).unwrap(), (2, 0));
-        assert_eq!(v2, [0x67, 0x68]);
-        assert_eq!(sut.peek_read(v2.as_mut(), 0).unwrap(), (2, 0));
-        assert_eq!(v2, [0x69, 0x6a]);
-    }
-
-    #[test]
-    fn test_peek_read_peek_with_larger_peek_buffer() {
-        let mut sut = PeekReader::new(Cursor::new(&b"abcdefghij"[..]));
-
-        let mut v = [0; 8];
-        assert_eq!(sut.peek_read(v.as_mut(), 4).unwrap(), (4, 4));
-        assert_eq!(v, [0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68]);
-
-        let mut v2 = [0; 8];
-        assert_eq!(sut.peek_read(v2.as_mut(), 8).unwrap(), (0, 6));
-        assert_eq!(v2, [0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0, 0]);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/prn_char.rs.html b/coreutils/dev/src/uu_od/prn_char.rs.html deleted file mode 100644 index 20be7a7b5..000000000 --- a/coreutils/dev/src/uu_od/prn_char.rs.html +++ /dev/null @@ -1,311 +0,0 @@ -prn_char.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-
use std::str::from_utf8;
-
-use crate::formatteriteminfo::{FormatWriter, FormatterItemInfo};
-
-pub static FORMAT_ITEM_A: FormatterItemInfo = FormatterItemInfo {
-    byte_size: 1,
-    print_width: 4,
-    formatter: FormatWriter::IntWriter(format_item_a),
-};
-
-pub static FORMAT_ITEM_C: FormatterItemInfo = FormatterItemInfo {
-    byte_size: 1,
-    print_width: 4,
-    formatter: FormatWriter::MultibyteWriter(format_item_c),
-};
-
-static A_CHARS: [&str; 128] = [
-    "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs", "ht", "nl", "vt", "ff", "cr",
-    "so", "si", "dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc",
-    "fs", "gs", "rs", "us", "sp", "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-",
-    ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@",
-    "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S",
-    "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f",
-    "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y",
-    "z", "{", "|", "}", "~", "del",
-];
-
-fn format_item_a(p: u64) -> String {
-    // item-bytes == 1
-    let b = (p & 0x7f) as u8;
-    format!("{:>4}", A_CHARS.get(b as usize).unwrap_or(&"??"))
-}
-
-static C_CHARS: [&str; 128] = [
-    "\\0", "001", "002", "003", "004", "005", "006", "\\a", "\\b", "\\t", "\\n", "\\v", "\\f",
-    "\\r", "016", "017", "020", "021", "022", "023", "024", "025", "026", "027", "030", "031",
-    "032", "033", "034", "035", "036", "037", " ", "!", "\"", "#", "$", "%", "&", "'", "(", ")",
-    "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<",
-    "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O",
-    "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "a", "b",
-    "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u",
-    "v", "w", "x", "y", "z", "{", "|", "}", "~", "177",
-];
-
-fn format_item_c(bytes: &[u8]) -> String {
-    // item-bytes == 1
-    let b = bytes[0];
-
-    if b & 0x80 == 0x00 {
-        match C_CHARS.get(b as usize) {
-            Some(s) => format!("{s:>4}"),
-            None => format!("{b:>4}"),
-        }
-    } else if (b & 0xc0) == 0x80 {
-        // second or subsequent octet of an utf-8 sequence
-        String::from("  **")
-    } else if ((b & 0xe0) == 0xc0) && (bytes.len() >= 2) {
-        // start of a 2 octet utf-8 sequence
-        match from_utf8(&bytes[0..2]) {
-            Ok(s) => format!("{s:>4}"),
-            Err(_) => format!(" {b:03o}"),
-        }
-    } else if ((b & 0xf0) == 0xe0) && (bytes.len() >= 3) {
-        // start of a 3 octet utf-8 sequence
-        match from_utf8(&bytes[0..3]) {
-            Ok(s) => format!("{s:>4}"),
-            Err(_) => format!(" {b:03o}"),
-        }
-    } else if ((b & 0xf8) == 0xf0) && (bytes.len() >= 4) {
-        // start of a 4 octet utf-8 sequence
-        match from_utf8(&bytes[0..4]) {
-            Ok(s) => format!("{s:>4}"),
-            Err(_) => format!(" {b:03o}"),
-        }
-    } else {
-        // invalid utf-8
-        format!(" {b:03o}")
-    }
-}
-
-pub fn format_ascii_dump(bytes: &[u8]) -> String {
-    let mut result = String::new();
-
-    result.push('>');
-    for c in bytes.iter() {
-        if *c >= 0x20 && *c <= 0x7e {
-            result.push_str(C_CHARS[*c as usize]);
-        } else {
-            result.push('.');
-        }
-    }
-    result.push('<');
-
-    result
-}
-
-#[test]
-fn test_format_item_a() {
-    assert_eq!(" nul", format_item_a(0x00));
-    assert_eq!(" soh", format_item_a(0x01));
-    assert_eq!("  sp", format_item_a(0x20));
-    assert_eq!("   A", format_item_a(0x41));
-    assert_eq!("   ~", format_item_a(0x7e));
-    assert_eq!(" del", format_item_a(0x7f));
-
-    assert_eq!(" nul", format_item_a(0x80));
-    assert_eq!("   A", format_item_a(0xc1));
-    assert_eq!("   ~", format_item_a(0xfe));
-    assert_eq!(" del", format_item_a(0xff));
-}
-
-#[test]
-fn test_format_item_c() {
-    assert_eq!("  \\0", format_item_c(&[0x00]));
-    assert_eq!(" 001", format_item_c(&[0x01]));
-    assert_eq!("    ", format_item_c(&[0x20]));
-    assert_eq!("   A", format_item_c(&[0x41]));
-    assert_eq!("   ~", format_item_c(&[0x7e]));
-    assert_eq!(" 177", format_item_c(&[0x7f]));
-    assert_eq!("   A", format_item_c(&[0x41, 0x21]));
-
-    assert_eq!("  **", format_item_c(&[0x80]));
-    assert_eq!("  **", format_item_c(&[0x9f]));
-
-    assert_eq!("   ß", format_item_c(&[0xc3, 0x9f]));
-    assert_eq!("   ß", format_item_c(&[0xc3, 0x9f, 0x21]));
-
-    assert_eq!("   \u{1000}", format_item_c(&[0xe1, 0x80, 0x80]));
-    assert_eq!("   \u{1000}", format_item_c(&[0xe1, 0x80, 0x80, 0x21]));
-
-    assert_eq!("   \u{1f496}", format_item_c(&[0xf0, 0x9f, 0x92, 0x96]));
-    assert_eq!(
-        "   \u{1f496}",
-        format_item_c(&[0xf0, 0x9f, 0x92, 0x96, 0x21])
-    );
-
-    assert_eq!(" 300", format_item_c(&[0xc0, 0x80])); // invalid utf-8 (UTF-8 null)
-    assert_eq!(" 301", format_item_c(&[0xc1, 0xa1])); // invalid utf-8
-    assert_eq!(" 303", format_item_c(&[0xc3, 0xc3])); // invalid utf-8
-    assert_eq!(" 360", format_item_c(&[0xf0, 0x82, 0x82, 0xac])); // invalid utf-8 (overlong)
-    assert_eq!(" 360", format_item_c(&[0xf0, 0x9f, 0x92])); // invalid utf-8 (missing octet)
-    assert_eq!("   \u{10FFFD}", format_item_c(&[0xf4, 0x8f, 0xbf, 0xbd])); // largest valid utf-8   // spell-checker:ignore 10FFFD FFFD
-    assert_eq!(" 364", format_item_c(&[0xf4, 0x90, 0x00, 0x00])); // invalid utf-8
-    assert_eq!(" 365", format_item_c(&[0xf5, 0x80, 0x80, 0x80])); // invalid utf-8
-    assert_eq!(" 377", format_item_c(&[0xff])); // invalid utf-8
-}
-
-#[test]
-fn test_format_ascii_dump() {
-    assert_eq!(">.<", format_ascii_dump(&[0x00]));
-    assert_eq!(
-        ">. A~.<",
-        format_ascii_dump(&[0x1f, 0x20, 0x41, 0x7e, 0x7f])
-    );
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/prn_float.rs.html b/coreutils/dev/src/uu_od/prn_float.rs.html deleted file mode 100644 index a79aff0ee..000000000 --- a/coreutils/dev/src/uu_od/prn_float.rs.html +++ /dev/null @@ -1,435 +0,0 @@ -prn_float.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-
use half::f16;
-use std::f32;
-use std::f64;
-use std::num::FpCategory;
-
-use crate::formatteriteminfo::{FormatWriter, FormatterItemInfo};
-
-pub static FORMAT_ITEM_F16: FormatterItemInfo = FormatterItemInfo {
-    byte_size: 2,
-    print_width: 10,
-    formatter: FormatWriter::FloatWriter(format_item_flo16),
-};
-
-pub static FORMAT_ITEM_F32: FormatterItemInfo = FormatterItemInfo {
-    byte_size: 4,
-    print_width: 15,
-    formatter: FormatWriter::FloatWriter(format_item_flo32),
-};
-
-pub static FORMAT_ITEM_F64: FormatterItemInfo = FormatterItemInfo {
-    byte_size: 8,
-    print_width: 25,
-    formatter: FormatWriter::FloatWriter(format_item_flo64),
-};
-
-pub fn format_item_flo16(f: f64) -> String {
-    format!(" {}", format_flo16(f16::from_f64(f)))
-}
-
-pub fn format_item_flo32(f: f64) -> String {
-    format!(" {}", format_flo32(f as f32))
-}
-
-pub fn format_item_flo64(f: f64) -> String {
-    format!(" {}", format_flo64(f))
-}
-
-fn format_flo16(f: f16) -> String {
-    format_float(f64::from(f), 9, 4)
-}
-
-// formats float with 8 significant digits, eg 12345678 or -1.2345678e+12
-// always returns a string of 14 characters
-fn format_flo32(f: f32) -> String {
-    let width: usize = 14;
-    let precision: usize = 8;
-
-    if f.classify() == FpCategory::Subnormal {
-        // subnormal numbers will be normal as f64, so will print with a wrong precision
-        format!("{f:width$e}") // subnormal numbers
-    } else {
-        format_float(f64::from(f), width, precision)
-    }
-}
-
-fn format_flo64(f: f64) -> String {
-    format_float(f, 24, 17)
-}
-
-fn format_float(f: f64, width: usize, precision: usize) -> String {
-    if !f.is_normal() {
-        if f == -0.0 && f.is_sign_negative() {
-            return format!("{:>width$}", "-0");
-        }
-        if f == 0.0 || !f.is_finite() {
-            return format!("{f:width$}");
-        }
-        return format!("{f:width$e}"); // subnormal numbers
-    }
-
-    let mut l = f.abs().log10().floor() as i32;
-
-    let r = 10f64.powi(l);
-    if (f > 0.0 && r > f) || (f < 0.0 && -r < f) {
-        // fix precision error
-        l -= 1;
-    }
-
-    if l >= 0 && l <= (precision as i32 - 1) {
-        format!("{:width$.dec$}", f, dec = (precision - 1) - l as usize)
-    } else if l == -1 {
-        format!("{f:width$.precision$}")
-    } else {
-        format!("{:width$.dec$e}", f, dec = precision - 1)
-    }
-}
-
-#[test]
-#[allow(clippy::excessive_precision)]
-fn test_format_flo32() {
-    assert_eq!(format_flo32(1.0), "     1.0000000");
-    assert_eq!(format_flo32(9.9999990), "     9.9999990");
-    assert_eq!(format_flo32(10.0), "     10.000000");
-    assert_eq!(format_flo32(99.999977), "     99.999977");
-    assert_eq!(format_flo32(99.999992), "     99.999992");
-    assert_eq!(format_flo32(100.0), "     100.00000");
-    assert_eq!(format_flo32(999.99994), "     999.99994");
-    assert_eq!(format_flo32(1000.0), "     1000.0000");
-    assert_eq!(format_flo32(9999.9990), "     9999.9990");
-    assert_eq!(format_flo32(10000.0), "     10000.000");
-    assert_eq!(format_flo32(99999.992), "     99999.992");
-    assert_eq!(format_flo32(100000.0), "     100000.00");
-    assert_eq!(format_flo32(999999.94), "     999999.94");
-    assert_eq!(format_flo32(1000000.0), "     1000000.0");
-    assert_eq!(format_flo32(9999999.0), "     9999999.0");
-    assert_eq!(format_flo32(10000000.0), "      10000000");
-    assert_eq!(format_flo32(99999992.0), "      99999992");
-    assert_eq!(format_flo32(100000000.0), "   1.0000000e8");
-    assert_eq!(format_flo32(9.9999994e8), "   9.9999994e8");
-    assert_eq!(format_flo32(1.0e9), "   1.0000000e9");
-    assert_eq!(format_flo32(9.9999990e9), "   9.9999990e9");
-    assert_eq!(format_flo32(1.0e10), "  1.0000000e10");
-
-    assert_eq!(format_flo32(0.1), "    0.10000000");
-    assert_eq!(format_flo32(0.99999994), "    0.99999994");
-    assert_eq!(format_flo32(0.010000001), "  1.0000001e-2");
-    assert_eq!(format_flo32(0.099999994), "  9.9999994e-2");
-    assert_eq!(format_flo32(0.001), "  1.0000000e-3");
-    assert_eq!(format_flo32(0.0099999998), "  9.9999998e-3");
-
-    assert_eq!(format_flo32(-1.0), "    -1.0000000");
-    assert_eq!(format_flo32(-9.9999990), "    -9.9999990");
-    assert_eq!(format_flo32(-10.0), "    -10.000000");
-    assert_eq!(format_flo32(-99.999977), "    -99.999977");
-    assert_eq!(format_flo32(-99.999992), "    -99.999992");
-    assert_eq!(format_flo32(-100.0), "    -100.00000");
-    assert_eq!(format_flo32(-999.99994), "    -999.99994");
-    assert_eq!(format_flo32(-1000.0), "    -1000.0000");
-    assert_eq!(format_flo32(-9999.9990), "    -9999.9990");
-    assert_eq!(format_flo32(-10000.0), "    -10000.000");
-    assert_eq!(format_flo32(-99999.992), "    -99999.992");
-    assert_eq!(format_flo32(-100000.0), "    -100000.00");
-    assert_eq!(format_flo32(-999999.94), "    -999999.94");
-    assert_eq!(format_flo32(-1000000.0), "    -1000000.0");
-    assert_eq!(format_flo32(-9999999.0), "    -9999999.0");
-    assert_eq!(format_flo32(-10000000.0), "     -10000000");
-    assert_eq!(format_flo32(-99999992.0), "     -99999992");
-    assert_eq!(format_flo32(-100000000.0), "  -1.0000000e8");
-    assert_eq!(format_flo32(-9.9999994e8), "  -9.9999994e8");
-    assert_eq!(format_flo32(-1.0e9), "  -1.0000000e9");
-    assert_eq!(format_flo32(-9.9999990e9), "  -9.9999990e9");
-    assert_eq!(format_flo32(-1.0e10), " -1.0000000e10");
-
-    assert_eq!(format_flo32(-0.1), "   -0.10000000");
-    assert_eq!(format_flo32(-0.99999994), "   -0.99999994");
-    assert_eq!(format_flo32(-0.010000001), " -1.0000001e-2");
-    assert_eq!(format_flo32(-0.099999994), " -9.9999994e-2");
-    assert_eq!(format_flo32(-0.001), " -1.0000000e-3");
-    assert_eq!(format_flo32(-0.0099999998), " -9.9999998e-3");
-
-    assert_eq!(format_flo32(3.4028233e38), "  3.4028233e38");
-    assert_eq!(format_flo32(-3.4028233e38), " -3.4028233e38");
-    assert_eq!(format_flo32(-1.1663108e-38), "-1.1663108e-38");
-    assert_eq!(format_flo32(-4.7019771e-38), "-4.7019771e-38");
-    assert_eq!(format_flo32(1e-45), "         1e-45");
-
-    assert_eq!(format_flo32(-3.402823466e+38), " -3.4028235e38");
-    assert_eq!(format_flo32(f32::NAN), "           NaN");
-    assert_eq!(format_flo32(f32::INFINITY), "           inf");
-    assert_eq!(format_flo32(f32::NEG_INFINITY), "          -inf");
-    assert_eq!(format_flo32(-0.0), "            -0");
-    assert_eq!(format_flo32(0.0), "             0");
-}
-
-#[test]
-fn test_format_flo64() {
-    assert_eq!(format_flo64(1.0), "      1.0000000000000000");
-    assert_eq!(format_flo64(10.0), "      10.000000000000000");
-    assert_eq!(format_flo64(1000000000000000.0), "      1000000000000000.0");
-    assert_eq!(
-        format_flo64(10000000000000000.0),
-        "       10000000000000000"
-    );
-    assert_eq!(
-        format_flo64(100000000000000000.0),
-        "   1.0000000000000000e17"
-    );
-
-    assert_eq!(format_flo64(-0.1), "    -0.10000000000000001");
-    assert_eq!(format_flo64(-0.01), "  -1.0000000000000000e-2");
-
-    assert_eq!(
-        format_flo64(-2.2250738585072014e-308),
-        "-2.2250738585072014e-308"
-    );
-    assert_eq!(format_flo64(4e-320), "                  4e-320");
-    assert_eq!(format_flo64(f64::NAN), "                     NaN");
-    assert_eq!(format_flo64(f64::INFINITY), "                     inf");
-    assert_eq!(format_flo64(f64::NEG_INFINITY), "                    -inf");
-    assert_eq!(format_flo64(-0.0), "                      -0");
-    assert_eq!(format_flo64(0.0), "                       0");
-}
-
-#[test]
-fn test_format_flo16() {
-    assert_eq!(format_flo16(f16::from_bits(0x8400u16)), "-6.104e-5");
-    assert_eq!(format_flo16(f16::from_bits(0x8401u16)), "-6.109e-5");
-    assert_eq!(format_flo16(f16::from_bits(0x8402u16)), "-6.115e-5");
-    assert_eq!(format_flo16(f16::from_bits(0x8403u16)), "-6.121e-5");
-
-    assert_eq!(format_flo16(f16::from_f32(1.0)), "    1.000");
-    assert_eq!(format_flo16(f16::from_f32(10.0)), "    10.00");
-    assert_eq!(format_flo16(f16::from_f32(100.0)), "    100.0");
-    assert_eq!(format_flo16(f16::from_f32(1000.0)), "     1000");
-    assert_eq!(format_flo16(f16::from_f32(10000.0)), "  1.000e4");
-
-    assert_eq!(format_flo16(f16::from_f32(-0.2)), "  -0.2000");
-    assert_eq!(format_flo16(f16::from_f32(-0.02)), "-2.000e-2");
-
-    assert_eq!(format_flo16(f16::MIN_POSITIVE_SUBNORMAL), " 5.960e-8");
-    assert_eq!(format_flo16(f16::MIN), " -6.550e4");
-    assert_eq!(format_flo16(f16::NAN), "      NaN");
-    assert_eq!(format_flo16(f16::INFINITY), "      inf");
-    assert_eq!(format_flo16(f16::NEG_INFINITY), "     -inf");
-    assert_eq!(format_flo16(f16::NEG_ZERO), "       -0");
-    assert_eq!(format_flo16(f16::ZERO), "        0");
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_od/prn_int.rs.html b/coreutils/dev/src/uu_od/prn_int.rs.html deleted file mode 100644 index 3da55b947..000000000 --- a/coreutils/dev/src/uu_od/prn_int.rs.html +++ /dev/null @@ -1,395 +0,0 @@ -prn_int.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-
use crate::formatteriteminfo::*;
-
-/// format string to print octal using `int_writer_unsigned`
-macro_rules! OCT {
-    () => {
-        " {:0width$o}"
-    };
-}
-/// format string to print hexadecimal using `int_writer_unsigned`
-macro_rules! HEX {
-    () => {
-        " {:0width$x}"
-    };
-}
-/// format string to print decimal using `int_writer_unsigned` or `int_writer_signed`
-macro_rules! DEC {
-    () => {
-        " {:width$}"
-    };
-}
-
-/// defines a static struct of type `FormatterItemInfo` called `$NAME`
-///
-/// Used to format unsigned integer types with help of a function called `$function`
-/// `$byte_size` is the size of the type, `$print_width` is the maximum width in
-/// human-readable format. `$format_str` is one of OCT, HEX or DEC
-macro_rules! int_writer_unsigned {
-    ($NAME:ident, $byte_size:expr, $print_width:expr, $function:ident, $format_str:expr) => {
-        fn $function(p: u64) -> String {
-            format!($format_str, p, width = $print_width - 1)
-        }
-
-        pub static $NAME: FormatterItemInfo = FormatterItemInfo {
-            byte_size: $byte_size,
-            print_width: $print_width,
-            formatter: FormatWriter::IntWriter($function),
-        };
-    };
-}
-
-/// defines a static struct of type `FormatterItemInfo` called `$NAME`
-///
-/// Used to format signed integer types with help of a function called `$function`
-/// `$byte_size` is the size of the type, `$print_width` is the maximum width in
-/// human-readable format. `$format_str` should be DEC
-macro_rules! int_writer_signed {
-    ($NAME:ident, $byte_size:expr, $print_width:expr, $function:ident, $format_str:expr) => {
-        fn $function(p: u64) -> String {
-            let s = sign_extend(p, $byte_size);
-            format!($format_str, s, width = $print_width - 1)
-        }
-
-        pub static $NAME: FormatterItemInfo = FormatterItemInfo {
-            byte_size: $byte_size,
-            print_width: $print_width,
-            formatter: FormatWriter::IntWriter($function),
-        };
-    };
-}
-
-/// Extends a signed number in `item` of `item_bytes` bytes into a (signed) i64
-fn sign_extend(item: u64, item_bytes: usize) -> i64 {
-    let shift = 64 - item_bytes * 8;
-    (item << shift) as i64 >> shift
-}
-
-int_writer_unsigned!(FORMAT_ITEM_OCT8, 1, 4, format_item_oct8, OCT!()); // max: 377
-int_writer_unsigned!(FORMAT_ITEM_OCT16, 2, 7, format_item_oct16, OCT!()); // max: 177777
-int_writer_unsigned!(FORMAT_ITEM_OCT32, 4, 12, format_item_oct32, OCT!()); // max: 37777777777
-int_writer_unsigned!(FORMAT_ITEM_OCT64, 8, 23, format_item_oct64, OCT!()); // max: 1777777777777777777777
-
-int_writer_unsigned!(FORMAT_ITEM_HEX8, 1, 3, format_item_hex8, HEX!()); // max: ff
-int_writer_unsigned!(FORMAT_ITEM_HEX16, 2, 5, format_item_hex16, HEX!()); // max: ffff
-int_writer_unsigned!(FORMAT_ITEM_HEX32, 4, 9, format_item_hex32, HEX!()); // max: ffffffff
-int_writer_unsigned!(FORMAT_ITEM_HEX64, 8, 17, format_item_hex64, HEX!()); // max: ffffffffffffffff
-
-int_writer_unsigned!(FORMAT_ITEM_DEC8U, 1, 4, format_item_dec_u8, DEC!()); // max: 255
-int_writer_unsigned!(FORMAT_ITEM_DEC16U, 2, 6, format_item_dec_u16, DEC!()); // max: 65535
-int_writer_unsigned!(FORMAT_ITEM_DEC32U, 4, 11, format_item_dec_u32, DEC!()); // max: 4294967295
-int_writer_unsigned!(FORMAT_ITEM_DEC64U, 8, 21, format_item_dec_u64, DEC!()); // max: 18446744073709551615
-
-int_writer_signed!(FORMAT_ITEM_DEC8S, 1, 5, format_item_dec_s8, DEC!()); // max: -128
-int_writer_signed!(FORMAT_ITEM_DEC16S, 2, 7, format_item_dec_s16, DEC!()); // max: -32768
-int_writer_signed!(FORMAT_ITEM_DEC32S, 4, 12, format_item_dec_s32, DEC!()); // max: -2147483648
-int_writer_signed!(FORMAT_ITEM_DEC64S, 8, 21, format_item_dec_s64, DEC!()); // max: -9223372036854775808
-
-#[test]
-fn test_sign_extend() {
-    assert_eq!(
-        0xffff_ffff_ffff_ff80u64 as i64,
-        sign_extend(0x0000_0000_0000_0080, 1)
-    );
-    assert_eq!(
-        0xffff_ffff_ffff_8000u64 as i64,
-        sign_extend(0x0000_0000_0000_8000, 2)
-    );
-    assert_eq!(
-        0xffff_ffff_ff80_0000u64 as i64,
-        sign_extend(0x0000_0000_0080_0000, 3)
-    );
-    assert_eq!(
-        0xffff_ffff_8000_0000u64 as i64,
-        sign_extend(0x0000_0000_8000_0000, 4)
-    );
-    assert_eq!(
-        0xffff_ff80_0000_0000u64 as i64,
-        sign_extend(0x0000_0080_0000_0000, 5)
-    );
-    assert_eq!(
-        0xffff_8000_0000_0000u64 as i64,
-        sign_extend(0x0000_8000_0000_0000, 6)
-    );
-    assert_eq!(
-        0xff80_0000_0000_0000u64 as i64,
-        sign_extend(0x0080_0000_0000_0000, 7)
-    );
-    assert_eq!(
-        0x8000_0000_0000_0000u64 as i64,
-        sign_extend(0x8000_0000_0000_0000, 8)
-    );
-
-    assert_eq!(0x0000_0000_0000_007f, sign_extend(0x0000_0000_0000_007f, 1));
-    assert_eq!(0x0000_0000_0000_7fff, sign_extend(0x0000_0000_0000_7fff, 2));
-    assert_eq!(0x0000_0000_007f_ffff, sign_extend(0x0000_0000_007f_ffff, 3));
-    assert_eq!(0x0000_0000_7fff_ffff, sign_extend(0x0000_0000_7fff_ffff, 4));
-    assert_eq!(0x0000_007f_ffff_ffff, sign_extend(0x0000_007f_ffff_ffff, 5));
-    assert_eq!(0x0000_7fff_ffff_ffff, sign_extend(0x0000_7fff_ffff_ffff, 6));
-    assert_eq!(0x007f_ffff_ffff_ffff, sign_extend(0x007f_ffff_ffff_ffff, 7));
-    assert_eq!(0x7fff_ffff_ffff_ffff, sign_extend(0x7fff_ffff_ffff_ffff, 8));
-}
-
-#[test]
-fn test_format_item_oct() {
-    assert_eq!(" 000", format_item_oct8(0));
-    assert_eq!(" 377", format_item_oct8(0xff));
-    assert_eq!(" 000000", format_item_oct16(0));
-    assert_eq!(" 177777", format_item_oct16(0xffff));
-    assert_eq!(" 00000000000", format_item_oct32(0));
-    assert_eq!(" 37777777777", format_item_oct32(0xffff_ffff));
-    assert_eq!(" 0000000000000000000000", format_item_oct64(0));
-    assert_eq!(
-        " 1777777777777777777777",
-        format_item_oct64(0xffff_ffff_ffff_ffff)
-    );
-}
-
-#[test]
-fn test_format_item_hex() {
-    assert_eq!(" 00", format_item_hex8(0));
-    assert_eq!(" ff", format_item_hex8(0xff));
-    assert_eq!(" 0000", format_item_hex16(0));
-    assert_eq!(" ffff", format_item_hex16(0xffff));
-    assert_eq!(" 00000000", format_item_hex32(0));
-    assert_eq!(" ffffffff", format_item_hex32(0xffff_ffff));
-    assert_eq!(" 0000000000000000", format_item_hex64(0));
-    assert_eq!(
-        " ffffffffffffffff",
-        format_item_hex64(0xffff_ffff_ffff_ffff)
-    );
-}
-
-#[test]
-fn test_format_item_dec_u() {
-    assert_eq!("   0", format_item_dec_u8(0));
-    assert_eq!(" 255", format_item_dec_u8(0xff));
-    assert_eq!("     0", format_item_dec_u16(0));
-    assert_eq!(" 65535", format_item_dec_u16(0xffff));
-    assert_eq!("          0", format_item_dec_u32(0));
-    assert_eq!(" 4294967295", format_item_dec_u32(0xffff_ffff));
-    assert_eq!("                    0", format_item_dec_u64(0));
-    assert_eq!(
-        " 18446744073709551615",
-        format_item_dec_u64(0xffff_ffff_ffff_ffff)
-    );
-}
-
-#[test]
-fn test_format_item_dec_s() {
-    assert_eq!("    0", format_item_dec_s8(0));
-    assert_eq!("  127", format_item_dec_s8(0x7f));
-    assert_eq!(" -128", format_item_dec_s8(0x80));
-    assert_eq!("      0", format_item_dec_s16(0));
-    assert_eq!("  32767", format_item_dec_s16(0x7fff));
-    assert_eq!(" -32768", format_item_dec_s16(0x8000));
-    assert_eq!("           0", format_item_dec_s32(0));
-    assert_eq!("  2147483647", format_item_dec_s32(0x7fff_ffff));
-    assert_eq!(" -2147483648", format_item_dec_s32(0x8000_0000));
-    assert_eq!("                    0", format_item_dec_s64(0));
-    assert_eq!(
-        "  9223372036854775807",
-        format_item_dec_s64(0x7fff_ffff_ffff_ffff)
-    );
-    assert_eq!(
-        " -9223372036854775808",
-        format_item_dec_s64(0x8000_0000_0000_0000)
-    );
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_paste/paste.rs.html b/coreutils/dev/src/uu_paste/paste.rs.html deleted file mode 100644 index 8bcc51506..000000000 --- a/coreutils/dev/src/uu_paste/paste.rs.html +++ /dev/null @@ -1,441 +0,0 @@ -paste.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) delim
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::fs::File;
-use std::io::{stdin, stdout, BufRead, BufReader, Read, Write};
-use std::path::Path;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::line_ending::LineEnding;
-use uucore::{format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("paste.md");
-const USAGE: &str = help_usage!("paste.md");
-
-mod options {
-    pub const DELIMITER: &str = "delimiters";
-    pub const SERIAL: &str = "serial";
-    pub const FILE: &str = "file";
-    pub const ZERO_TERMINATED: &str = "zero-terminated";
-}
-
-// Wraps BufReader and stdin
-fn read_until<R: Read>(
-    reader: Option<&mut BufReader<R>>,
-    byte: u8,
-    buf: &mut Vec<u8>,
-) -> std::io::Result<usize> {
-    match reader {
-        Some(reader) => reader.read_until(byte, buf),
-        None => stdin().lock().read_until(byte, buf),
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let serial = matches.get_flag(options::SERIAL);
-    let delimiters = matches.get_one::<String>(options::DELIMITER).unwrap();
-    let files = matches
-        .get_many::<String>(options::FILE)
-        .unwrap()
-        .map(|s| s.to_owned())
-        .collect();
-    let line_ending = LineEnding::from_zero_flag(matches.get_flag(options::ZERO_TERMINATED));
-
-    paste(files, serial, delimiters, line_ending)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::SERIAL)
-                .long(options::SERIAL)
-                .short('s')
-                .help("paste one file at a time instead of in parallel")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DELIMITER)
-                .long(options::DELIMITER)
-                .short('d')
-                .help("reuse characters from LIST instead of TABs")
-                .value_name("LIST")
-                .default_value("\t")
-                .hide_default_value(true),
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .value_name("FILE")
-                .action(ArgAction::Append)
-                .default_value("-")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::ZERO_TERMINATED)
-                .long(options::ZERO_TERMINATED)
-                .short('z')
-                .help("line delimiter is NUL, not newline")
-                .action(ArgAction::SetTrue),
-        )
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn paste(
-    filenames: Vec<String>,
-    serial: bool,
-    delimiters: &str,
-    line_ending: LineEnding,
-) -> UResult<()> {
-    let mut files = Vec::with_capacity(filenames.len());
-    for name in filenames {
-        let file = if name == "-" {
-            None
-        } else {
-            let path = Path::new(&name);
-            let r = File::open(path).map_err_context(String::new)?;
-            Some(BufReader::new(r))
-        };
-        files.push(file);
-    }
-
-    if delimiters.ends_with('\\') && !delimiters.ends_with("\\\\") {
-        return Err(USimpleError::new(
-            1,
-            format!(
-                "delimiter list ends with an unescaped backslash: {}",
-                delimiters
-            ),
-        ));
-    }
-
-    let delimiters: Vec<char> = unescape(delimiters).chars().collect();
-    let mut delim_count = 0;
-    let mut delim_length = 1;
-    let stdout = stdout();
-    let mut stdout = stdout.lock();
-
-    let mut output = Vec::new();
-    if serial {
-        for file in &mut files {
-            output.clear();
-            loop {
-                match read_until(file.as_mut(), line_ending as u8, &mut output) {
-                    Ok(0) => break,
-                    Ok(_) => {
-                        if output.ends_with(&[line_ending as u8]) {
-                            output.pop();
-                        }
-                        // a buffer of length four is large enough to encode any char
-                        let mut buffer = [0; 4];
-                        let ch =
-                            delimiters[delim_count % delimiters.len()].encode_utf8(&mut buffer);
-                        delim_length = ch.len();
-
-                        for byte in buffer.iter().take(delim_length) {
-                            output.push(*byte);
-                        }
-                    }
-                    Err(e) => return Err(e.map_err_context(String::new)),
-                }
-                delim_count += 1;
-            }
-            // remove final delimiter
-            output.truncate(output.len() - delim_length);
-
-            write!(
-                stdout,
-                "{}{}",
-                String::from_utf8_lossy(&output),
-                line_ending
-            )?;
-        }
-    } else {
-        let mut eof = vec![false; files.len()];
-        loop {
-            output.clear();
-            let mut eof_count = 0;
-            for (i, file) in files.iter_mut().enumerate() {
-                if eof[i] {
-                    eof_count += 1;
-                } else {
-                    match read_until(file.as_mut(), line_ending as u8, &mut output) {
-                        Ok(0) => {
-                            eof[i] = true;
-                            eof_count += 1;
-                        }
-                        Ok(_) => {
-                            if output.ends_with(&[line_ending as u8]) {
-                                output.pop();
-                            }
-                        }
-                        Err(e) => return Err(e.map_err_context(String::new)),
-                    }
-                }
-                // a buffer of length four is large enough to encode any char
-                let mut buffer = [0; 4];
-                let ch = delimiters[delim_count % delimiters.len()].encode_utf8(&mut buffer);
-                delim_length = ch.len();
-
-                for byte in buffer.iter().take(delim_length) {
-                    output.push(*byte);
-                }
-
-                delim_count += 1;
-            }
-            if files.len() == eof_count {
-                break;
-            }
-            // Remove final delimiter
-            output.truncate(output.len() - delim_length);
-
-            write!(
-                stdout,
-                "{}{}",
-                String::from_utf8_lossy(&output),
-                line_ending
-            )?;
-            delim_count = 0;
-        }
-    }
-    Ok(())
-}
-
-// Unescape all special characters
-fn unescape(s: &str) -> String {
-    s.replace("\\n", "\n")
-        .replace("\\t", "\t")
-        .replace("\\\\", "\\")
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_pathchk/pathchk.rs.html b/coreutils/dev/src/uu_pathchk/pathchk.rs.html deleted file mode 100644 index 9531d25cc..000000000 --- a/coreutils/dev/src/uu_pathchk/pathchk.rs.html +++ /dev/null @@ -1,499 +0,0 @@ -pathchk.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-
#![allow(unused_must_use)] // because we of writeln!
-
-//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Inokentiy Babushkin <inokentiy.babushkin@googlemail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE file
-//  * that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) lstat
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::fs;
-use std::io::{ErrorKind, Write};
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, UResult, UUsageError};
-use uucore::{format_usage, help_about, help_usage};
-
-// operating mode
-enum Mode {
-    Default, // use filesystem to determine information and limits
-    Basic,   // check basic compatibility with POSIX
-    Extra,   // check for leading dashes and empty names
-    Both,    // a combination of `Basic` and `Extra`
-}
-
-const ABOUT: &str = help_about!("pathchk.md");
-const USAGE: &str = help_usage!("pathchk.md");
-
-mod options {
-    pub const POSIX: &str = "posix";
-    pub const POSIX_SPECIAL: &str = "posix-special";
-    pub const PORTABILITY: &str = "portability";
-    pub const PATH: &str = "path";
-}
-
-// a few global constants as used in the GNU implementation
-const POSIX_PATH_MAX: usize = 256;
-const POSIX_NAME_MAX: usize = 14;
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    // set working mode
-    let is_posix = matches.get_flag(options::POSIX);
-    let is_posix_special = matches.get_flag(options::POSIX_SPECIAL);
-    let is_portability = matches.get_flag(options::PORTABILITY);
-
-    let mode = if (is_posix && is_posix_special) || is_portability {
-        Mode::Both
-    } else if is_posix {
-        Mode::Basic
-    } else if is_posix_special {
-        Mode::Extra
-    } else {
-        Mode::Default
-    };
-
-    // take necessary actions
-    let paths = matches.get_many::<String>(options::PATH);
-    if paths.is_none() {
-        return Err(UUsageError::new(1, "missing operand"));
-    }
-
-    // free strings are path operands
-    // FIXME: TCS, seems inefficient and overly verbose (?)
-    let mut res = true;
-    for p in paths.unwrap() {
-        let mut path = Vec::new();
-        for path_segment in p.split('/') {
-            path.push(path_segment.to_string());
-        }
-        res &= check_path(&mode, &path);
-    }
-
-    // determine error code
-    if !res {
-        set_exit_code(1);
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::POSIX)
-                .short('p')
-                .help("check for most POSIX systems")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::POSIX_SPECIAL)
-                .short('P')
-                .help(r#"check for empty names and leading "-""#)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PORTABILITY)
-                .long(options::PORTABILITY)
-                .help("check for all POSIX systems (equivalent to -p -P)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PATH)
-                .hide(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
-// check a path, given as a slice of it's components and an operating mode
-fn check_path(mode: &Mode, path: &[String]) -> bool {
-    match *mode {
-        Mode::Basic => check_basic(path),
-        Mode::Extra => check_default(path) && check_extra(path),
-        Mode::Both => check_basic(path) && check_extra(path),
-        _ => check_default(path),
-    }
-}
-
-// check a path in basic compatibility mode
-fn check_basic(path: &[String]) -> bool {
-    let joined_path = path.join("/");
-    let total_len = joined_path.len();
-    // path length
-    if total_len > POSIX_PATH_MAX {
-        writeln!(
-            std::io::stderr(),
-            "limit {POSIX_PATH_MAX} exceeded by length {total_len} of file name {joined_path}"
-        );
-        return false;
-    } else if total_len == 0 {
-        writeln!(std::io::stderr(), "empty file name");
-        return false;
-    }
-    // components: character portability and length
-    for p in path {
-        let component_len = p.len();
-        if component_len > POSIX_NAME_MAX {
-            writeln!(
-                std::io::stderr(),
-                "limit {} exceeded by length {} of file name component {}",
-                POSIX_NAME_MAX,
-                component_len,
-                p.quote()
-            );
-            return false;
-        }
-        if !check_portable_chars(p) {
-            return false;
-        }
-    }
-    // permission checks
-    check_searchable(&joined_path)
-}
-
-// check a path in extra compatibility mode
-fn check_extra(path: &[String]) -> bool {
-    // components: leading hyphens
-    for p in path {
-        if p.starts_with('-') {
-            writeln!(
-                std::io::stderr(),
-                "leading hyphen in file name component {}",
-                p.quote()
-            );
-            return false;
-        }
-    }
-    // path length
-    if path.join("/").is_empty() {
-        writeln!(std::io::stderr(), "empty file name");
-        return false;
-    }
-    true
-}
-
-// check a path in default mode (using the file system)
-fn check_default(path: &[String]) -> bool {
-    let joined_path = path.join("/");
-    let total_len = joined_path.len();
-    // path length
-    if total_len > libc::PATH_MAX as usize {
-        writeln!(
-            std::io::stderr(),
-            "limit {} exceeded by length {} of file name {}",
-            libc::PATH_MAX,
-            total_len,
-            joined_path.quote()
-        );
-        return false;
-    }
-    // components: length
-    for p in path {
-        let component_len = p.len();
-        if component_len > libc::FILENAME_MAX as usize {
-            writeln!(
-                std::io::stderr(),
-                "limit {} exceeded by length {} of file name component {}",
-                libc::FILENAME_MAX,
-                component_len,
-                p.quote()
-            );
-            return false;
-        }
-    }
-    // permission checks
-    check_searchable(&joined_path)
-}
-
-// check whether a path is or if other problems arise
-fn check_searchable(path: &str) -> bool {
-    // we use lstat, just like the original implementation
-    match fs::symlink_metadata(path) {
-        Ok(_) => true,
-        Err(e) => {
-            if e.kind() == ErrorKind::NotFound {
-                true
-            } else {
-                writeln!(std::io::stderr(), "{e}");
-                false
-            }
-        }
-    }
-}
-
-// check whether a path segment contains only valid (read: portable) characters
-fn check_portable_chars(path_segment: &str) -> bool {
-    const VALID_CHARS: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-";
-    for (i, ch) in path_segment.as_bytes().iter().enumerate() {
-        if !VALID_CHARS.contains(ch) {
-            let invalid = path_segment[i..].chars().next().unwrap();
-            writeln!(
-                std::io::stderr(),
-                "nonportable character '{}' in file name component {}",
-                invalid,
-                path_segment.quote()
-            );
-            return false;
-        }
-    }
-    true
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_pinky/pinky.rs.html b/coreutils/dev/src/uu_pinky/pinky.rs.html deleted file mode 100644 index 689481ddf..000000000 --- a/coreutils/dev/src/uu_pinky/pinky.rs.html +++ /dev/null @@ -1,813 +0,0 @@ -pinky.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) BUFSIZE gecos fullname, mesg iobuf
-
-use uucore::entries::{Locate, Passwd};
-use uucore::error::{FromIo, UResult};
-use uucore::libc::S_IWGRP;
-use uucore::utmpx::{self, time, Utmpx};
-
-use std::io::prelude::*;
-use std::io::BufReader;
-
-use std::fs::File;
-use std::os::unix::fs::MetadataExt;
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::path::PathBuf;
-use uucore::{format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("pinky.md");
-const USAGE: &str = help_usage!("pinky.md");
-
-mod options {
-    pub const LONG_FORMAT: &str = "long_format";
-    pub const OMIT_HOME_DIR: &str = "omit_home_dir";
-    pub const OMIT_PROJECT_FILE: &str = "omit_project_file";
-    pub const OMIT_PLAN_FILE: &str = "omit_plan_file";
-    pub const SHORT_FORMAT: &str = "short_format";
-    pub const OMIT_HEADINGS: &str = "omit_headings";
-    pub const OMIT_NAME: &str = "omit_name";
-    pub const OMIT_NAME_HOST: &str = "omit_name_host";
-    pub const OMIT_NAME_HOST_TIME: &str = "omit_name_host_time";
-    pub const USER: &str = "user";
-    pub const HELP: &str = "help";
-}
-
-fn get_long_usage() -> String {
-    format!(
-        "A lightweight 'finger' program;  print user information.\n\
-         The utmp file will be {}.",
-        utmpx::DEFAULT_FILE
-    )
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app()
-        .after_help(get_long_usage())
-        .try_get_matches_from(args)?;
-
-    let users: Vec<String> = matches
-        .get_many::<String>(options::USER)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    // If true, display the hours:minutes since each user has touched
-    // the keyboard, or blank if within the last minute, or days followed
-    // by a 'd' if not within the last day.
-    let mut include_idle = true;
-
-    // If true, display a line at the top describing each field.
-    let include_heading = !matches.get_flag(options::OMIT_HEADINGS);
-
-    // if true, display the user's full name from pw_gecos.
-    let mut include_fullname = true;
-
-    // if true, display the user's ~/.project file when doing long format.
-    let include_project = !matches.get_flag(options::OMIT_PROJECT_FILE);
-
-    // if true, display the user's ~/.plan file when doing long format.
-    let include_plan = !matches.get_flag(options::OMIT_PLAN_FILE);
-
-    // if true, display the user's home directory and shell
-    // when doing long format.
-    let include_home_and_shell = !matches.get_flag(options::OMIT_HOME_DIR);
-
-    // if true, use the "short" output format.
-    let do_short_format = !matches.get_flag(options::LONG_FORMAT);
-
-    /* if true, display the ut_host field. */
-    let mut include_where = true;
-
-    if matches.get_flag(options::OMIT_NAME) {
-        include_fullname = false;
-    }
-    if matches.get_flag(options::OMIT_NAME_HOST) {
-        include_fullname = false;
-        include_where = false;
-    }
-    if matches.get_flag(options::OMIT_NAME_HOST_TIME) {
-        include_fullname = false;
-        include_idle = false;
-        include_where = false;
-    }
-
-    let pk = Pinky {
-        include_idle,
-        include_heading,
-        include_fullname,
-        include_project,
-        include_plan,
-        include_home_and_shell,
-        include_where,
-        names: users,
-    };
-
-    if do_short_format {
-        match pk.short_pinky() {
-            Ok(_) => Ok(()),
-            Err(e) => Err(e.map_err_context(String::new)),
-        }
-    } else {
-        pk.long_pinky();
-        Ok(())
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::LONG_FORMAT)
-                .short('l')
-                .requires(options::USER)
-                .help("produce long format output for the specified USERs")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OMIT_HOME_DIR)
-                .short('b')
-                .help("omit the user's home directory and shell in long format")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OMIT_PROJECT_FILE)
-                .short('h')
-                .help("omit the user's project file in long format")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OMIT_PLAN_FILE)
-                .short('p')
-                .help("omit the user's plan file in long format")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SHORT_FORMAT)
-                .short('s')
-                .help("do short format output, this is the default")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OMIT_HEADINGS)
-                .short('f')
-                .help("omit the line of column headings in short format")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OMIT_NAME)
-                .short('w')
-                .help("omit the user's full name in short format")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OMIT_NAME_HOST)
-                .short('i')
-                .help("omit the user's full name and remote host in short format")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OMIT_NAME_HOST_TIME)
-                .short('q')
-                .help("omit the user's full name, remote host and idle time in short format")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::USER)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::Username),
-        )
-        .arg(
-            // Redefine the help argument to not include the short flag
-            // since that conflicts with omit_project_file.
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information")
-                .action(ArgAction::Help),
-        )
-}
-
-struct Pinky {
-    include_idle: bool,
-    include_heading: bool,
-    include_fullname: bool,
-    include_project: bool,
-    include_plan: bool,
-    include_where: bool,
-    include_home_and_shell: bool,
-    names: Vec<String>,
-}
-
-pub trait Capitalize {
-    fn capitalize(&self) -> String;
-}
-
-impl Capitalize for str {
-    fn capitalize(&self) -> String {
-        self.char_indices()
-            .fold(String::with_capacity(self.len()), |mut acc, x| {
-                if x.0 == 0 {
-                    acc.push(x.1.to_ascii_uppercase());
-                } else {
-                    acc.push(x.1);
-                }
-                acc
-            })
-    }
-}
-
-fn idle_string(when: i64) -> String {
-    thread_local! {
-        static NOW: time::OffsetDateTime = time::OffsetDateTime::now_local().unwrap();
-    }
-    NOW.with(|n| {
-        let duration = n.unix_timestamp() - when;
-        if duration < 60 {
-            // less than 1min
-            "     ".to_owned()
-        } else if duration < 24 * 3600 {
-            // less than 1day
-            let hours = duration / (60 * 60);
-            let minutes = (duration % (60 * 60)) / 60;
-            format!("{hours:02}:{minutes:02}")
-        } else {
-            // more than 1day
-            let days = duration / (24 * 3600);
-            format!("{days}d")
-        }
-    })
-}
-
-fn time_string(ut: &Utmpx) -> String {
-    // "%b %e %H:%M"
-    let time_format: Vec<time::format_description::FormatItem> =
-        time::format_description::parse("[month repr:short] [day padding:space] [hour]:[minute]")
-            .unwrap();
-    ut.login_time().format(&time_format).unwrap() // LC_ALL=C
-}
-
-fn gecos_to_fullname(pw: &Passwd) -> Option<String> {
-    let mut gecos = if let Some(gecos) = &pw.user_info {
-        gecos.clone()
-    } else {
-        return None;
-    };
-    if let Some(n) = gecos.find(',') {
-        gecos.truncate(n);
-    }
-    Some(gecos.replace('&', &pw.name.capitalize()))
-}
-
-impl Pinky {
-    fn print_entry(&self, ut: &Utmpx) -> std::io::Result<()> {
-        let mut pts_path = PathBuf::from("/dev");
-        pts_path.push(ut.tty_device().as_str());
-
-        let mesg;
-        let last_change;
-
-        match pts_path.metadata() {
-            #[allow(clippy::unnecessary_cast)]
-            Ok(meta) => {
-                mesg = if meta.mode() & S_IWGRP as u32 == 0 {
-                    '*'
-                } else {
-                    ' '
-                };
-                last_change = meta.atime();
-            }
-            _ => {
-                mesg = '?';
-                last_change = 0;
-            }
-        }
-
-        print!("{1:<8.0$}", utmpx::UT_NAMESIZE, ut.user());
-
-        if self.include_fullname {
-            let fullname = if let Ok(pw) = Passwd::locate(ut.user().as_ref()) {
-                gecos_to_fullname(&pw)
-            } else {
-                None
-            };
-            if let Some(fullname) = fullname {
-                print!(" {fullname:<19.19}");
-            } else {
-                print!(" {:19}", "        ???");
-            }
-        }
-
-        print!(" {}{:<8.*}", mesg, utmpx::UT_LINESIZE, ut.tty_device());
-
-        if self.include_idle {
-            if last_change == 0 {
-                print!(" {:<6}", "?????");
-            } else {
-                print!(" {:<6}", idle_string(last_change));
-            }
-        }
-
-        print!(" {}", time_string(ut));
-
-        let mut s = ut.host();
-        if self.include_where && !s.is_empty() {
-            s = ut.canon_host()?;
-            print!(" {s}");
-        }
-
-        println!();
-        Ok(())
-    }
-
-    fn print_heading(&self) {
-        print!("{:<8}", "Login");
-        if self.include_fullname {
-            print!(" {:<19}", "Name");
-        }
-        print!(" {:<9}", " TTY");
-        if self.include_idle {
-            print!(" {:<6}", "Idle");
-        }
-        print!(" {:<16}", "When");
-        if self.include_where {
-            print!(" Where");
-        }
-        println!();
-    }
-
-    fn short_pinky(&self) -> std::io::Result<()> {
-        if self.include_heading {
-            self.print_heading();
-        }
-        for ut in Utmpx::iter_all_records() {
-            if ut.is_user_process()
-                && (self.names.is_empty() || self.names.iter().any(|n| n.as_str() == ut.user()))
-            {
-                self.print_entry(&ut)?;
-            }
-        }
-        Ok(())
-    }
-
-    fn long_pinky(&self) {
-        for u in &self.names {
-            print!("Login name: {u:<28}In real life: ");
-            if let Ok(pw) = Passwd::locate(u.as_str()) {
-                let fullname = gecos_to_fullname(&pw).unwrap_or_default();
-                let user_dir = pw.user_dir.unwrap_or_default();
-                let user_shell = pw.user_shell.unwrap_or_default();
-                println!(" {fullname}");
-                if self.include_home_and_shell {
-                    print!("Directory: {user_dir:<29}");
-                    println!("Shell:  {user_shell}");
-                }
-                if self.include_project {
-                    let mut p = PathBuf::from(&user_dir);
-                    p.push(".project");
-                    if let Ok(f) = File::open(p) {
-                        print!("Project: ");
-                        read_to_console(f);
-                    }
-                }
-                if self.include_plan {
-                    let mut p = PathBuf::from(&user_dir);
-                    p.push(".plan");
-                    if let Ok(f) = File::open(p) {
-                        println!("Plan:");
-                        read_to_console(f);
-                    }
-                }
-                println!();
-            } else {
-                println!(" ???");
-            }
-        }
-    }
-}
-
-fn read_to_console<F: Read>(f: F) {
-    let mut reader = BufReader::new(f);
-    let mut iobuf = Vec::new();
-    if reader.read_to_end(&mut iobuf).is_ok() {
-        print!("{}", String::from_utf8_lossy(&iobuf));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_pr/pr.rs.html b/coreutils/dev/src/uu_pr/pr.rs.html deleted file mode 100644 index ea369faf1..000000000 --- a/coreutils/dev/src/uu_pr/pr.rs.html +++ /dev/null @@ -1,2529 +0,0 @@ -pr.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
-1143
-1144
-1145
-1146
-1147
-1148
-1149
-1150
-1151
-1152
-1153
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162
-1163
-1164
-1165
-1166
-1167
-1168
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179
-1180
-1181
-1182
-1183
-1184
-1185
-1186
-1187
-1188
-1189
-1190
-1191
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200
-1201
-1202
-1203
-1204
-1205
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214
-1215
-1216
-1217
-1218
-1219
-1220
-1221
-1222
-1223
-1224
-1225
-1226
-1227
-1228
-1229
-1230
-1231
-1232
-1233
-1234
-1235
-1236
-1237
-1238
-1239
-1240
-1241
-1242
-1243
-1244
-1245
-1246
-1247
-1248
-1249
-1250
-1251
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-
// This file is part of the uutils coreutils package.
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-//
-
-// spell-checker:ignore (ToDO) adFfmprt, kmerge
-
-use chrono::{DateTime, Local};
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-use itertools::Itertools;
-use quick_error::ResultExt;
-use regex::Regex;
-use std::convert::From;
-use std::fs::{metadata, File};
-use std::io::{stdin, stdout, BufRead, BufReader, Lines, Read, Write};
-#[cfg(unix)]
-use std::os::unix::fs::FileTypeExt;
-
-use quick_error::quick_error;
-use uucore::display::Quotable;
-use uucore::error::UResult;
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-const ABOUT: &str = help_about!("pr.md");
-const USAGE: &str = help_usage!("pr.md");
-const AFTER_HELP: &str = help_section!("after help", "pr.md");
-const TAB: char = '\t';
-const LINES_PER_PAGE: usize = 66;
-const LINES_PER_PAGE_FOR_FORM_FEED: usize = 63;
-const HEADER_LINES_PER_PAGE: usize = 5;
-const TRAILER_LINES_PER_PAGE: usize = 5;
-const FILE_STDIN: &str = "-";
-const READ_BUFFER_SIZE: usize = 1024 * 64;
-const DEFAULT_COLUMN_WIDTH: usize = 72;
-const DEFAULT_COLUMN_WIDTH_WITH_S_OPTION: usize = 512;
-const DEFAULT_COLUMN_SEPARATOR: &char = &TAB;
-const FF: u8 = 0x0C_u8;
-const DATE_TIME_FORMAT: &str = "%b %d %H:%M %Y";
-
-mod options {
-    pub const HEADER: &str = "header";
-    pub const DOUBLE_SPACE: &str = "double-space";
-    pub const NUMBER_LINES: &str = "number-lines";
-    pub const FIRST_LINE_NUMBER: &str = "first-line-number";
-    pub const PAGES: &str = "pages";
-    pub const OMIT_HEADER: &str = "omit-header";
-    pub const PAGE_LENGTH: &str = "length";
-    pub const NO_FILE_WARNINGS: &str = "no-file-warnings";
-    pub const FORM_FEED: &str = "form-feed";
-    pub const COLUMN_WIDTH: &str = "width";
-    pub const PAGE_WIDTH: &str = "page-width";
-    pub const ACROSS: &str = "across";
-    pub const COLUMN: &str = "column";
-    pub const COLUMN_CHAR_SEPARATOR: &str = "separator";
-    pub const COLUMN_STRING_SEPARATOR: &str = "sep-string";
-    pub const MERGE: &str = "merge";
-    pub const INDENT: &str = "indent";
-    pub const JOIN_LINES: &str = "join-lines";
-    pub const HELP: &str = "help";
-    pub const FILES: &str = "files";
-}
-
-struct OutputOptions {
-    /// Line numbering mode
-    number: Option<NumberingMode>,
-    header: String,
-    double_space: bool,
-    line_separator: String,
-    content_line_separator: String,
-    last_modified_time: String,
-    start_page: usize,
-    end_page: Option<usize>,
-    display_header_and_trailer: bool,
-    content_lines_per_page: usize,
-    page_separator_char: String,
-    column_mode_options: Option<ColumnModeOptions>,
-    merge_files_print: Option<usize>,
-    offset_spaces: String,
-    form_feed_used: bool,
-    join_lines: bool,
-    col_sep_for_printing: String,
-    line_width: Option<usize>,
-}
-
-struct FileLine {
-    file_id: usize,
-    line_number: usize,
-    page_number: usize,
-    group_key: usize,
-    line_content: Result<String, std::io::Error>,
-    form_feeds_after: usize,
-}
-
-struct ColumnModeOptions {
-    width: usize,
-    columns: usize,
-    column_separator: String,
-    across_mode: bool,
-}
-
-/// Line numbering mode
-struct NumberingMode {
-    width: usize,
-    separator: String,
-    first_number: usize,
-}
-
-impl Default for NumberingMode {
-    fn default() -> Self {
-        Self {
-            width: 5,
-            separator: TAB.to_string(),
-            first_number: 1,
-        }
-    }
-}
-
-impl Default for FileLine {
-    fn default() -> Self {
-        Self {
-            file_id: 0,
-            line_number: 0,
-            page_number: 0,
-            group_key: 0,
-            line_content: Ok(String::new()),
-            form_feeds_after: 0,
-        }
-    }
-}
-
-impl From<std::io::Error> for PrError {
-    fn from(err: std::io::Error) -> Self {
-        Self::EncounteredErrors(err.to_string())
-    }
-}
-
-quick_error! {
-    #[derive(Debug)]
-    enum PrError {
-        Input(err: std::io::Error, path: String) {
-            context(path: &'a str, err: std::io::Error) -> (err, path.to_owned())
-            display("pr: Reading from input {0} gave error", path)
-            source(err)
-        }
-
-        UnknownFiletype(path: String) {
-            display("pr: {0}: unknown filetype", path)
-        }
-
-        EncounteredErrors(msg: String) {
-            display("pr: {0}", msg)
-        }
-
-        IsDirectory(path: String) {
-            display("pr: {0}: Is a directory", path)
-        }
-
-        IsSocket(path: String) {
-            display("pr: cannot open {}, Operation not supported on socket", path)
-        }
-
-        NotExists(path: String) {
-            display("pr: cannot open {}, No such file or directory", path)
-        }
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .args_override_self(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::PAGES)
-                .long(options::PAGES)
-                .help("Begin and stop printing with page FIRST_PAGE[:LAST_PAGE]")
-                .value_name("FIRST_PAGE[:LAST_PAGE]"),
-        )
-        .arg(
-            Arg::new(options::HEADER)
-                .short('h')
-                .long(options::HEADER)
-                .help(
-                    "Use the string header to replace the file name \
-                    in the header line.",
-                )
-                .value_name("STRING"),
-        )
-        .arg(
-            Arg::new(options::DOUBLE_SPACE)
-                .short('d')
-                .long(options::DOUBLE_SPACE)
-                .help(
-                    "Produce output that is double spaced. An extra <newline> \
-                character is output following every <newline> found in the input.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NUMBER_LINES)
-                .short('n')
-                .long(options::NUMBER_LINES)
-                .help(
-                    "Provide width digit line numbering.  The default for width, \
-                if not specified, is 5.  The number occupies the first width column \
-                positions of each text column or each line of -m output.  If char \
-                (any non-digit character) is given, it is appended to the line number \
-                to separate it from whatever follows.  The default for char is a <tab>. \
-                Line numbers longer than width columns are truncated.",
-                )
-                .allow_hyphen_values(true)
-                .value_name("[char][width]"),
-        )
-        .arg(
-            Arg::new(options::FIRST_LINE_NUMBER)
-                .short('N')
-                .long(options::FIRST_LINE_NUMBER)
-                .help("start counting with NUMBER at 1st line of first page printed")
-                .value_name("NUMBER"),
-        )
-        .arg(
-            Arg::new(options::OMIT_HEADER)
-                .short('t')
-                .long(options::OMIT_HEADER)
-                .help(
-                    "Write neither the five-line identifying header nor the five-line \
-                trailer usually supplied for each page. Quit writing after the last line \
-                 of each file without spacing to the end of the page.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PAGE_LENGTH)
-                .short('l')
-                .long(options::PAGE_LENGTH)
-                .help(
-                    "Override the 66-line default (default number of lines of text 56, \
-                    and with -F 63) and reset the page length to lines.  If lines is not \
-                    greater than the sum  of  both the  header  and trailer depths (in lines), \
-                    the pr utility shall suppress both the header and trailer, as if the -t \
-                    option were in effect. ",
-                )
-                .value_name("PAGE_LENGTH"),
-        )
-        .arg(
-            Arg::new(options::NO_FILE_WARNINGS)
-                .short('r')
-                .long(options::NO_FILE_WARNINGS)
-                .help("omit warning when a file cannot be opened")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FORM_FEED)
-                .short('F')
-                .short_alias('f')
-                .long(options::FORM_FEED)
-                .help(
-                    "Use a <form-feed> for new pages, instead of the default behavior that \
-                uses a sequence of <newline>s.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::COLUMN_WIDTH)
-                .short('w')
-                .long(options::COLUMN_WIDTH)
-                .help(
-                    "Set the width of the line to width column positions for multiple \
-                text-column output only. If the -w option is not specified and the -s option \
-                is not specified, the default width shall be 72. If the -w option is not specified \
-                and the -s option is specified, the default width shall be 512.",
-                )
-                .value_name("width"),
-        )
-        .arg(
-            Arg::new(options::PAGE_WIDTH)
-                .short('W')
-                .long(options::PAGE_WIDTH)
-                .help(
-                    "set page width to PAGE_WIDTH (72) characters always, \
-                truncate lines, except -J option is set, no interference \
-                with -S or -s",
-                )
-                .value_name("width"),
-        )
-        .arg(
-            Arg::new(options::ACROSS)
-                .short('a')
-                .long(options::ACROSS)
-                .help(
-                    "Modify the effect of the - column option so that the columns are filled \
-                across the page in a  round-robin  order (for example, when column is 2, the \
-                first input line heads column 1, the second heads column 2, the third is the \
-                second line in column 1, and so on).",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::COLUMN)
-                .long(options::COLUMN)
-                .help(
-                    "Produce multi-column output that is arranged in column columns \
-                (the default shall be 1) and is written down each column  in  the order in which \
-                the text is received from the input file. This option should not be used with -m. \
-                The options -e and -i shall be assumed for multiple text-column output.  Whether \
-                or not text columns are produced with identical vertical lengths is unspecified, \
-                but a text column shall never exceed the length of the page (see the -l option). \
-                When used with -t, use the minimum number of lines to write the output.",
-                )
-                .value_name("column"),
-        )
-        .arg(
-            Arg::new(options::COLUMN_CHAR_SEPARATOR)
-                .short('s')
-                .long(options::COLUMN_CHAR_SEPARATOR)
-                .help(
-                    "Separate text columns by the single character char instead of by the \
-                appropriate number of <space>s (default for char is the <tab> character).",
-                )
-                .value_name("char"),
-        )
-        .arg(
-            Arg::new(options::COLUMN_STRING_SEPARATOR)
-                .short('S')
-                .long(options::COLUMN_STRING_SEPARATOR)
-                .help(
-                    "separate columns by STRING, \
-                without -S: Default separator <TAB> with -J and <space> \
-                otherwise (same as -S\" \"), no effect on column options",
-                )
-                .value_name("string"),
-        )
-        .arg(
-            Arg::new(options::MERGE)
-                .short('m')
-                .long(options::MERGE)
-                .help(
-                    "Merge files. Standard output shall be formatted so the pr utility \
-                writes one line from each file specified by a file operand, side by side \
-                into text columns of equal fixed widths, in terms of the number of column \
-                positions. Implementations shall support merging of at least nine file operands.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::INDENT)
-                .short('o')
-                .long(options::INDENT)
-                .help(
-                    "Each line of output shall be preceded by offset <space>s. If the -o \
-                option is not specified, the default offset shall be zero. The space taken is \
-                in addition to the output line width (see the -w option below).",
-                )
-                .value_name("margin"),
-        )
-        .arg(
-            Arg::new(options::JOIN_LINES)
-                .short('J')
-                .help(
-                    "merge full lines, turns off -W line truncation, no column \
-                alignment, --sep-string[=STRING] sets separators",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new(options::FILES)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let opt_args = recreate_arguments(&args);
-
-    let mut command = uu_app();
-    let matches = match command.try_get_matches_from_mut(opt_args) {
-        Ok(m) => m,
-        Err(e) => {
-            e.print()?;
-            return Ok(());
-        }
-    };
-
-    let mut files = matches
-        .get_many::<String>(options::FILES)
-        .map(|v| v.map(|s| s.as_str()).collect::<Vec<_>>())
-        .unwrap_or_default()
-        .clone();
-    if files.is_empty() {
-        files.insert(0, FILE_STDIN);
-    }
-
-    let file_groups: Vec<_> = if matches.get_flag(options::MERGE) {
-        vec![files]
-    } else {
-        files.into_iter().map(|i| vec![i]).collect()
-    };
-
-    for file_group in file_groups {
-        let result_options = build_options(&matches, &file_group, &args.join(" "));
-        let options = match result_options {
-            Ok(options) => options,
-            Err(err) => {
-                print_error(&matches, &err);
-                return Err(1.into());
-            }
-        };
-
-        let cmd_result = if let Ok(group) = file_group.iter().exactly_one() {
-            pr(group, &options)
-        } else {
-            mpr(&file_group, &options)
-        };
-
-        let status = match cmd_result {
-            Err(error) => {
-                print_error(&matches, &error);
-                1
-            }
-            _ => 0,
-        };
-        if status != 0 {
-            return Err(status.into());
-        }
-    }
-    Ok(())
-}
-
-/// Returns re-written arguments which are passed to the program.
-/// Removes -column and +page option as getopts cannot parse things like -3 etc
-/// # Arguments
-/// * `args` - Command line arguments
-fn recreate_arguments(args: &[String]) -> Vec<String> {
-    let column_page_option = Regex::new(r"^[-+]\d+.*").unwrap();
-    let num_regex = Regex::new(r"^[^-]\d*$").unwrap();
-    let n_regex = Regex::new(r"^-n\s*$").unwrap();
-    let mut arguments = args.to_owned();
-    let num_option = args.iter().find_position(|x| n_regex.is_match(x.trim()));
-    if let Some((pos, _value)) = num_option {
-        if let Some(num_val_opt) = args.get(pos + 1) {
-            if !num_regex.is_match(num_val_opt) {
-                let could_be_file = arguments.remove(pos + 1);
-                arguments.insert(pos + 1, format!("{}", NumberingMode::default().width));
-                arguments.insert(pos + 2, could_be_file);
-            }
-        }
-    }
-
-    arguments
-        .into_iter()
-        .filter(|i| !column_page_option.is_match(i))
-        .collect()
-}
-
-fn print_error(matches: &ArgMatches, err: &PrError) {
-    if !matches.get_flag(options::NO_FILE_WARNINGS) {
-        eprintln!("{err}");
-    }
-}
-
-fn parse_usize(matches: &ArgMatches, opt: &str) -> Option<Result<usize, PrError>> {
-    let from_parse_error_to_pr_error = |value_to_parse: (String, String)| {
-        let i = value_to_parse.0;
-        let option = value_to_parse.1;
-        i.parse().map_err(|_e| {
-            PrError::EncounteredErrors(format!("invalid {} argument {}", option, i.quote()))
-        })
-    };
-    matches
-        .get_one::<String>(opt)
-        .map(|i| (i.to_string(), format!("-{opt}")))
-        .map(from_parse_error_to_pr_error)
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn build_options(
-    matches: &ArgMatches,
-    paths: &[&str],
-    free_args: &str,
-) -> Result<OutputOptions, PrError> {
-    let form_feed_used = matches.get_flag(options::FORM_FEED);
-
-    let is_merge_mode = matches.get_flag(options::MERGE);
-
-    if is_merge_mode && matches.contains_id(options::COLUMN) {
-        let err_msg = String::from("cannot specify number of columns when printing in parallel");
-        return Err(PrError::EncounteredErrors(err_msg));
-    }
-
-    if is_merge_mode && matches.get_flag(options::ACROSS) {
-        let err_msg = String::from("cannot specify both printing across and printing in parallel");
-        return Err(PrError::EncounteredErrors(err_msg));
-    }
-
-    let merge_files_print = if matches.get_flag(options::MERGE) {
-        Some(paths.len())
-    } else {
-        None
-    };
-
-    let header = matches
-        .get_one::<String>(options::HEADER)
-        .map(|s| s.as_str())
-        .unwrap_or(if is_merge_mode || paths[0] == FILE_STDIN {
-            ""
-        } else {
-            paths[0]
-        })
-        .to_string();
-
-    let default_first_number = NumberingMode::default().first_number;
-    let first_number =
-        parse_usize(matches, options::FIRST_LINE_NUMBER).unwrap_or(Ok(default_first_number))?;
-
-    let number = matches
-        .get_one::<String>(options::NUMBER_LINES)
-        .map(|i| {
-            let parse_result = i.parse::<usize>();
-
-            let separator = if parse_result.is_err() {
-                i[0..1].to_string()
-            } else {
-                NumberingMode::default().separator
-            };
-
-            let width = match parse_result {
-                Ok(res) => res,
-                Err(_) => i[1..]
-                    .parse::<usize>()
-                    .unwrap_or(NumberingMode::default().width),
-            };
-
-            NumberingMode {
-                width,
-                separator,
-                first_number,
-            }
-        })
-        .or_else(|| {
-            if matches.contains_id(options::NUMBER_LINES) {
-                Some(NumberingMode::default())
-            } else {
-                None
-            }
-        });
-
-    let double_space = matches.get_flag(options::DOUBLE_SPACE);
-
-    let content_line_separator = if double_space {
-        "\n".repeat(2)
-    } else {
-        "\n".to_string()
-    };
-
-    let line_separator = "\n".to_string();
-
-    let last_modified_time = if is_merge_mode || paths[0].eq(FILE_STDIN) {
-        let date_time = Local::now();
-        date_time.format(DATE_TIME_FORMAT).to_string()
-    } else {
-        file_last_modified_time(paths.first().unwrap())
-    };
-
-    // +page option is less priority than --pages
-    let page_plus_re = Regex::new(r"\s*\+(\d+:*\d*)\s*").unwrap();
-    let start_page_in_plus_option = match page_plus_re.captures(free_args).map(|i| {
-        let unparsed_num = i.get(1).unwrap().as_str().trim();
-        let x: Vec<_> = unparsed_num.split(':').collect();
-        x[0].to_string().parse::<usize>().map_err(|_e| {
-            PrError::EncounteredErrors(format!("invalid {} argument {}", "+", unparsed_num.quote()))
-        })
-    }) {
-        Some(res) => res?,
-        None => 1,
-    };
-
-    let end_page_in_plus_option = match page_plus_re
-        .captures(free_args)
-        .map(|i| i.get(1).unwrap().as_str().trim())
-        .filter(|i| i.contains(':'))
-        .map(|unparsed_num| {
-            let x: Vec<_> = unparsed_num.split(':').collect();
-            x[1].to_string().parse::<usize>().map_err(|_e| {
-                PrError::EncounteredErrors(format!(
-                    "invalid {} argument {}",
-                    "+",
-                    unparsed_num.quote()
-                ))
-            })
-        }) {
-        Some(res) => Some(res?),
-        None => None,
-    };
-
-    let invalid_pages_map = |i: String| {
-        let unparsed_value = matches.get_one::<String>(options::PAGES).unwrap();
-        i.parse::<usize>().map_err(|_e| {
-            PrError::EncounteredErrors(format!(
-                "invalid --pages argument {}",
-                unparsed_value.quote()
-            ))
-        })
-    };
-
-    let start_page = match matches
-        .get_one::<String>(options::PAGES)
-        .map(|i| {
-            let x: Vec<_> = i.split(':').collect();
-            x[0].to_string()
-        })
-        .map(invalid_pages_map)
-    {
-        Some(res) => res?,
-        None => start_page_in_plus_option,
-    };
-
-    let end_page = match matches
-        .get_one::<String>(options::PAGES)
-        .filter(|i| i.contains(':'))
-        .map(|i| {
-            let x: Vec<_> = i.split(':').collect();
-            x[1].to_string()
-        })
-        .map(invalid_pages_map)
-    {
-        Some(res) => Some(res?),
-        None => end_page_in_plus_option,
-    };
-
-    if let Some(end_page) = end_page {
-        if start_page > end_page {
-            return Err(PrError::EncounteredErrors(format!(
-                "invalid --pages argument '{start_page}:{end_page}'"
-            )));
-        }
-    }
-
-    let default_lines_per_page = if form_feed_used {
-        LINES_PER_PAGE_FOR_FORM_FEED
-    } else {
-        LINES_PER_PAGE
-    };
-
-    let page_length =
-        parse_usize(matches, options::PAGE_LENGTH).unwrap_or(Ok(default_lines_per_page))?;
-
-    let page_length_le_ht = page_length < (HEADER_LINES_PER_PAGE + TRAILER_LINES_PER_PAGE);
-
-    let display_header_and_trailer =
-        !(page_length_le_ht) && !matches.get_flag(options::OMIT_HEADER);
-
-    let content_lines_per_page = if page_length_le_ht {
-        page_length
-    } else {
-        page_length - (HEADER_LINES_PER_PAGE + TRAILER_LINES_PER_PAGE)
-    };
-
-    let page_separator_char = if matches.get_flag(options::FORM_FEED) {
-        let bytes = vec![FF];
-        String::from_utf8(bytes).unwrap()
-    } else {
-        "\n".to_string()
-    };
-
-    let across_mode = matches.get_flag(options::ACROSS);
-
-    let column_separator = match matches.get_one::<String>(options::COLUMN_STRING_SEPARATOR) {
-        Some(x) => Some(x),
-        None => matches.get_one::<String>(options::COLUMN_CHAR_SEPARATOR),
-    }
-    .map(ToString::to_string)
-    .unwrap_or_else(|| DEFAULT_COLUMN_SEPARATOR.to_string());
-
-    let default_column_width = if matches.contains_id(options::COLUMN_WIDTH)
-        && matches.contains_id(options::COLUMN_CHAR_SEPARATOR)
-    {
-        DEFAULT_COLUMN_WIDTH_WITH_S_OPTION
-    } else {
-        DEFAULT_COLUMN_WIDTH
-    };
-
-    let column_width =
-        parse_usize(matches, options::COLUMN_WIDTH).unwrap_or(Ok(default_column_width))?;
-
-    let page_width = if matches.get_flag(options::JOIN_LINES) {
-        None
-    } else {
-        match parse_usize(matches, options::PAGE_WIDTH) {
-            Some(res) => Some(res?),
-            None => None,
-        }
-    };
-
-    let re_col = Regex::new(r"\s*-(\d+)\s*").unwrap();
-
-    let start_column_option = match re_col.captures(free_args).map(|i| {
-        let unparsed_num = i.get(1).unwrap().as_str().trim();
-        unparsed_num.parse::<usize>().map_err(|_e| {
-            PrError::EncounteredErrors(format!("invalid {} argument {}", "-", unparsed_num.quote()))
-        })
-    }) {
-        Some(res) => Some(res?),
-        None => None,
-    };
-
-    // --column has more priority than -column
-
-    let column_option_value = match parse_usize(matches, options::COLUMN) {
-        Some(res) => Some(res?),
-        None => start_column_option,
-    };
-
-    let column_mode_options = column_option_value.map(|columns| ColumnModeOptions {
-        columns,
-        width: column_width,
-        column_separator,
-        across_mode,
-    });
-
-    let offset_spaces = " ".repeat(parse_usize(matches, options::INDENT).unwrap_or(Ok(0))?);
-    let join_lines = matches.get_flag(options::JOIN_LINES);
-
-    let col_sep_for_printing = column_mode_options
-        .as_ref()
-        .map(|i| i.column_separator.clone())
-        .unwrap_or_else(|| {
-            merge_files_print
-                .map(|_k| DEFAULT_COLUMN_SEPARATOR.to_string())
-                .unwrap_or_default()
-        });
-
-    let columns_to_print = merge_files_print
-        .unwrap_or_else(|| column_mode_options.as_ref().map(|i| i.columns).unwrap_or(1));
-
-    let line_width = if join_lines {
-        None
-    } else if columns_to_print > 1 {
-        Some(
-            column_mode_options
-                .as_ref()
-                .map(|i| i.width)
-                .unwrap_or(DEFAULT_COLUMN_WIDTH),
-        )
-    } else {
-        page_width
-    };
-
-    Ok(OutputOptions {
-        number,
-        header,
-        double_space,
-        line_separator,
-        content_line_separator,
-        last_modified_time,
-        start_page,
-        end_page,
-        display_header_and_trailer,
-        content_lines_per_page,
-        page_separator_char,
-        column_mode_options,
-        merge_files_print,
-        offset_spaces,
-        form_feed_used,
-        join_lines,
-        col_sep_for_printing,
-        line_width,
-    })
-}
-
-fn open(path: &str) -> Result<Box<dyn Read>, PrError> {
-    if path == FILE_STDIN {
-        let stdin = stdin();
-        return Ok(Box::new(stdin) as Box<dyn Read>);
-    }
-
-    metadata(path)
-        .map(|i| {
-            let path_string = path.to_string();
-            match i.file_type() {
-                #[cfg(unix)]
-                ft if ft.is_block_device() => Err(PrError::UnknownFiletype(path_string)),
-                #[cfg(unix)]
-                ft if ft.is_char_device() => Err(PrError::UnknownFiletype(path_string)),
-                #[cfg(unix)]
-                ft if ft.is_fifo() => Err(PrError::UnknownFiletype(path_string)),
-                #[cfg(unix)]
-                ft if ft.is_socket() => Err(PrError::IsSocket(path_string)),
-                ft if ft.is_dir() => Err(PrError::IsDirectory(path_string)),
-                ft if ft.is_file() || ft.is_symlink() => {
-                    Ok(Box::new(File::open(path).context(path)?) as Box<dyn Read>)
-                }
-                _ => Err(PrError::UnknownFiletype(path_string)),
-            }
-        })
-        .unwrap_or_else(|_| Err(PrError::NotExists(path.to_string())))
-}
-
-fn split_lines_if_form_feed(file_content: Result<String, std::io::Error>) -> Vec<FileLine> {
-    file_content
-        .map(|content| {
-            let mut lines = Vec::new();
-            let mut f_occurred = 0;
-            let mut chunk = Vec::new();
-            for byte in content.as_bytes() {
-                if byte == &FF {
-                    f_occurred += 1;
-                } else {
-                    if f_occurred != 0 {
-                        // First time byte occurred in the scan
-                        lines.push(FileLine {
-                            line_content: Ok(String::from_utf8(chunk.clone()).unwrap()),
-                            form_feeds_after: f_occurred,
-                            ..FileLine::default()
-                        });
-                        chunk.clear();
-                    }
-                    chunk.push(*byte);
-                    f_occurred = 0;
-                }
-            }
-
-            lines.push(FileLine {
-                line_content: Ok(String::from_utf8(chunk).unwrap()),
-                form_feeds_after: f_occurred,
-                ..FileLine::default()
-            });
-
-            lines
-        })
-        .unwrap_or_else(|e| {
-            vec![FileLine {
-                line_content: Err(e),
-                ..FileLine::default()
-            }]
-        })
-}
-
-fn pr(path: &str, options: &OutputOptions) -> Result<i32, PrError> {
-    let lines = BufReader::with_capacity(READ_BUFFER_SIZE, open(path)?).lines();
-
-    let pages = read_stream_and_create_pages(options, lines, 0);
-
-    for page_with_page_number in pages {
-        let page_number = page_with_page_number.0 + 1;
-        let page = page_with_page_number.1;
-        print_page(&page, options, page_number)?;
-    }
-
-    Ok(0)
-}
-
-fn read_stream_and_create_pages(
-    options: &OutputOptions,
-    lines: Lines<BufReader<Box<dyn Read>>>,
-    file_id: usize,
-) -> Box<dyn Iterator<Item = (usize, Vec<FileLine>)>> {
-    let start_page = options.start_page;
-    let start_line_number = get_start_line_number(options);
-    let last_page = options.end_page;
-    let lines_needed_per_page = lines_to_read_for_page(options);
-
-    Box::new(
-        lines
-            .flat_map(split_lines_if_form_feed)
-            .enumerate()
-            .map(move |(i, line)| FileLine {
-                line_number: i + start_line_number,
-                file_id,
-                ..line
-            }) // Add line number and file_id
-            .batching(move |it| {
-                let mut first_page = Vec::new();
-                let mut page_with_lines = Vec::new();
-                for line in it {
-                    let form_feeds_after = line.form_feeds_after;
-                    first_page.push(line);
-
-                    if form_feeds_after > 1 {
-                        // insert empty pages
-                        page_with_lines.push(first_page);
-                        for _i in 1..form_feeds_after {
-                            page_with_lines.push(vec![]);
-                        }
-                        return Some(page_with_lines);
-                    }
-
-                    if first_page.len() == lines_needed_per_page || form_feeds_after == 1 {
-                        break;
-                    }
-                }
-
-                if first_page.is_empty() {
-                    return None;
-                }
-                page_with_lines.push(first_page);
-                Some(page_with_lines)
-            }) // Create set of pages as form feeds could lead to empty pages
-            .flatten() // Flatten to pages from page sets
-            .enumerate() // Assign page number
-            .skip_while(move |(x, _)| {
-                // Skip the not needed pages
-                let current_page = x + 1;
-                current_page < start_page
-            })
-            .take_while(move |(x, _)| {
-                // Take only the required pages
-                let current_page = x + 1;
-
-                current_page >= start_page
-                    && last_page.map_or(true, |last_page| current_page <= last_page)
-            }),
-    )
-}
-
-fn mpr(paths: &[&str], options: &OutputOptions) -> Result<i32, PrError> {
-    let n_files = paths.len();
-
-    // Check if files exists
-    for path in paths {
-        open(path)?;
-    }
-
-    let file_line_groups = paths
-        .iter()
-        .enumerate()
-        .map(|(i, path)| {
-            let lines = BufReader::with_capacity(READ_BUFFER_SIZE, open(path).unwrap()).lines();
-
-            read_stream_and_create_pages(options, lines, i).flat_map(move |(x, line)| {
-                let file_line = line;
-                let page_number = x + 1;
-                file_line
-                    .into_iter()
-                    .map(|fl| FileLine {
-                        page_number,
-                        group_key: page_number * n_files + fl.file_id,
-                        ..fl
-                    })
-                    .collect::<Vec<_>>()
-            })
-        })
-        .kmerge_by(|a, b| {
-            if a.group_key == b.group_key {
-                a.line_number < b.line_number
-            } else {
-                a.group_key < b.group_key
-            }
-        })
-        .group_by(|file_line| file_line.group_key);
-
-    let start_page = options.start_page;
-    let mut lines = Vec::new();
-    let mut page_counter = start_page;
-
-    for (_key, file_line_group) in &file_line_groups {
-        for file_line in file_line_group {
-            if let Err(e) = file_line.line_content {
-                return Err(e.into());
-            }
-            let new_page_number = file_line.page_number;
-            if page_counter != new_page_number {
-                print_page(&lines, options, page_counter)?;
-                lines = Vec::new();
-                page_counter = new_page_number;
-            }
-            lines.push(file_line);
-        }
-    }
-
-    print_page(&lines, options, page_counter)?;
-
-    Ok(0)
-}
-
-fn print_page(
-    lines: &[FileLine],
-    options: &OutputOptions,
-    page: usize,
-) -> Result<usize, std::io::Error> {
-    let line_separator = options.line_separator.as_bytes();
-    let page_separator = options.page_separator_char.as_bytes();
-
-    let header = header_content(options, page);
-    let trailer_content = trailer_content(options);
-
-    let out = stdout();
-    let mut out = out.lock();
-
-    for x in header {
-        out.write_all(x.as_bytes())?;
-        out.write_all(line_separator)?;
-    }
-
-    let lines_written = write_columns(lines, options, &mut out)?;
-
-    for (index, x) in trailer_content.iter().enumerate() {
-        out.write_all(x.as_bytes())?;
-        if index + 1 != trailer_content.len() {
-            out.write_all(line_separator)?;
-        }
-    }
-    out.write_all(page_separator)?;
-    out.flush()?;
-    Ok(lines_written)
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn write_columns(
-    lines: &[FileLine],
-    options: &OutputOptions,
-    out: &mut impl Write,
-) -> Result<usize, std::io::Error> {
-    let line_separator = options.content_line_separator.as_bytes();
-
-    let content_lines_per_page = if options.double_space {
-        options.content_lines_per_page / 2
-    } else {
-        options.content_lines_per_page
-    };
-
-    let columns = options
-        .merge_files_print
-        .unwrap_or_else(|| get_columns(options));
-    let line_width = options.line_width;
-    let mut lines_printed = 0;
-    let feed_line_present = options.form_feed_used;
-    let mut not_found_break = false;
-
-    let across_mode = options
-        .column_mode_options
-        .as_ref()
-        .map(|i| i.across_mode)
-        .unwrap_or(false);
-
-    let mut filled_lines = Vec::new();
-    if options.merge_files_print.is_some() {
-        let mut offset = 0;
-        for col in 0..columns {
-            let mut inserted = 0;
-            for line in &lines[offset..] {
-                if line.file_id != col {
-                    break;
-                }
-                filled_lines.push(Some(line));
-                inserted += 1;
-            }
-            offset += inserted;
-
-            for _i in inserted..content_lines_per_page {
-                filled_lines.push(None);
-            }
-        }
-    }
-
-    let table: Vec<Vec<_>> = (0..content_lines_per_page)
-        .map(move |a| {
-            (0..columns)
-                .map(|i| {
-                    if across_mode {
-                        lines.get(a * columns + i)
-                    } else if options.merge_files_print.is_some() {
-                        *filled_lines
-                            .get(content_lines_per_page * i + a)
-                            .unwrap_or(&None)
-                    } else {
-                        lines.get(content_lines_per_page * i + a)
-                    }
-                })
-                .collect()
-        })
-        .collect();
-
-    let blank_line = FileLine::default();
-    for row in table {
-        let indexes = row.len();
-        for (i, cell) in row.iter().enumerate() {
-            if cell.is_none() && options.merge_files_print.is_some() {
-                out.write_all(
-                    get_line_for_printing(options, &blank_line, columns, i, &line_width, indexes)
-                        .as_bytes(),
-                )?;
-            } else if cell.is_none() {
-                not_found_break = true;
-                break;
-            } else if cell.is_some() {
-                let file_line = cell.unwrap();
-
-                out.write_all(
-                    get_line_for_printing(options, file_line, columns, i, &line_width, indexes)
-                        .as_bytes(),
-                )?;
-                lines_printed += 1;
-            }
-        }
-        if not_found_break && feed_line_present {
-            break;
-        } else {
-            out.write_all(line_separator)?;
-        }
-    }
-
-    Ok(lines_printed)
-}
-
-fn get_line_for_printing(
-    options: &OutputOptions,
-    file_line: &FileLine,
-    columns: usize,
-    index: usize,
-    line_width: &Option<usize>,
-    indexes: usize,
-) -> String {
-    let blank_line = String::new();
-    let formatted_line_number = get_formatted_line_number(options, file_line.line_number, index);
-
-    let mut complete_line = format!(
-        "{}{}",
-        formatted_line_number,
-        file_line.line_content.as_ref().unwrap()
-    );
-
-    let offset_spaces = &options.offset_spaces;
-
-    let tab_count = complete_line.chars().filter(|i| i == &TAB).count();
-
-    let display_length = complete_line.len() + (tab_count * 7);
-
-    let sep = if (index + 1) != indexes && !options.join_lines {
-        &options.col_sep_for_printing
-    } else {
-        &blank_line
-    };
-
-    format!(
-        "{}{}{}",
-        offset_spaces,
-        line_width
-            .map(|i| {
-                let min_width = (i - (columns - 1)) / columns;
-                if display_length < min_width {
-                    for _i in 0..(min_width - display_length) {
-                        complete_line.push(' ');
-                    }
-                }
-
-                complete_line.chars().take(min_width).collect()
-            })
-            .unwrap_or(complete_line),
-        sep
-    )
-}
-
-fn get_formatted_line_number(opts: &OutputOptions, line_number: usize, index: usize) -> String {
-    let should_show_line_number =
-        opts.number.is_some() && (opts.merge_files_print.is_none() || index == 0);
-    if should_show_line_number && line_number != 0 {
-        let line_str = line_number.to_string();
-        let num_opt = opts.number.as_ref().unwrap();
-        let width = num_opt.width;
-        let separator = &num_opt.separator;
-        if line_str.len() >= width {
-            format!(
-                "{:>width$}{}",
-                &line_str[line_str.len() - width..],
-                separator
-            )
-        } else {
-            format!("{line_str:>width$}{separator}")
-        }
-    } else {
-        String::new()
-    }
-}
-
-/// Returns a five line header content if displaying header is not disabled by
-/// using `NO_HEADER_TRAILER_OPTION` option.
-fn header_content(options: &OutputOptions, page: usize) -> Vec<String> {
-    if options.display_header_and_trailer {
-        let first_line = format!(
-            "{} {} Page {}",
-            options.last_modified_time, options.header, page
-        );
-        vec![
-            String::new(),
-            String::new(),
-            first_line,
-            String::new(),
-            String::new(),
-        ]
-    } else {
-        Vec::new()
-    }
-}
-
-fn file_last_modified_time(path: &str) -> String {
-    metadata(path)
-        .map(|i| {
-            i.modified()
-                .map(|x| {
-                    let date_time: DateTime<Local> = x.into();
-                    date_time.format(DATE_TIME_FORMAT).to_string()
-                })
-                .unwrap_or_default()
-        })
-        .unwrap_or_default()
-}
-
-/// Returns five empty lines as trailer content if displaying trailer
-/// is not disabled by using `NO_HEADER_TRAILER_OPTION`option.
-fn trailer_content(options: &OutputOptions) -> Vec<String> {
-    if options.display_header_and_trailer && !options.form_feed_used {
-        vec![
-            String::new(),
-            String::new(),
-            String::new(),
-            String::new(),
-            String::new(),
-        ]
-    } else {
-        Vec::new()
-    }
-}
-
-/// Returns starting line number for the file to be printed.
-/// If -N is specified the first line number changes otherwise
-/// default is 1.
-fn get_start_line_number(opts: &OutputOptions) -> usize {
-    opts.number.as_ref().map(|i| i.first_number).unwrap_or(1)
-}
-
-/// Returns number of lines to read from input for constructing one page of pr output.
-/// If double space -d is used lines are halved.
-/// If columns --columns is used the lines are multiplied by the value.
-fn lines_to_read_for_page(opts: &OutputOptions) -> usize {
-    let content_lines_per_page = opts.content_lines_per_page;
-    let columns = get_columns(opts);
-    if opts.double_space {
-        (content_lines_per_page / 2) * columns
-    } else {
-        content_lines_per_page * columns
-    }
-}
-
-/// Returns number of columns to output
-fn get_columns(opts: &OutputOptions) -> usize {
-    opts.column_mode_options
-        .as_ref()
-        .map(|i| i.columns)
-        .unwrap_or(1)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_printenv/printenv.rs.html b/coreutils/dev/src/uu_printenv/printenv.rs.html deleted file mode 100644 index 5574eac09..000000000 --- a/coreutils/dev/src/uu_printenv/printenv.rs.html +++ /dev/null @@ -1,165 +0,0 @@ -printenv.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Jordi Boggiano <j.boggiano@seld.be>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-/* last synced with: printenv (GNU coreutils) 8.13 */
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::env;
-use uucore::{error::UResult, format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("printenv.md");
-const USAGE: &str = help_usage!("printenv.md");
-
-static OPT_NULL: &str = "null";
-
-static ARG_VARIABLES: &str = "variables";
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().get_matches_from(args);
-
-    let variables: Vec<String> = matches
-        .get_many::<String>(ARG_VARIABLES)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    let separator = if matches.get_flag(OPT_NULL) {
-        "\x00"
-    } else {
-        "\n"
-    };
-
-    if variables.is_empty() {
-        for (env_var, value) in env::vars() {
-            print!("{env_var}={value}{separator}");
-        }
-        return Ok(());
-    }
-
-    let mut error_found = false;
-    for env_var in variables {
-        // we silently ignore a=b as variable but we trigger an error
-        if env_var.contains('=') {
-            error_found = true;
-            continue;
-        }
-        if let Ok(var) = env::var(env_var) {
-            print!("{var}{separator}");
-        } else {
-            error_found = true;
-        }
-    }
-
-    if error_found {
-        Err(1.into())
-    } else {
-        Ok(())
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_NULL)
-                .short('0')
-                .long(OPT_NULL)
-                .help("end each output line with 0 byte rather than newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_VARIABLES)
-                .action(ArgAction::Append)
-                .num_args(1..),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_printf/printf.rs.html b/coreutils/dev/src/uu_printf/printf.rs.html deleted file mode 100644 index b8bbe0b8a..000000000 --- a/coreutils/dev/src/uu_printf/printf.rs.html +++ /dev/null @@ -1,123 +0,0 @@ -printf.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-
#![allow(dead_code)]
-// spell-checker:ignore (change!) each's
-// spell-checker:ignore (ToDO) LONGHELP FORMATSTRING templating parameterizing formatstr
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use uucore::error::{UResult, UUsageError};
-use uucore::memo::printf;
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-const VERSION: &str = "version";
-const HELP: &str = "help";
-const USAGE: &str = help_usage!("printf.md");
-const ABOUT: &str = help_about!("printf.md");
-const AFTER_HELP: &str = help_section!("after help", "printf.md");
-
-mod options {
-    pub const FORMATSTRING: &str = "FORMATSTRING";
-    pub const ARGUMENT: &str = "ARGUMENT";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-    let matches = uu_app().get_matches_from(args);
-
-    let format_string = matches
-        .get_one::<String>(options::FORMATSTRING)
-        .ok_or_else(|| UUsageError::new(1, "missing operand"))?;
-    let values: Vec<String> = match matches.get_many::<String>(options::ARGUMENT) {
-        Some(s) => s.map(|s| s.to_string()).collect(),
-        None => vec![],
-    };
-
-    printf(format_string, &values[..])?;
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .allow_hyphen_values(true)
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .disable_help_flag(true)
-        .disable_version_flag(true)
-        .arg(
-            Arg::new(HELP)
-                .long(HELP)
-                .help("Print help information")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new(VERSION)
-                .long(VERSION)
-                .help("Print version information")
-                .action(ArgAction::Version),
-        )
-        .arg(Arg::new(options::FORMATSTRING))
-        .arg(Arg::new(options::ARGUMENT).action(ArgAction::Append))
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_ptx/ptx.rs.html b/coreutils/dev/src/uu_ptx/ptx.rs.html deleted file mode 100644 index ff3d936e9..000000000 --- a/coreutils/dev/src/uu_ptx/ptx.rs.html +++ /dev/null @@ -1,1739 +0,0 @@ -ptx.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Dorota Kapturkiewicz <dokaptur@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDOs) corasick memchr Roff trunc oset iset CHARCLASS
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use regex::Regex;
-use std::cmp;
-use std::collections::{BTreeSet, HashMap, HashSet};
-use std::default::Default;
-use std::error::Error;
-use std::fmt::{Display, Formatter, Write as FmtWrite};
-use std::fs::File;
-use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write};
-use std::num::ParseIntError;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UError, UResult};
-use uucore::{format_usage, help_about, help_usage};
-
-const USAGE: &str = help_usage!("ptx.md");
-const ABOUT: &str = help_about!("ptx.md");
-
-const REGEX_CHARCLASS: &str = "^-]\\";
-
-#[derive(Debug)]
-enum OutFormat {
-    Dumb,
-    Roff,
-    Tex,
-}
-
-#[derive(Debug)]
-struct Config {
-    format: OutFormat,
-    gnu_ext: bool,
-    auto_ref: bool,
-    input_ref: bool,
-    right_ref: bool,
-    ignore_case: bool,
-    macro_name: String,
-    trunc_str: String,
-    context_regex: String,
-    line_width: usize,
-    gap_size: usize,
-}
-
-impl Default for Config {
-    fn default() -> Self {
-        Self {
-            format: OutFormat::Dumb,
-            gnu_ext: true,
-            auto_ref: false,
-            input_ref: false,
-            right_ref: false,
-            ignore_case: false,
-            macro_name: "xx".to_owned(),
-            trunc_str: "/".to_owned(),
-            context_regex: "\\w+".to_owned(),
-            line_width: 72,
-            gap_size: 3,
-        }
-    }
-}
-
-fn read_word_filter_file(
-    matches: &clap::ArgMatches,
-    option: &str,
-) -> std::io::Result<HashSet<String>> {
-    let filename = matches
-        .get_one::<String>(option)
-        .expect("parsing options failed!")
-        .to_string();
-    let file = File::open(filename)?;
-    let reader = BufReader::new(file);
-    let mut words: HashSet<String> = HashSet::new();
-    for word in reader.lines() {
-        words.insert(word?);
-    }
-    Ok(words)
-}
-
-/// reads contents of file as unique set of characters to be used with the break-file option
-fn read_char_filter_file(
-    matches: &clap::ArgMatches,
-    option: &str,
-) -> std::io::Result<HashSet<char>> {
-    let filename = matches
-        .get_one::<String>(option)
-        .expect("parsing options failed!");
-    let mut reader = File::open(filename)?;
-    let mut buffer = String::new();
-    reader.read_to_string(&mut buffer)?;
-    Ok(buffer.chars().collect())
-}
-
-#[derive(Debug)]
-struct WordFilter {
-    only_specified: bool,
-    ignore_specified: bool,
-    only_set: HashSet<String>,
-    ignore_set: HashSet<String>,
-    word_regex: String,
-}
-
-impl WordFilter {
-    #[allow(clippy::cognitive_complexity)]
-    fn new(matches: &clap::ArgMatches, config: &Config) -> UResult<Self> {
-        let (o, oset): (bool, HashSet<String>) = if matches.contains_id(options::ONLY_FILE) {
-            let words =
-                read_word_filter_file(matches, options::ONLY_FILE).map_err_context(String::new)?;
-            (true, words)
-        } else {
-            (false, HashSet::new())
-        };
-        let (i, iset): (bool, HashSet<String>) = if matches.contains_id(options::IGNORE_FILE) {
-            let words = read_word_filter_file(matches, options::IGNORE_FILE)
-                .map_err_context(String::new)?;
-            (true, words)
-        } else {
-            (false, HashSet::new())
-        };
-        let break_set: Option<HashSet<char>> = if matches.contains_id(options::BREAK_FILE)
-            && !matches.contains_id(options::WORD_REGEXP)
-        {
-            let chars =
-                read_char_filter_file(matches, options::BREAK_FILE).map_err_context(String::new)?;
-            let mut hs: HashSet<char> = if config.gnu_ext {
-                HashSet::new() // really only chars found in file
-            } else {
-                // GNU off means at least these are considered
-                [' ', '\t', '\n'].iter().cloned().collect()
-            };
-            hs.extend(chars);
-            Some(hs)
-        } else {
-            // if -W takes precedence or default
-            None
-        };
-        // Ignore empty string regex from cmd-line-args
-        let arg_reg: Option<String> = if matches.contains_id(options::WORD_REGEXP) {
-            match matches.get_one::<String>(options::WORD_REGEXP) {
-                Some(v) => {
-                    if v.is_empty() {
-                        None
-                    } else {
-                        Some(v.to_string())
-                    }
-                }
-                None => None,
-            }
-        } else {
-            None
-        };
-        let reg = match arg_reg {
-            Some(arg_reg) => arg_reg,
-            None => {
-                if break_set.is_some() {
-                    format!(
-                        "[^{}]+",
-                        break_set
-                            .unwrap()
-                            .into_iter()
-                            .map(|c| if REGEX_CHARCLASS.contains(c) {
-                                format!("\\{c}")
-                            } else {
-                                c.to_string()
-                            })
-                            .collect::<String>()
-                    )
-                } else if config.gnu_ext {
-                    "\\w+".to_owned()
-                } else {
-                    "[^ \t\n]+".to_owned()
-                }
-            }
-        };
-        Ok(Self {
-            only_specified: o,
-            ignore_specified: i,
-            only_set: oset,
-            ignore_set: iset,
-            word_regex: reg,
-        })
-    }
-}
-
-#[derive(Debug, PartialOrd, PartialEq, Eq, Ord)]
-struct WordRef {
-    word: String,
-    global_line_nr: usize,
-    local_line_nr: usize,
-    position: usize,
-    position_end: usize,
-    filename: String,
-}
-
-#[derive(Debug)]
-enum PtxError {
-    DumbFormat,
-    NotImplemented(&'static str),
-    ParseError(ParseIntError),
-}
-
-impl Error for PtxError {}
-impl UError for PtxError {}
-
-impl Display for PtxError {
-    fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
-        match self {
-            Self::DumbFormat => {
-                write!(f, "There is no dumb format with GNU extensions disabled")
-            }
-            Self::NotImplemented(s) => write!(f, "{s} not implemented yet"),
-            Self::ParseError(e) => e.fmt(f),
-        }
-    }
-}
-
-fn get_config(matches: &clap::ArgMatches) -> UResult<Config> {
-    let mut config = Config::default();
-    let err_msg = "parsing options failed";
-    if matches.get_flag(options::TRADITIONAL) {
-        config.gnu_ext = false;
-        config.format = OutFormat::Roff;
-        config.context_regex = "[^ \t\n]+".to_owned();
-    } else {
-        return Err(PtxError::NotImplemented("GNU extensions").into());
-    }
-    if matches.contains_id(options::SENTENCE_REGEXP) {
-        return Err(PtxError::NotImplemented("-S").into());
-    }
-    config.auto_ref = matches.get_flag(options::AUTO_REFERENCE);
-    config.input_ref = matches.get_flag(options::REFERENCES);
-    config.right_ref &= matches.get_flag(options::RIGHT_SIDE_REFS);
-    config.ignore_case = matches.get_flag(options::IGNORE_CASE);
-    if matches.contains_id(options::MACRO_NAME) {
-        config.macro_name = matches
-            .get_one::<String>(options::MACRO_NAME)
-            .expect(err_msg)
-            .to_string();
-    }
-    if matches.contains_id(options::FLAG_TRUNCATION) {
-        config.trunc_str = matches
-            .get_one::<String>(options::FLAG_TRUNCATION)
-            .expect(err_msg)
-            .to_string();
-    }
-    if matches.contains_id(options::WIDTH) {
-        config.line_width = matches
-            .get_one::<String>(options::WIDTH)
-            .expect(err_msg)
-            .parse()
-            .map_err(PtxError::ParseError)?;
-    }
-    if matches.contains_id(options::GAP_SIZE) {
-        config.gap_size = matches
-            .get_one::<String>(options::GAP_SIZE)
-            .expect(err_msg)
-            .parse()
-            .map_err(PtxError::ParseError)?;
-    }
-    if matches.get_flag(options::FORMAT_ROFF) {
-        config.format = OutFormat::Roff;
-    }
-    if matches.get_flag(options::FORMAT_TEX) {
-        config.format = OutFormat::Tex;
-    }
-    Ok(config)
-}
-
-struct FileContent {
-    lines: Vec<String>,
-    chars_lines: Vec<Vec<char>>,
-    offset: usize,
-}
-
-type FileMap = HashMap<String, FileContent>;
-
-fn read_input(input_files: &[String], config: &Config) -> std::io::Result<FileMap> {
-    let mut file_map: FileMap = HashMap::new();
-    let mut files = Vec::new();
-    if input_files.is_empty() {
-        files.push("-");
-    } else if config.gnu_ext {
-        for file in input_files {
-            files.push(file);
-        }
-    } else {
-        files.push(&input_files[0]);
-    }
-    let mut offset: usize = 0;
-    for filename in files {
-        let reader: BufReader<Box<dyn Read>> = BufReader::new(if filename == "-" {
-            Box::new(stdin())
-        } else {
-            let file = File::open(filename)?;
-            Box::new(file)
-        });
-        let lines: Vec<String> = reader.lines().collect::<std::io::Result<Vec<String>>>()?;
-
-        // Indexing UTF-8 string requires walking from the beginning, which can hurts performance badly when the line is long.
-        // Since we will be jumping around the line a lot, we dump the content into a Vec<char>, which can be indexed in constant time.
-        let chars_lines: Vec<Vec<char>> = lines.iter().map(|x| x.chars().collect()).collect();
-        let size = lines.len();
-        file_map.insert(
-            filename.to_owned(),
-            FileContent {
-                lines,
-                chars_lines,
-                offset,
-            },
-        );
-        offset += size;
-    }
-    Ok(file_map)
-}
-
-/// Go through every lines in the input files and record each match occurrence as a `WordRef`.
-fn create_word_set(config: &Config, filter: &WordFilter, file_map: &FileMap) -> BTreeSet<WordRef> {
-    let reg = Regex::new(&filter.word_regex).unwrap();
-    let ref_reg = Regex::new(&config.context_regex).unwrap();
-    let mut word_set: BTreeSet<WordRef> = BTreeSet::new();
-    for (file, lines) in file_map.iter() {
-        let mut count: usize = 0;
-        let offs = lines.offset;
-        for line in &lines.lines {
-            // if -r, exclude reference from word set
-            let (ref_beg, ref_end) = match ref_reg.find(line) {
-                Some(x) => (x.start(), x.end()),
-                None => (0, 0),
-            };
-            // match words with given regex
-            for mat in reg.find_iter(line) {
-                let (beg, end) = (mat.start(), mat.end());
-                if config.input_ref && ((beg, end) == (ref_beg, ref_end)) {
-                    continue;
-                }
-                let mut word = line[beg..end].to_owned();
-                if filter.only_specified && !(filter.only_set.contains(&word)) {
-                    continue;
-                }
-                if filter.ignore_specified && filter.ignore_set.contains(&word) {
-                    continue;
-                }
-                if config.ignore_case {
-                    word = word.to_lowercase();
-                }
-                word_set.insert(WordRef {
-                    word,
-                    filename: file.clone(),
-                    global_line_nr: offs + count,
-                    local_line_nr: count,
-                    position: beg,
-                    position_end: end,
-                });
-            }
-            count += 1;
-        }
-    }
-    word_set
-}
-
-fn get_reference(config: &Config, word_ref: &WordRef, line: &str, context_reg: &Regex) -> String {
-    if config.auto_ref {
-        format!(
-            "{}:{}",
-            word_ref.filename.maybe_quote(),
-            word_ref.local_line_nr + 1
-        )
-    } else if config.input_ref {
-        let (beg, end) = match context_reg.find(line) {
-            Some(x) => (x.start(), x.end()),
-            None => (0, 0),
-        };
-        line[beg..end].to_string()
-    } else {
-        String::new()
-    }
-}
-
-fn assert_str_integrity(s: &[char], beg: usize, end: usize) {
-    assert!(beg <= end);
-    assert!(end <= s.len());
-}
-
-fn trim_broken_word_left(s: &[char], beg: usize, end: usize) -> usize {
-    assert_str_integrity(s, beg, end);
-    if beg == end || beg == 0 || s[beg].is_whitespace() || s[beg - 1].is_whitespace() {
-        return beg;
-    }
-    let mut b = beg;
-    while b < end && !s[b].is_whitespace() {
-        b += 1;
-    }
-    b
-}
-
-fn trim_broken_word_right(s: &[char], beg: usize, end: usize) -> usize {
-    assert_str_integrity(s, beg, end);
-    if beg == end || end == s.len() || s[end - 1].is_whitespace() || s[end].is_whitespace() {
-        return end;
-    }
-    let mut e = end;
-    while beg < e && !s[e - 1].is_whitespace() {
-        e -= 1;
-    }
-    e
-}
-
-fn trim_idx(s: &[char], beg: usize, end: usize) -> (usize, usize) {
-    assert_str_integrity(s, beg, end);
-    let mut b = beg;
-    let mut e = end;
-    while b < e && s[b].is_whitespace() {
-        b += 1;
-    }
-    while b < e && s[e - 1].is_whitespace() {
-        e -= 1;
-    }
-    (b, e)
-}
-
-fn get_output_chunks(
-    all_before: &[char],
-    keyword: &str,
-    all_after: &[char],
-    config: &Config,
-) -> (String, String, String, String) {
-    // Chunk size logics are mostly copied from the GNU ptx source.
-    // https://github.com/MaiZure/coreutils-8.3/blob/master/src/ptx.c#L1234
-    let half_line_size = config.line_width / 2;
-    let max_before_size = cmp::max(half_line_size as isize - config.gap_size as isize, 0) as usize;
-    let max_after_size = cmp::max(
-        half_line_size as isize
-            - (2 * config.trunc_str.len()) as isize
-            - keyword.len() as isize
-            - 1,
-        0,
-    ) as usize;
-
-    // Allocate plenty space for all the chunks.
-    let mut head = String::with_capacity(half_line_size);
-    let mut before = String::with_capacity(half_line_size);
-    let mut after = String::with_capacity(half_line_size);
-    let mut tail = String::with_capacity(half_line_size);
-
-    // the before chunk
-
-    // trim whitespace away from all_before to get the index where the before chunk should end.
-    let (_, before_end) = trim_idx(all_before, 0, all_before.len());
-
-    // the minimum possible begin index of the before_chunk is the end index minus the length.
-    let before_beg = cmp::max(before_end as isize - max_before_size as isize, 0) as usize;
-    // in case that falls in the middle of a word, trim away the word.
-    let before_beg = trim_broken_word_left(all_before, before_beg, before_end);
-
-    // trim away white space.
-    let (before_beg, before_end) = trim_idx(all_before, before_beg, before_end);
-
-    // and get the string.
-    let before_str: String = all_before[before_beg..before_end].iter().collect();
-    before.push_str(&before_str);
-    assert!(max_before_size >= before.len());
-
-    // the after chunk
-
-    // must be no longer than the minimum between the max size and the total available string.
-    let after_end = cmp::min(max_after_size, all_after.len());
-    // in case that falls in the middle of a word, trim away the word.
-    let after_end = trim_broken_word_right(all_after, 0, after_end);
-
-    // trim away white space.
-    let (_, after_end) = trim_idx(all_after, 0, after_end);
-
-    // and get the string
-    let after_str: String = all_after[0..after_end].iter().collect();
-    after.push_str(&after_str);
-    assert!(max_after_size >= after.len());
-
-    // the tail chunk
-
-    // max size of the tail chunk = max size of left half - space taken by before chunk - gap size.
-    let max_tail_size = cmp::max(
-        max_before_size as isize - before.len() as isize - config.gap_size as isize,
-        0,
-    ) as usize;
-
-    // the tail chunk takes text starting from where the after chunk ends (with whitespace trimmed).
-    let (tail_beg, _) = trim_idx(all_after, after_end, all_after.len());
-
-    // end = begin + max length
-    let tail_end = cmp::min(all_after.len(), tail_beg + max_tail_size);
-    // in case that falls in the middle of a word, trim away the word.
-    let tail_end = trim_broken_word_right(all_after, tail_beg, tail_end);
-
-    // trim away whitespace again.
-    let (tail_beg, tail_end) = trim_idx(all_after, tail_beg, tail_end);
-
-    // and get the string
-    let tail_str: String = all_after[tail_beg..tail_end].iter().collect();
-    tail.push_str(&tail_str);
-
-    // the head chunk
-
-    // max size of the head chunk = max size of right half - space taken by after chunk - gap size.
-    let max_head_size = cmp::max(
-        max_after_size as isize - after.len() as isize - config.gap_size as isize,
-        0,
-    ) as usize;
-
-    // the head chunk takes text from before the before chunk
-    let (_, head_end) = trim_idx(all_before, 0, before_beg);
-
-    // begin = end - max length
-    let head_beg = cmp::max(head_end as isize - max_head_size as isize, 0) as usize;
-    // in case that falls in the middle of a word, trim away the word.
-    let head_beg = trim_broken_word_left(all_before, head_beg, head_end);
-
-    // trim away white space again.
-    let (head_beg, head_end) = trim_idx(all_before, head_beg, head_end);
-
-    // and get the string.
-    let head_str: String = all_before[head_beg..head_end].iter().collect();
-    head.push_str(&head_str);
-
-    // put right context truncation string if needed
-    if after_end != all_after.len() && tail_beg == tail_end {
-        after.push_str(&config.trunc_str);
-    } else if after_end != all_after.len() && tail_end != all_after.len() {
-        tail.push_str(&config.trunc_str);
-    }
-
-    // put left context truncation string if needed
-    if before_beg != 0 && head_beg == head_end {
-        before = format!("{}{}", config.trunc_str, before);
-    } else if before_beg != 0 && head_beg != 0 {
-        head = format!("{}{}", config.trunc_str, head);
-    }
-
-    (tail, before, after, head)
-}
-
-fn tex_mapper(x: char) -> String {
-    match x {
-        '\\' => "\\backslash{}".to_owned(),
-        '$' | '%' | '#' | '&' | '_' => format!("\\{x}"),
-        '}' | '{' => format!("$\\{x}$"),
-        _ => x.to_string(),
-    }
-}
-
-/// Escape special characters for TeX.
-fn format_tex_field(s: &str) -> String {
-    let mapped_chunks: Vec<String> = s.chars().map(tex_mapper).collect();
-    mapped_chunks.join("")
-}
-
-fn format_tex_line(
-    config: &Config,
-    word_ref: &WordRef,
-    line: &str,
-    chars_line: &[char],
-    reference: &str,
-) -> String {
-    let mut output = String::new();
-    write!(output, "\\{} ", config.macro_name).unwrap();
-    let all_before = if config.input_ref {
-        let before = &line[0..word_ref.position];
-        let before_start_trim_offset =
-            word_ref.position - before.trim_start_matches(reference).trim_start().len();
-        let before_end_index = before.len();
-        &chars_line[before_start_trim_offset..cmp::max(before_end_index, before_start_trim_offset)]
-    } else {
-        let before_chars_trim_idx = (0, word_ref.position);
-        &chars_line[before_chars_trim_idx.0..before_chars_trim_idx.1]
-    };
-    let keyword = &line[word_ref.position..word_ref.position_end];
-    let after_chars_trim_idx = (word_ref.position_end, chars_line.len());
-    let all_after = &chars_line[after_chars_trim_idx.0..after_chars_trim_idx.1];
-    let (tail, before, after, head) = get_output_chunks(all_before, keyword, all_after, config);
-    write!(
-        output,
-        "{{{0}}}{{{1}}}{{{2}}}{{{3}}}{{{4}}}",
-        format_tex_field(&tail),
-        format_tex_field(&before),
-        format_tex_field(keyword),
-        format_tex_field(&after),
-        format_tex_field(&head),
-    )
-    .unwrap();
-    if config.auto_ref || config.input_ref {
-        write!(output, "{{{}}}", format_tex_field(reference)).unwrap();
-    }
-    output
-}
-
-fn format_roff_field(s: &str) -> String {
-    s.replace('\"', "\"\"")
-}
-
-fn format_roff_line(
-    config: &Config,
-    word_ref: &WordRef,
-    line: &str,
-    chars_line: &[char],
-    reference: &str,
-) -> String {
-    let mut output = String::new();
-    write!(output, ".{}", config.macro_name).unwrap();
-    let all_before = if config.input_ref {
-        let before = &line[0..word_ref.position];
-        let before_start_trim_offset =
-            word_ref.position - before.trim_start_matches(reference).trim_start().len();
-        let before_end_index = before.len();
-        &chars_line[before_start_trim_offset..cmp::max(before_end_index, before_start_trim_offset)]
-    } else {
-        let before_chars_trim_idx = (0, word_ref.position);
-        &chars_line[before_chars_trim_idx.0..before_chars_trim_idx.1]
-    };
-    let keyword = &line[word_ref.position..word_ref.position_end];
-    let after_chars_trim_idx = (word_ref.position_end, chars_line.len());
-    let all_after = &chars_line[after_chars_trim_idx.0..after_chars_trim_idx.1];
-    let (tail, before, after, head) = get_output_chunks(all_before, keyword, all_after, config);
-    write!(
-        output,
-        " \"{}\" \"{}\" \"{}{}\" \"{}\"",
-        format_roff_field(&tail),
-        format_roff_field(&before),
-        format_roff_field(keyword),
-        format_roff_field(&after),
-        format_roff_field(&head)
-    )
-    .unwrap();
-    if config.auto_ref || config.input_ref {
-        write!(output, " \"{}\"", format_roff_field(reference)).unwrap();
-    }
-    output
-}
-
-fn write_traditional_output(
-    config: &Config,
-    file_map: &FileMap,
-    words: &BTreeSet<WordRef>,
-    output_filename: &str,
-) -> UResult<()> {
-    let mut writer: BufWriter<Box<dyn Write>> = BufWriter::new(if output_filename == "-" {
-        Box::new(stdout())
-    } else {
-        let file = File::create(output_filename).map_err_context(String::new)?;
-        Box::new(file)
-    });
-
-    let context_reg = Regex::new(&config.context_regex).unwrap();
-
-    for word_ref in words.iter() {
-        let file_map_value: &FileContent = file_map
-            .get(&(word_ref.filename))
-            .expect("Missing file in file map");
-        let FileContent {
-            ref lines,
-            ref chars_lines,
-            offset: _,
-        } = *(file_map_value);
-        let reference = get_reference(
-            config,
-            word_ref,
-            &lines[word_ref.local_line_nr],
-            &context_reg,
-        );
-        let output_line: String = match config.format {
-            OutFormat::Tex => format_tex_line(
-                config,
-                word_ref,
-                &lines[word_ref.local_line_nr],
-                &chars_lines[word_ref.local_line_nr],
-                &reference,
-            ),
-            OutFormat::Roff => format_roff_line(
-                config,
-                word_ref,
-                &lines[word_ref.local_line_nr],
-                &chars_lines[word_ref.local_line_nr],
-                &reference,
-            ),
-            OutFormat::Dumb => {
-                return Err(PtxError::DumbFormat.into());
-            }
-        };
-        writeln!(writer, "{output_line}").map_err_context(String::new)?;
-    }
-    Ok(())
-}
-
-mod options {
-    pub static FILE: &str = "file";
-    pub static AUTO_REFERENCE: &str = "auto-reference";
-    pub static TRADITIONAL: &str = "traditional";
-    pub static FLAG_TRUNCATION: &str = "flag-truncation";
-    pub static MACRO_NAME: &str = "macro-name";
-    pub static FORMAT_ROFF: &str = "format=roff";
-    pub static RIGHT_SIDE_REFS: &str = "right-side-refs";
-    pub static SENTENCE_REGEXP: &str = "sentence-regexp";
-    pub static FORMAT_TEX: &str = "format=tex";
-    pub static WORD_REGEXP: &str = "word-regexp";
-    pub static BREAK_FILE: &str = "break-file";
-    pub static IGNORE_CASE: &str = "ignore-case";
-    pub static GAP_SIZE: &str = "gap-size";
-    pub static IGNORE_FILE: &str = "ignore-file";
-    pub static ONLY_FILE: &str = "only-file";
-    pub static REFERENCES: &str = "references";
-    pub static WIDTH: &str = "width";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let mut input_files: Vec<String> = match &matches.get_many::<String>(options::FILE) {
-        Some(v) => v.clone().map(|v| v.to_owned()).collect(),
-        None => vec!["-".to_string()],
-    };
-
-    let config = get_config(&matches)?;
-    let word_filter = WordFilter::new(&matches, &config)?;
-    let file_map = read_input(&input_files, &config).map_err_context(String::new)?;
-    let word_set = create_word_set(&config, &word_filter, &file_map);
-    let output_file = if !config.gnu_ext && input_files.len() == 2 {
-        input_files.pop().unwrap()
-    } else {
-        "-".to_string()
-    };
-    write_traditional_output(&config, &file_map, &word_set, &output_file)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .about(ABOUT)
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::AUTO_REFERENCE)
-                .short('A')
-                .long(options::AUTO_REFERENCE)
-                .help("output automatically generated references")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::TRADITIONAL)
-                .short('G')
-                .long(options::TRADITIONAL)
-                .help("behave more like System V 'ptx'")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FLAG_TRUNCATION)
-                .short('F')
-                .long(options::FLAG_TRUNCATION)
-                .help("use STRING for flagging line truncations")
-                .value_name("STRING"),
-        )
-        .arg(
-            Arg::new(options::MACRO_NAME)
-                .short('M')
-                .long(options::MACRO_NAME)
-                .help("macro name to use instead of 'xx'")
-                .value_name("STRING"),
-        )
-        .arg(
-            Arg::new(options::FORMAT_ROFF)
-                .short('O')
-                .long(options::FORMAT_ROFF)
-                .help("generate output as roff directives")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::RIGHT_SIDE_REFS)
-                .short('R')
-                .long(options::RIGHT_SIDE_REFS)
-                .help("put references at right, not counted in -w")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SENTENCE_REGEXP)
-                .short('S')
-                .long(options::SENTENCE_REGEXP)
-                .help("for end of lines or end of sentences")
-                .value_name("REGEXP"),
-        )
-        .arg(
-            Arg::new(options::FORMAT_TEX)
-                .short('T')
-                .long(options::FORMAT_TEX)
-                .help("generate output as TeX directives")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::WORD_REGEXP)
-                .short('W')
-                .long(options::WORD_REGEXP)
-                .help("use REGEXP to match each keyword")
-                .value_name("REGEXP"),
-        )
-        .arg(
-            Arg::new(options::BREAK_FILE)
-                .short('b')
-                .long(options::BREAK_FILE)
-                .help("word break characters in this FILE")
-                .value_name("FILE")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::IGNORE_CASE)
-                .short('f')
-                .long(options::IGNORE_CASE)
-                .help("fold lower case to upper case for sorting")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::GAP_SIZE)
-                .short('g')
-                .long(options::GAP_SIZE)
-                .help("gap size in columns between output fields")
-                .value_name("NUMBER"),
-        )
-        .arg(
-            Arg::new(options::IGNORE_FILE)
-                .short('i')
-                .long(options::IGNORE_FILE)
-                .help("read ignore word list from FILE")
-                .value_name("FILE")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::ONLY_FILE)
-                .short('o')
-                .long(options::ONLY_FILE)
-                .help("read only word list from this FILE")
-                .value_name("FILE")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::REFERENCES)
-                .short('r')
-                .long(options::REFERENCES)
-                .help("first field of each line is a reference")
-                .value_name("FILE")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::WIDTH)
-                .short('w')
-                .long(options::WIDTH)
-                .help("output width in columns, reference excluded")
-                .value_name("NUMBER"),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_pwd/pwd.rs.html b/coreutils/dev/src/uu_pwd/pwd.rs.html deleted file mode 100644 index 157f781f5..000000000 --- a/coreutils/dev/src/uu_pwd/pwd.rs.html +++ /dev/null @@ -1,329 +0,0 @@ -pwd.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Derek Chiang <derekchiang93@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use clap::ArgAction;
-use clap::{crate_version, Arg, Command};
-use std::env;
-use std::io;
-use std::path::PathBuf;
-use uucore::{format_usage, help_about, help_usage};
-
-use uucore::display::println_verbatim;
-use uucore::error::{FromIo, UResult};
-
-const ABOUT: &str = help_about!("pwd.md");
-const USAGE: &str = help_usage!("pwd.md");
-const OPT_LOGICAL: &str = "logical";
-const OPT_PHYSICAL: &str = "physical";
-
-fn physical_path() -> io::Result<PathBuf> {
-    // std::env::current_dir() is a thin wrapper around libc::getcwd().
-
-    // On Unix, getcwd() must return the physical path:
-    // https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html
-    #[cfg(unix)]
-    {
-        env::current_dir()
-    }
-
-    // On Windows we have to resolve it.
-    // On other systems we also resolve it, just in case.
-    #[cfg(not(unix))]
-    {
-        env::current_dir().and_then(|path| path.canonicalize())
-    }
-}
-
-fn logical_path() -> io::Result<PathBuf> {
-    // getcwd() on Windows seems to include symlinks, so this is easy.
-    #[cfg(windows)]
-    {
-        env::current_dir()
-    }
-
-    // If we're not on Windows we do things Unix-style.
-    //
-    // Typical Unix-like kernels don't actually keep track of the logical working
-    // directory. They know the precise directory a process is in, and the getcwd()
-    // syscall reconstructs a path from that.
-    //
-    // The logical working directory is maintained by the shell, in the $PWD
-    // environment variable. So we check carefully if that variable looks
-    // reasonable, and if not then we fall back to the physical path.
-    //
-    // POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pwd.html
-    #[cfg(not(windows))]
-    {
-        use std::path::Path;
-        fn looks_reasonable(path: &Path) -> bool {
-            // First, check if it's an absolute path.
-            if !path.has_root() {
-                return false;
-            }
-
-            // Then, make sure there are no . or .. components.
-            // Path::components() isn't useful here, it normalizes those out.
-
-            // to_string_lossy() may allocate, but that's fine, we call this
-            // only once per run. It may also lose information, but not any
-            // information that we need for this check.
-            if path
-                .to_string_lossy()
-                .split(std::path::is_separator)
-                .any(|piece| piece == "." || piece == "..")
-            {
-                return false;
-            }
-
-            // Finally, check if it matches the directory we're in.
-            #[cfg(unix)]
-            {
-                use std::fs::metadata;
-                use std::os::unix::fs::MetadataExt;
-                match (metadata(path), metadata(".")) {
-                    (Ok(info1), Ok(info2)) => {
-                        info1.dev() == info2.dev() && info1.ino() == info2.ino()
-                    }
-                    _ => false,
-                }
-            }
-
-            #[cfg(not(unix))]
-            {
-                use std::fs::canonicalize;
-                match (canonicalize(path), canonicalize(".")) {
-                    (Ok(path1), Ok(path2)) => path1 == path2,
-                    _ => false,
-                }
-            }
-        }
-
-        match env::var_os("PWD").map(PathBuf::from) {
-            Some(value) if looks_reasonable(&value) => Ok(value),
-            _ => env::current_dir(),
-        }
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-    // if POSIXLY_CORRECT is set, we want to a logical resolution.
-    // This produces a different output when doing mkdir -p a/b && ln -s a/b c && cd c && pwd
-    // We should get c in this case instead of a/b at the end of the path
-    let cwd = if matches.get_flag(OPT_PHYSICAL) {
-        physical_path()
-    } else if matches.get_flag(OPT_LOGICAL) || env::var("POSIXLY_CORRECT").is_ok() {
-        logical_path()
-    } else {
-        physical_path()
-    }
-    .map_err_context(|| "failed to get current directory".to_owned())?;
-
-    // \\?\ is a prefix Windows gives to paths under certain circumstances,
-    // including when canonicalizing them.
-    // With the right extension trait we can remove it non-lossily, but
-    // we print it lossily anyway, so no reason to bother.
-    #[cfg(windows)]
-    let cwd = cwd
-        .to_string_lossy()
-        .strip_prefix(r"\\?\")
-        .map(Into::into)
-        .unwrap_or(cwd);
-
-    println_verbatim(cwd).map_err_context(|| "failed to print current directory".to_owned())?;
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_LOGICAL)
-                .short('L')
-                .long(OPT_LOGICAL)
-                .help("use PWD from environment, even if it contains symlinks")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_PHYSICAL)
-                .short('P')
-                .long(OPT_PHYSICAL)
-                .overrides_with(OPT_LOGICAL)
-                .help("avoid all symlinks")
-                .action(ArgAction::SetTrue),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_readlink/readlink.rs.html b/coreutils/dev/src/uu_readlink/readlink.rs.html deleted file mode 100644 index 92c4abc68..000000000 --- a/coreutils/dev/src/uu_readlink/readlink.rs.html +++ /dev/null @@ -1,379 +0,0 @@ -readlink.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Haitao Li <lihaitao@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) errno
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::fs;
-use std::io::{stdout, Write};
-use std::path::{Path, PathBuf};
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
-use uucore::fs::{canonicalize, MissingHandling, ResolveMode};
-use uucore::line_ending::LineEnding;
-use uucore::{format_usage, help_about, help_usage, show_error};
-
-const ABOUT: &str = help_about!("readlink.md");
-const USAGE: &str = help_usage!("readlink.md");
-const OPT_CANONICALIZE: &str = "canonicalize";
-const OPT_CANONICALIZE_MISSING: &str = "canonicalize-missing";
-const OPT_CANONICALIZE_EXISTING: &str = "canonicalize-existing";
-const OPT_NO_NEWLINE: &str = "no-newline";
-const OPT_QUIET: &str = "quiet";
-const OPT_SILENT: &str = "silent";
-const OPT_VERBOSE: &str = "verbose";
-const OPT_ZERO: &str = "zero";
-
-const ARG_FILES: &str = "files";
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let mut no_trailing_delimiter = matches.get_flag(OPT_NO_NEWLINE);
-    let use_zero = matches.get_flag(OPT_ZERO);
-    let silent = matches.get_flag(OPT_SILENT) || matches.get_flag(OPT_QUIET);
-    let verbose = matches.get_flag(OPT_VERBOSE);
-
-    let res_mode = if matches.get_flag(OPT_CANONICALIZE)
-        || matches.get_flag(OPT_CANONICALIZE_EXISTING)
-        || matches.get_flag(OPT_CANONICALIZE_MISSING)
-    {
-        ResolveMode::Logical
-    } else {
-        ResolveMode::None
-    };
-
-    let can_mode = if matches.get_flag(OPT_CANONICALIZE_EXISTING) {
-        MissingHandling::Existing
-    } else if matches.get_flag(OPT_CANONICALIZE_MISSING) {
-        MissingHandling::Missing
-    } else {
-        MissingHandling::Normal
-    };
-
-    let files: Vec<String> = matches
-        .get_many::<String>(ARG_FILES)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-    if files.is_empty() {
-        return Err(UUsageError::new(1, "missing operand"));
-    }
-
-    if no_trailing_delimiter && files.len() > 1 && !silent {
-        show_error!("ignoring --no-newline with multiple arguments");
-        no_trailing_delimiter = false;
-    }
-    let line_ending = if no_trailing_delimiter {
-        None
-    } else {
-        Some(LineEnding::from_zero_flag(use_zero))
-    };
-
-    for f in &files {
-        let p = PathBuf::from(f);
-        let path_result = if res_mode == ResolveMode::None {
-            fs::read_link(&p)
-        } else {
-            canonicalize(&p, can_mode, res_mode)
-        };
-        match path_result {
-            Ok(path) => {
-                show(&path, line_ending).map_err_context(String::new)?;
-            }
-            Err(err) => {
-                if verbose {
-                    return Err(USimpleError::new(
-                        1,
-                        err.map_err_context(move || f.maybe_quote().to_string())
-                            .to_string(),
-                    ));
-                } else {
-                    return Err(1.into());
-                }
-            }
-        }
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_CANONICALIZE)
-                .short('f')
-                .long(OPT_CANONICALIZE)
-                .help(
-                    "canonicalize by following every symlink in every component of the \
-                     given name recursively; all but the last component must exist",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_CANONICALIZE_EXISTING)
-                .short('e')
-                .long("canonicalize-existing")
-                .help(
-                    "canonicalize by following every symlink in every component of the \
-                     given name recursively, all components must exist",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_CANONICALIZE_MISSING)
-                .short('m')
-                .long(OPT_CANONICALIZE_MISSING)
-                .help(
-                    "canonicalize by following every symlink in every component of the \
-                     given name recursively, without requirements on components existence",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_NO_NEWLINE)
-                .short('n')
-                .long(OPT_NO_NEWLINE)
-                .help("do not output the trailing delimiter")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_QUIET)
-                .short('q')
-                .long(OPT_QUIET)
-                .help("suppress most error messages")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_SILENT)
-                .short('s')
-                .long(OPT_SILENT)
-                .help("suppress most error messages")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_VERBOSE)
-                .short('v')
-                .long(OPT_VERBOSE)
-                .help("report error message")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_ZERO)
-                .short('z')
-                .long(OPT_ZERO)
-                .help("separate output with NUL rather than newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
-fn show(path: &Path, line_ending: Option<LineEnding>) -> std::io::Result<()> {
-    let path = path.to_str().unwrap();
-    print!("{path}");
-    if let Some(line_ending) = line_ending {
-        print!("{line_ending}");
-    }
-    stdout().flush()
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_realpath/realpath.rs.html b/coreutils/dev/src/uu_realpath/realpath.rs.html deleted file mode 100644 index 1cc645d80..000000000 --- a/coreutils/dev/src/uu_realpath/realpath.rs.html +++ /dev/null @@ -1,591 +0,0 @@ -realpath.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) 2014 Vsevolod Velichko <torkvemada@sorokdva.net>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) retcode
-
-use clap::{
-    builder::NonEmptyStringValueParser, crate_version, Arg, ArgAction, ArgMatches, Command,
-};
-use std::{
-    io::{stdout, Write},
-    path::{Path, PathBuf},
-};
-use uucore::fs::make_path_relative_to;
-use uucore::{
-    display::{print_verbatim, Quotable},
-    error::{FromIo, UResult},
-    format_usage,
-    fs::{canonicalize, MissingHandling, ResolveMode},
-    help_about, help_usage,
-    line_ending::LineEnding,
-};
-use uucore::{error::UClapError, show, show_if_err};
-
-static ABOUT: &str = help_about!("realpath.md");
-const USAGE: &str = help_usage!("realpath.md");
-
-static OPT_QUIET: &str = "quiet";
-static OPT_STRIP: &str = "strip";
-static OPT_ZERO: &str = "zero";
-static OPT_PHYSICAL: &str = "physical";
-static OPT_LOGICAL: &str = "logical";
-const OPT_CANONICALIZE_MISSING: &str = "canonicalize-missing";
-const OPT_CANONICALIZE_EXISTING: &str = "canonicalize-existing";
-const OPT_RELATIVE_TO: &str = "relative-to";
-const OPT_RELATIVE_BASE: &str = "relative-base";
-
-static ARG_FILES: &str = "files";
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args).with_exit_code(1)?;
-
-    /*  the list of files */
-
-    let paths: Vec<PathBuf> = matches
-        .get_many::<String>(ARG_FILES)
-        .unwrap()
-        .map(PathBuf::from)
-        .collect();
-
-    let strip = matches.get_flag(OPT_STRIP);
-    let line_ending = LineEnding::from_zero_flag(matches.get_flag(OPT_ZERO));
-    let quiet = matches.get_flag(OPT_QUIET);
-    let logical = matches.get_flag(OPT_LOGICAL);
-    let can_mode = if matches.get_flag(OPT_CANONICALIZE_EXISTING) {
-        MissingHandling::Existing
-    } else if matches.get_flag(OPT_CANONICALIZE_MISSING) {
-        MissingHandling::Missing
-    } else {
-        MissingHandling::Normal
-    };
-    let resolve_mode = if strip {
-        ResolveMode::None
-    } else if logical {
-        ResolveMode::Logical
-    } else {
-        ResolveMode::Physical
-    };
-    let (relative_to, relative_base) = prepare_relative_options(&matches, can_mode, resolve_mode)?;
-    for path in &paths {
-        let result = resolve_path(
-            path,
-            line_ending,
-            resolve_mode,
-            can_mode,
-            relative_to.as_deref(),
-            relative_base.as_deref(),
-        );
-        if !quiet {
-            show_if_err!(result.map_err_context(|| path.maybe_quote().to_string()));
-        }
-    }
-    // Although we return `Ok`, it is possible that a call to
-    // `show!()` above has set the exit code for the program to a
-    // non-zero integer.
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_QUIET)
-                .short('q')
-                .long(OPT_QUIET)
-                .help("Do not print warnings for invalid paths")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_STRIP)
-                .short('s')
-                .long(OPT_STRIP)
-                .visible_alias("no-symlinks")
-                .help("Only strip '.' and '..' components, but don't resolve symbolic links")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_ZERO)
-                .short('z')
-                .long(OPT_ZERO)
-                .help("Separate output filenames with \\0 rather than newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_LOGICAL)
-                .short('L')
-                .long(OPT_LOGICAL)
-                .help("resolve '..' components before symlinks")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_PHYSICAL)
-                .short('P')
-                .long(OPT_PHYSICAL)
-                .overrides_with_all([OPT_STRIP, OPT_LOGICAL])
-                .help("resolve symlinks as encountered (default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_CANONICALIZE_EXISTING)
-                .short('e')
-                .long(OPT_CANONICALIZE_EXISTING)
-                .help(
-                    "canonicalize by following every symlink in every component of the \
-                     given name recursively, all components must exist",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_CANONICALIZE_MISSING)
-                .short('m')
-                .long(OPT_CANONICALIZE_MISSING)
-                .help(
-                    "canonicalize by following every symlink in every component of the \
-                     given name recursively, without requirements on components existence",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_RELATIVE_TO)
-                .long(OPT_RELATIVE_TO)
-                .value_name("DIR")
-                .value_parser(NonEmptyStringValueParser::new())
-                .help("print the resolved path relative to DIR"),
-        )
-        .arg(
-            Arg::new(OPT_RELATIVE_BASE)
-                .long(OPT_RELATIVE_BASE)
-                .value_name("DIR")
-                .value_parser(NonEmptyStringValueParser::new())
-                .help("print absolute paths unless paths below DIR"),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .required(true)
-                .value_parser(NonEmptyStringValueParser::new())
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
-/// Prepare `--relative-to` and `--relative-base` options.
-/// Convert them to their absolute values.
-/// Check if `--relative-to` is a descendant of `--relative-base`,
-/// otherwise nullify their value.
-fn prepare_relative_options(
-    matches: &ArgMatches,
-    can_mode: MissingHandling,
-    resolve_mode: ResolveMode,
-) -> UResult<(Option<PathBuf>, Option<PathBuf>)> {
-    let relative_to = matches
-        .get_one::<String>(OPT_RELATIVE_TO)
-        .map(PathBuf::from);
-    let relative_base = matches
-        .get_one::<String>(OPT_RELATIVE_BASE)
-        .map(PathBuf::from);
-    let relative_to = canonicalize_relative_option(relative_to, can_mode, resolve_mode)?;
-    let relative_base = canonicalize_relative_option(relative_base, can_mode, resolve_mode)?;
-    if let (Some(base), Some(to)) = (relative_base.as_deref(), relative_to.as_deref()) {
-        if !to.starts_with(base) {
-            return Ok((None, None));
-        }
-    }
-    Ok((relative_to, relative_base))
-}
-
-/// Prepare single `relative-*` option.
-fn canonicalize_relative_option(
-    relative: Option<PathBuf>,
-    can_mode: MissingHandling,
-    resolve_mode: ResolveMode,
-) -> UResult<Option<PathBuf>> {
-    Ok(match relative {
-        None => None,
-        Some(p) => Some(
-            canonicalize_relative(&p, can_mode, resolve_mode)
-                .map_err_context(|| p.maybe_quote().to_string())?,
-        ),
-    })
-}
-
-/// Make `relative-to` or `relative-base` path values absolute.
-///
-/// # Errors
-///
-/// If the given path is not a directory the function returns an error.
-/// If some parts of the file don't exist, or symlinks make loops, or
-/// some other IO error happens, the function returns error, too.
-fn canonicalize_relative(
-    r: &Path,
-    can_mode: MissingHandling,
-    resolve: ResolveMode,
-) -> std::io::Result<PathBuf> {
-    let abs = canonicalize(r, can_mode, resolve)?;
-    if can_mode == MissingHandling::Existing && !abs.is_dir() {
-        abs.read_dir()?; // raise not a directory error
-    }
-    Ok(abs)
-}
-
-/// Resolve a path to an absolute form and print it.
-///
-/// If `relative_to` and/or `relative_base` is given
-/// the path is printed in a relative form to one of this options.
-/// See the details in `process_relative` function.
-/// If `zero` is `true`, then this function
-/// prints the path followed by the null byte (`'\0'`) instead of a
-/// newline character (`'\n'`).
-///
-/// # Errors
-///
-/// This function returns an error if there is a problem resolving
-/// symbolic links.
-fn resolve_path(
-    p: &Path,
-    line_ending: LineEnding,
-    resolve: ResolveMode,
-    can_mode: MissingHandling,
-    relative_to: Option<&Path>,
-    relative_base: Option<&Path>,
-) -> std::io::Result<()> {
-    let abs = canonicalize(p, can_mode, resolve)?;
-
-    let abs = process_relative(abs, relative_base, relative_to);
-
-    print_verbatim(abs)?;
-    stdout().write_all(&[line_ending.into()])?;
-    Ok(())
-}
-
-/// Conditionally converts an absolute path to a relative form,
-/// according to the rules:
-/// 1. if only `relative_to` is given, the result is relative to `relative_to`
-/// 1. if only `relative_base` is given, it checks whether given `path` is a descendant
-/// of `relative_base`, on success the result is relative to `relative_base`, otherwise
-/// the result is the given `path`
-/// 1. if both `relative_to` and `relative_base` are given, the result is relative to `relative_to`
-/// if `path` is a descendant of `relative_base`, otherwise the result is `path`
-///
-/// For more information see
-/// <https://www.gnu.org/software/coreutils/manual/html_node/Realpath-usage-examples.html>
-fn process_relative(
-    path: PathBuf,
-    relative_base: Option<&Path>,
-    relative_to: Option<&Path>,
-) -> PathBuf {
-    if let Some(base) = relative_base {
-        if path.starts_with(base) {
-            make_path_relative_to(path, relative_to.unwrap_or(base))
-        } else {
-            path
-        }
-    } else if let Some(to) = relative_to {
-        make_path_relative_to(path, to)
-    } else {
-        path
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_relpath/relpath.rs.html b/coreutils/dev/src/uu_relpath/relpath.rs.html deleted file mode 100644 index 3911e292c..000000000 --- a/coreutils/dev/src/uu_relpath/relpath.rs.html +++ /dev/null @@ -1,179 +0,0 @@ -relpath.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) 2014 Vsevolod Velichko <torkvemada@sorokdva.net>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) subpath absto absfrom absbase
-
-use clap::{crate_version, Arg, Command};
-use std::env;
-use std::path::{Path, PathBuf};
-use uucore::display::println_verbatim;
-use uucore::error::{FromIo, UResult};
-use uucore::fs::{canonicalize, MissingHandling, ResolveMode};
-use uucore::{format_usage, help_about, help_usage};
-
-const USAGE: &str = help_usage!("relpath.md");
-const ABOUT: &str = help_about!("relpath.md");
-
-mod options {
-    pub const DIR: &str = "DIR";
-    pub const TO: &str = "TO";
-    pub const FROM: &str = "FROM";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().get_matches_from(args);
-
-    let to = Path::new(matches.get_one::<String>(options::TO).unwrap()).to_path_buf(); // required
-    let from = match matches.get_one::<String>(options::FROM) {
-        Some(p) => Path::new(p).to_path_buf(),
-        None => env::current_dir().unwrap(),
-    };
-    let absto = canonicalize(to, MissingHandling::Normal, ResolveMode::Logical)
-        .map_err_context(String::new)?;
-    let absfrom = canonicalize(from, MissingHandling::Normal, ResolveMode::Logical)
-        .map_err_context(String::new)?;
-
-    if matches.contains_id(options::DIR) {
-        let base = Path::new(&matches.get_one::<String>(options::DIR).unwrap()).to_path_buf();
-        let absbase = canonicalize(base, MissingHandling::Normal, ResolveMode::Logical)
-            .map_err_context(String::new)?;
-        if !absto.as_path().starts_with(absbase.as_path())
-            || !absfrom.as_path().starts_with(absbase.as_path())
-        {
-            return println_verbatim(absto).map_err_context(String::new);
-        }
-    }
-
-    let mut suffix_pos = 0;
-    for (f, t) in absfrom.components().zip(absto.components()) {
-        if f == t {
-            suffix_pos += 1;
-        } else {
-            break;
-        }
-    }
-
-    let mut result = PathBuf::new();
-    absfrom
-        .components()
-        .skip(suffix_pos)
-        .map(|_| result.push(".."))
-        .last();
-    absto
-        .components()
-        .skip(suffix_pos)
-        .map(|x| result.push(x.as_os_str()))
-        .last();
-
-    println_verbatim(result).map_err_context(String::new)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(Arg::new(options::DIR).short('d').help(
-            "If any of FROM and TO is not subpath of DIR, output absolute path instead of relative",
-        ))
-        .arg(Arg::new(options::TO).value_hint(clap::ValueHint::AnyPath))
-        .arg(Arg::new(options::FROM).value_hint(clap::ValueHint::AnyPath))
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_rm/rm.rs.html b/coreutils/dev/src/uu_rm/rm.rs.html deleted file mode 100644 index 7d6cdbb40..000000000 --- a/coreutils/dev/src/uu_rm/rm.rs.html +++ /dev/null @@ -1,1165 +0,0 @@ -rm.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (path) eacces
-
-use clap::{builder::ValueParser, crate_version, parser::ValueSource, Arg, ArgAction, Command};
-use std::collections::VecDeque;
-use std::ffi::{OsStr, OsString};
-use std::fs::{self, File, Metadata};
-use std::io::ErrorKind;
-use std::ops::BitOr;
-use std::path::{Path, PathBuf};
-use uucore::display::Quotable;
-use uucore::error::{UResult, USimpleError, UUsageError};
-use uucore::{format_usage, help_about, help_section, help_usage, prompt_yes, show_error};
-use walkdir::{DirEntry, WalkDir};
-
-#[derive(Eq, PartialEq, Clone, Copy)]
-enum InteractiveMode {
-    Never,
-    Once,
-    Always,
-    PromptProtected,
-}
-
-struct Options {
-    force: bool,
-    interactive: InteractiveMode,
-    #[allow(dead_code)]
-    one_fs: bool,
-    preserve_root: bool,
-    recursive: bool,
-    dir: bool,
-    verbose: bool,
-}
-
-const ABOUT: &str = help_about!("rm.md");
-const USAGE: &str = help_usage!("rm.md");
-const AFTER_HELP: &str = help_section!("after help", "rm.md");
-
-static OPT_DIR: &str = "dir";
-static OPT_INTERACTIVE: &str = "interactive";
-static OPT_FORCE: &str = "force";
-static OPT_NO_PRESERVE_ROOT: &str = "no-preserve-root";
-static OPT_ONE_FILE_SYSTEM: &str = "one-file-system";
-static OPT_PRESERVE_ROOT: &str = "preserve-root";
-static OPT_PROMPT: &str = "prompt";
-static OPT_PROMPT_MORE: &str = "prompt-more";
-static OPT_RECURSIVE: &str = "recursive";
-static OPT_VERBOSE: &str = "verbose";
-static PRESUME_INPUT_TTY: &str = "-presume-input-tty";
-
-static ARG_FILES: &str = "files";
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().after_help(AFTER_HELP).try_get_matches_from(args)?;
-
-    let files: Vec<&OsStr> = matches
-        .get_many::<OsString>(ARG_FILES)
-        .map(|v| v.map(OsString::as_os_str).collect())
-        .unwrap_or_default();
-
-    let force_flag = matches.get_flag(OPT_FORCE);
-
-    // If -f(--force) is before any -i (or variants) we want prompts else no prompts
-    let force_prompt_never: bool = force_flag && {
-        let force_index = matches.index_of(OPT_FORCE).unwrap_or(0);
-        ![OPT_PROMPT, OPT_PROMPT_MORE, OPT_INTERACTIVE]
-            .iter()
-            .any(|flag| {
-                matches.value_source(flag) == Some(ValueSource::CommandLine)
-                    && matches.index_of(flag).unwrap_or(0) > force_index
-            })
-    };
-
-    if files.is_empty() && !force_flag {
-        // Still check by hand and not use clap
-        // Because "rm -f" is a thing
-        return Err(UUsageError::new(1, "missing operand"));
-    } else {
-        let options = Options {
-            force: force_flag,
-            interactive: {
-                if force_prompt_never {
-                    InteractiveMode::Never
-                } else if matches.get_flag(OPT_PROMPT) {
-                    InteractiveMode::Always
-                } else if matches.get_flag(OPT_PROMPT_MORE) {
-                    InteractiveMode::Once
-                } else if matches.contains_id(OPT_INTERACTIVE) {
-                    match matches.get_one::<String>(OPT_INTERACTIVE).unwrap().as_str() {
-                        "never" => InteractiveMode::Never,
-                        "once" => InteractiveMode::Once,
-                        "always" => InteractiveMode::Always,
-                        val => {
-                            return Err(USimpleError::new(
-                                1,
-                                format!("Invalid argument to interactive ({val})"),
-                            ))
-                        }
-                    }
-                } else {
-                    InteractiveMode::PromptProtected
-                }
-            },
-            one_fs: matches.get_flag(OPT_ONE_FILE_SYSTEM),
-            preserve_root: !matches.get_flag(OPT_NO_PRESERVE_ROOT),
-            recursive: matches.get_flag(OPT_RECURSIVE),
-            dir: matches.get_flag(OPT_DIR),
-            verbose: matches.get_flag(OPT_VERBOSE),
-        };
-        if options.interactive == InteractiveMode::Once && (options.recursive || files.len() > 3) {
-            let msg: String = format!(
-                "remove {} {}{}",
-                files.len(),
-                if files.len() > 1 {
-                    "arguments"
-                } else {
-                    "argument"
-                },
-                if options.recursive {
-                    " recursively?"
-                } else {
-                    "?"
-                }
-            );
-            if !prompt_yes!("{}", msg) {
-                return Ok(());
-            }
-        }
-
-        if remove(&files, &options) {
-            return Err(1.into());
-        }
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .args_override_self(true)
-        .arg(
-            Arg::new(OPT_FORCE)
-                .short('f')
-                .long(OPT_FORCE)
-                .help("ignore nonexistent files and arguments, never prompt")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_PROMPT)
-                .short('i')
-                .help("prompt before every removal")
-                .overrides_with_all([OPT_PROMPT_MORE, OPT_INTERACTIVE])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_PROMPT_MORE)
-                .short('I')
-                .help("prompt once before removing more than three files, or when removing recursively. \
-                Less intrusive than -i, while still giving some protection against most mistakes")
-                .overrides_with_all([OPT_PROMPT, OPT_INTERACTIVE])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_INTERACTIVE)
-                .long(OPT_INTERACTIVE)
-                .help(
-                    "prompt according to WHEN: never, once (-I), or always (-i). Without WHEN, \
-                    prompts always",
-                )
-                .value_name("WHEN")
-                .num_args(0..=1)
-                .require_equals(true)
-                .default_missing_value("always")
-                .overrides_with_all([OPT_PROMPT, OPT_PROMPT_MORE]),
-        )
-        .arg(
-            Arg::new(OPT_ONE_FILE_SYSTEM)
-                .long(OPT_ONE_FILE_SYSTEM)
-                .help(
-                    "when removing a hierarchy recursively, skip any directory that is on a file \
-                    system different from that of the corresponding command line argument (NOT \
-                    IMPLEMENTED)",
-                ).action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_NO_PRESERVE_ROOT)
-                .long(OPT_NO_PRESERVE_ROOT)
-                .help("do not treat '/' specially")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_PRESERVE_ROOT)
-                .long(OPT_PRESERVE_ROOT)
-                .help("do not remove '/' (default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_RECURSIVE)
-                .short('r')
-                .visible_short_alias('R')
-                .long(OPT_RECURSIVE)
-                .help("remove directories and their contents recursively")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_DIR)
-                .short('d')
-                .long(OPT_DIR)
-                .help("remove empty directories")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_VERBOSE)
-                .short('v')
-                .long(OPT_VERBOSE)
-                .help("explain what is being done")
-                .action(ArgAction::SetTrue),
-        )
-        // From the GNU source code:
-        // This is solely for testing.
-        // Do not document.
-        // It is relatively difficult to ensure that there is a tty on stdin.
-        // Since rm acts differently depending on that, without this option,
-        // it'd be harder to test the parts of rm that depend on that setting.
-        // In contrast with Arg::long, Arg::alias does not strip leading
-        // hyphens. Therefore it supports 3 leading hyphens.
-        .arg(
-            Arg::new(PRESUME_INPUT_TTY)
-                .long("presume-input-tty")
-                .alias(PRESUME_INPUT_TTY)
-                .hide(true)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .value_parser(ValueParser::os_string())
-                .num_args(1..)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
-// TODO: implement one-file-system (this may get partially implemented in walkdir)
-fn remove(files: &[&OsStr], options: &Options) -> bool {
-    let mut had_err = false;
-
-    for filename in files {
-        let file = Path::new(filename);
-        had_err = match file.symlink_metadata() {
-            Ok(metadata) => {
-                if metadata.is_dir() {
-                    handle_dir(file, options)
-                } else if is_symlink_dir(&metadata) {
-                    remove_dir(file, options)
-                } else {
-                    remove_file(file, options)
-                }
-            }
-            Err(_e) => {
-                // TODO: actually print out the specific error
-                // TODO: When the error is not about missing files
-                // (e.g., permission), even rm -f should fail with
-                // outputting the error, but there's no easy eay.
-                if options.force {
-                    false
-                } else {
-                    show_error!(
-                        "cannot remove {}: No such file or directory",
-                        filename.quote()
-                    );
-                    true
-                }
-            }
-        }
-        .bitor(had_err);
-    }
-
-    had_err
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn handle_dir(path: &Path, options: &Options) -> bool {
-    let mut had_err = false;
-
-    let is_root = path.has_root() && path.parent().is_none();
-    if options.recursive && (!is_root || !options.preserve_root) {
-        if options.interactive != InteractiveMode::Always && !options.verbose {
-            if let Err(e) = fs::remove_dir_all(path) {
-                had_err = true;
-                if e.kind() == std::io::ErrorKind::PermissionDenied {
-                    // GNU compatibility (rm/fail-eacces.sh)
-                    // here, GNU doesn't use some kind of remove_dir_all
-                    // It will show directory+file
-                    show_error!("cannot remove {}: {}", path.quote(), "Permission denied");
-                } else {
-                    show_error!("cannot remove {}: {}", path.quote(), e);
-                }
-            }
-        } else {
-            let mut dirs: VecDeque<DirEntry> = VecDeque::new();
-            // The Paths to not descend into. We need to this because WalkDir doesn't have a way, afaik, to not descend into a directory
-            // So we have to just ignore paths as they come up if they start with a path we aren't descending into
-            let mut not_descended: Vec<PathBuf> = Vec::new();
-
-            'outer: for entry in WalkDir::new(path) {
-                match entry {
-                    Ok(entry) => {
-                        if options.interactive == InteractiveMode::Always {
-                            for not_descend in &not_descended {
-                                if entry.path().starts_with(not_descend) {
-                                    // We don't need to continue the rest of code in this loop if we are in a directory we don't want to descend into
-                                    continue 'outer;
-                                }
-                            }
-                        }
-                        let file_type = entry.file_type();
-                        if file_type.is_dir() {
-                            // If we are in Interactive Mode Always and the directory isn't empty we ask if we should descend else we push this directory onto dirs vector
-                            if options.interactive == InteractiveMode::Always
-                                && fs::read_dir(entry.path()).unwrap().count() != 0
-                            {
-                                // If we don't descend we push this directory onto our not_descended vector else we push this directory onto dirs vector
-                                if prompt_descend(entry.path()) {
-                                    dirs.push_back(entry);
-                                } else {
-                                    not_descended.push(entry.path().to_path_buf());
-                                }
-                            } else {
-                                dirs.push_back(entry);
-                            }
-                        } else {
-                            had_err = remove_file(entry.path(), options).bitor(had_err);
-                        }
-                    }
-                    Err(e) => {
-                        had_err = true;
-                        show_error!("recursing in {}: {}", path.quote(), e);
-                    }
-                }
-            }
-
-            for dir in dirs.iter().rev() {
-                had_err = remove_dir(dir.path(), options).bitor(had_err);
-            }
-        }
-    } else if options.dir && (!is_root || !options.preserve_root) {
-        had_err = remove_dir(path, options).bitor(had_err);
-    } else if options.recursive {
-        show_error!("could not remove directory {}", path.quote());
-        had_err = true;
-    } else {
-        show_error!(
-            "cannot remove {}: Is a directory", // GNU's rm error message does not include help
-            path.quote()
-        );
-        had_err = true;
-    }
-
-    had_err
-}
-
-fn remove_dir(path: &Path, options: &Options) -> bool {
-    if prompt_dir(path, options) {
-        if let Ok(mut read_dir) = fs::read_dir(path) {
-            if options.dir || options.recursive {
-                if read_dir.next().is_none() {
-                    match fs::remove_dir(path) {
-                        Ok(_) => {
-                            if options.verbose {
-                                println!("removed directory {}", normalize(path).quote());
-                            }
-                        }
-                        Err(e) => {
-                            if e.kind() == std::io::ErrorKind::PermissionDenied {
-                                // GNU compatibility (rm/fail-eacces.sh)
-                                show_error!(
-                                    "cannot remove {}: {}",
-                                    path.quote(),
-                                    "Permission denied"
-                                );
-                            } else {
-                                show_error!("cannot remove {}: {}", path.quote(), e);
-                            }
-                            return true;
-                        }
-                    }
-                } else {
-                    // directory can be read but is not empty
-                    show_error!("cannot remove {}: Directory not empty", path.quote());
-                    return true;
-                }
-            } else {
-                // called to remove a symlink_dir (windows) without "-r"/"-R" or "-d"
-                show_error!("cannot remove {}: Is a directory", path.quote());
-                return true;
-            }
-        } else {
-            // GNU's rm shows this message if directory is empty but not readable
-            show_error!("cannot remove {}: Directory not empty", path.quote());
-            return true;
-        }
-    }
-
-    false
-}
-
-fn remove_file(path: &Path, options: &Options) -> bool {
-    if prompt_file(path, options) {
-        match fs::remove_file(path) {
-            Ok(_) => {
-                if options.verbose {
-                    println!("removed {}", normalize(path).quote());
-                }
-            }
-            Err(e) => {
-                if e.kind() == std::io::ErrorKind::PermissionDenied {
-                    // GNU compatibility (rm/fail-eacces.sh)
-                    show_error!("cannot remove {}: {}", path.quote(), "Permission denied");
-                } else {
-                    show_error!("cannot remove {}: {}", path.quote(), e);
-                }
-                return true;
-            }
-        }
-    }
-
-    false
-}
-
-fn prompt_dir(path: &Path, options: &Options) -> bool {
-    // If interactive is Never we never want to send prompts
-    if options.interactive == InteractiveMode::Never {
-        return true;
-    }
-
-    // We can't use metadata.permissions.readonly for directories because it only works on files
-    // So we have to handle whether a directory is writable manually
-    if let Ok(metadata) = fs::metadata(path) {
-        handle_writable_directory(path, options, &metadata)
-    } else {
-        true
-    }
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn prompt_file(path: &Path, options: &Options) -> bool {
-    // If interactive is Never we never want to send prompts
-    if options.interactive == InteractiveMode::Never {
-        return true;
-    }
-    // If interactive is Always we want to check if the file is symlink to prompt the right message
-    if options.interactive == InteractiveMode::Always {
-        if let Ok(metadata) = fs::symlink_metadata(path) {
-            if metadata.is_symlink() {
-                return prompt_yes!("remove symbolic link {}?", path.quote());
-            }
-        }
-    }
-    // File::open(path) doesn't open the file in write mode so we need to use file options to open it in also write mode to check if it can written too
-    match File::options().read(true).write(true).open(path) {
-        Ok(file) => {
-            if let Ok(metadata) = file.metadata() {
-                if metadata.permissions().readonly() {
-                    if metadata.len() == 0 {
-                        prompt_yes!(
-                            "remove write-protected regular empty file {}?",
-                            path.quote()
-                        )
-                    } else {
-                        prompt_yes!("remove write-protected regular file {}?", path.quote())
-                    }
-                } else if options.interactive == InteractiveMode::Always {
-                    if metadata.len() == 0 {
-                        prompt_yes!("remove regular empty file {}?", path.quote())
-                    } else {
-                        prompt_yes!("remove file {}?", path.quote())
-                    }
-                } else {
-                    true
-                }
-            } else {
-                true
-            }
-        }
-        Err(err) => {
-            if err.kind() == ErrorKind::PermissionDenied {
-                match fs::metadata(path) {
-                    Ok(metadata) if metadata.len() == 0 => {
-                        prompt_yes!(
-                            "remove write-protected regular empty file {}?",
-                            path.quote()
-                        )
-                    }
-                    _ => prompt_yes!("remove write-protected regular file {}?", path.quote()),
-                }
-            } else {
-                true
-            }
-        }
-    }
-}
-
-// For directories finding if they are writable or not is a hassle. In Unix we can use the built-in rust crate to to check mode bits. But other os don't have something similar afaik
-// Most cases are covered by keep eye out for edge cases
-#[cfg(unix)]
-fn handle_writable_directory(path: &Path, options: &Options, metadata: &Metadata) -> bool {
-    use std::os::unix::fs::PermissionsExt;
-    let mode = metadata.permissions().mode();
-    // Check if directory has user write permissions
-    // Why is S_IWUSR showing up as a u16 on macos?
-    #[allow(clippy::unnecessary_cast)]
-    let user_writable = (mode & (libc::S_IWUSR as u32)) != 0;
-    if !user_writable {
-        prompt_yes!("remove write-protected directory {}?", path.quote())
-    } else if options.interactive == InteractiveMode::Always {
-        prompt_yes!("remove directory {}?", path.quote())
-    } else {
-        true
-    }
-}
-
-// For windows we can use windows metadata trait and file attributes to see if a directory is readonly
-#[cfg(windows)]
-fn handle_writable_directory(path: &Path, options: &Options, metadata: &Metadata) -> bool {
-    use std::os::windows::prelude::MetadataExt;
-    use windows_sys::Win32::Storage::FileSystem::FILE_ATTRIBUTE_READONLY;
-    let not_user_writable = (metadata.file_attributes() & FILE_ATTRIBUTE_READONLY) != 0;
-    if not_user_writable {
-        prompt_yes!("remove write-protected directory {}?", path.quote())
-    } else if options.interactive == InteractiveMode::Always {
-        prompt_yes!("remove directory {}?", path.quote())
-    } else {
-        true
-    }
-}
-
-// I have this here for completeness but it will always return "remove directory {}" because metadata.permissions().readonly() only works for file not directories
-#[cfg(not(windows))]
-#[cfg(not(unix))]
-fn handle_writable_directory(path: &Path, options: &Options, metadata: &Metadata) -> bool {
-    if options.interactive == InteractiveMode::Always {
-        prompt_yes!("remove directory {}?", path.quote())
-    } else {
-        true
-    }
-}
-
-fn prompt_descend(path: &Path) -> bool {
-    prompt_yes!("descend into directory {}?", path.quote())
-}
-
-fn normalize(path: &Path) -> PathBuf {
-    // copied from https://github.com/rust-lang/cargo/blob/2e4cfc2b7d43328b207879228a2ca7d427d188bb/src/cargo/util/paths.rs#L65-L90
-    // both projects are MIT https://github.com/rust-lang/cargo/blob/master/LICENSE-MIT
-    // for std impl progress see rfc https://github.com/rust-lang/rfcs/issues/2208
-    // TODO: replace this once that lands
-    uucore::fs::normalize_path(path)
-}
-
-#[cfg(not(windows))]
-fn is_symlink_dir(_metadata: &Metadata) -> bool {
-    false
-}
-
-#[cfg(windows)]
-fn is_symlink_dir(metadata: &Metadata) -> bool {
-    use std::os::windows::prelude::MetadataExt;
-    use windows_sys::Win32::Storage::FileSystem::FILE_ATTRIBUTE_DIRECTORY;
-
-    metadata.file_type().is_symlink()
-        && ((metadata.file_attributes() & FILE_ATTRIBUTE_DIRECTORY) != 0)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_rmdir/rmdir.rs.html b/coreutils/dev/src/uu_rmdir/rmdir.rs.html deleted file mode 100644 index 3cb8c8cac..000000000 --- a/coreutils/dev/src/uu_rmdir/rmdir.rs.html +++ /dev/null @@ -1,407 +0,0 @@ -rmdir.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) ENOTDIR
-
-use clap::builder::ValueParser;
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::ffi::OsString;
-use std::fs::{read_dir, remove_dir};
-use std::io;
-use std::path::Path;
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, strip_errno, UResult};
-
-use uucore::{format_usage, help_about, help_usage, show_error, util_name};
-
-static ABOUT: &str = help_about!("rmdir.md");
-const USAGE: &str = help_usage!("rmdir.md");
-static OPT_IGNORE_FAIL_NON_EMPTY: &str = "ignore-fail-on-non-empty";
-static OPT_PARENTS: &str = "parents";
-static OPT_VERBOSE: &str = "verbose";
-
-static ARG_DIRS: &str = "dirs";
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let opts = Opts {
-        ignore: matches.get_flag(OPT_IGNORE_FAIL_NON_EMPTY),
-        parents: matches.get_flag(OPT_PARENTS),
-        verbose: matches.get_flag(OPT_VERBOSE),
-    };
-
-    for path in matches
-        .get_many::<OsString>(ARG_DIRS)
-        .unwrap_or_default()
-        .map(Path::new)
-    {
-        if let Err(error) = remove(path, opts) {
-            let Error { error, path } = error;
-
-            if opts.ignore && dir_not_empty(&error, path) {
-                continue;
-            }
-
-            set_exit_code(1);
-
-            // If `foo` is a symlink to a directory then `rmdir foo/` may give
-            // a "not a directory" error. This is confusing as `rm foo/` says
-            // "is a directory".
-            // This differs from system to system. Some don't give an error.
-            // Windows simply allows calling RemoveDirectory on symlinks so we
-            // don't need to worry about it here.
-            // GNU rmdir seems to print "Symbolic link not followed" if:
-            // - It has a trailing slash
-            // - It's a symlink
-            // - It either points to a directory or dangles
-            #[cfg(unix)]
-            {
-                use std::ffi::OsStr;
-                use std::os::unix::ffi::OsStrExt;
-
-                fn points_to_directory(path: &Path) -> io::Result<bool> {
-                    Ok(path.metadata()?.file_type().is_dir())
-                }
-
-                let bytes = path.as_os_str().as_bytes();
-                if error.raw_os_error() == Some(libc::ENOTDIR) && bytes.ends_with(b"/") {
-                    // Strip the trailing slash or .symlink_metadata() will follow the symlink
-                    let no_slash: &Path = OsStr::from_bytes(&bytes[..bytes.len() - 1]).as_ref();
-                    if no_slash.is_symlink() && points_to_directory(no_slash).unwrap_or(true) {
-                        show_error!(
-                            "failed to remove {}: Symbolic link not followed",
-                            path.quote()
-                        );
-                        continue;
-                    }
-                }
-            }
-
-            show_error!("failed to remove {}: {}", path.quote(), strip_errno(&error));
-        }
-    }
-
-    Ok(())
-}
-
-struct Error<'a> {
-    error: io::Error,
-    path: &'a Path,
-}
-
-fn remove(mut path: &Path, opts: Opts) -> Result<(), Error<'_>> {
-    remove_single(path, opts)?;
-    if opts.parents {
-        while let Some(new) = path.parent() {
-            path = new;
-            if path.as_os_str().is_empty() {
-                break;
-            }
-            remove_single(path, opts)?;
-        }
-    }
-    Ok(())
-}
-
-fn remove_single(path: &Path, opts: Opts) -> Result<(), Error<'_>> {
-    if opts.verbose {
-        println!("{}: removing directory, {}", util_name(), path.quote());
-    }
-    remove_dir(path).map_err(|error| Error { error, path })
-}
-
-// POSIX: https://pubs.opengroup.org/onlinepubs/009696799/functions/rmdir.html
-#[cfg(not(windows))]
-const NOT_EMPTY_CODES: &[i32] = &[libc::ENOTEMPTY, libc::EEXIST];
-
-// 145 is ERROR_DIR_NOT_EMPTY, determined experimentally.
-#[cfg(windows)]
-const NOT_EMPTY_CODES: &[i32] = &[145];
-
-// Other error codes you might get for directories that could be found and are
-// not empty.
-// This is a subset of the error codes listed in rmdir(2) from the Linux man-pages
-// project. Maybe other systems have additional codes that apply?
-#[cfg(not(windows))]
-const PERHAPS_EMPTY_CODES: &[i32] = &[libc::EACCES, libc::EBUSY, libc::EPERM, libc::EROFS];
-
-// Probably incomplete, I can't find a list of possible errors for
-// RemoveDirectory anywhere.
-#[cfg(windows)]
-const PERHAPS_EMPTY_CODES: &[i32] = &[
-    5, // ERROR_ACCESS_DENIED, found experimentally.
-];
-
-fn dir_not_empty(error: &io::Error, path: &Path) -> bool {
-    if let Some(code) = error.raw_os_error() {
-        if NOT_EMPTY_CODES.contains(&code) {
-            return true;
-        }
-        // If --ignore-fail-on-non-empty is used then we want to ignore all errors
-        // for non-empty directories, even if the error was e.g. because there's
-        // no permission. So we do an additional check.
-        if PERHAPS_EMPTY_CODES.contains(&code) {
-            if let Ok(mut iterator) = read_dir(path) {
-                if iterator.next().is_some() {
-                    return true;
-                }
-            }
-        }
-    }
-    false
-}
-
-#[derive(Clone, Copy, Debug)]
-struct Opts {
-    ignore: bool,
-    parents: bool,
-    verbose: bool,
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_IGNORE_FAIL_NON_EMPTY)
-                .long(OPT_IGNORE_FAIL_NON_EMPTY)
-                .help("ignore each failure that is solely because a directory is non-empty")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_PARENTS)
-                .short('p')
-                .long(OPT_PARENTS)
-                .help(
-                    "remove DIRECTORY and its ancestors; e.g.,
-                  'rmdir -p a/b/c' is similar to rmdir a/b/c a/b a",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_VERBOSE)
-                .short('v')
-                .long(OPT_VERBOSE)
-                .help("output a diagnostic for every directory processed")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_DIRS)
-                .action(ArgAction::Append)
-                .num_args(1..)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::DirPath),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_runcon/errors.rs.html b/coreutils/dev/src/uu_runcon/errors.rs.html deleted file mode 100644 index be3817087..000000000 --- a/coreutils/dev/src/uu_runcon/errors.rs.html +++ /dev/null @@ -1,233 +0,0 @@ -errors.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-
use std::ffi::OsString;
-use std::fmt::{Display, Formatter, Write};
-use std::io;
-use std::str::Utf8Error;
-
-use uucore::display::Quotable;
-use uucore::error::UError;
-
-pub(crate) type Result<T> = std::result::Result<T, Error>;
-
-// This list is NOT exhaustive. This command might perform an `execvp()` to run
-// a different program. When that happens successfully, the exit status of this
-// process will be the exit status of that program.
-pub(crate) mod error_exit_status {
-    pub const NOT_FOUND: i32 = 127;
-    pub const COULD_NOT_EXECUTE: i32 = 126;
-    pub const ANOTHER_ERROR: i32 = libc::EXIT_FAILURE;
-}
-
-#[derive(thiserror::Error, Debug)]
-pub(crate) enum Error {
-    #[error("No command is specified")]
-    MissingCommand,
-
-    #[error("SELinux is not enabled")]
-    SELinuxNotEnabled,
-
-    #[error(transparent)]
-    NotUTF8(#[from] Utf8Error),
-
-    #[error(transparent)]
-    CommandLine(#[from] clap::Error),
-
-    #[error("{operation} failed")]
-    SELinux {
-        operation: &'static str,
-        source: selinux::errors::Error,
-    },
-
-    #[error("{operation} failed")]
-    Io {
-        operation: &'static str,
-        source: io::Error,
-    },
-
-    #[error("{operation} failed on {}", .operand1.quote())]
-    Io1 {
-        operation: &'static str,
-        operand1: OsString,
-        source: io::Error,
-    },
-}
-
-impl Error {
-    pub(crate) fn from_io(operation: &'static str, source: io::Error) -> Self {
-        Self::Io { operation, source }
-    }
-
-    pub(crate) fn from_io1(
-        operation: &'static str,
-        operand1: impl Into<OsString>,
-        source: io::Error,
-    ) -> Self {
-        Self::Io1 {
-            operation,
-            operand1: operand1.into(),
-            source,
-        }
-    }
-
-    pub(crate) fn from_selinux(operation: &'static str, source: selinux::errors::Error) -> Self {
-        Self::SELinux { operation, source }
-    }
-}
-
-pub(crate) fn write_full_error<W>(writer: &mut W, err: &dyn std::error::Error) -> std::fmt::Result
-where
-    W: Write,
-{
-    write!(writer, "{err}")?;
-    let mut err = err;
-    while let Some(source) = err.source() {
-        err = source;
-        write!(writer, ": {err}")?;
-    }
-    write!(writer, ".")?;
-    Ok(())
-}
-
-#[derive(Debug)]
-pub(crate) struct RunconError {
-    inner: Error,
-    code: i32,
-}
-
-impl RunconError {
-    pub(crate) fn new(e: Error) -> Self {
-        Self::with_code(error_exit_status::ANOTHER_ERROR, e)
-    }
-
-    pub(crate) fn with_code(code: i32, e: Error) -> Self {
-        Self { inner: e, code }
-    }
-}
-
-impl std::error::Error for RunconError {}
-impl UError for RunconError {
-    fn code(&self) -> i32 {
-        self.code
-    }
-}
-impl Display for RunconError {
-    fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
-        write_full_error(f, &self.inner)
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_runcon/runcon.rs.html b/coreutils/dev/src/uu_runcon/runcon.rs.html deleted file mode 100644 index f39abea15..000000000 --- a/coreutils/dev/src/uu_runcon/runcon.rs.html +++ /dev/null @@ -1,821 +0,0 @@ -runcon.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-
// spell-checker:ignore (vars) RFILE
-
-use clap::builder::ValueParser;
-use uucore::error::{UResult, UUsageError};
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use selinux::{OpaqueSecurityContext, SecurityClass, SecurityContext};
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-use std::borrow::Cow;
-use std::ffi::{CStr, CString, OsStr, OsString};
-use std::os::raw::c_char;
-use std::os::unix::ffi::OsStrExt;
-use std::{io, ptr};
-
-mod errors;
-
-use errors::error_exit_status;
-use errors::{Error, Result, RunconError};
-
-const ABOUT: &str = help_about!("runcon.md");
-const USAGE: &str = help_usage!("runcon.md");
-const DESCRIPTION: &str = help_section!("after help", "runcon.md");
-
-pub mod options {
-    pub const COMPUTE: &str = "compute";
-
-    pub const USER: &str = "user";
-    pub const ROLE: &str = "role";
-    pub const TYPE: &str = "type";
-    pub const RANGE: &str = "range";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let config = uu_app();
-
-    let options = match parse_command_line(config, args) {
-        Ok(r) => r,
-        Err(r) => {
-            if let Error::CommandLine(ref r) = r {
-                match r.kind() {
-                    clap::error::ErrorKind::DisplayHelp
-                    | clap::error::ErrorKind::DisplayVersion => {
-                        println!("{r}");
-                        return Ok(());
-                    }
-                    _ => {}
-                }
-            }
-            return Err(UUsageError::new(
-                error_exit_status::ANOTHER_ERROR,
-                format!("{r}"),
-            ));
-        }
-    };
-
-    match &options.mode {
-        CommandLineMode::Print => print_current_context().map_err(|e| RunconError::new(e).into()),
-        CommandLineMode::PlainContext { context, command } => {
-            get_plain_context(context)
-                .and_then(|ctx| set_next_exec_context(&ctx))
-                .map_err(RunconError::new)?;
-            // On successful execution, the following call never returns,
-            // and this process image is replaced.
-            execute_command(command, &options.arguments)
-        }
-        CommandLineMode::CustomContext {
-            compute_transition_context,
-            user,
-            role,
-            the_type,
-            range,
-            command,
-        } => {
-            match command {
-                Some(command) => {
-                    get_custom_context(
-                        *compute_transition_context,
-                        user.as_deref(),
-                        role.as_deref(),
-                        the_type.as_deref(),
-                        range.as_deref(),
-                        command,
-                    )
-                    .and_then(|ctx| set_next_exec_context(&ctx))
-                    .map_err(RunconError::new)?;
-                    // On successful execution, the following call never returns,
-                    // and this process image is replaced.
-                    execute_command(command, &options.arguments)
-                }
-                None => print_current_context().map_err(|e| RunconError::new(e).into()),
-            }
-        }
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(DESCRIPTION)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::COMPUTE)
-                .short('c')
-                .long(options::COMPUTE)
-                .help("Compute process transition context before modifying.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::USER)
-                .short('u')
-                .long(options::USER)
-                .value_name("USER")
-                .help("Set user USER in the target security context.")
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(options::ROLE)
-                .short('r')
-                .long(options::ROLE)
-                .value_name("ROLE")
-                .help("Set role ROLE in the target security context.")
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(options::TYPE)
-                .short('t')
-                .long(options::TYPE)
-                .value_name("TYPE")
-                .help("Set type TYPE in the target security context.")
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(options::RANGE)
-                .short('l')
-                .long(options::RANGE)
-                .value_name("RANGE")
-                .help("Set range RANGE in the target security context.")
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new("ARG")
-                .action(ArgAction::Append)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::CommandName),
-        )
-        // Once "ARG" is parsed, everything after that belongs to it.
-        //
-        // This is not how POSIX does things, but this is how the GNU implementation
-        // parses its command line.
-        .trailing_var_arg(true)
-}
-
-#[derive(Debug)]
-enum CommandLineMode {
-    Print,
-
-    PlainContext {
-        context: OsString,
-        command: OsString,
-    },
-
-    CustomContext {
-        /// Compute process transition context before modifying.
-        compute_transition_context: bool,
-
-        /// Use the current context with the specified user.
-        user: Option<OsString>,
-
-        /// Use the current context with the specified role.
-        role: Option<OsString>,
-
-        /// Use the current context with the specified type.
-        the_type: Option<OsString>,
-
-        /// Use the current context with the specified range.
-        range: Option<OsString>,
-
-        // `command` can be `None`, in which case we're dealing with this syntax:
-        // runcon [-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE]
-        //
-        // This syntax is undocumented, but it is accepted by the GNU implementation,
-        // so we do the same for compatibility.
-        command: Option<OsString>,
-    },
-}
-
-#[derive(Debug)]
-struct Options {
-    mode: CommandLineMode,
-    arguments: Vec<OsString>,
-}
-
-fn parse_command_line(config: Command, args: impl uucore::Args) -> Result<Options> {
-    let matches = config.try_get_matches_from(args)?;
-
-    let compute_transition_context = matches.get_flag(options::COMPUTE);
-
-    let mut args = matches
-        .get_many::<OsString>("ARG")
-        .unwrap_or_default()
-        .map(OsString::from);
-
-    if compute_transition_context
-        || matches.contains_id(options::USER)
-        || matches.contains_id(options::ROLE)
-        || matches.contains_id(options::TYPE)
-        || matches.contains_id(options::RANGE)
-    {
-        // runcon [-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] [COMMAND [args]]
-
-        let mode = CommandLineMode::CustomContext {
-            compute_transition_context,
-            user: matches.get_one::<OsString>(options::USER).map(Into::into),
-            role: matches.get_one::<OsString>(options::ROLE).map(Into::into),
-            the_type: matches.get_one::<OsString>(options::TYPE).map(Into::into),
-            range: matches.get_one::<OsString>(options::RANGE).map(Into::into),
-            command: args.next(),
-        };
-
-        Ok(Options {
-            mode,
-            arguments: args.collect(),
-        })
-    } else if let Some(context) = args.next() {
-        // runcon CONTEXT COMMAND [args]
-
-        args.next()
-            .ok_or(Error::MissingCommand)
-            .map(move |command| Options {
-                mode: CommandLineMode::PlainContext { context, command },
-                arguments: args.collect(),
-            })
-    } else {
-        // runcon
-
-        Ok(Options {
-            mode: CommandLineMode::Print,
-            arguments: Vec::default(),
-        })
-    }
-}
-
-fn print_current_context() -> Result<()> {
-    let op = "Getting security context of the current process";
-    let context = SecurityContext::current(false).map_err(|r| Error::from_selinux(op, r))?;
-
-    let context = context
-        .to_c_string()
-        .map_err(|r| Error::from_selinux(op, r))?;
-
-    if let Some(context) = context {
-        let context = context.as_ref().to_str()?;
-        println!("{context}");
-    } else {
-        println!();
-    }
-    Ok(())
-}
-
-fn set_next_exec_context(context: &OpaqueSecurityContext) -> Result<()> {
-    let c_context = context
-        .to_c_string()
-        .map_err(|r| Error::from_selinux("Creating new context", r))?;
-
-    let sc = SecurityContext::from_c_str(&c_context, false);
-
-    if sc.check() != Some(true) {
-        let ctx = OsStr::from_bytes(c_context.as_bytes());
-        let err = io::ErrorKind::InvalidInput.into();
-        return Err(Error::from_io1("Checking security context", ctx, err));
-    }
-
-    sc.set_for_next_exec()
-        .map_err(|r| Error::from_selinux("Setting new security context", r))
-}
-
-fn get_plain_context(context: &OsStr) -> Result<OpaqueSecurityContext> {
-    if selinux::kernel_support() == selinux::KernelSupport::Unsupported {
-        return Err(Error::SELinuxNotEnabled);
-    }
-
-    let c_context = os_str_to_c_string(context)?;
-
-    OpaqueSecurityContext::from_c_str(&c_context)
-        .map_err(|r| Error::from_selinux("Creating new context", r))
-}
-
-fn get_transition_context(command: &OsStr) -> Result<SecurityContext> {
-    // Generate context based on process transition.
-    let sec_class = SecurityClass::from_name("process")
-        .map_err(|r| Error::from_selinux("Getting process security class", r))?;
-
-    // Get context of file to be executed.
-    let file_context = match SecurityContext::of_path(command, true, false) {
-        Ok(Some(context)) => context,
-
-        Ok(None) => {
-            let err = io::Error::from_raw_os_error(libc::ENODATA);
-            return Err(Error::from_io1("getfilecon", command, err));
-        }
-
-        Err(r) => {
-            let op = "Getting security context of command file";
-            return Err(Error::from_selinux(op, r));
-        }
-    };
-
-    let process_context = SecurityContext::current(false)
-        .map_err(|r| Error::from_selinux("Getting security context of the current process", r))?;
-
-    // Compute result of process transition.
-    process_context
-        .of_labeling_decision(&file_context, sec_class, "")
-        .map_err(|r| Error::from_selinux("Computing result of process transition", r))
-}
-
-fn get_initial_custom_opaque_context(
-    compute_transition_context: bool,
-    command: &OsStr,
-) -> Result<OpaqueSecurityContext> {
-    let context = if compute_transition_context {
-        get_transition_context(command)?
-    } else {
-        SecurityContext::current(false).map_err(|r| {
-            Error::from_selinux("Getting security context of the current process", r)
-        })?
-    };
-
-    let c_context = context
-        .to_c_string()
-        .map_err(|r| Error::from_selinux("Getting security context", r))?
-        .unwrap_or_else(|| Cow::Owned(CString::default()));
-
-    OpaqueSecurityContext::from_c_str(c_context.as_ref())
-        .map_err(|r| Error::from_selinux("Creating new context", r))
-}
-
-fn get_custom_context(
-    compute_transition_context: bool,
-    user: Option<&OsStr>,
-    role: Option<&OsStr>,
-    the_type: Option<&OsStr>,
-    range: Option<&OsStr>,
-    command: &OsStr,
-) -> Result<OpaqueSecurityContext> {
-    use OpaqueSecurityContext as OSC;
-    type SetNewValueProc = fn(&OSC, &CStr) -> selinux::errors::Result<()>;
-
-    if selinux::kernel_support() == selinux::KernelSupport::Unsupported {
-        return Err(Error::SELinuxNotEnabled);
-    }
-
-    let osc = get_initial_custom_opaque_context(compute_transition_context, command)?;
-
-    let list: &[(Option<&OsStr>, SetNewValueProc, &'static str)] = &[
-        (user, OSC::set_user, "Setting security context user"),
-        (role, OSC::set_role, "Setting security context role"),
-        (the_type, OSC::set_type, "Setting security context type"),
-        (range, OSC::set_range, "Setting security context range"),
-    ];
-
-    for &(new_value, method, op) in list {
-        if let Some(new_value) = new_value {
-            let c_new_value = os_str_to_c_string(new_value)?;
-            method(&osc, &c_new_value).map_err(|r| Error::from_selinux(op, r))?;
-        }
-    }
-    Ok(osc)
-}
-
-/// The actual return type of this function should be `UResult<!>`.
-/// However, until the *never* type is stabilized, one way to indicate to the
-/// compiler the only valid return type is to say "if this returns, it will
-/// always return an error".
-fn execute_command(command: &OsStr, arguments: &[OsString]) -> UResult<()> {
-    let c_command = os_str_to_c_string(command).map_err(RunconError::new)?;
-
-    let argv_storage: Vec<CString> = arguments
-        .iter()
-        .map(AsRef::as_ref)
-        .map(os_str_to_c_string)
-        .collect::<Result<_>>()
-        .map_err(RunconError::new)?;
-
-    let mut argv: Vec<*const c_char> = Vec::with_capacity(arguments.len().saturating_add(2));
-    argv.push(c_command.as_ptr());
-    argv.extend(argv_storage.iter().map(AsRef::as_ref).map(CStr::as_ptr));
-    argv.push(ptr::null());
-
-    unsafe { libc::execvp(c_command.as_ptr(), argv.as_ptr()) };
-
-    let err = io::Error::last_os_error();
-    let exit_status = if err.kind() == io::ErrorKind::NotFound {
-        error_exit_status::NOT_FOUND
-    } else {
-        error_exit_status::COULD_NOT_EXECUTE
-    };
-
-    let err = Error::from_io1("Executing command", command, err);
-    Err(RunconError::with_code(exit_status, err).into())
-}
-
-fn os_str_to_c_string(s: &OsStr) -> Result<CString> {
-    CString::new(s.as_bytes())
-        .map_err(|_r| Error::from_io("CString::new()", io::ErrorKind::InvalidInput.into()))
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_seq/error.rs.html b/coreutils/dev/src/uu_seq/error.rs.html deleted file mode 100644 index 31498d768..000000000 --- a/coreutils/dev/src/uu_seq/error.rs.html +++ /dev/null @@ -1,123 +0,0 @@ -error.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore numberparse
-//! Errors returned by seq.
-use std::error::Error;
-use std::fmt::Display;
-
-use uucore::display::Quotable;
-use uucore::error::UError;
-
-use crate::numberparse::ParseNumberError;
-
-#[derive(Debug)]
-pub enum SeqError {
-    /// An error parsing the input arguments.
-    ///
-    /// The parameters are the [`String`] argument as read from the
-    /// command line and the underlying parsing error itself.
-    ParseError(String, ParseNumberError),
-
-    /// The increment argument was zero, which is not allowed.
-    ///
-    /// The parameter is the increment argument as a [`String`] as read
-    /// from the command line.
-    ZeroIncrement(String),
-
-    /// No arguments were passed to this function, 1 or more is required
-    NoArguments,
-}
-
-impl UError for SeqError {
-    /// Always return 1.
-    fn code(&self) -> i32 {
-        1
-    }
-
-    fn usage(&self) -> bool {
-        true
-    }
-}
-
-impl Error for SeqError {}
-
-impl Display for SeqError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::ParseError(s, e) => {
-                let error_type = match e {
-                    ParseNumberError::Float => "floating point",
-                    ParseNumberError::Nan => "'not-a-number'",
-                    ParseNumberError::Hex => "hexadecimal",
-                };
-                write!(f, "invalid {error_type} argument: {}", s.quote())
-            }
-            Self::ZeroIncrement(s) => write!(f, "invalid Zero increment value: {}", s.quote()),
-            Self::NoArguments => write!(f, "missing operand"),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_seq/extendedbigdecimal.rs.html b/coreutils/dev/src/uu_seq/extendedbigdecimal.rs.html deleted file mode 100644 index e5a9b8646..000000000 --- a/coreutils/dev/src/uu_seq/extendedbigdecimal.rs.html +++ /dev/null @@ -1,557 +0,0 @@ -extendedbigdecimal.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-
// spell-checker:ignore bigdecimal extendedbigdecimal extendedbigint
-//! An arbitrary precision float that can also represent infinity, NaN, etc.
-//!
-//! The finite values are stored as [`BigDecimal`] instances. Because
-//! the `bigdecimal` library does not represent infinity, NaN, etc., we
-//! need to represent them explicitly ourselves. The
-//! [`ExtendedBigDecimal`] enumeration does that.
-//!
-//! # Examples
-//!
-//! Addition works for [`ExtendedBigDecimal`] as it does for floats. For
-//! example, adding infinity to any finite value results in infinity:
-//!
-//! ```rust,ignore
-//! let summand1 = ExtendedBigDecimal::BigDecimal(BigDecimal::zero());
-//! let summand2 = ExtendedBigDecimal::Infinity;
-//! assert_eq!(summand1 + summand2, ExtendedBigDecimal::Infinity);
-//! ```
-use std::cmp::Ordering;
-use std::fmt::Display;
-use std::ops::Add;
-
-use bigdecimal::BigDecimal;
-use num_bigint::BigInt;
-use num_bigint::ToBigInt;
-use num_traits::One;
-use num_traits::Zero;
-
-use crate::extendedbigint::ExtendedBigInt;
-
-#[derive(Debug, Clone)]
-pub enum ExtendedBigDecimal {
-    /// Arbitrary precision floating point number.
-    BigDecimal(BigDecimal),
-
-    /// Floating point positive infinity.
-    ///
-    /// This is represented as its own enumeration member instead of as
-    /// a [`BigDecimal`] because the `bigdecimal` library does not
-    /// support infinity, see [here][0].
-    ///
-    /// [0]: https://github.com/akubera/bigdecimal-rs/issues/67
-    Infinity,
-
-    /// Floating point negative infinity.
-    ///
-    /// This is represented as its own enumeration member instead of as
-    /// a [`BigDecimal`] because the `bigdecimal` library does not
-    /// support infinity, see [here][0].
-    ///
-    /// [0]: https://github.com/akubera/bigdecimal-rs/issues/67
-    MinusInfinity,
-
-    /// Floating point negative zero.
-    ///
-    /// This is represented as its own enumeration member instead of as
-    /// a [`BigDecimal`] because the `bigdecimal` library does not
-    /// support negative zero.
-    MinusZero,
-
-    /// Floating point NaN.
-    ///
-    /// This is represented as its own enumeration member instead of as
-    /// a [`BigDecimal`] because the `bigdecimal` library does not
-    /// support NaN, see [here][0].
-    ///
-    /// [0]: https://github.com/akubera/bigdecimal-rs/issues/67
-    Nan,
-}
-
-/// The smallest integer greater than or equal to this number.
-fn ceil(x: BigDecimal) -> BigInt {
-    if x.is_integer() {
-        // Unwrapping the Option because it always returns Some
-        x.to_bigint().unwrap()
-    } else {
-        (x + BigDecimal::one().half()).round(0).to_bigint().unwrap()
-    }
-}
-
-/// The largest integer less than or equal to this number.
-fn floor(x: BigDecimal) -> BigInt {
-    if x.is_integer() {
-        // Unwrapping the Option because it always returns Some
-        x.to_bigint().unwrap()
-    } else {
-        (x - BigDecimal::one().half()).round(0).to_bigint().unwrap()
-    }
-}
-
-impl ExtendedBigDecimal {
-    /// The smallest integer greater than or equal to this number.
-    pub fn ceil(self) -> ExtendedBigInt {
-        match self {
-            Self::BigDecimal(x) => ExtendedBigInt::BigInt(ceil(x)),
-            other => From::from(other),
-        }
-    }
-
-    /// The largest integer less than or equal to this number.
-    pub fn floor(self) -> ExtendedBigInt {
-        match self {
-            Self::BigDecimal(x) => ExtendedBigInt::BigInt(floor(x)),
-            other => From::from(other),
-        }
-    }
-}
-
-impl From<ExtendedBigInt> for ExtendedBigDecimal {
-    fn from(big_int: ExtendedBigInt) -> Self {
-        match big_int {
-            ExtendedBigInt::BigInt(n) => Self::BigDecimal(BigDecimal::from(n)),
-            ExtendedBigInt::Infinity => Self::Infinity,
-            ExtendedBigInt::MinusInfinity => Self::MinusInfinity,
-            ExtendedBigInt::MinusZero => Self::MinusZero,
-            ExtendedBigInt::Nan => Self::Nan,
-        }
-    }
-}
-
-impl Display for ExtendedBigDecimal {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::BigDecimal(x) => {
-                let (n, p) = x.as_bigint_and_exponent();
-                match p {
-                    0 => Self::BigDecimal(BigDecimal::new(n * 10, 1)).fmt(f),
-                    _ => x.fmt(f),
-                }
-            }
-            Self::Infinity => f32::INFINITY.fmt(f),
-            Self::MinusInfinity => f32::NEG_INFINITY.fmt(f),
-            Self::MinusZero => (-0.0f32).fmt(f),
-            Self::Nan => "nan".fmt(f),
-        }
-    }
-}
-
-impl Zero for ExtendedBigDecimal {
-    fn zero() -> Self {
-        Self::BigDecimal(BigDecimal::zero())
-    }
-    fn is_zero(&self) -> bool {
-        match self {
-            Self::BigDecimal(n) => n.is_zero(),
-            Self::MinusZero => true,
-            _ => false,
-        }
-    }
-}
-
-impl Add for ExtendedBigDecimal {
-    type Output = Self;
-
-    fn add(self, other: Self) -> Self {
-        match (self, other) {
-            (Self::BigDecimal(m), Self::BigDecimal(n)) => Self::BigDecimal(m.add(n)),
-            (Self::BigDecimal(_), Self::MinusInfinity) => Self::MinusInfinity,
-            (Self::BigDecimal(_), Self::Infinity) => Self::Infinity,
-            (Self::BigDecimal(_), Self::Nan) => Self::Nan,
-            (Self::BigDecimal(m), Self::MinusZero) => Self::BigDecimal(m),
-            (Self::Infinity, Self::BigDecimal(_)) => Self::Infinity,
-            (Self::Infinity, Self::Infinity) => Self::Infinity,
-            (Self::Infinity, Self::MinusZero) => Self::Infinity,
-            (Self::Infinity, Self::MinusInfinity) => Self::Nan,
-            (Self::Infinity, Self::Nan) => Self::Nan,
-            (Self::MinusInfinity, Self::BigDecimal(_)) => Self::MinusInfinity,
-            (Self::MinusInfinity, Self::MinusInfinity) => Self::MinusInfinity,
-            (Self::MinusInfinity, Self::MinusZero) => Self::MinusInfinity,
-            (Self::MinusInfinity, Self::Infinity) => Self::Nan,
-            (Self::MinusInfinity, Self::Nan) => Self::Nan,
-            (Self::Nan, _) => Self::Nan,
-            (Self::MinusZero, other) => other,
-        }
-    }
-}
-
-impl PartialEq for ExtendedBigDecimal {
-    fn eq(&self, other: &Self) -> bool {
-        match (self, other) {
-            (Self::BigDecimal(m), Self::BigDecimal(n)) => m.eq(n),
-            (Self::BigDecimal(_), Self::MinusInfinity) => false,
-            (Self::BigDecimal(_), Self::Infinity) => false,
-            (Self::BigDecimal(_), Self::Nan) => false,
-            (Self::BigDecimal(_), Self::MinusZero) => false,
-            (Self::Infinity, Self::BigDecimal(_)) => false,
-            (Self::Infinity, Self::Infinity) => true,
-            (Self::Infinity, Self::MinusZero) => false,
-            (Self::Infinity, Self::MinusInfinity) => false,
-            (Self::Infinity, Self::Nan) => false,
-            (Self::MinusInfinity, Self::BigDecimal(_)) => false,
-            (Self::MinusInfinity, Self::Infinity) => false,
-            (Self::MinusInfinity, Self::MinusZero) => false,
-            (Self::MinusInfinity, Self::MinusInfinity) => true,
-            (Self::MinusInfinity, Self::Nan) => false,
-            (Self::Nan, _) => false,
-            (Self::MinusZero, Self::BigDecimal(_)) => false,
-            (Self::MinusZero, Self::Infinity) => false,
-            (Self::MinusZero, Self::MinusZero) => true,
-            (Self::MinusZero, Self::MinusInfinity) => false,
-            (Self::MinusZero, Self::Nan) => false,
-        }
-    }
-}
-
-impl PartialOrd for ExtendedBigDecimal {
-    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-        match (self, other) {
-            (Self::BigDecimal(m), Self::BigDecimal(n)) => m.partial_cmp(n),
-            (Self::BigDecimal(_), Self::MinusInfinity) => Some(Ordering::Greater),
-            (Self::BigDecimal(_), Self::Infinity) => Some(Ordering::Less),
-            (Self::BigDecimal(_), Self::Nan) => None,
-            (Self::BigDecimal(m), Self::MinusZero) => m.partial_cmp(&BigDecimal::zero()),
-            (Self::Infinity, Self::BigDecimal(_)) => Some(Ordering::Greater),
-            (Self::Infinity, Self::Infinity) => Some(Ordering::Equal),
-            (Self::Infinity, Self::MinusZero) => Some(Ordering::Greater),
-            (Self::Infinity, Self::MinusInfinity) => Some(Ordering::Greater),
-            (Self::Infinity, Self::Nan) => None,
-            (Self::MinusInfinity, Self::BigDecimal(_)) => Some(Ordering::Less),
-            (Self::MinusInfinity, Self::Infinity) => Some(Ordering::Less),
-            (Self::MinusInfinity, Self::MinusZero) => Some(Ordering::Less),
-            (Self::MinusInfinity, Self::MinusInfinity) => Some(Ordering::Equal),
-            (Self::MinusInfinity, Self::Nan) => None,
-            (Self::Nan, _) => None,
-            (Self::MinusZero, Self::BigDecimal(n)) => BigDecimal::zero().partial_cmp(n),
-            (Self::MinusZero, Self::Infinity) => Some(Ordering::Less),
-            (Self::MinusZero, Self::MinusZero) => Some(Ordering::Equal),
-            (Self::MinusZero, Self::MinusInfinity) => Some(Ordering::Greater),
-            (Self::MinusZero, Self::Nan) => None,
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use bigdecimal::BigDecimal;
-    use num_traits::Zero;
-
-    use crate::extendedbigdecimal::ExtendedBigDecimal;
-
-    #[test]
-    fn test_addition_infinity() {
-        let summand1 = ExtendedBigDecimal::BigDecimal(BigDecimal::zero());
-        let summand2 = ExtendedBigDecimal::Infinity;
-        assert_eq!(summand1 + summand2, ExtendedBigDecimal::Infinity);
-    }
-
-    #[test]
-    fn test_addition_minus_infinity() {
-        let summand1 = ExtendedBigDecimal::BigDecimal(BigDecimal::zero());
-        let summand2 = ExtendedBigDecimal::MinusInfinity;
-        assert_eq!(summand1 + summand2, ExtendedBigDecimal::MinusInfinity);
-    }
-
-    #[test]
-    fn test_addition_nan() {
-        let summand1 = ExtendedBigDecimal::BigDecimal(BigDecimal::zero());
-        let summand2 = ExtendedBigDecimal::Nan;
-        let sum = summand1 + summand2;
-        match sum {
-            ExtendedBigDecimal::Nan => (),
-            _ => unreachable!(),
-        }
-    }
-
-    #[test]
-    fn test_display() {
-        assert_eq!(
-            format!("{}", ExtendedBigDecimal::BigDecimal(BigDecimal::zero())),
-            "0.0"
-        );
-        assert_eq!(format!("{}", ExtendedBigDecimal::Infinity), "inf");
-        assert_eq!(format!("{}", ExtendedBigDecimal::MinusInfinity), "-inf");
-        assert_eq!(format!("{}", ExtendedBigDecimal::Nan), "nan");
-        assert_eq!(format!("{}", ExtendedBigDecimal::MinusZero), "-0");
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_seq/extendedbigint.rs.html b/coreutils/dev/src/uu_seq/extendedbigint.rs.html deleted file mode 100644 index 8d89f0c72..000000000 --- a/coreutils/dev/src/uu_seq/extendedbigint.rs.html +++ /dev/null @@ -1,421 +0,0 @@ -extendedbigint.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-
// spell-checker:ignore bigint extendedbigint extendedbigdecimal
-//! An arbitrary precision integer that can also represent infinity, NaN, etc.
-//!
-//! Usually infinity, NaN, and negative zero are only represented for
-//! floating point numbers. The [`ExtendedBigInt`] enumeration provides
-//! a representation of those things with the set of integers. The
-//! finite values are stored as [`BigInt`] instances.
-//!
-//! # Examples
-//!
-//! Addition works for [`ExtendedBigInt`] as it does for floats. For
-//! example, adding infinity to any finite value results in infinity:
-//!
-//! ```rust,ignore
-//! let summand1 = ExtendedBigInt::BigInt(BigInt::zero());
-//! let summand2 = ExtendedBigInt::Infinity;
-//! assert_eq!(summand1 + summand2, ExtendedBigInt::Infinity);
-//! ```
-use std::cmp::Ordering;
-use std::fmt::Display;
-use std::ops::Add;
-
-use num_bigint::BigInt;
-use num_bigint::ToBigInt;
-use num_traits::One;
-use num_traits::Zero;
-
-use crate::extendedbigdecimal::ExtendedBigDecimal;
-
-#[derive(Debug, Clone)]
-pub enum ExtendedBigInt {
-    BigInt(BigInt),
-    Infinity,
-    MinusInfinity,
-    MinusZero,
-    Nan,
-}
-
-impl ExtendedBigInt {
-    /// The integer number one.
-    pub fn one() -> Self {
-        // We would like to implement `num_traits::One`, but it requires
-        // a multiplication implementation, and we don't want to
-        // implement that here.
-        Self::BigInt(BigInt::one())
-    }
-}
-
-impl From<ExtendedBigDecimal> for ExtendedBigInt {
-    fn from(big_decimal: ExtendedBigDecimal) -> Self {
-        match big_decimal {
-            // TODO When can this fail?
-            ExtendedBigDecimal::BigDecimal(x) => Self::BigInt(x.to_bigint().unwrap()),
-            ExtendedBigDecimal::Infinity => Self::Infinity,
-            ExtendedBigDecimal::MinusInfinity => Self::MinusInfinity,
-            ExtendedBigDecimal::MinusZero => Self::MinusZero,
-            ExtendedBigDecimal::Nan => Self::Nan,
-        }
-    }
-}
-
-impl Display for ExtendedBigInt {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::BigInt(n) => n.fmt(f),
-            Self::Infinity => f32::INFINITY.fmt(f),
-            Self::MinusInfinity => f32::NEG_INFINITY.fmt(f),
-            Self::MinusZero => "-0".fmt(f),
-            Self::Nan => "nan".fmt(f),
-        }
-    }
-}
-
-impl Zero for ExtendedBigInt {
-    fn zero() -> Self {
-        Self::BigInt(BigInt::zero())
-    }
-    fn is_zero(&self) -> bool {
-        match self {
-            Self::BigInt(n) => n.is_zero(),
-            Self::MinusZero => true,
-            _ => false,
-        }
-    }
-}
-
-impl Add for ExtendedBigInt {
-    type Output = Self;
-
-    fn add(self, other: Self) -> Self {
-        match (self, other) {
-            (Self::BigInt(m), Self::BigInt(n)) => Self::BigInt(m.add(n)),
-            (Self::BigInt(_), Self::MinusInfinity) => Self::MinusInfinity,
-            (Self::BigInt(_), Self::Infinity) => Self::Infinity,
-            (Self::BigInt(_), Self::Nan) => Self::Nan,
-            (Self::BigInt(m), Self::MinusZero) => Self::BigInt(m),
-            (Self::Infinity, Self::BigInt(_)) => Self::Infinity,
-            (Self::Infinity, Self::Infinity) => Self::Infinity,
-            (Self::Infinity, Self::MinusZero) => Self::Infinity,
-            (Self::Infinity, Self::MinusInfinity) => Self::Nan,
-            (Self::Infinity, Self::Nan) => Self::Nan,
-            (Self::MinusInfinity, Self::BigInt(_)) => Self::MinusInfinity,
-            (Self::MinusInfinity, Self::MinusInfinity) => Self::MinusInfinity,
-            (Self::MinusInfinity, Self::MinusZero) => Self::MinusInfinity,
-            (Self::MinusInfinity, Self::Infinity) => Self::Nan,
-            (Self::MinusInfinity, Self::Nan) => Self::Nan,
-            (Self::Nan, _) => Self::Nan,
-            (Self::MinusZero, other) => other,
-        }
-    }
-}
-
-impl PartialEq for ExtendedBigInt {
-    fn eq(&self, other: &Self) -> bool {
-        match (self, other) {
-            (Self::BigInt(m), Self::BigInt(n)) => m.eq(n),
-            (Self::BigInt(_), Self::MinusInfinity) => false,
-            (Self::BigInt(_), Self::Infinity) => false,
-            (Self::BigInt(_), Self::Nan) => false,
-            (Self::BigInt(_), Self::MinusZero) => false,
-            (Self::Infinity, Self::BigInt(_)) => false,
-            (Self::Infinity, Self::Infinity) => true,
-            (Self::Infinity, Self::MinusZero) => false,
-            (Self::Infinity, Self::MinusInfinity) => false,
-            (Self::Infinity, Self::Nan) => false,
-            (Self::MinusInfinity, Self::BigInt(_)) => false,
-            (Self::MinusInfinity, Self::Infinity) => false,
-            (Self::MinusInfinity, Self::MinusZero) => false,
-            (Self::MinusInfinity, Self::MinusInfinity) => true,
-            (Self::MinusInfinity, Self::Nan) => false,
-            (Self::Nan, _) => false,
-            (Self::MinusZero, Self::BigInt(_)) => false,
-            (Self::MinusZero, Self::Infinity) => false,
-            (Self::MinusZero, Self::MinusZero) => true,
-            (Self::MinusZero, Self::MinusInfinity) => false,
-            (Self::MinusZero, Self::Nan) => false,
-        }
-    }
-}
-
-impl PartialOrd for ExtendedBigInt {
-    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-        match (self, other) {
-            (Self::BigInt(m), Self::BigInt(n)) => m.partial_cmp(n),
-            (Self::BigInt(_), Self::MinusInfinity) => Some(Ordering::Greater),
-            (Self::BigInt(_), Self::Infinity) => Some(Ordering::Less),
-            (Self::BigInt(_), Self::Nan) => None,
-            (Self::BigInt(m), Self::MinusZero) => m.partial_cmp(&BigInt::zero()),
-            (Self::Infinity, Self::BigInt(_)) => Some(Ordering::Greater),
-            (Self::Infinity, Self::Infinity) => Some(Ordering::Equal),
-            (Self::Infinity, Self::MinusZero) => Some(Ordering::Greater),
-            (Self::Infinity, Self::MinusInfinity) => Some(Ordering::Greater),
-            (Self::Infinity, Self::Nan) => None,
-            (Self::MinusInfinity, Self::BigInt(_)) => Some(Ordering::Less),
-            (Self::MinusInfinity, Self::Infinity) => Some(Ordering::Less),
-            (Self::MinusInfinity, Self::MinusZero) => Some(Ordering::Less),
-            (Self::MinusInfinity, Self::MinusInfinity) => Some(Ordering::Equal),
-            (Self::MinusInfinity, Self::Nan) => None,
-            (Self::Nan, _) => None,
-            (Self::MinusZero, Self::BigInt(n)) => BigInt::zero().partial_cmp(n),
-            (Self::MinusZero, Self::Infinity) => Some(Ordering::Less),
-            (Self::MinusZero, Self::MinusZero) => Some(Ordering::Equal),
-            (Self::MinusZero, Self::MinusInfinity) => Some(Ordering::Greater),
-            (Self::MinusZero, Self::Nan) => None,
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use num_bigint::BigInt;
-    use num_traits::Zero;
-
-    use crate::extendedbigint::ExtendedBigInt;
-
-    #[test]
-    fn test_addition_infinity() {
-        let summand1 = ExtendedBigInt::BigInt(BigInt::zero());
-        let summand2 = ExtendedBigInt::Infinity;
-        assert_eq!(summand1 + summand2, ExtendedBigInt::Infinity);
-    }
-
-    #[test]
-    fn test_addition_minus_infinity() {
-        let summand1 = ExtendedBigInt::BigInt(BigInt::zero());
-        let summand2 = ExtendedBigInt::MinusInfinity;
-        assert_eq!(summand1 + summand2, ExtendedBigInt::MinusInfinity);
-    }
-
-    #[test]
-    fn test_addition_nan() {
-        let summand1 = ExtendedBigInt::BigInt(BigInt::zero());
-        let summand2 = ExtendedBigInt::Nan;
-        let sum = summand1 + summand2;
-        match sum {
-            ExtendedBigInt::Nan => (),
-            _ => unreachable!(),
-        }
-    }
-
-    #[test]
-    fn test_display() {
-        assert_eq!(format!("{}", ExtendedBigInt::BigInt(BigInt::zero())), "0");
-        assert_eq!(format!("{}", ExtendedBigInt::MinusZero), "-0");
-        assert_eq!(format!("{}", ExtendedBigInt::Infinity), "inf");
-        assert_eq!(format!("{}", ExtendedBigInt::MinusInfinity), "-inf");
-        assert_eq!(format!("{}", ExtendedBigInt::Nan), "nan");
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_seq/number.rs.html b/coreutils/dev/src/uu_seq/number.rs.html deleted file mode 100644 index 3beeb4ea9..000000000 --- a/coreutils/dev/src/uu_seq/number.rs.html +++ /dev/null @@ -1,231 +0,0 @@ -number.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-
// spell-checker:ignore extendedbigdecimal extendedbigint
-//! A type to represent the possible start, increment, and end values for seq.
-//!
-//! The [`Number`] enumeration represents the possible values for the
-//! start, increment, and end values for `seq`. These may be integers,
-//! floating point numbers, negative zero, etc. A [`Number`] can be
-//! parsed from a string by calling [`str::parse`].
-use num_traits::Zero;
-
-use crate::extendedbigdecimal::ExtendedBigDecimal;
-use crate::extendedbigint::ExtendedBigInt;
-
-/// An integral or floating point number.
-#[derive(Debug, PartialEq)]
-pub enum Number {
-    Int(ExtendedBigInt),
-    Float(ExtendedBigDecimal),
-}
-
-impl Number {
-    /// Decide whether this number is zero (either positive or negative).
-    pub fn is_zero(&self) -> bool {
-        // We would like to implement `num_traits::Zero`, but it
-        // requires an addition implementation, and we don't want to
-        // implement that here.
-        match self {
-            Self::Int(n) => n.is_zero(),
-            Self::Float(x) => x.is_zero(),
-        }
-    }
-
-    /// Convert this number into an `ExtendedBigDecimal`.
-    pub fn into_extended_big_decimal(self) -> ExtendedBigDecimal {
-        match self {
-            Self::Int(n) => ExtendedBigDecimal::from(n),
-            Self::Float(x) => x,
-        }
-    }
-
-    /// The integer number one.
-    pub fn one() -> Self {
-        // We would like to implement `num_traits::One`, but it requires
-        // a multiplication implementation, and we don't want to
-        // implement that here.
-        Self::Int(ExtendedBigInt::one())
-    }
-
-    /// Round this number towards the given other number.
-    ///
-    /// If `other` is greater, then round up. If `other` is smaller,
-    /// then round down.
-    pub fn round_towards(self, other: &ExtendedBigInt) -> ExtendedBigInt {
-        match self {
-            // If this number is already an integer, it is already
-            // rounded to the nearest integer in the direction of
-            // `other`.
-            Self::Int(num) => num,
-            // Otherwise, if this number is a float, we need to decide
-            // whether `other` is larger or smaller than it, and thus
-            // whether to round up or round down, respectively.
-            Self::Float(num) => {
-                let other: ExtendedBigDecimal = From::from(other.clone());
-                if other > num {
-                    num.ceil()
-                } else {
-                    // If they are equal, then `self` is already an
-                    // integer, so calling `floor()` does no harm and
-                    // will just return that integer anyway.
-                    num.floor()
-                }
-            }
-        }
-    }
-}
-
-/// A number with a specified number of integer and fractional digits.
-///
-/// This struct can be used to represent a number along with information
-/// on how many significant digits to use when displaying the number.
-/// The [`PreciseNumber::num_integral_digits`] field also includes the width needed to
-/// display the "-" character for a negative number.
-///
-/// You can get an instance of this struct by calling [`str::parse`].
-#[derive(Debug)]
-pub struct PreciseNumber {
-    pub number: Number,
-    pub num_integral_digits: usize,
-    pub num_fractional_digits: usize,
-}
-
-impl PreciseNumber {
-    pub fn new(number: Number, num_integral_digits: usize, num_fractional_digits: usize) -> Self {
-        Self {
-            number,
-            num_integral_digits,
-            num_fractional_digits,
-        }
-    }
-
-    /// The integer number one.
-    pub fn one() -> Self {
-        // We would like to implement `num_traits::One`, but it requires
-        // a multiplication implementation, and we don't want to
-        // implement that here.
-        Self::new(Number::one(), 1, 0)
-    }
-
-    /// Decide whether this number is zero (either positive or negative).
-    pub fn is_zero(&self) -> bool {
-        // We would like to implement `num_traits::Zero`, but it
-        // requires an addition implementation, and we don't want to
-        // implement that here.
-        self.number.is_zero()
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_seq/numberparse.rs.html b/coreutils/dev/src/uu_seq/numberparse.rs.html deleted file mode 100644 index ee3d58cf1..000000000 --- a/coreutils/dev/src/uu_seq/numberparse.rs.html +++ /dev/null @@ -1,1235 +0,0 @@ -numberparse.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-
// spell-checker:ignore extendedbigdecimal extendedbigint bigdecimal numberparse
-//! Parsing numbers for use in `seq`.
-//!
-//! This module provides an implementation of [`FromStr`] for the
-//! [`PreciseNumber`] struct.
-use std::str::FromStr;
-
-use bigdecimal::BigDecimal;
-use num_bigint::BigInt;
-use num_bigint::Sign;
-use num_traits::Num;
-use num_traits::Zero;
-
-use crate::extendedbigdecimal::ExtendedBigDecimal;
-use crate::extendedbigint::ExtendedBigInt;
-use crate::number::Number;
-use crate::number::PreciseNumber;
-
-/// An error returned when parsing a number fails.
-#[derive(Debug, PartialEq, Eq)]
-pub enum ParseNumberError {
-    Float,
-    Nan,
-    Hex,
-}
-
-/// Decide whether a given string and its parsed `BigInt` is negative zero.
-fn is_minus_zero_int(s: &str, n: &BigInt) -> bool {
-    s.starts_with('-') && n == &BigInt::zero()
-}
-
-/// Decide whether a given string and its parsed `BigDecimal` is negative zero.
-fn is_minus_zero_float(s: &str, x: &BigDecimal) -> bool {
-    s.starts_with('-') && x == &BigDecimal::zero()
-}
-
-/// Parse a number with neither a decimal point nor an exponent.
-///
-/// # Errors
-///
-/// This function returns an error if the input string is a variant of
-/// "NaN" or if no [`BigInt`] could be parsed from the string.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// let actual = "0".parse::<Number>().unwrap().number;
-/// let expected = Number::BigInt(BigInt::zero());
-/// assert_eq!(actual, expected);
-/// ```
-fn parse_no_decimal_no_exponent(s: &str) -> Result<PreciseNumber, ParseNumberError> {
-    match s.parse::<BigInt>() {
-        Ok(n) => {
-            // If `s` is '-0', then `parse()` returns `BigInt::zero()`,
-            // but we need to return `Number::MinusZeroInt` instead.
-            if is_minus_zero_int(s, &n) {
-                Ok(PreciseNumber::new(
-                    Number::Int(ExtendedBigInt::MinusZero),
-                    s.len(),
-                    0,
-                ))
-            } else {
-                Ok(PreciseNumber::new(
-                    Number::Int(ExtendedBigInt::BigInt(n)),
-                    s.len(),
-                    0,
-                ))
-            }
-        }
-        Err(_) => {
-            // Possibly "NaN" or "inf".
-            //
-            // TODO In Rust v1.53.0, this change
-            // https://github.com/rust-lang/rust/pull/78618 improves the
-            // parsing of floats to include being able to parse "NaN"
-            // and "inf". So when the minimum version of this crate is
-            // increased to 1.53.0, we should just use the built-in
-            // `f32` parsing instead.
-            if s.eq_ignore_ascii_case("inf") {
-                Ok(PreciseNumber::new(
-                    Number::Float(ExtendedBigDecimal::Infinity),
-                    0,
-                    0,
-                ))
-            } else if s.eq_ignore_ascii_case("-inf") {
-                Ok(PreciseNumber::new(
-                    Number::Float(ExtendedBigDecimal::MinusInfinity),
-                    0,
-                    0,
-                ))
-            } else if s.eq_ignore_ascii_case("nan") || s.eq_ignore_ascii_case("-nan") {
-                Err(ParseNumberError::Nan)
-            } else {
-                Err(ParseNumberError::Float)
-            }
-        }
-    }
-}
-
-/// Parse a number with an exponent but no decimal point.
-///
-/// # Errors
-///
-/// This function returns an error if `s` is not a valid number.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// let actual = "1e2".parse::<Number>().unwrap().number;
-/// let expected = "100".parse::<BigInt>().unwrap();
-/// assert_eq!(actual, expected);
-/// ```
-fn parse_exponent_no_decimal(s: &str, j: usize) -> Result<PreciseNumber, ParseNumberError> {
-    let exponent: i64 = s[j + 1..].parse().map_err(|_| ParseNumberError::Float)?;
-    // If the exponent is strictly less than zero, then the number
-    // should be treated as a floating point number that will be
-    // displayed in decimal notation. For example, "1e-2" will be
-    // displayed as "0.01", but "1e2" will be displayed as "100",
-    // without a decimal point.
-    let x: BigDecimal = s.parse().map_err(|_| ParseNumberError::Float)?;
-    let num_integral_digits = if is_minus_zero_float(s, &x) {
-        2
-    } else {
-        let total = j as i64 + exponent;
-        let result = if total < 1 {
-            1
-        } else {
-            total.try_into().unwrap()
-        };
-        if x.sign() == Sign::Minus {
-            result + 1
-        } else {
-            result
-        }
-    };
-    let num_fractional_digits = if exponent < 0 { -exponent as usize } else { 0 };
-
-    if exponent < 0 {
-        if is_minus_zero_float(s, &x) {
-            Ok(PreciseNumber::new(
-                Number::Float(ExtendedBigDecimal::MinusZero),
-                num_integral_digits,
-                num_fractional_digits,
-            ))
-        } else {
-            Ok(PreciseNumber::new(
-                Number::Float(ExtendedBigDecimal::BigDecimal(x)),
-                num_integral_digits,
-                num_fractional_digits,
-            ))
-        }
-    } else {
-        let zeros = "0".repeat(exponent.try_into().unwrap());
-        let expanded = [&s[0..j], &zeros].concat();
-        parse_no_decimal_no_exponent(&expanded)
-    }
-}
-
-/// Parse a number with a decimal point but no exponent.
-///
-/// # Errors
-///
-/// This function returns an error if `s` is not a valid number.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// let actual = "1.2".parse::<Number>().unwrap().number;
-/// let expected = "1.2".parse::<BigDecimal>().unwrap();
-/// assert_eq!(actual, expected);
-/// ```
-fn parse_decimal_no_exponent(s: &str, i: usize) -> Result<PreciseNumber, ParseNumberError> {
-    let x: BigDecimal = s.parse().map_err(|_| ParseNumberError::Float)?;
-
-    // The number of integral digits is the number of chars until the period.
-    //
-    // This includes the negative sign if there is one. Also, it is
-    // possible that a number is expressed as "-.123" instead of
-    // "-0.123", but when we display the number we want it to include
-    // the leading 0.
-    let num_integral_digits = if s.starts_with("-.") { i + 1 } else { i };
-    let num_fractional_digits = s.len() - (i + 1);
-    if is_minus_zero_float(s, &x) {
-        Ok(PreciseNumber::new(
-            Number::Float(ExtendedBigDecimal::MinusZero),
-            num_integral_digits,
-            num_fractional_digits,
-        ))
-    } else {
-        Ok(PreciseNumber::new(
-            Number::Float(ExtendedBigDecimal::BigDecimal(x)),
-            num_integral_digits,
-            num_fractional_digits,
-        ))
-    }
-}
-
-/// Parse a number with both a decimal point and an exponent.
-///
-/// # Errors
-///
-/// This function returns an error if `s` is not a valid number.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// let actual = "1.2e3".parse::<Number>().unwrap().number;
-/// let expected = "1200".parse::<BigInt>().unwrap();
-/// assert_eq!(actual, expected);
-/// ```
-fn parse_decimal_and_exponent(
-    s: &str,
-    i: usize,
-    j: usize,
-) -> Result<PreciseNumber, ParseNumberError> {
-    // Because of the match guard, this subtraction will not underflow.
-    let num_digits_between_decimal_point_and_e = (j - (i + 1)) as i64;
-    let exponent: i64 = s[j + 1..].parse().map_err(|_| ParseNumberError::Float)?;
-    let val: BigDecimal = s.parse().map_err(|_| ParseNumberError::Float)?;
-
-    let num_integral_digits = {
-        let minimum: usize = {
-            let integral_part: f64 = s[..j].parse().map_err(|_| ParseNumberError::Float)?;
-            if integral_part.is_sign_negative() {
-                2
-            } else {
-                1
-            }
-        };
-        // Special case: if the string is "-.1e2", we need to treat it
-        // as if it were "-0.1e2".
-        let total = if s.starts_with("-.") {
-            i as i64 + exponent + 1
-        } else {
-            i as i64 + exponent
-        };
-        if total < minimum as i64 {
-            minimum
-        } else {
-            total.try_into().unwrap()
-        }
-    };
-
-    let num_fractional_digits = if num_digits_between_decimal_point_and_e < exponent {
-        0
-    } else {
-        (num_digits_between_decimal_point_and_e - exponent)
-            .try_into()
-            .unwrap()
-    };
-
-    if num_digits_between_decimal_point_and_e <= exponent {
-        if is_minus_zero_float(s, &val) {
-            Ok(PreciseNumber::new(
-                Number::Int(ExtendedBigInt::MinusZero),
-                num_integral_digits,
-                num_fractional_digits,
-            ))
-        } else {
-            let zeros: String = "0".repeat(
-                (exponent - num_digits_between_decimal_point_and_e)
-                    .try_into()
-                    .unwrap(),
-            );
-            let expanded = [&s[0..i], &s[i + 1..j], &zeros].concat();
-            let n = expanded
-                .parse::<BigInt>()
-                .map_err(|_| ParseNumberError::Float)?;
-            Ok(PreciseNumber::new(
-                Number::Int(ExtendedBigInt::BigInt(n)),
-                num_integral_digits,
-                num_fractional_digits,
-            ))
-        }
-    } else if is_minus_zero_float(s, &val) {
-        Ok(PreciseNumber::new(
-            Number::Float(ExtendedBigDecimal::MinusZero),
-            num_integral_digits,
-            num_fractional_digits,
-        ))
-    } else {
-        Ok(PreciseNumber::new(
-            Number::Float(ExtendedBigDecimal::BigDecimal(val)),
-            num_integral_digits,
-            num_fractional_digits,
-        ))
-    }
-}
-
-/// Parse a hexadecimal integer from a string.
-///
-/// # Errors
-///
-/// This function returns an error if no [`BigInt`] could be parsed from
-/// the string.
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// let actual = "0x0".parse::<Number>().unwrap().number;
-/// let expected = Number::BigInt(BigInt::zero());
-/// assert_eq!(actual, expected);
-/// ```
-fn parse_hexadecimal(s: &str) -> Result<PreciseNumber, ParseNumberError> {
-    let (is_neg, s) = if s.starts_with('-') {
-        (true, &s[3..])
-    } else {
-        (false, &s[2..])
-    };
-
-    if s.starts_with('-') || s.starts_with('+') {
-        // Even though this is more like an invalid hexadecimal number,
-        // GNU reports this as an invalid floating point number, so we
-        // use `ParseNumberError::Float` to match that behavior.
-        return Err(ParseNumberError::Float);
-    }
-
-    let num = BigInt::from_str_radix(s, 16).map_err(|_| ParseNumberError::Hex)?;
-
-    match (is_neg, num == BigInt::zero()) {
-        (true, true) => Ok(PreciseNumber::new(
-            Number::Int(ExtendedBigInt::MinusZero),
-            2,
-            0,
-        )),
-        (true, false) => Ok(PreciseNumber::new(
-            Number::Int(ExtendedBigInt::BigInt(-num)),
-            0,
-            0,
-        )),
-        (false, _) => Ok(PreciseNumber::new(
-            Number::Int(ExtendedBigInt::BigInt(num)),
-            0,
-            0,
-        )),
-    }
-}
-
-impl FromStr for PreciseNumber {
-    type Err = ParseNumberError;
-    fn from_str(mut s: &str) -> Result<Self, Self::Err> {
-        // Trim leading whitespace.
-        s = s.trim_start();
-
-        // Trim a single leading "+" character.
-        if s.starts_with('+') {
-            s = &s[1..];
-        }
-
-        // Check if the string seems to be in hexadecimal format.
-        //
-        // May be 0x123 or -0x123, so the index `i` may be either 0 or 1.
-        if let Some(i) = s.to_lowercase().find("0x") {
-            if i <= 1 {
-                return parse_hexadecimal(s);
-            }
-        }
-
-        // Find the decimal point and the exponent symbol. Parse the
-        // number differently depending on its form. This is important
-        // because the form of the input dictates how the output will be
-        // presented.
-        match (s.find('.'), s.find('e')) {
-            // For example, "123456" or "inf".
-            (None, None) => parse_no_decimal_no_exponent(s),
-            // For example, "123e456" or "1e-2".
-            (None, Some(j)) => parse_exponent_no_decimal(s, j),
-            // For example, "123.456".
-            (Some(i), None) => parse_decimal_no_exponent(s, i),
-            // For example, "123.456e789".
-            (Some(i), Some(j)) if i < j => parse_decimal_and_exponent(s, i, j),
-            // For example, "1e2.3" or "1.2.3".
-            _ => Err(ParseNumberError::Float),
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use bigdecimal::BigDecimal;
-    use num_bigint::BigInt;
-    use num_traits::Zero;
-
-    use crate::extendedbigdecimal::ExtendedBigDecimal;
-    use crate::extendedbigint::ExtendedBigInt;
-    use crate::number::Number;
-    use crate::number::PreciseNumber;
-    use crate::numberparse::ParseNumberError;
-
-    /// Convenience function for parsing a [`Number`] and unwrapping.
-    fn parse(s: &str) -> Number {
-        s.parse::<PreciseNumber>().unwrap().number
-    }
-
-    /// Convenience function for getting the number of integral digits.
-    fn num_integral_digits(s: &str) -> usize {
-        s.parse::<PreciseNumber>().unwrap().num_integral_digits
-    }
-
-    /// Convenience function for getting the number of fractional digits.
-    fn num_fractional_digits(s: &str) -> usize {
-        s.parse::<PreciseNumber>().unwrap().num_fractional_digits
-    }
-
-    #[test]
-    fn test_parse_minus_zero_int() {
-        assert_eq!(parse("-0e0"), Number::Int(ExtendedBigInt::MinusZero));
-        assert_eq!(parse("-0e-0"), Number::Int(ExtendedBigInt::MinusZero));
-        assert_eq!(parse("-0e1"), Number::Int(ExtendedBigInt::MinusZero));
-        assert_eq!(parse("-0e+1"), Number::Int(ExtendedBigInt::MinusZero));
-        assert_eq!(parse("-0.0e1"), Number::Int(ExtendedBigInt::MinusZero));
-        assert_eq!(parse("-0x0"), Number::Int(ExtendedBigInt::MinusZero));
-    }
-
-    #[test]
-    fn test_parse_minus_zero_float() {
-        assert_eq!(parse("-0.0"), Number::Float(ExtendedBigDecimal::MinusZero));
-        assert_eq!(parse("-0e-1"), Number::Float(ExtendedBigDecimal::MinusZero));
-        assert_eq!(
-            parse("-0.0e-1"),
-            Number::Float(ExtendedBigDecimal::MinusZero)
-        );
-    }
-
-    #[test]
-    fn test_parse_big_int() {
-        assert_eq!(parse("0"), Number::Int(ExtendedBigInt::zero()));
-        assert_eq!(parse("0.1e1"), Number::Int(ExtendedBigInt::one()));
-        assert_eq!(
-            parse("1.0e1"),
-            Number::Int(ExtendedBigInt::BigInt("10".parse::<BigInt>().unwrap()))
-        );
-    }
-
-    #[test]
-    fn test_parse_hexadecimal_big_int() {
-        assert_eq!(parse("0x0"), Number::Int(ExtendedBigInt::zero()));
-        assert_eq!(
-            parse("0x10"),
-            Number::Int(ExtendedBigInt::BigInt("16".parse::<BigInt>().unwrap()))
-        );
-    }
-
-    #[test]
-    fn test_parse_big_decimal() {
-        assert_eq!(
-            parse("0.0"),
-            Number::Float(ExtendedBigDecimal::BigDecimal(
-                "0.0".parse::<BigDecimal>().unwrap()
-            ))
-        );
-        assert_eq!(
-            parse(".0"),
-            Number::Float(ExtendedBigDecimal::BigDecimal(
-                "0.0".parse::<BigDecimal>().unwrap()
-            ))
-        );
-        assert_eq!(
-            parse("1.0"),
-            Number::Float(ExtendedBigDecimal::BigDecimal(
-                "1.0".parse::<BigDecimal>().unwrap()
-            ))
-        );
-        assert_eq!(
-            parse("10e-1"),
-            Number::Float(ExtendedBigDecimal::BigDecimal(
-                "1.0".parse::<BigDecimal>().unwrap()
-            ))
-        );
-        assert_eq!(
-            parse("-1e-3"),
-            Number::Float(ExtendedBigDecimal::BigDecimal(
-                "-0.001".parse::<BigDecimal>().unwrap()
-            ))
-        );
-    }
-
-    #[test]
-    fn test_parse_inf() {
-        assert_eq!(parse("inf"), Number::Float(ExtendedBigDecimal::Infinity));
-        assert_eq!(parse("+inf"), Number::Float(ExtendedBigDecimal::Infinity));
-        assert_eq!(
-            parse("-inf"),
-            Number::Float(ExtendedBigDecimal::MinusInfinity)
-        );
-    }
-
-    #[test]
-    fn test_parse_invalid_float() {
-        assert_eq!(
-            "1.2.3".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Float
-        );
-        assert_eq!(
-            "1e2e3".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Float
-        );
-        assert_eq!(
-            "1e2.3".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Float
-        );
-        assert_eq!(
-            "-+-1".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Float
-        );
-    }
-
-    #[test]
-    fn test_parse_invalid_hex() {
-        assert_eq!(
-            "0xg".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Hex
-        );
-    }
-
-    #[test]
-    fn test_parse_invalid_nan() {
-        assert_eq!(
-            "nan".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Nan
-        );
-        assert_eq!(
-            "NAN".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Nan
-        );
-        assert_eq!(
-            "NaN".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Nan
-        );
-        assert_eq!(
-            "nAn".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Nan
-        );
-        assert_eq!(
-            "-nan".parse::<PreciseNumber>().unwrap_err(),
-            ParseNumberError::Nan
-        );
-    }
-
-    #[test]
-    fn test_num_integral_digits() {
-        // no decimal, no exponent
-        assert_eq!(num_integral_digits("123"), 3);
-        // decimal, no exponent
-        assert_eq!(num_integral_digits("123.45"), 3);
-        assert_eq!(num_integral_digits("-0.1"), 2);
-        assert_eq!(num_integral_digits("-.1"), 2);
-        // exponent, no decimal
-        assert_eq!(num_integral_digits("123e4"), 3 + 4);
-        assert_eq!(num_integral_digits("123e-4"), 1);
-        assert_eq!(num_integral_digits("-1e-3"), 2);
-        // decimal and exponent
-        assert_eq!(num_integral_digits("123.45e6"), 3 + 6);
-        assert_eq!(num_integral_digits("123.45e-6"), 1);
-        assert_eq!(num_integral_digits("123.45e-1"), 2);
-        assert_eq!(num_integral_digits("-0.1e0"), 2);
-        assert_eq!(num_integral_digits("-0.1e2"), 4);
-        assert_eq!(num_integral_digits("-.1e0"), 2);
-        assert_eq!(num_integral_digits("-.1e2"), 4);
-        assert_eq!(num_integral_digits("-1.e-3"), 2);
-        assert_eq!(num_integral_digits("-1.0e-4"), 2);
-        // minus zero int
-        assert_eq!(num_integral_digits("-0e0"), 2);
-        assert_eq!(num_integral_digits("-0e-0"), 2);
-        assert_eq!(num_integral_digits("-0e1"), 3);
-        assert_eq!(num_integral_digits("-0e+1"), 3);
-        assert_eq!(num_integral_digits("-0.0e1"), 3);
-        // minus zero float
-        assert_eq!(num_integral_digits("-0.0"), 2);
-        assert_eq!(num_integral_digits("-0e-1"), 2);
-        assert_eq!(num_integral_digits("-0.0e-1"), 2);
-
-        // TODO In GNU `seq`, the `-w` option does not seem to work with
-        // hexadecimal arguments. In order to match that behavior, we
-        // report the number of integral digits as zero for hexadecimal
-        // inputs.
-        assert_eq!(num_integral_digits("0xff"), 0);
-    }
-
-    #[test]
-    fn test_num_fractional_digits() {
-        // no decimal, no exponent
-        assert_eq!(num_fractional_digits("123"), 0);
-        assert_eq!(num_fractional_digits("0xff"), 0);
-        // decimal, no exponent
-        assert_eq!(num_fractional_digits("123.45"), 2);
-        assert_eq!(num_fractional_digits("-0.1"), 1);
-        assert_eq!(num_fractional_digits("-.1"), 1);
-        // exponent, no decimal
-        assert_eq!(num_fractional_digits("123e4"), 0);
-        assert_eq!(num_fractional_digits("123e-4"), 4);
-        assert_eq!(num_fractional_digits("123e-1"), 1);
-        assert_eq!(num_fractional_digits("-1e-3"), 3);
-        // decimal and exponent
-        assert_eq!(num_fractional_digits("123.45e6"), 0);
-        assert_eq!(num_fractional_digits("123.45e1"), 1);
-        assert_eq!(num_fractional_digits("123.45e-6"), 8);
-        assert_eq!(num_fractional_digits("123.45e-1"), 3);
-        assert_eq!(num_fractional_digits("-0.1e0"), 1);
-        assert_eq!(num_fractional_digits("-0.1e2"), 0);
-        assert_eq!(num_fractional_digits("-.1e0"), 1);
-        assert_eq!(num_fractional_digits("-.1e2"), 0);
-        assert_eq!(num_fractional_digits("-1.e-3"), 3);
-        assert_eq!(num_fractional_digits("-1.0e-4"), 5);
-        // minus zero int
-        assert_eq!(num_fractional_digits("-0e0"), 0);
-        assert_eq!(num_fractional_digits("-0e-0"), 0);
-        assert_eq!(num_fractional_digits("-0e1"), 0);
-        assert_eq!(num_fractional_digits("-0e+1"), 0);
-        assert_eq!(num_fractional_digits("-0.0e1"), 0);
-        // minus zero float
-        assert_eq!(num_fractional_digits("-0.0"), 1);
-        assert_eq!(num_fractional_digits("-0e-1"), 1);
-        assert_eq!(num_fractional_digits("-0.0e-1"), 2);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_seq/seq.rs.html b/coreutils/dev/src/uu_seq/seq.rs.html deleted file mode 100644 index 02cbdb8a1..000000000 --- a/coreutils/dev/src/uu_seq/seq.rs.html +++ /dev/null @@ -1,703 +0,0 @@ -seq.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore (ToDO) istr chiter argptr ilen extendedbigdecimal extendedbigint numberparse
-use std::io::{stdout, ErrorKind, Write};
-use std::process::exit;
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use num_traits::Zero;
-
-use uucore::error::FromIo;
-use uucore::error::UResult;
-use uucore::memo::printf;
-use uucore::show;
-use uucore::{format_usage, help_about, help_usage};
-
-mod error;
-mod extendedbigdecimal;
-mod extendedbigint;
-mod number;
-mod numberparse;
-use crate::error::SeqError;
-use crate::extendedbigdecimal::ExtendedBigDecimal;
-use crate::extendedbigint::ExtendedBigInt;
-use crate::number::Number;
-use crate::number::PreciseNumber;
-
-const ABOUT: &str = help_about!("seq.md");
-const USAGE: &str = help_usage!("seq.md");
-
-const OPT_SEPARATOR: &str = "separator";
-const OPT_TERMINATOR: &str = "terminator";
-const OPT_EQUAL_WIDTH: &str = "equal-width";
-const OPT_FORMAT: &str = "format";
-
-const ARG_NUMBERS: &str = "numbers";
-
-#[derive(Clone)]
-struct SeqOptions<'a> {
-    separator: String,
-    terminator: String,
-    equal_width: bool,
-    format: Option<&'a str>,
-}
-
-/// A range of integers.
-///
-/// The elements are (first, increment, last).
-type RangeInt = (ExtendedBigInt, ExtendedBigInt, ExtendedBigInt);
-
-/// A range of floats.
-///
-/// The elements are (first, increment, last).
-type RangeFloat = (ExtendedBigDecimal, ExtendedBigDecimal, ExtendedBigDecimal);
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let numbers_option = matches.get_many::<String>(ARG_NUMBERS);
-
-    if numbers_option.is_none() {
-        return Err(SeqError::NoArguments.into());
-    }
-
-    let numbers = numbers_option.unwrap().collect::<Vec<_>>();
-
-    let options = SeqOptions {
-        separator: matches
-            .get_one::<String>(OPT_SEPARATOR)
-            .map(|s| s.as_str())
-            .unwrap_or("\n")
-            .to_string(),
-        terminator: matches
-            .get_one::<String>(OPT_TERMINATOR)
-            .map(|s| s.as_str())
-            .unwrap_or("\n")
-            .to_string(),
-        equal_width: matches.get_flag(OPT_EQUAL_WIDTH),
-        format: matches.get_one::<String>(OPT_FORMAT).map(|s| s.as_str()),
-    };
-
-    let first = if numbers.len() > 1 {
-        match numbers[0].parse() {
-            Ok(num) => num,
-            Err(e) => return Err(SeqError::ParseError(numbers[0].to_string(), e).into()),
-        }
-    } else {
-        PreciseNumber::one()
-    };
-    let increment = if numbers.len() > 2 {
-        match numbers[1].parse() {
-            Ok(num) => num,
-            Err(e) => return Err(SeqError::ParseError(numbers[1].to_string(), e).into()),
-        }
-    } else {
-        PreciseNumber::one()
-    };
-    if increment.is_zero() {
-        return Err(SeqError::ZeroIncrement(numbers[1].to_string()).into());
-    }
-    let last: PreciseNumber = {
-        // We are guaranteed that `numbers.len()` is greater than zero
-        // and at most three because of the argument specification in
-        // `uu_app()`.
-        let n: usize = numbers.len();
-        match numbers[n - 1].parse() {
-            Ok(num) => num,
-            Err(e) => return Err(SeqError::ParseError(numbers[n - 1].to_string(), e).into()),
-        }
-    };
-
-    let padding = first
-        .num_integral_digits
-        .max(increment.num_integral_digits)
-        .max(last.num_integral_digits);
-    let largest_dec = first
-        .num_fractional_digits
-        .max(increment.num_fractional_digits);
-
-    let result = match (first.number, increment.number, last.number) {
-        (Number::Int(first), Number::Int(increment), last) => {
-            let last = last.round_towards(&first);
-            print_seq_integers(
-                (first, increment, last),
-                &options.separator,
-                &options.terminator,
-                options.equal_width,
-                padding,
-                options.format,
-            )
-        }
-        (first, increment, last) => print_seq(
-            (
-                first.into_extended_big_decimal(),
-                increment.into_extended_big_decimal(),
-                last.into_extended_big_decimal(),
-            ),
-            largest_dec,
-            &options.separator,
-            &options.terminator,
-            options.equal_width,
-            padding,
-            options.format,
-        ),
-    };
-    match result {
-        Ok(_) => Ok(()),
-        Err(err) if err.kind() == ErrorKind::BrokenPipe => Ok(()),
-        Err(e) => Err(e.map_err_context(|| "write error".into())),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .trailing_var_arg(true)
-        .allow_negative_numbers(true)
-        .infer_long_args(true)
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .arg(
-            Arg::new(OPT_SEPARATOR)
-                .short('s')
-                .long("separator")
-                .help("Separator character (defaults to \\n)"),
-        )
-        .arg(
-            Arg::new(OPT_TERMINATOR)
-                .short('t')
-                .long("terminator")
-                .help("Terminator character (defaults to \\n)"),
-        )
-        .arg(
-            Arg::new(OPT_EQUAL_WIDTH)
-                .short('w')
-                .long("equal-width")
-                .help("Equalize widths of all numbers by padding with zeros")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_FORMAT)
-                .short('f')
-                .long(OPT_FORMAT)
-                .help("use printf style floating-point FORMAT"),
-        )
-        .arg(
-            Arg::new(ARG_NUMBERS)
-                .action(ArgAction::Append)
-                .num_args(1..=3),
-        )
-}
-
-fn done_printing<T: Zero + PartialOrd>(next: &T, increment: &T, last: &T) -> bool {
-    if increment >= &T::zero() {
-        next > last
-    } else {
-        next < last
-    }
-}
-
-/// Write a big decimal formatted according to the given parameters.
-fn write_value_float(
-    writer: &mut impl Write,
-    value: &ExtendedBigDecimal,
-    width: usize,
-    precision: usize,
-) -> std::io::Result<()> {
-    let value_as_str =
-        if *value == ExtendedBigDecimal::Infinity || *value == ExtendedBigDecimal::MinusInfinity {
-            format!("{value:>width$.precision$}")
-        } else {
-            format!("{value:>0width$.precision$}")
-        };
-    write!(writer, "{value_as_str}")
-}
-
-/// Write a big int formatted according to the given parameters.
-fn write_value_int(
-    writer: &mut impl Write,
-    value: &ExtendedBigInt,
-    width: usize,
-    pad: bool,
-) -> std::io::Result<()> {
-    let value_as_str = if pad {
-        if *value == ExtendedBigInt::MinusZero {
-            format!("{value:0<width$}")
-        } else {
-            format!("{value:>0width$}")
-        }
-    } else {
-        format!("{value}")
-    };
-    write!(writer, "{value_as_str}")
-}
-
-// TODO `print_seq()` and `print_seq_integers()` are nearly identical,
-// they could be refactored into a single more general function.
-
-/// Floating point based code path
-fn print_seq(
-    range: RangeFloat,
-    largest_dec: usize,
-    separator: &str,
-    terminator: &str,
-    pad: bool,
-    padding: usize,
-    format: Option<&str>,
-) -> std::io::Result<()> {
-    let stdout = stdout();
-    let mut stdout = stdout.lock();
-    let (first, increment, last) = range;
-    let mut value = first;
-    let padding = if pad { padding + 1 + largest_dec } else { 0 };
-    let mut is_first_iteration = true;
-    while !done_printing(&value, &increment, &last) {
-        if !is_first_iteration {
-            write!(stdout, "{separator}")?;
-        }
-        // If there was an argument `-f FORMAT`, then use that format
-        // template instead of the default formatting strategy.
-        //
-        // TODO The `printf()` method takes a string as its second
-        // parameter but we have an `ExtendedBigDecimal`. In order to
-        // satisfy the signature of the function, we convert the
-        // `ExtendedBigDecimal` into a string. The `printf()`
-        // logic will subsequently parse that string into something
-        // similar to an `ExtendedBigDecimal` again before rendering
-        // it as a string and ultimately writing to `stdout`. We
-        // shouldn't have to do so much converting back and forth via
-        // strings.
-        match format {
-            Some(f) => {
-                let s = format!("{value}");
-                if let Err(x) = printf(f, &[s]) {
-                    show!(x);
-                    exit(1);
-                }
-            }
-            None => write_value_float(&mut stdout, &value, padding, largest_dec)?,
-        }
-        // TODO Implement augmenting addition.
-        value = value + increment.clone();
-        is_first_iteration = false;
-    }
-    if !is_first_iteration {
-        write!(stdout, "{terminator}")?;
-    }
-    stdout.flush()?;
-    Ok(())
-}
-
-/// Print an integer sequence.
-///
-/// This function prints a sequence of integers defined by `range`,
-/// which defines the first integer, last integer, and increment of the
-/// range. The `separator` is inserted between each integer and
-/// `terminator` is inserted at the end.
-///
-/// The `pad` parameter indicates whether to pad numbers to the width
-/// given in `padding`.
-///
-/// If `is_first_minus_zero` is `true`, then the `first` parameter is
-/// printed as if it were negative zero, even though no such number
-/// exists as an integer (negative zero only exists for floating point
-/// numbers). Only set this to `true` if `first` is actually zero.
-fn print_seq_integers(
-    range: RangeInt,
-    separator: &str,
-    terminator: &str,
-    pad: bool,
-    padding: usize,
-    format: Option<&str>,
-) -> std::io::Result<()> {
-    let stdout = stdout();
-    let mut stdout = stdout.lock();
-    let (first, increment, last) = range;
-    let mut value = first;
-    let mut is_first_iteration = true;
-    while !done_printing(&value, &increment, &last) {
-        if !is_first_iteration {
-            write!(stdout, "{separator}")?;
-        }
-        // If there was an argument `-f FORMAT`, then use that format
-        // template instead of the default formatting strategy.
-        //
-        // The `printf()` function takes in the template and
-        // the current value and writes the result to `stdout`.
-        //
-        // TODO See similar comment about formatting in `print_seq()`.
-        match format {
-            Some(f) => {
-                let s = format!("{value}");
-                if let Err(x) = printf(f, &[s]) {
-                    show!(x);
-                    exit(1);
-                }
-            }
-            None => write_value_int(&mut stdout, &value, padding, pad)?,
-        }
-        // TODO Implement augmenting addition.
-        value = value + increment.clone();
-        is_first_iteration = false;
-    }
-
-    if !is_first_iteration {
-        write!(stdout, "{terminator}")?;
-    }
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_shred/shred.rs.html b/coreutils/dev/src/uu_shred/shred.rs.html deleted file mode 100644 index a96acb745..000000000 --- a/coreutils/dev/src/uu_shred/shred.rs.html +++ /dev/null @@ -1,1149 +0,0 @@ -shred.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) Michael Rosenberg <42micro@gmail.com>
-// * (c) Fort <forticulous@gmail.com>
-// *
-// * For the full copyright and license information, please view the LICENSE
-// * file that was distributed with this source code.
-
-// spell-checker:ignore (words) wipesync prefill
-
-use clap::{crate_version, Arg, ArgAction, Command};
-#[cfg(unix)]
-use libc::S_IWUSR;
-use rand::{rngs::StdRng, seq::SliceRandom, Rng, SeedableRng};
-use std::fs::{self, File, OpenOptions};
-use std::io::{self, Seek, Write};
-#[cfg(unix)]
-use std::os::unix::prelude::PermissionsExt;
-use std::path::{Path, PathBuf};
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
-use uucore::parse_size::parse_size;
-use uucore::{format_usage, help_about, help_section, help_usage, show, show_error, show_if_err};
-
-const ABOUT: &str = help_about!("shred.md");
-const USAGE: &str = help_usage!("shred.md");
-const AFTER_HELP: &str = help_section!("after help", "shred.md");
-
-pub mod options {
-    pub const FORCE: &str = "force";
-    pub const FILE: &str = "file";
-    pub const ITERATIONS: &str = "iterations";
-    pub const SIZE: &str = "size";
-    pub const REMOVE: &str = "remove";
-    pub const VERBOSE: &str = "verbose";
-    pub const EXACT: &str = "exact";
-    pub const ZERO: &str = "zero";
-}
-
-// This block size seems to match GNU (2^16 = 65536)
-const BLOCK_SIZE: usize = 1 << 16;
-const NAME_CHARSET: &[u8] = b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_.";
-
-const PATTERN_LENGTH: usize = 3;
-const PATTERN_BUFFER_SIZE: usize = BLOCK_SIZE + PATTERN_LENGTH - 1;
-
-/// Patterns that appear in order for the passes
-///
-/// They are all extended to 3 bytes for consistency, even though some could be
-/// expressed as single bytes.
-const PATTERNS: [Pattern; 22] = [
-    Pattern::Single(b'\x00'),
-    Pattern::Single(b'\xFF'),
-    Pattern::Single(b'\x55'),
-    Pattern::Single(b'\xAA'),
-    Pattern::Multi([b'\x24', b'\x92', b'\x49']),
-    Pattern::Multi([b'\x49', b'\x24', b'\x92']),
-    Pattern::Multi([b'\x6D', b'\xB6', b'\xDB']),
-    Pattern::Multi([b'\x92', b'\x49', b'\x24']),
-    Pattern::Multi([b'\xB6', b'\xDB', b'\x6D']),
-    Pattern::Multi([b'\xDB', b'\x6D', b'\xB6']),
-    Pattern::Single(b'\x11'),
-    Pattern::Single(b'\x22'),
-    Pattern::Single(b'\x33'),
-    Pattern::Single(b'\x44'),
-    Pattern::Single(b'\x66'),
-    Pattern::Single(b'\x77'),
-    Pattern::Single(b'\x88'),
-    Pattern::Single(b'\x99'),
-    Pattern::Single(b'\xBB'),
-    Pattern::Single(b'\xCC'),
-    Pattern::Single(b'\xDD'),
-    Pattern::Single(b'\xEE'),
-];
-
-#[derive(Clone, Copy)]
-enum Pattern {
-    Single(u8),
-    Multi([u8; 3]),
-}
-
-enum PassType {
-    Pattern(Pattern),
-    Random,
-}
-
-/// Iterates over all possible filenames of a certain length using NAME_CHARSET as an alphabet
-struct FilenameIter {
-    // Store the indices of the letters of our filename in NAME_CHARSET
-    name_charset_indices: Vec<usize>,
-    exhausted: bool,
-}
-
-impl FilenameIter {
-    fn new(name_len: usize) -> Self {
-        Self {
-            name_charset_indices: vec![0; name_len],
-            exhausted: false,
-        }
-    }
-}
-
-impl Iterator for FilenameIter {
-    type Item = String;
-
-    fn next(&mut self) -> Option<String> {
-        if self.exhausted {
-            return None;
-        }
-
-        // First, make the return value using the current state
-        let ret: String = self
-            .name_charset_indices
-            .iter()
-            .map(|i| char::from(NAME_CHARSET[*i]))
-            .collect();
-
-        // Now increment the least significant index and possibly each next
-        // index if necessary.
-        for index in self.name_charset_indices.iter_mut().rev() {
-            if *index == NAME_CHARSET.len() - 1 {
-                // Carry the 1
-                *index = 0;
-                continue;
-            } else {
-                *index += 1;
-                return Some(ret);
-            }
-        }
-
-        // If we get here, we flipped all bits back to 0, so we exhausted all options.
-        self.exhausted = true;
-        Some(ret)
-    }
-}
-
-/// Used to generate blocks of bytes of size <= BLOCK_SIZE based on either a give pattern
-/// or randomness
-// The lint warns about a large difference because StdRng is big, but the buffers are much
-// larger anyway, so it's fine.
-#[allow(clippy::large_enum_variant)]
-enum BytesWriter {
-    Random {
-        rng: StdRng,
-        buffer: [u8; BLOCK_SIZE],
-    },
-    // To write patterns we only write to the buffer once. To be able to do
-    // this, we need to extend the buffer with 2 bytes. We can then easily
-    // obtain a buffer starting with any character of the pattern that we
-    // want with an offset of either 0, 1 or 2.
-    //
-    // For example, if we have the pattern ABC, but we want to write a block
-    // of BLOCK_SIZE starting with B, we just pick the slice [1..BLOCK_SIZE+1]
-    // This means that we only have to fill the buffer once and can just reuse
-    // it afterwards.
-    Pattern {
-        offset: usize,
-        buffer: [u8; PATTERN_BUFFER_SIZE],
-    },
-}
-
-impl BytesWriter {
-    fn from_pass_type(pass: &PassType) -> Self {
-        match pass {
-            PassType::Random => Self::Random {
-                rng: StdRng::from_entropy(),
-                buffer: [0; BLOCK_SIZE],
-            },
-            PassType::Pattern(pattern) => {
-                // Copy the pattern in chunks rather than simply one byte at a time
-                // We prefill the pattern so that the buffer can be reused at each
-                // iteration as a small optimization.
-                let buffer = match pattern {
-                    Pattern::Single(byte) => [*byte; PATTERN_BUFFER_SIZE],
-                    Pattern::Multi(bytes) => {
-                        let mut buf = [0; PATTERN_BUFFER_SIZE];
-                        for chunk in buf.chunks_exact_mut(PATTERN_LENGTH) {
-                            chunk.copy_from_slice(bytes);
-                        }
-                        buf
-                    }
-                };
-                Self::Pattern { offset: 0, buffer }
-            }
-        }
-    }
-
-    fn bytes_for_pass(&mut self, size: usize) -> &[u8] {
-        match self {
-            Self::Random { rng, buffer } => {
-                let bytes = &mut buffer[..size];
-                rng.fill(bytes);
-                bytes
-            }
-            Self::Pattern { offset, buffer } => {
-                let bytes = &buffer[*offset..size + *offset];
-                *offset = (*offset + size) % PATTERN_LENGTH;
-                bytes
-            }
-        }
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    if !matches.contains_id(options::FILE) {
-        return Err(UUsageError::new(1, "missing file operand"));
-    }
-
-    let iterations = match matches.get_one::<String>(options::ITERATIONS) {
-        Some(s) => match s.parse::<usize>() {
-            Ok(u) => u,
-            Err(_) => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("invalid number of passes: {}", s.quote()),
-                ))
-            }
-        },
-        None => unreachable!(),
-    };
-
-    // TODO: implement --remove HOW
-    //       The optional HOW parameter indicates how to remove a directory entry:
-    //         - 'unlink' => use a standard unlink call.
-    //         - 'wipe' => also first obfuscate bytes in the name.
-    //         - 'wipesync' => also sync each obfuscated byte to disk.
-    //       The default mode is 'wipesync', but note it can be expensive.
-
-    // TODO: implement --random-source
-
-    let force = matches.get_flag(options::FORCE);
-    let remove = matches.get_flag(options::REMOVE);
-    let size_arg = matches
-        .get_one::<String>(options::SIZE)
-        .map(|s| s.to_string());
-    let size = get_size(size_arg);
-    let exact = matches.get_flag(options::EXACT) || size.is_some();
-    let zero = matches.get_flag(options::ZERO);
-    let verbose = matches.get_flag(options::VERBOSE);
-
-    for path_str in matches.get_many::<String>(options::FILE).unwrap() {
-        show_if_err!(wipe_file(
-            path_str, iterations, remove, size, exact, zero, verbose, force,
-        ));
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::FORCE)
-                .long(options::FORCE)
-                .short('f')
-                .help("change permissions to allow writing if necessary")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ITERATIONS)
-                .long(options::ITERATIONS)
-                .short('n')
-                .help("overwrite N times instead of the default (3)")
-                .value_name("NUMBER")
-                .default_value("3"),
-        )
-        .arg(
-            Arg::new(options::SIZE)
-                .long(options::SIZE)
-                .short('s')
-                .value_name("N")
-                .help("shred this many bytes (suffixes like K, M, G accepted)"),
-        )
-        .arg(
-            Arg::new(options::REMOVE)
-                .short('u')
-                .long(options::REMOVE)
-                .help("truncate and remove file after overwriting;  See below")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::VERBOSE)
-                .long(options::VERBOSE)
-                .short('v')
-                .help("show progress")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::EXACT)
-                .long(options::EXACT)
-                .short('x')
-                .help(
-                    "do not round file sizes up to the next full block;\n\
-                     this is the default for non-regular files",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ZERO)
-                .long(options::ZERO)
-                .short('z')
-                .help("add a final overwrite with zeros to hide shredding")
-                .action(ArgAction::SetTrue),
-        )
-        // Positional arguments
-        .arg(
-            Arg::new(options::FILE)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-fn get_size(size_str_opt: Option<String>) -> Option<u64> {
-    size_str_opt
-        .as_ref()
-        .and_then(|size| parse_size(size.as_str()).ok())
-        .or_else(|| {
-            if let Some(size) = size_str_opt {
-                show_error!("invalid file size: {}", size.quote());
-                std::process::exit(1);
-            }
-            None
-        })
-}
-
-fn pass_name(pass_type: &PassType) -> String {
-    match pass_type {
-        PassType::Random => String::from("random"),
-        PassType::Pattern(Pattern::Single(byte)) => format!("{byte:x}{byte:x}{byte:x}"),
-        PassType::Pattern(Pattern::Multi([a, b, c])) => format!("{a:x}{b:x}{c:x}"),
-    }
-}
-
-#[allow(clippy::too_many_arguments)]
-#[allow(clippy::cognitive_complexity)]
-fn wipe_file(
-    path_str: &str,
-    n_passes: usize,
-    remove: bool,
-    size: Option<u64>,
-    exact: bool,
-    zero: bool,
-    verbose: bool,
-    force: bool,
-) -> UResult<()> {
-    // Get these potential errors out of the way first
-    let path = Path::new(path_str);
-    if !path.exists() {
-        return Err(USimpleError::new(
-            1,
-            format!("{}: No such file or directory", path.maybe_quote()),
-        ));
-    }
-    if !path.is_file() {
-        return Err(USimpleError::new(
-            1,
-            format!("{}: Not a file", path.maybe_quote()),
-        ));
-    }
-
-    // If force is true, set file permissions to not-readonly.
-    if force {
-        let metadata = fs::metadata(path).map_err_context(String::new)?;
-        let mut perms = metadata.permissions();
-        #[cfg(unix)]
-        #[allow(clippy::useless_conversion)]
-        {
-            // NOTE: set_readonly(false) makes the file world-writable on Unix.
-            // NOTE: S_IWUSR type is u16 on macOS.
-            if (perms.mode() & u32::from(S_IWUSR)) == 0 {
-                perms.set_mode(u32::from(S_IWUSR));
-            }
-        }
-        #[cfg(not(unix))]
-        // TODO: Remove the following once https://github.com/rust-lang/rust-clippy/issues/10477 is resolved.
-        #[allow(clippy::permissions_set_readonly_false)]
-        perms.set_readonly(false);
-        fs::set_permissions(path, perms).map_err_context(String::new)?;
-    }
-
-    // Fill up our pass sequence
-    let mut pass_sequence = Vec::new();
-
-    if n_passes <= 3 {
-        // Only random passes if n_passes <= 3
-        for _ in 0..n_passes {
-            pass_sequence.push(PassType::Random);
-        }
-    } else {
-        // First fill it with Patterns, shuffle it, then evenly distribute Random
-        let n_full_arrays = n_passes / PATTERNS.len(); // How many times can we go through all the patterns?
-        let remainder = n_passes % PATTERNS.len(); // How many do we get through on our last time through?
-
-        for _ in 0..n_full_arrays {
-            for p in PATTERNS {
-                pass_sequence.push(PassType::Pattern(p));
-            }
-        }
-        for pattern in PATTERNS.into_iter().take(remainder) {
-            pass_sequence.push(PassType::Pattern(pattern));
-        }
-        let mut rng = rand::thread_rng();
-        pass_sequence.shuffle(&mut rng); // randomize the order of application
-
-        let n_random = 3 + n_passes / 10; // Minimum 3 random passes; ratio of 10 after
-                                          // Evenly space random passes; ensures one at the beginning and end
-        for i in 0..n_random {
-            pass_sequence[i * (n_passes - 1) / (n_random - 1)] = PassType::Random;
-        }
-    }
-
-    // --zero specifies whether we want one final pass of 0x00 on our file
-    if zero {
-        pass_sequence.push(PassType::Pattern(PATTERNS[0]));
-    }
-
-    let total_passes = pass_sequence.len();
-    let mut file = OpenOptions::new()
-        .write(true)
-        .truncate(false)
-        .open(path)
-        .map_err_context(|| format!("{}: failed to open for writing", path.maybe_quote()))?;
-
-    let size = match size {
-        Some(size) => size,
-        None => get_file_size(path)?,
-    };
-
-    for (i, pass_type) in pass_sequence.into_iter().enumerate() {
-        if verbose {
-            let pass_name = pass_name(&pass_type);
-            if total_passes < 10 {
-                show_error!(
-                    "{}: pass {}/{} ({})... ",
-                    path.maybe_quote(),
-                    i + 1,
-                    total_passes,
-                    pass_name
-                );
-            } else {
-                show_error!(
-                    "{}: pass {:2.0}/{:2.0} ({})... ",
-                    path.maybe_quote(),
-                    i + 1,
-                    total_passes,
-                    pass_name
-                );
-            }
-        }
-        // size is an optional argument for exactly how many bytes we want to shred
-        // Ignore failed writes; just keep trying
-        show_if_err!(do_pass(&mut file, &pass_type, exact, size)
-            .map_err_context(|| format!("{}: File write pass failed", path.maybe_quote())));
-    }
-
-    if remove {
-        do_remove(path, path_str, verbose)
-            .map_err_context(|| format!("{}: failed to remove file", path.maybe_quote()))?;
-    }
-    Ok(())
-}
-
-fn do_pass(
-    file: &mut File,
-    pass_type: &PassType,
-    exact: bool,
-    file_size: u64,
-) -> Result<(), io::Error> {
-    // We might be at the end of the file due to a previous iteration, so rewind.
-    file.rewind()?;
-
-    let mut writer = BytesWriter::from_pass_type(pass_type);
-
-    // We start by writing BLOCK_SIZE times as many time as possible.
-    for _ in 0..(file_size / BLOCK_SIZE as u64) {
-        let block = writer.bytes_for_pass(BLOCK_SIZE);
-        file.write_all(block)?;
-    }
-
-    // Now we might have some bytes left, so we write either that
-    // many bytes if exact is true, or BLOCK_SIZE bytes if not.
-    let bytes_left = (file_size % BLOCK_SIZE as u64) as usize;
-    if bytes_left > 0 {
-        let size = if exact { bytes_left } else { BLOCK_SIZE };
-        let block = writer.bytes_for_pass(size);
-        file.write_all(block)?;
-    }
-
-    file.sync_data()?;
-
-    Ok(())
-}
-
-fn get_file_size(path: &Path) -> Result<u64, io::Error> {
-    Ok(fs::metadata(path)?.len())
-}
-
-// Repeatedly renames the file with strings of decreasing length (most likely all 0s)
-// Return the path of the file after its last renaming or None if error
-fn wipe_name(orig_path: &Path, verbose: bool) -> Option<PathBuf> {
-    let file_name_len = orig_path.file_name().unwrap().to_str().unwrap().len();
-
-    let mut last_path = PathBuf::from(orig_path);
-
-    for length in (1..=file_name_len).rev() {
-        // Try all filenames of a given length.
-        // If every possible filename already exists, just reduce the length and try again
-        for name in FilenameIter::new(length) {
-            let new_path = orig_path.with_file_name(name);
-            // We don't want the filename to already exist (don't overwrite)
-            // If it does, find another name that doesn't
-            if new_path.exists() {
-                continue;
-            }
-            match fs::rename(&last_path, &new_path) {
-                Ok(()) => {
-                    if verbose {
-                        show_error!(
-                            "{}: renamed to {}",
-                            last_path.maybe_quote(),
-                            new_path.quote()
-                        );
-                    }
-
-                    // Sync every file rename
-                    let new_file = OpenOptions::new()
-                        .write(true)
-                        .open(new_path.clone())
-                        .expect("Failed to open renamed file for syncing");
-                    new_file.sync_all().expect("Failed to sync renamed file");
-
-                    last_path = new_path;
-                    break;
-                }
-                Err(e) => {
-                    show_error!(
-                        "{}: Couldn't rename to {}: {}",
-                        last_path.maybe_quote(),
-                        new_path.quote(),
-                        e
-                    );
-                    return None;
-                }
-            }
-        }
-    }
-
-    Some(last_path)
-}
-
-fn do_remove(path: &Path, orig_filename: &str, verbose: bool) -> Result<(), io::Error> {
-    if verbose {
-        show_error!("{}: removing", orig_filename.maybe_quote());
-    }
-
-    if let Some(rp) = wipe_name(path, verbose) {
-        fs::remove_file(rp)?;
-    }
-
-    if verbose {
-        show_error!("{}: removed", orig_filename.maybe_quote());
-    }
-
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_shuf/rand_read_adapter.rs.html b/coreutils/dev/src/uu_shuf/rand_read_adapter.rs.html deleted file mode 100644 index 882eb3642..000000000 --- a/coreutils/dev/src/uu_shuf/rand_read_adapter.rs.html +++ /dev/null @@ -1,283 +0,0 @@ -rand_read_adapter.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-
// Copyright 2018 Developers of the Rand project.
-// Copyright 2013 The Rust Project Developers.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//! A wrapper around any Read to treat it as an RNG.
-
-use std::fmt;
-use std::io::Read;
-
-use rand_core::{impls, Error, RngCore};
-
-/// An RNG that reads random bytes straight from any type supporting
-/// [`std::io::Read`], for example files.
-///
-/// This will work best with an infinite reader, but that is not required.
-///
-/// This can be used with `/dev/urandom` on Unix but it is recommended to use
-/// [`OsRng`] instead.
-///
-/// # Panics
-///
-/// `ReadRng` uses [`std::io::Read::read_exact`], which retries on interrupts.
-/// All other errors from the underlying reader, including when it does not
-/// have enough data, will only be reported through [`try_fill_bytes`].
-/// The other [`RngCore`] methods will panic in case of an error.
-///
-/// [`OsRng`]: rand::rngs::OsRng
-/// [`try_fill_bytes`]: RngCore::try_fill_bytes
-#[derive(Debug)]
-pub struct ReadRng<R> {
-    reader: R,
-}
-
-impl<R: Read> ReadRng<R> {
-    /// Create a new `ReadRng` from a `Read`.
-    pub fn new(r: R) -> Self {
-        Self { reader: r }
-    }
-}
-
-impl<R: Read> RngCore for ReadRng<R> {
-    fn next_u32(&mut self) -> u32 {
-        impls::next_u32_via_fill(self)
-    }
-
-    fn next_u64(&mut self) -> u64 {
-        impls::next_u64_via_fill(self)
-    }
-
-    fn fill_bytes(&mut self, dest: &mut [u8]) {
-        self.try_fill_bytes(dest).unwrap_or_else(|err| {
-            panic!("reading random bytes from Read implementation failed; error: {err}");
-        });
-    }
-
-    fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> {
-        if dest.is_empty() {
-            return Ok(());
-        }
-        // Use `std::io::read_exact`, which retries on `ErrorKind::Interrupted`.
-        self.reader
-            .read_exact(dest)
-            .map_err(|e| Error::new(ReadError(e)))
-    }
-}
-
-/// `ReadRng` error type
-#[derive(Debug)]
-pub struct ReadError(std::io::Error);
-
-impl fmt::Display for ReadError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        write!(f, "ReadError: {}", self.0)
-    }
-}
-
-impl std::error::Error for ReadError {
-    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
-        Some(&self.0)
-    }
-}
-
-#[cfg(test)]
-mod test {
-    use std::println;
-
-    use super::ReadRng;
-    use rand::RngCore;
-
-    #[test]
-    fn test_reader_rng_u64() {
-        // transmute from the target to avoid endianness concerns.
-        #[rustfmt::skip]
-        let v = [0u8, 0, 0, 0, 0, 0, 0, 1,
-                 0,   4, 0, 0, 3, 0, 0, 2,
-                 5,   0, 0, 0, 0, 0, 0, 0];
-        let mut rng = ReadRng::new(&v[..]);
-
-        assert_eq!(rng.next_u64(), 1 << 56);
-        assert_eq!(rng.next_u64(), (2 << 56) + (3 << 32) + (4 << 8));
-        assert_eq!(rng.next_u64(), 5);
-    }
-
-    #[test]
-    fn test_reader_rng_u32() {
-        let v = [0u8, 0, 0, 1, 0, 0, 2, 0, 3, 0, 0, 0];
-        let mut rng = ReadRng::new(&v[..]);
-
-        assert_eq!(rng.next_u32(), 1 << 24);
-        assert_eq!(rng.next_u32(), 2 << 16);
-        assert_eq!(rng.next_u32(), 3);
-    }
-
-    #[test]
-    fn test_reader_rng_fill_bytes() {
-        let v = [1u8, 2, 3, 4, 5, 6, 7, 8];
-        let mut w = [0u8; 8];
-
-        let mut rng = ReadRng::new(&v[..]);
-        rng.fill_bytes(&mut w);
-
-        assert!(v == w);
-    }
-
-    #[test]
-    fn test_reader_rng_insufficient_bytes() {
-        let v = [1u8, 2, 3, 4, 5, 6, 7, 8];
-        let mut w = [0u8; 9];
-
-        let mut rng = ReadRng::new(&v[..]);
-
-        let result = rng.try_fill_bytes(&mut w);
-        assert!(result.is_err());
-        println!("Error: {}", result.unwrap_err());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_shuf/shuf.rs.html b/coreutils/dev/src/uu_shuf/shuf.rs.html deleted file mode 100644 index a482f9543..000000000 --- a/coreutils/dev/src/uu_shuf/shuf.rs.html +++ /dev/null @@ -1,671 +0,0 @@ -shuf.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) cmdline evec seps rvec fdata
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use memchr::memchr_iter;
-use rand::prelude::SliceRandom;
-use rand::RngCore;
-use std::fs::File;
-use std::io::{stdin, stdout, BufReader, BufWriter, Read, Write};
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage};
-
-mod rand_read_adapter;
-
-enum Mode {
-    Default(String),
-    Echo(Vec<String>),
-    InputRange((usize, usize)),
-}
-
-static USAGE: &str = help_usage!("shuf.md");
-static ABOUT: &str = help_about!("shuf.md");
-
-struct Options {
-    head_count: usize,
-    output: Option<String>,
-    random_source: Option<String>,
-    repeat: bool,
-    sep: u8,
-}
-
-mod options {
-    pub static ECHO: &str = "echo";
-    pub static INPUT_RANGE: &str = "input-range";
-    pub static HEAD_COUNT: &str = "head-count";
-    pub static OUTPUT: &str = "output";
-    pub static RANDOM_SOURCE: &str = "random-source";
-    pub static REPEAT: &str = "repeat";
-    pub static ZERO_TERMINATED: &str = "zero-terminated";
-    pub static FILE: &str = "file";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let mode = if let Some(args) = matches.get_many::<String>(options::ECHO) {
-        Mode::Echo(args.map(String::from).collect())
-    } else if let Some(range) = matches.get_one::<String>(options::INPUT_RANGE) {
-        match parse_range(range) {
-            Ok(m) => Mode::InputRange(m),
-            Err(msg) => {
-                return Err(USimpleError::new(1, msg));
-            }
-        }
-    } else {
-        Mode::Default(
-            matches
-                .get_one::<String>(options::FILE)
-                .map(|s| s.as_str())
-                .unwrap_or("-")
-                .to_string(),
-        )
-    };
-
-    let options = Options {
-        head_count: {
-            let headcounts = matches
-                .get_many::<String>(options::HEAD_COUNT)
-                .unwrap_or_default()
-                .map(|s| s.to_owned())
-                .collect();
-            match parse_head_count(headcounts) {
-                Ok(val) => val,
-                Err(msg) => return Err(USimpleError::new(1, msg)),
-            }
-        },
-        output: matches.get_one::<String>(options::OUTPUT).map(String::from),
-        random_source: matches
-            .get_one::<String>(options::RANDOM_SOURCE)
-            .map(String::from),
-        repeat: matches.get_flag(options::REPEAT),
-        sep: if matches.get_flag(options::ZERO_TERMINATED) {
-            0x00_u8
-        } else {
-            0x0a_u8
-        },
-    };
-
-    match mode {
-        Mode::Echo(args) => {
-            let mut evec = args.iter().map(String::as_bytes).collect::<Vec<_>>();
-            find_seps(&mut evec, options.sep);
-            shuf_bytes(&mut evec, options)?;
-        }
-        Mode::InputRange((b, e)) => {
-            let rvec = (b..e).map(|x| format!("{x}")).collect::<Vec<String>>();
-            let mut rvec = rvec.iter().map(String::as_bytes).collect::<Vec<&[u8]>>();
-            shuf_bytes(&mut rvec, options)?;
-        }
-        Mode::Default(filename) => {
-            let fdata = read_input_file(&filename)?;
-            let mut fdata = vec![&fdata[..]];
-            find_seps(&mut fdata, options.sep);
-            shuf_bytes(&mut fdata, options)?;
-        }
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .about(ABOUT)
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .args_override_self(true)
-        .arg(
-            Arg::new(options::ECHO)
-                .short('e')
-                .long(options::ECHO)
-                .value_name("ARG")
-                .help("treat each ARG as an input line")
-                .use_value_delimiter(false)
-                .num_args(0..)
-                .conflicts_with(options::INPUT_RANGE),
-        )
-        .arg(
-            Arg::new(options::INPUT_RANGE)
-                .short('i')
-                .long(options::INPUT_RANGE)
-                .value_name("LO-HI")
-                .help("treat each number LO through HI as an input line")
-                .conflicts_with(options::FILE),
-        )
-        .arg(
-            Arg::new(options::HEAD_COUNT)
-                .short('n')
-                .long(options::HEAD_COUNT)
-                .value_name("COUNT")
-                .help("output at most COUNT lines"),
-        )
-        .arg(
-            Arg::new(options::OUTPUT)
-                .short('o')
-                .long(options::OUTPUT)
-                .value_name("FILE")
-                .help("write result to FILE instead of standard output")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::RANDOM_SOURCE)
-                .long(options::RANDOM_SOURCE)
-                .value_name("FILE")
-                .help("get random bytes from FILE")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::REPEAT)
-                .short('r')
-                .long(options::REPEAT)
-                .help("output lines can be repeated")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ZERO_TERMINATED)
-                .short('z')
-                .long(options::ZERO_TERMINATED)
-                .help("line delimiter is NUL, not newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(Arg::new(options::FILE).value_hint(clap::ValueHint::FilePath))
-}
-
-fn read_input_file(filename: &str) -> UResult<Vec<u8>> {
-    let mut file = BufReader::new(if filename == "-" {
-        Box::new(stdin()) as Box<dyn Read>
-    } else {
-        let file = File::open(filename)
-            .map_err_context(|| format!("failed to open {}", filename.quote()))?;
-        Box::new(file) as Box<dyn Read>
-    });
-
-    let mut data = Vec::new();
-    file.read_to_end(&mut data)
-        .map_err_context(|| format!("failed reading {}", filename.quote()))?;
-
-    Ok(data)
-}
-
-fn find_seps(data: &mut Vec<&[u8]>, sep: u8) {
-    // need to use for loop so we don't borrow the vector as we modify it in place
-    // basic idea:
-    // * We don't care about the order of the result. This lets us slice the slices
-    //   without making a new vector.
-    // * Starting from the end of the vector, we examine each element.
-    // * If that element contains the separator, we remove it from the vector,
-    //   and then sub-slice it into slices that do not contain the separator.
-    // * We maintain the invariant throughout that each element in the vector past
-    //   the ith element does not have any separators remaining.
-    for i in (0..data.len()).rev() {
-        if data[i].contains(&sep) {
-            let this = data.swap_remove(i);
-            let mut p = 0;
-            for i in memchr_iter(sep, this) {
-                data.push(&this[p..i]);
-                p = i + 1;
-            }
-            if p < this.len() {
-                data.push(&this[p..]);
-            }
-        }
-    }
-}
-
-fn shuf_bytes(input: &mut Vec<&[u8]>, opts: Options) -> UResult<()> {
-    let mut output = BufWriter::new(match opts.output {
-        None => Box::new(stdout()) as Box<dyn Write>,
-        Some(s) => {
-            let file = File::create(&s[..])
-                .map_err_context(|| format!("failed to open {} for writing", s.quote()))?;
-            Box::new(file) as Box<dyn Write>
-        }
-    });
-
-    let mut rng = match opts.random_source {
-        Some(r) => {
-            let file = File::open(&r[..])
-                .map_err_context(|| format!("failed to open random source {}", r.quote()))?;
-            WrappedRng::RngFile(rand_read_adapter::ReadRng::new(file))
-        }
-        None => WrappedRng::RngDefault(rand::thread_rng()),
-    };
-
-    if input.is_empty() {
-        return Ok(());
-    }
-
-    if opts.repeat {
-        for _ in 0..opts.head_count {
-            // Returns None is the slice is empty. We checked this before, so
-            // this is safe.
-            let r = input.choose(&mut rng).unwrap();
-
-            output
-                .write_all(r)
-                .map_err_context(|| "write failed".to_string())?;
-            output
-                .write_all(&[opts.sep])
-                .map_err_context(|| "write failed".to_string())?;
-        }
-    } else {
-        let (shuffled, _) = input.partial_shuffle(&mut rng, opts.head_count);
-        for r in shuffled {
-            output
-                .write_all(r)
-                .map_err_context(|| "write failed".to_string())?;
-            output
-                .write_all(&[opts.sep])
-                .map_err_context(|| "write failed".to_string())?;
-        }
-    }
-
-    Ok(())
-}
-
-fn parse_range(input_range: &str) -> Result<(usize, usize), String> {
-    if let Some((from, to)) = input_range.split_once('-') {
-        let begin = from
-            .parse::<usize>()
-            .map_err(|_| format!("invalid input range: {}", from.quote()))?;
-        let end = to
-            .parse::<usize>()
-            .map_err(|_| format!("invalid input range: {}", to.quote()))?;
-        Ok((begin, end + 1))
-    } else {
-        Err(format!("invalid input range: {}", input_range.quote()))
-    }
-}
-
-fn parse_head_count(headcounts: Vec<String>) -> Result<usize, String> {
-    let mut result = std::usize::MAX;
-    for count in headcounts {
-        match count.parse::<usize>() {
-            Ok(pv) => result = std::cmp::min(result, pv),
-            Err(_) => return Err(format!("invalid line count: {}", count.quote())),
-        }
-    }
-    Ok(result)
-}
-
-enum WrappedRng {
-    RngFile(rand_read_adapter::ReadRng<File>),
-    RngDefault(rand::rngs::ThreadRng),
-}
-
-impl RngCore for WrappedRng {
-    fn next_u32(&mut self) -> u32 {
-        match self {
-            Self::RngFile(r) => r.next_u32(),
-            Self::RngDefault(r) => r.next_u32(),
-        }
-    }
-
-    fn next_u64(&mut self) -> u64 {
-        match self {
-            Self::RngFile(r) => r.next_u64(),
-            Self::RngDefault(r) => r.next_u64(),
-        }
-    }
-
-    fn fill_bytes(&mut self, dest: &mut [u8]) {
-        match self {
-            Self::RngFile(r) => r.fill_bytes(dest),
-            Self::RngDefault(r) => r.fill_bytes(dest),
-        }
-    }
-
-    fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), rand::Error> {
-        match self {
-            Self::RngFile(r) => r.try_fill_bytes(dest),
-            Self::RngDefault(r) => r.try_fill_bytes(dest),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sleep/sleep.rs.html b/coreutils/dev/src/uu_sleep/sleep.rs.html deleted file mode 100644 index d1090007f..000000000 --- a/coreutils/dev/src/uu_sleep/sleep.rs.html +++ /dev/null @@ -1,207 +0,0 @@ -sleep.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use std::thread;
-use std::time::Duration;
-
-use uucore::{
-    error::{UResult, USimpleError, UUsageError},
-    format_usage, help_about, help_section, help_usage, show_error,
-};
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use fundu::{self, DurationParser, ParseError, SaturatingInto};
-
-static ABOUT: &str = help_about!("sleep.md");
-const USAGE: &str = help_usage!("sleep.md");
-static AFTER_HELP: &str = help_section!("after help", "sleep.md");
-
-mod options {
-    pub const NUMBER: &str = "NUMBER";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let numbers = matches
-        .get_many::<String>(options::NUMBER)
-        .ok_or_else(|| {
-            USimpleError::new(
-                1,
-                format!(
-                    "missing operand\nTry '{} --help' for more information.",
-                    uucore::execution_phrase()
-                ),
-            )
-        })?
-        .map(|s| s.as_str())
-        .collect::<Vec<_>>();
-
-    sleep(&numbers)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::NUMBER)
-                .help("pause for NUMBER seconds")
-                .value_name(options::NUMBER)
-                .action(ArgAction::Append),
-        )
-}
-
-fn sleep(args: &[&str]) -> UResult<()> {
-    let mut arg_error = false;
-
-    use fundu::TimeUnit::{Day, Hour, Minute, Second};
-    let parser = DurationParser::with_time_units(&[Second, Minute, Hour, Day]);
-
-    let sleep_dur = args
-        .iter()
-        .filter_map(|input| match parser.parse(input.trim()) {
-            Ok(duration) => Some(duration),
-            Err(error) => {
-                arg_error = true;
-
-                let reason = match error {
-                    ParseError::Empty if input.is_empty() => "Input was empty".to_string(),
-                    ParseError::Empty => "Found only whitespace in input".to_string(),
-                    ParseError::Syntax(pos, description)
-                    | ParseError::TimeUnit(pos, description) => {
-                        format!("{description} at position {}", pos.saturating_add(1))
-                    }
-                    ParseError::NegativeExponentOverflow | ParseError::PositiveExponentOverflow => {
-                        "Exponent was out of bounds".to_string()
-                    }
-                    ParseError::NegativeNumber => "Number was negative".to_string(),
-                    error => error.to_string(),
-                };
-                show_error!("invalid time interval '{input}': {reason}");
-
-                None
-            }
-        })
-        .fold(Duration::ZERO, |acc, n| {
-            acc.saturating_add(SaturatingInto::<std::time::Duration>::saturating_into(n))
-        });
-
-    if arg_error {
-        return Err(UUsageError::new(1, ""));
-    };
-    thread::sleep(sleep_dur);
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sort/check.rs.html b/coreutils/dev/src/uu_sort/check.rs.html deleted file mode 100644 index 2fc778c23..000000000 --- a/coreutils/dev/src/uu_sort/check.rs.html +++ /dev/null @@ -1,253 +0,0 @@ -check.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Michael Debertol <michael.debertol..AT..gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-//! Check if a file is ordered
-
-use crate::{
-    chunks::{self, Chunk, RecycledChunk},
-    compare_by, open, GlobalSettings, SortError,
-};
-use itertools::Itertools;
-use std::{
-    cmp::Ordering,
-    ffi::OsStr,
-    io::Read,
-    iter,
-    sync::mpsc::{sync_channel, Receiver, SyncSender},
-    thread,
-};
-use uucore::error::UResult;
-
-/// Check if the file at `path` is ordered.
-///
-/// # Returns
-///
-/// The code we should exit with.
-pub fn check(path: &OsStr, settings: &GlobalSettings) -> UResult<()> {
-    let max_allowed_cmp = if settings.unique {
-        // If `unique` is enabled, the previous line must compare _less_ to the next one.
-        Ordering::Less
-    } else {
-        // Otherwise, the line previous line must compare _less or equal_ to the next one.
-        Ordering::Equal
-    };
-    let file = open(path)?;
-    let (recycled_sender, recycled_receiver) = sync_channel(2);
-    let (loaded_sender, loaded_receiver) = sync_channel(2);
-    thread::spawn({
-        let settings = settings.clone();
-        move || reader(file, &recycled_receiver, &loaded_sender, &settings)
-    });
-    for _ in 0..2 {
-        let _ = recycled_sender.send(RecycledChunk::new(if settings.buffer_size < 100 * 1024 {
-            // when the buffer size is smaller than 100KiB we choose it instead of the default.
-            // this improves testability.
-            settings.buffer_size
-        } else {
-            100 * 1024
-        }));
-    }
-
-    let mut prev_chunk: Option<Chunk> = None;
-    let mut line_idx = 0;
-    for chunk in loaded_receiver.iter() {
-        line_idx += 1;
-        if let Some(prev_chunk) = prev_chunk.take() {
-            // Check if the first element of the new chunk is greater than the last
-            // element from the previous chunk
-            let prev_last = prev_chunk.lines().last().unwrap();
-            let new_first = chunk.lines().first().unwrap();
-
-            if compare_by(
-                prev_last,
-                new_first,
-                settings,
-                prev_chunk.line_data(),
-                chunk.line_data(),
-            ) > max_allowed_cmp
-            {
-                return Err(SortError::Disorder {
-                    file: path.to_owned(),
-                    line_number: line_idx,
-                    line: new_first.line.to_owned(),
-                    silent: settings.check_silent,
-                }
-                .into());
-            }
-            let _ = recycled_sender.send(prev_chunk.recycle());
-        }
-
-        for (a, b) in chunk.lines().iter().tuple_windows() {
-            line_idx += 1;
-            if compare_by(a, b, settings, chunk.line_data(), chunk.line_data()) > max_allowed_cmp {
-                return Err(SortError::Disorder {
-                    file: path.to_owned(),
-                    line_number: line_idx,
-                    line: b.line.to_owned(),
-                    silent: settings.check_silent,
-                }
-                .into());
-            }
-        }
-
-        prev_chunk = Some(chunk);
-    }
-    Ok(())
-}
-
-/// The function running on the reader thread.
-fn reader(
-    mut file: Box<dyn Read + Send>,
-    receiver: &Receiver<RecycledChunk>,
-    sender: &SyncSender<Chunk>,
-    settings: &GlobalSettings,
-) -> UResult<()> {
-    let mut carry_over = vec![];
-    for recycled_chunk in receiver.iter() {
-        let should_continue = chunks::read(
-            sender,
-            recycled_chunk,
-            None,
-            &mut carry_over,
-            &mut file,
-            &mut iter::empty(),
-            settings.line_ending.into(),
-            settings,
-        )?;
-        if !should_continue {
-            break;
-        }
-    }
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sort/chunks.rs.html b/coreutils/dev/src/uu_sort/chunks.rs.html deleted file mode 100644 index 0d0150c05..000000000 --- a/coreutils/dev/src/uu_sort/chunks.rs.html +++ /dev/null @@ -1,645 +0,0 @@ -chunks.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Michael Debertol <michael.debertol..AT..gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-//! Utilities for reading files as chunks.
-
-#![allow(dead_code)]
-// Ignores non-used warning for `borrow_buffer` in `Chunk`
-
-use std::{
-    io::{ErrorKind, Read},
-    sync::mpsc::SyncSender,
-};
-
-use memchr::memchr_iter;
-use self_cell::self_cell;
-use uucore::error::{UResult, USimpleError};
-
-use crate::{numeric_str_cmp::NumInfo, GeneralF64ParseResult, GlobalSettings, Line, SortError};
-
-self_cell!(
-    /// The chunk that is passed around between threads.
-    pub struct Chunk {
-        owner: Vec<u8>,
-
-        #[covariant]
-        dependent: ChunkContents,
-    }
-
-    impl {Debug}
-);
-
-#[derive(Debug)]
-pub struct ChunkContents<'a> {
-    pub lines: Vec<Line<'a>>,
-    pub line_data: LineData<'a>,
-}
-
-#[derive(Debug)]
-pub struct LineData<'a> {
-    pub selections: Vec<&'a str>,
-    pub num_infos: Vec<NumInfo>,
-    pub parsed_floats: Vec<GeneralF64ParseResult>,
-}
-
-impl Chunk {
-    /// Destroy this chunk and return its components to be reused.
-    pub fn recycle(mut self) -> RecycledChunk {
-        let recycled_contents = self.with_dependent_mut(|_, contents| {
-            contents.lines.clear();
-            contents.line_data.selections.clear();
-            contents.line_data.num_infos.clear();
-            contents.line_data.parsed_floats.clear();
-            let lines = unsafe {
-                // SAFETY: It is safe to (temporarily) transmute to a vector of lines with a longer lifetime,
-                // because the vector is empty.
-                // Transmuting is necessary to make recycling possible. See https://github.com/rust-lang/rfcs/pull/2802
-                // for a rfc to make this unnecessary. Its example is similar to the code here.
-                std::mem::transmute::<Vec<Line<'_>>, Vec<Line<'static>>>(std::mem::take(
-                    &mut contents.lines,
-                ))
-            };
-            let selections = unsafe {
-                // SAFETY: (same as above) It is safe to (temporarily) transmute to a vector of &str with a longer lifetime,
-                // because the vector is empty.
-                std::mem::transmute::<Vec<&'_ str>, Vec<&'static str>>(std::mem::take(
-                    &mut contents.line_data.selections,
-                ))
-            };
-            (
-                lines,
-                selections,
-                std::mem::take(&mut contents.line_data.num_infos),
-                std::mem::take(&mut contents.line_data.parsed_floats),
-            )
-        });
-        RecycledChunk {
-            lines: recycled_contents.0,
-            selections: recycled_contents.1,
-            num_infos: recycled_contents.2,
-            parsed_floats: recycled_contents.3,
-            buffer: self.into_owner(),
-        }
-    }
-
-    pub fn lines(&self) -> &Vec<Line> {
-        &self.borrow_dependent().lines
-    }
-    pub fn line_data(&self) -> &LineData {
-        &self.borrow_dependent().line_data
-    }
-}
-
-pub struct RecycledChunk {
-    lines: Vec<Line<'static>>,
-    selections: Vec<&'static str>,
-    num_infos: Vec<NumInfo>,
-    parsed_floats: Vec<GeneralF64ParseResult>,
-    buffer: Vec<u8>,
-}
-
-impl RecycledChunk {
-    pub fn new(capacity: usize) -> Self {
-        Self {
-            lines: Vec::new(),
-            selections: Vec::new(),
-            num_infos: Vec::new(),
-            parsed_floats: Vec::new(),
-            buffer: vec![0; capacity],
-        }
-    }
-}
-
-/// Read a chunk, parse lines and send them.
-///
-/// No empty chunk will be sent. If we reach the end of the input, `false` is returned.
-/// However, if this function returns `true`, it is not guaranteed that there is still
-/// input left: If the input fits _exactly_ into a buffer, we will only notice that there's
-/// nothing more to read at the next invocation. In case there is no input left, nothing will
-/// be sent.
-///
-/// # Arguments
-///
-/// (see also `read_to_chunk` for a more detailed documentation)
-///
-/// * `sender`: The sender to send the lines to the sorter.
-/// * `recycled_chunk`: The recycled chunk, as returned by `Chunk::recycle`.
-///   (i.e. `buffer.len()` should be equal to `buffer.capacity()`)
-/// * `max_buffer_size`: How big `buffer` can be.
-/// * `carry_over`: The bytes that must be carried over in between invocations.
-/// * `file`: The current file.
-/// * `next_files`: What `file` should be updated to next.
-/// * `separator`: The line separator.
-/// * `settings`: The global settings.
-#[allow(clippy::too_many_arguments)]
-pub fn read<T: Read>(
-    sender: &SyncSender<Chunk>,
-    recycled_chunk: RecycledChunk,
-    max_buffer_size: Option<usize>,
-    carry_over: &mut Vec<u8>,
-    file: &mut T,
-    next_files: &mut impl Iterator<Item = UResult<T>>,
-    separator: u8,
-    settings: &GlobalSettings,
-) -> UResult<bool> {
-    let RecycledChunk {
-        lines,
-        selections,
-        num_infos,
-        parsed_floats,
-        mut buffer,
-    } = recycled_chunk;
-    if buffer.len() < carry_over.len() {
-        buffer.resize(carry_over.len() + 10 * 1024, 0);
-    }
-    buffer[..carry_over.len()].copy_from_slice(carry_over);
-    let (read, should_continue) = read_to_buffer(
-        file,
-        next_files,
-        &mut buffer,
-        max_buffer_size,
-        carry_over.len(),
-        separator,
-    )?;
-    carry_over.clear();
-    carry_over.extend_from_slice(&buffer[read..]);
-
-    if read != 0 {
-        let payload: UResult<Chunk> = Chunk::try_new(buffer, |buffer| {
-            let selections = unsafe {
-                // SAFETY: It is safe to transmute to an empty vector of selections with shorter lifetime.
-                // It was only temporarily transmuted to a Vec<Line<'static>> to make recycling possible.
-                std::mem::transmute::<Vec<&'static str>, Vec<&'_ str>>(selections)
-            };
-            let mut lines = unsafe {
-                // SAFETY: (same as above) It is safe to transmute to a vector of lines with shorter lifetime,
-                // because it was only temporarily transmuted to a Vec<Line<'static>> to make recycling possible.
-                std::mem::transmute::<Vec<Line<'static>>, Vec<Line<'_>>>(lines)
-            };
-            let read = std::str::from_utf8(&buffer[..read])
-                .map_err(|error| SortError::Uft8Error { error })?;
-            let mut line_data = LineData {
-                selections,
-                num_infos,
-                parsed_floats,
-            };
-            parse_lines(read, &mut lines, &mut line_data, separator, settings);
-            Ok(ChunkContents { lines, line_data })
-        });
-        sender.send(payload?).unwrap();
-    }
-    Ok(should_continue)
-}
-
-/// Split `read` into `Line`s, and add them to `lines`.
-fn parse_lines<'a>(
-    read: &'a str,
-    lines: &mut Vec<Line<'a>>,
-    line_data: &mut LineData<'a>,
-    separator: u8,
-    settings: &GlobalSettings,
-) {
-    let read = read.strip_suffix(separator as char).unwrap_or(read);
-
-    assert!(lines.is_empty());
-    assert!(line_data.selections.is_empty());
-    assert!(line_data.num_infos.is_empty());
-    assert!(line_data.parsed_floats.is_empty());
-    let mut token_buffer = vec![];
-    lines.extend(
-        read.split(separator as char)
-            .enumerate()
-            .map(|(index, line)| Line::create(line, index, line_data, &mut token_buffer, settings)),
-    );
-}
-
-/// Read from `file` into `buffer`.
-///
-/// This function makes sure that at least two lines are read (unless we reach EOF and there's no next file),
-/// growing the buffer if necessary.
-/// The last line is likely to not have been fully read into the buffer. Its bytes must be copied to
-/// the front of the buffer for the next invocation so that it can be continued to be read
-/// (see the return values and `start_offset`).
-///
-/// # Arguments
-///
-/// * `file`: The file to start reading from.
-/// * `next_files`: When `file` reaches EOF, it is updated to `next_files.next()` if that is `Some`,
-///    and this function continues reading.
-/// * `buffer`: The buffer that is filled with bytes. Its contents will mostly be overwritten (see `start_offset`
-///   as well). It will be grown up to `max_buffer_size` if necessary, but it will always grow to read at least two lines.
-/// * `max_buffer_size`: Grow the buffer to at most this length. If None, the buffer will not grow, unless needed to read at least two lines.
-/// * `start_offset`: The amount of bytes at the start of `buffer` that were carried over
-///    from the previous read and should not be overwritten.
-/// * `separator`: The byte that separates lines.
-///
-/// # Returns
-///
-/// * The amount of bytes in `buffer` that can now be interpreted as lines.
-///   The remaining bytes must be copied to the start of the buffer for the next invocation,
-///   if another invocation is necessary, which is determined by the other return value.
-/// * Whether this function should be called again.
-fn read_to_buffer<T: Read>(
-    file: &mut T,
-    next_files: &mut impl Iterator<Item = UResult<T>>,
-    buffer: &mut Vec<u8>,
-    max_buffer_size: Option<usize>,
-    start_offset: usize,
-    separator: u8,
-) -> UResult<(usize, bool)> {
-    let mut read_target = &mut buffer[start_offset..];
-    let mut last_file_target_size = read_target.len();
-    loop {
-        match file.read(read_target) {
-            Ok(0) => {
-                if read_target.is_empty() {
-                    // chunk is full
-                    if let Some(max_buffer_size) = max_buffer_size {
-                        if max_buffer_size > buffer.len() {
-                            // we can grow the buffer
-                            let prev_len = buffer.len();
-                            if buffer.len() < max_buffer_size / 2 {
-                                buffer.resize(buffer.len() * 2, 0);
-                            } else {
-                                buffer.resize(max_buffer_size, 0);
-                            }
-                            read_target = &mut buffer[prev_len..];
-                            continue;
-                        }
-                    }
-                    let mut sep_iter = memchr_iter(separator, buffer).rev();
-                    let last_line_end = sep_iter.next();
-                    if sep_iter.next().is_some() {
-                        // We read enough lines.
-                        let end = last_line_end.unwrap();
-                        // We want to include the separator here, because it shouldn't be carried over.
-                        return Ok((end + 1, true));
-                    } else {
-                        // We need to read more lines
-                        let len = buffer.len();
-                        // resize the vector to 10 KB more
-                        buffer.resize(len + 1024 * 10, 0);
-                        read_target = &mut buffer[len..];
-                    }
-                } else {
-                    // This file has been fully read.
-                    let mut leftover_len = read_target.len();
-                    if last_file_target_size != leftover_len {
-                        // The file was not empty.
-                        let read_len = buffer.len() - leftover_len;
-                        if buffer[read_len - 1] != separator {
-                            // The file did not end with a separator. We have to insert one.
-                            buffer[read_len] = separator;
-                            leftover_len -= 1;
-                        }
-                        let read_len = buffer.len() - leftover_len;
-                        read_target = &mut buffer[read_len..];
-                    }
-                    if let Some(next_file) = next_files.next() {
-                        // There is another file.
-                        last_file_target_size = leftover_len;
-                        *file = next_file?;
-                    } else {
-                        // This was the last file.
-                        let read_len = buffer.len() - leftover_len;
-                        return Ok((read_len, false));
-                    }
-                }
-            }
-            Ok(n) => {
-                read_target = &mut read_target[n..];
-            }
-            Err(e) if e.kind() == ErrorKind::Interrupted => {
-                // retry
-            }
-            Err(e) => return Err(USimpleError::new(2, e.to_string())),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sort/custom_str_cmp.rs.html b/coreutils/dev/src/uu_sort/custom_str_cmp.rs.html deleted file mode 100644 index 7c1447fb1..000000000 --- a/coreutils/dev/src/uu_sort/custom_str_cmp.rs.html +++ /dev/null @@ -1,129 +0,0 @@ -custom_str_cmp.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Michael Debertol <michael.debertol..AT..gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-//! Custom string comparisons.
-//!
-//! The goal is to compare strings without transforming them first (i.e. not allocating new strings)
-
-use std::cmp::Ordering;
-
-fn filter_char(c: char, ignore_non_printing: bool, ignore_non_dictionary: bool) -> bool {
-    if ignore_non_dictionary && !(c.is_ascii_alphanumeric() || c.is_ascii_whitespace()) {
-        return false;
-    }
-    if ignore_non_printing && (c.is_ascii_control() || !c.is_ascii()) {
-        return false;
-    }
-    true
-}
-
-fn cmp_chars(a: char, b: char, ignore_case: bool) -> Ordering {
-    if ignore_case {
-        a.to_ascii_uppercase().cmp(&b.to_ascii_uppercase())
-    } else {
-        a.cmp(&b)
-    }
-}
-
-pub fn custom_str_cmp(
-    a: &str,
-    b: &str,
-    ignore_non_printing: bool,
-    ignore_non_dictionary: bool,
-    ignore_case: bool,
-) -> Ordering {
-    if !(ignore_case || ignore_non_dictionary || ignore_non_printing) {
-        // There are no custom settings. Fall back to the default strcmp, which is faster.
-        return a.cmp(b);
-    }
-    let mut a_chars = a
-        .chars()
-        .filter(|&c| filter_char(c, ignore_non_printing, ignore_non_dictionary));
-    let mut b_chars = b
-        .chars()
-        .filter(|&c| filter_char(c, ignore_non_printing, ignore_non_dictionary));
-    loop {
-        let a_char = a_chars.next();
-        let b_char = b_chars.next();
-        match (a_char, b_char) {
-            (None, None) => return Ordering::Equal,
-            (Some(_), None) => return Ordering::Greater,
-            (None, Some(_)) => return Ordering::Less,
-            (Some(a_char), Some(b_char)) => {
-                let ordering = cmp_chars(a_char, b_char, ignore_case);
-                if ordering != Ordering::Equal {
-                    return ordering;
-                }
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sort/ext_sort.rs.html b/coreutils/dev/src/uu_sort/ext_sort.rs.html deleted file mode 100644 index 82cff81b3..000000000 --- a/coreutils/dev/src/uu_sort/ext_sort.rs.html +++ /dev/null @@ -1,565 +0,0 @@ -ext_sort.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Michael Debertol <michael.debertol..AT..gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-//! Sort big files by using auxiliary files for storing intermediate chunks.
-//!
-//! Files are read into chunks of memory which are then sorted individually and
-//! written to temporary files. There are two threads: One sorter, and one reader/writer.
-//! The buffers for the individual chunks are recycled. There are two buffers.
-
-use std::cmp::Ordering;
-use std::fs::File;
-use std::io::Write;
-use std::path::PathBuf;
-use std::{
-    io::Read,
-    sync::mpsc::{Receiver, SyncSender},
-    thread,
-};
-
-use itertools::Itertools;
-use uucore::error::UResult;
-
-use crate::chunks::RecycledChunk;
-use crate::merge::ClosedTmpFile;
-use crate::merge::WriteableCompressedTmpFile;
-use crate::merge::WriteablePlainTmpFile;
-use crate::merge::WriteableTmpFile;
-use crate::tmp_dir::TmpDirWrapper;
-use crate::Output;
-use crate::{
-    chunks::{self, Chunk},
-    compare_by, merge, sort_by, GlobalSettings,
-};
-use crate::{print_sorted, Line};
-
-const START_BUFFER_SIZE: usize = 8_000;
-
-/// Sort files by using auxiliary files for storing intermediate chunks (if needed), and output the result.
-pub fn ext_sort(
-    files: &mut impl Iterator<Item = UResult<Box<dyn Read + Send>>>,
-    settings: &GlobalSettings,
-    output: Output,
-    tmp_dir: &mut TmpDirWrapper,
-) -> UResult<()> {
-    let (sorted_sender, sorted_receiver) = std::sync::mpsc::sync_channel(1);
-    let (recycled_sender, recycled_receiver) = std::sync::mpsc::sync_channel(1);
-    thread::spawn({
-        let settings = settings.clone();
-        move || sorter(&recycled_receiver, &sorted_sender, &settings)
-    });
-    if settings.compress_prog.is_some() {
-        reader_writer::<_, WriteableCompressedTmpFile>(
-            files,
-            settings,
-            &sorted_receiver,
-            recycled_sender,
-            output,
-            tmp_dir,
-        )
-    } else {
-        reader_writer::<_, WriteablePlainTmpFile>(
-            files,
-            settings,
-            &sorted_receiver,
-            recycled_sender,
-            output,
-            tmp_dir,
-        )
-    }
-}
-
-fn reader_writer<
-    F: Iterator<Item = UResult<Box<dyn Read + Send>>>,
-    Tmp: WriteableTmpFile + 'static,
->(
-    files: F,
-    settings: &GlobalSettings,
-    receiver: &Receiver<Chunk>,
-    sender: SyncSender<Chunk>,
-    output: Output,
-    tmp_dir: &mut TmpDirWrapper,
-) -> UResult<()> {
-    let separator = settings.line_ending.into();
-
-    // Heuristically chosen: Dividing by 10 seems to keep our memory usage roughly
-    // around settings.buffer_size as a whole.
-    let buffer_size = settings.buffer_size / 10;
-    let read_result: ReadResult<Tmp> = read_write_loop(
-        files,
-        tmp_dir,
-        separator,
-        buffer_size,
-        settings,
-        receiver,
-        sender,
-    )?;
-    match read_result {
-        ReadResult::WroteChunksToFile { tmp_files } => {
-            let merger = merge::merge_with_file_limit::<_, _, Tmp>(
-                tmp_files.into_iter().map(|c| c.reopen()),
-                settings,
-                tmp_dir,
-            )?;
-            merger.write_all(settings, output)?;
-        }
-        ReadResult::SortedSingleChunk(chunk) => {
-            if settings.unique {
-                print_sorted(
-                    chunk.lines().iter().dedup_by(|a, b| {
-                        compare_by(a, b, settings, chunk.line_data(), chunk.line_data())
-                            == Ordering::Equal
-                    }),
-                    settings,
-                    output,
-                );
-            } else {
-                print_sorted(chunk.lines().iter(), settings, output);
-            }
-        }
-        ReadResult::SortedTwoChunks([a, b]) => {
-            let merged_iter = a.lines().iter().map(|line| (line, &a)).merge_by(
-                b.lines().iter().map(|line| (line, &b)),
-                |(line_a, a), (line_b, b)| {
-                    compare_by(line_a, line_b, settings, a.line_data(), b.line_data())
-                        != Ordering::Greater
-                },
-            );
-            if settings.unique {
-                print_sorted(
-                    merged_iter
-                        .dedup_by(|(line_a, a), (line_b, b)| {
-                            compare_by(line_a, line_b, settings, a.line_data(), b.line_data())
-                                == Ordering::Equal
-                        })
-                        .map(|(line, _)| line),
-                    settings,
-                    output,
-                );
-            } else {
-                print_sorted(merged_iter.map(|(line, _)| line), settings, output);
-            }
-        }
-        ReadResult::EmptyInput => {
-            // don't output anything
-        }
-    }
-    Ok(())
-}
-
-/// The function that is executed on the sorter thread.
-fn sorter(receiver: &Receiver<Chunk>, sender: &SyncSender<Chunk>, settings: &GlobalSettings) {
-    while let Ok(mut payload) = receiver.recv() {
-        payload.with_dependent_mut(|_, contents| {
-            sort_by(&mut contents.lines, settings, &contents.line_data);
-        });
-        if sender.send(payload).is_err() {
-            // The receiver has gone away, likely because the other thread hit an error.
-            // We stop silently because the actual error is printed by the other thread.
-            return;
-        }
-    }
-}
-
-/// Describes how we read the chunks from the input.
-enum ReadResult<I: WriteableTmpFile> {
-    /// The input was empty. Nothing was read.
-    EmptyInput,
-    /// The input fits into a single Chunk, which was kept in memory.
-    SortedSingleChunk(Chunk),
-    /// The input fits into two chunks, which were kept in memory.
-    SortedTwoChunks([Chunk; 2]),
-    /// The input was read into multiple chunks, which were written to auxiliary files.
-    WroteChunksToFile { tmp_files: Vec<I::Closed> },
-}
-/// The function that is executed on the reader/writer thread.
-fn read_write_loop<I: WriteableTmpFile>(
-    mut files: impl Iterator<Item = UResult<Box<dyn Read + Send>>>,
-    tmp_dir: &mut TmpDirWrapper,
-    separator: u8,
-    buffer_size: usize,
-    settings: &GlobalSettings,
-    receiver: &Receiver<Chunk>,
-    sender: SyncSender<Chunk>,
-) -> UResult<ReadResult<I>> {
-    let mut file = files.next().unwrap()?;
-
-    let mut carry_over = vec![];
-    // kick things off with two reads
-    for _ in 0..2 {
-        let should_continue = chunks::read(
-            &sender,
-            RecycledChunk::new(if START_BUFFER_SIZE < buffer_size {
-                START_BUFFER_SIZE
-            } else {
-                buffer_size
-            }),
-            Some(buffer_size),
-            &mut carry_over,
-            &mut file,
-            &mut files,
-            separator,
-            settings,
-        )?;
-
-        if !should_continue {
-            drop(sender);
-            // We have already read the whole input. Since we are in our first two reads,
-            // this means that we can fit the whole input into memory. Bypass writing below and
-            // handle this case in a more straightforward way.
-            return Ok(if let Ok(first_chunk) = receiver.recv() {
-                if let Ok(second_chunk) = receiver.recv() {
-                    ReadResult::SortedTwoChunks([first_chunk, second_chunk])
-                } else {
-                    ReadResult::SortedSingleChunk(first_chunk)
-                }
-            } else {
-                ReadResult::EmptyInput
-            });
-        }
-    }
-
-    let mut sender_option = Some(sender);
-    let mut tmp_files = vec![];
-    loop {
-        let mut chunk = match receiver.recv() {
-            Ok(it) => it,
-            _ => {
-                return Ok(ReadResult::WroteChunksToFile { tmp_files });
-            }
-        };
-
-        let tmp_file = write::<I>(
-            &mut chunk,
-            tmp_dir.next_file()?,
-            settings.compress_prog.as_deref(),
-            separator,
-        )?;
-        tmp_files.push(tmp_file);
-
-        let recycled_chunk = chunk.recycle();
-
-        if let Some(sender) = &sender_option {
-            let should_continue = chunks::read(
-                sender,
-                recycled_chunk,
-                None,
-                &mut carry_over,
-                &mut file,
-                &mut files,
-                separator,
-                settings,
-            )?;
-            if !should_continue {
-                sender_option = None;
-            }
-        }
-    }
-}
-
-/// Write the lines in `chunk` to `file`, separated by `separator`.
-/// `compress_prog` is used to optionally compress file contents.
-fn write<I: WriteableTmpFile>(
-    chunk: &mut Chunk,
-    file: (File, PathBuf),
-    compress_prog: Option<&str>,
-    separator: u8,
-) -> UResult<I::Closed> {
-    let mut tmp_file = I::create(file, compress_prog)?;
-    write_lines(chunk.lines(), tmp_file.as_write(), separator);
-    tmp_file.finished_writing()
-}
-
-fn write_lines<T: Write>(lines: &[Line], writer: &mut T, separator: u8) {
-    for s in lines {
-        writer.write_all(s.line.as_bytes()).unwrap();
-        writer.write_all(&[separator]).unwrap();
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sort/merge.rs.html b/coreutils/dev/src/uu_sort/merge.rs.html deleted file mode 100644 index 43511abd1..000000000 --- a/coreutils/dev/src/uu_sort/merge.rs.html +++ /dev/null @@ -1,1103 +0,0 @@ -merge.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-
//! Merge already sorted files.
-//!
-//! We achieve performance by splitting the tasks of sorting and writing, and reading and parsing between two threads.
-//! The threads communicate over channels. There's one channel per file in the direction reader -> sorter, but only
-//! one channel from the sorter back to the reader. The channels to the sorter are used to send the read chunks.
-//! The sorter reads the next chunk from the channel whenever it needs the next chunk after running out of lines
-//! from the previous read of the file. The channel back from the sorter to the reader has two purposes: To allow the reader
-//! to reuse memory allocations and to tell the reader which file to read from next.
-
-use std::{
-    cmp::Ordering,
-    ffi::OsString,
-    fs::{self, File},
-    io::{BufWriter, Read, Write},
-    iter,
-    path::{Path, PathBuf},
-    process::{Child, ChildStdin, ChildStdout, Command, Stdio},
-    rc::Rc,
-    sync::mpsc::{channel, sync_channel, Receiver, Sender, SyncSender},
-    thread::{self, JoinHandle},
-};
-
-use compare::Compare;
-use itertools::Itertools;
-use uucore::error::UResult;
-
-use crate::{
-    chunks::{self, Chunk, RecycledChunk},
-    compare_by, open,
-    tmp_dir::TmpDirWrapper,
-    GlobalSettings, Output, SortError,
-};
-
-/// If the output file occurs in the input files as well, copy the contents of the output file
-/// and replace its occurrences in the inputs with that copy.
-fn replace_output_file_in_input_files(
-    files: &mut [OsString],
-    output: Option<&str>,
-    tmp_dir: &mut TmpDirWrapper,
-) -> UResult<()> {
-    let mut copy: Option<PathBuf> = None;
-    if let Some(Ok(output_path)) = output.map(|path| Path::new(path).canonicalize()) {
-        for file in files {
-            if let Ok(file_path) = Path::new(file).canonicalize() {
-                if file_path == output_path {
-                    if let Some(copy) = &copy {
-                        *file = copy.clone().into_os_string();
-                    } else {
-                        let (_file, copy_path) = tmp_dir.next_file()?;
-                        std::fs::copy(file_path, &copy_path)
-                            .map_err(|error| SortError::OpenTmpFileFailed { error })?;
-                        *file = copy_path.clone().into_os_string();
-                        copy = Some(copy_path);
-                    }
-                }
-            }
-        }
-    }
-    Ok(())
-}
-
-/// Merge pre-sorted `Box<dyn Read>`s.
-///
-/// If `settings.merge_batch_size` is greater than the length of `files`, intermediate files will be used.
-/// If `settings.compress_prog` is `Some`, intermediate files will be compressed with it.
-pub fn merge<'a>(
-    files: &mut [OsString],
-    settings: &'a GlobalSettings,
-    output: Option<&str>,
-    tmp_dir: &mut TmpDirWrapper,
-) -> UResult<FileMerger<'a>> {
-    replace_output_file_in_input_files(files, output, tmp_dir)?;
-    if settings.compress_prog.is_none() {
-        merge_with_file_limit::<_, _, WriteablePlainTmpFile>(
-            files
-                .iter()
-                .map(|file| open(file).map(|file| PlainMergeInput { inner: file })),
-            settings,
-            tmp_dir,
-        )
-    } else {
-        merge_with_file_limit::<_, _, WriteableCompressedTmpFile>(
-            files
-                .iter()
-                .map(|file| open(file).map(|file| PlainMergeInput { inner: file })),
-            settings,
-            tmp_dir,
-        )
-    }
-}
-
-// Merge already sorted `MergeInput`s.
-pub fn merge_with_file_limit<
-    'a,
-    M: MergeInput + 'static,
-    F: ExactSizeIterator<Item = UResult<M>>,
-    Tmp: WriteableTmpFile + 'static,
->(
-    files: F,
-    settings: &'a GlobalSettings,
-    tmp_dir: &mut TmpDirWrapper,
-) -> UResult<FileMerger<'a>> {
-    if files.len() > settings.merge_batch_size {
-        let mut remaining_files = files.len();
-        let batches = files.chunks(settings.merge_batch_size);
-        let mut batches = batches.into_iter();
-        let mut temporary_files = vec![];
-        while remaining_files != 0 {
-            // Work around the fact that `Chunks` is not an `ExactSizeIterator`.
-            remaining_files = remaining_files.saturating_sub(settings.merge_batch_size);
-            let merger = merge_without_limit(batches.next().unwrap(), settings)?;
-            let mut tmp_file =
-                Tmp::create(tmp_dir.next_file()?, settings.compress_prog.as_deref())?;
-            merger.write_all_to(settings, tmp_file.as_write())?;
-            temporary_files.push(tmp_file.finished_writing()?);
-        }
-        assert!(batches.next().is_none());
-        merge_with_file_limit::<_, _, Tmp>(
-            temporary_files
-                .into_iter()
-                .map(Box::new(|c: Tmp::Closed| c.reopen())
-                    as Box<
-                        dyn FnMut(Tmp::Closed) -> UResult<<Tmp::Closed as ClosedTmpFile>::Reopened>,
-                    >),
-            settings,
-            tmp_dir,
-        )
-    } else {
-        merge_without_limit(files, settings)
-    }
-}
-
-/// Merge files without limiting how many files are concurrently open.
-///
-/// It is the responsibility of the caller to ensure that `files` yields only
-/// as many files as we are allowed to open concurrently.
-fn merge_without_limit<M: MergeInput + 'static, F: Iterator<Item = UResult<M>>>(
-    files: F,
-    settings: &GlobalSettings,
-) -> UResult<FileMerger> {
-    let (request_sender, request_receiver) = channel();
-    let mut reader_files = Vec::with_capacity(files.size_hint().0);
-    let mut loaded_receivers = Vec::with_capacity(files.size_hint().0);
-    for (file_number, file) in files.enumerate() {
-        let (sender, receiver) = sync_channel(2);
-        loaded_receivers.push(receiver);
-        reader_files.push(Some(ReaderFile {
-            file: file?,
-            sender,
-            carry_over: vec![],
-        }));
-        // Send the initial chunk to trigger a read for each file
-        request_sender
-            .send((file_number, RecycledChunk::new(8 * 1024)))
-            .unwrap();
-    }
-
-    // Send the second chunk for each file
-    for file_number in 0..reader_files.len() {
-        request_sender
-            .send((file_number, RecycledChunk::new(8 * 1024)))
-            .unwrap();
-    }
-
-    let reader_join_handle = thread::spawn({
-        let settings = settings.clone();
-        move || {
-            reader(
-                &request_receiver,
-                &mut reader_files,
-                &settings,
-                settings.line_ending.into(),
-            )
-        }
-    });
-
-    let mut mergeable_files = vec![];
-
-    for (file_number, receiver) in loaded_receivers.into_iter().enumerate() {
-        if let Ok(chunk) = receiver.recv() {
-            mergeable_files.push(MergeableFile {
-                current_chunk: Rc::new(chunk),
-                file_number,
-                line_idx: 0,
-                receiver,
-            });
-        }
-    }
-
-    Ok(FileMerger {
-        heap: binary_heap_plus::BinaryHeap::from_vec_cmp(
-            mergeable_files,
-            FileComparator { settings },
-        ),
-        request_sender,
-        prev: None,
-        reader_join_handle,
-    })
-}
-/// The struct on the reader thread representing an input file
-struct ReaderFile<M: MergeInput> {
-    file: M,
-    sender: SyncSender<Chunk>,
-    carry_over: Vec<u8>,
-}
-
-/// The function running on the reader thread.
-fn reader(
-    recycled_receiver: &Receiver<(usize, RecycledChunk)>,
-    files: &mut [Option<ReaderFile<impl MergeInput>>],
-    settings: &GlobalSettings,
-    separator: u8,
-) -> UResult<()> {
-    for (file_idx, recycled_chunk) in recycled_receiver.iter() {
-        if let Some(ReaderFile {
-            file,
-            sender,
-            carry_over,
-        }) = &mut files[file_idx]
-        {
-            let should_continue = chunks::read(
-                sender,
-                recycled_chunk,
-                None,
-                carry_over,
-                file.as_read(),
-                &mut iter::empty(),
-                separator,
-                settings,
-            )?;
-            if !should_continue {
-                // Remove the file from the list by replacing it with `None`.
-                let ReaderFile { file, .. } = files[file_idx].take().unwrap();
-                // Depending on the kind of the `MergeInput`, this may delete the file:
-                file.finished_reading()?;
-            }
-        }
-    }
-    Ok(())
-}
-/// The struct on the main thread representing an input file
-pub struct MergeableFile {
-    current_chunk: Rc<Chunk>,
-    line_idx: usize,
-    receiver: Receiver<Chunk>,
-    file_number: usize,
-}
-
-/// A struct to keep track of the previous line we encountered.
-///
-/// This is required for deduplication purposes.
-struct PreviousLine {
-    chunk: Rc<Chunk>,
-    line_idx: usize,
-    file_number: usize,
-}
-
-/// Merges files together. This is **not** an iterator because of lifetime problems.
-pub struct FileMerger<'a> {
-    heap: binary_heap_plus::BinaryHeap<MergeableFile, FileComparator<'a>>,
-    request_sender: Sender<(usize, RecycledChunk)>,
-    prev: Option<PreviousLine>,
-    reader_join_handle: JoinHandle<UResult<()>>,
-}
-
-impl<'a> FileMerger<'a> {
-    /// Write the merged contents to the output file.
-    pub fn write_all(self, settings: &GlobalSettings, output: Output) -> UResult<()> {
-        let mut out = output.into_write();
-        self.write_all_to(settings, &mut out)
-    }
-
-    pub fn write_all_to(mut self, settings: &GlobalSettings, out: &mut impl Write) -> UResult<()> {
-        while self.write_next(settings, out) {}
-        drop(self.request_sender);
-        self.reader_join_handle.join().unwrap()
-    }
-
-    fn write_next(&mut self, settings: &GlobalSettings, out: &mut impl Write) -> bool {
-        if let Some(file) = self.heap.peek() {
-            let prev = self.prev.replace(PreviousLine {
-                chunk: file.current_chunk.clone(),
-                line_idx: file.line_idx,
-                file_number: file.file_number,
-            });
-
-            file.current_chunk.with_dependent(|_, contents| {
-                let current_line = &contents.lines[file.line_idx];
-                if settings.unique {
-                    if let Some(prev) = &prev {
-                        let cmp = compare_by(
-                            &prev.chunk.lines()[prev.line_idx],
-                            current_line,
-                            settings,
-                            prev.chunk.line_data(),
-                            file.current_chunk.line_data(),
-                        );
-                        if cmp == Ordering::Equal {
-                            return;
-                        }
-                    }
-                }
-                current_line.print(out, settings);
-            });
-
-            let was_last_line_for_file = file.current_chunk.lines().len() == file.line_idx + 1;
-
-            if was_last_line_for_file {
-                if let Ok(next_chunk) = file.receiver.recv() {
-                    let mut file = self.heap.peek_mut().unwrap();
-                    file.current_chunk = Rc::new(next_chunk);
-                    file.line_idx = 0;
-                } else {
-                    self.heap.pop();
-                }
-            } else {
-                // This will cause the comparison to use a different line and the heap to readjust.
-                self.heap.peek_mut().unwrap().line_idx += 1;
-            }
-
-            if let Some(prev) = prev {
-                if let Ok(prev_chunk) = Rc::try_unwrap(prev.chunk) {
-                    // If nothing is referencing the previous chunk anymore, this means that the previous line
-                    // was the last line of the chunk. We can recycle the chunk.
-                    self.request_sender
-                        .send((prev.file_number, prev_chunk.recycle()))
-                        .ok();
-                }
-            }
-        }
-        !self.heap.is_empty()
-    }
-}
-
-/// Compares files by their current line.
-struct FileComparator<'a> {
-    settings: &'a GlobalSettings,
-}
-
-impl<'a> Compare<MergeableFile> for FileComparator<'a> {
-    fn compare(&self, a: &MergeableFile, b: &MergeableFile) -> Ordering {
-        let mut cmp = compare_by(
-            &a.current_chunk.lines()[a.line_idx],
-            &b.current_chunk.lines()[b.line_idx],
-            self.settings,
-            a.current_chunk.line_data(),
-            b.current_chunk.line_data(),
-        );
-        if cmp == Ordering::Equal {
-            // To make sorting stable, we need to consider the file number as well,
-            // as lines from a file with a lower number are to be considered "earlier".
-            cmp = a.file_number.cmp(&b.file_number);
-        }
-        // BinaryHeap is a max heap. We use it as a min heap, so we need to reverse the ordering.
-        cmp.reverse()
-    }
-}
-
-// Wait for the child to exit and check its exit code.
-fn check_child_success(mut child: Child, program: &str) -> UResult<()> {
-    if matches!(
-        child.wait().map(|e| e.code()),
-        Ok(Some(0)) | Ok(None) | Err(_)
-    ) {
-        Ok(())
-    } else {
-        Err(SortError::CompressProgTerminatedAbnormally {
-            prog: program.to_owned(),
-        }
-        .into())
-    }
-}
-
-/// A temporary file that can be written to.
-pub trait WriteableTmpFile: Sized {
-    type Closed: ClosedTmpFile;
-    type InnerWrite: Write;
-    fn create(file: (File, PathBuf), compress_prog: Option<&str>) -> UResult<Self>;
-    /// Closes the temporary file.
-    fn finished_writing(self) -> UResult<Self::Closed>;
-    fn as_write(&mut self) -> &mut Self::InnerWrite;
-}
-/// A temporary file that is (temporarily) closed, but can be reopened.
-pub trait ClosedTmpFile {
-    type Reopened: MergeInput;
-    /// Reopens the temporary file.
-    fn reopen(self) -> UResult<Self::Reopened>;
-}
-/// A pre-sorted input for merging.
-pub trait MergeInput: Send {
-    type InnerRead: Read;
-    /// Cleans this `MergeInput` up.
-    /// Implementations may delete the backing file.
-    fn finished_reading(self) -> UResult<()>;
-    fn as_read(&mut self) -> &mut Self::InnerRead;
-}
-
-pub struct WriteablePlainTmpFile {
-    path: PathBuf,
-    file: BufWriter<File>,
-}
-pub struct ClosedPlainTmpFile {
-    path: PathBuf,
-}
-pub struct PlainTmpMergeInput {
-    path: PathBuf,
-    file: File,
-}
-impl WriteableTmpFile for WriteablePlainTmpFile {
-    type Closed = ClosedPlainTmpFile;
-    type InnerWrite = BufWriter<File>;
-
-    fn create((file, path): (File, PathBuf), _: Option<&str>) -> UResult<Self> {
-        Ok(Self {
-            file: BufWriter::new(file),
-            path,
-        })
-    }
-
-    fn finished_writing(self) -> UResult<Self::Closed> {
-        Ok(ClosedPlainTmpFile { path: self.path })
-    }
-
-    fn as_write(&mut self) -> &mut Self::InnerWrite {
-        &mut self.file
-    }
-}
-impl ClosedTmpFile for ClosedPlainTmpFile {
-    type Reopened = PlainTmpMergeInput;
-    fn reopen(self) -> UResult<Self::Reopened> {
-        Ok(PlainTmpMergeInput {
-            file: File::open(&self.path).map_err(|error| SortError::OpenTmpFileFailed { error })?,
-            path: self.path,
-        })
-    }
-}
-impl MergeInput for PlainTmpMergeInput {
-    type InnerRead = File;
-
-    fn finished_reading(self) -> UResult<()> {
-        // we ignore failures to delete the temporary file,
-        // because there is a race at the end of the execution and the whole
-        // temporary directory might already be gone.
-        let _ = fs::remove_file(self.path);
-        Ok(())
-    }
-
-    fn as_read(&mut self) -> &mut Self::InnerRead {
-        &mut self.file
-    }
-}
-
-pub struct WriteableCompressedTmpFile {
-    path: PathBuf,
-    compress_prog: String,
-    child: Child,
-    child_stdin: BufWriter<ChildStdin>,
-}
-pub struct ClosedCompressedTmpFile {
-    path: PathBuf,
-    compress_prog: String,
-}
-pub struct CompressedTmpMergeInput {
-    path: PathBuf,
-    compress_prog: String,
-    child: Child,
-    child_stdout: ChildStdout,
-}
-impl WriteableTmpFile for WriteableCompressedTmpFile {
-    type Closed = ClosedCompressedTmpFile;
-    type InnerWrite = BufWriter<ChildStdin>;
-
-    fn create((file, path): (File, PathBuf), compress_prog: Option<&str>) -> UResult<Self> {
-        let compress_prog = compress_prog.unwrap();
-        let mut command = Command::new(compress_prog);
-        command.stdin(Stdio::piped()).stdout(file);
-        let mut child = command
-            .spawn()
-            .map_err(|err| SortError::CompressProgExecutionFailed {
-                code: err.raw_os_error().unwrap(),
-            })?;
-        let child_stdin = child.stdin.take().unwrap();
-        Ok(Self {
-            path,
-            compress_prog: compress_prog.to_owned(),
-            child,
-            child_stdin: BufWriter::new(child_stdin),
-        })
-    }
-
-    fn finished_writing(self) -> UResult<Self::Closed> {
-        drop(self.child_stdin);
-        check_child_success(self.child, &self.compress_prog)?;
-        Ok(ClosedCompressedTmpFile {
-            path: self.path,
-            compress_prog: self.compress_prog,
-        })
-    }
-
-    fn as_write(&mut self) -> &mut Self::InnerWrite {
-        &mut self.child_stdin
-    }
-}
-impl ClosedTmpFile for ClosedCompressedTmpFile {
-    type Reopened = CompressedTmpMergeInput;
-
-    fn reopen(self) -> UResult<Self::Reopened> {
-        let mut command = Command::new(&self.compress_prog);
-        let file = File::open(&self.path).unwrap();
-        command.stdin(file).stdout(Stdio::piped()).arg("-d");
-        let mut child = command
-            .spawn()
-            .map_err(|err| SortError::CompressProgExecutionFailed {
-                code: err.raw_os_error().unwrap(),
-            })?;
-        let child_stdout = child.stdout.take().unwrap();
-        Ok(CompressedTmpMergeInput {
-            path: self.path,
-            compress_prog: self.compress_prog,
-            child,
-            child_stdout,
-        })
-    }
-}
-impl MergeInput for CompressedTmpMergeInput {
-    type InnerRead = ChildStdout;
-
-    fn finished_reading(self) -> UResult<()> {
-        drop(self.child_stdout);
-        check_child_success(self.child, &self.compress_prog)?;
-        let _ = fs::remove_file(self.path);
-        Ok(())
-    }
-
-    fn as_read(&mut self) -> &mut Self::InnerRead {
-        &mut self.child_stdout
-    }
-}
-
-pub struct PlainMergeInput<R: Read + Send> {
-    inner: R,
-}
-impl<R: Read + Send> MergeInput for PlainMergeInput<R> {
-    type InnerRead = R;
-    fn finished_reading(self) -> UResult<()> {
-        Ok(())
-    }
-    fn as_read(&mut self) -> &mut Self::InnerRead {
-        &mut self.inner
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sort/numeric_str_cmp.rs.html b/coreutils/dev/src/uu_sort/numeric_str_cmp.rs.html deleted file mode 100644 index 54549d373..000000000 --- a/coreutils/dev/src/uu_sort/numeric_str_cmp.rs.html +++ /dev/null @@ -1,1009 +0,0 @@ -numeric_str_cmp.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Michael Debertol <michael.debertol..AT..gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-//! Fast comparison for strings representing a base 10 number without precision loss.
-//!
-//! To be able to short-circuit when comparing, [NumInfo] must be passed along with each number
-//! to [numeric_str_cmp]. [NumInfo] is generally obtained by calling [NumInfo::parse] and should be cached.
-//! It is allowed to arbitrarily modify the exponent afterwards, which is equivalent to shifting the decimal point.
-//!
-//! More specifically, exponent can be understood so that the original number is in (1..10)*10^exponent.
-//! From that follows the constraints of this algorithm: It is able to compare numbers in ±(1*10^[i64::MIN]..10*10^[i64::MAX]).
-
-use std::{cmp::Ordering, ops::Range};
-
-#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
-enum Sign {
-    Negative,
-    Positive,
-}
-
-#[derive(Debug, PartialEq, Eq, Clone)]
-pub struct NumInfo {
-    exponent: i64,
-    sign: Sign,
-}
-#[derive(Debug, PartialEq, Eq, Clone)]
-pub struct NumInfoParseSettings {
-    pub accept_si_units: bool,
-    pub thousands_separator: Option<char>,
-    pub decimal_pt: Option<char>,
-}
-
-impl Default for NumInfoParseSettings {
-    fn default() -> Self {
-        Self {
-            accept_si_units: false,
-            thousands_separator: None,
-            decimal_pt: Some('.'),
-        }
-    }
-}
-
-impl NumInfo {
-    /// Parse NumInfo for this number.
-    /// Also returns the range of num that should be passed to numeric_str_cmp later.
-    ///
-    /// Leading zeros will be excluded from the returned range. If the number consists of only zeros,
-    /// an empty range (idx..idx) is returned so that idx is the char after the last zero.
-    /// If the input is not a number (which has to be treated as zero), the returned empty range
-    /// will be 0..0.
-    #[allow(clippy::cognitive_complexity)]
-    pub fn parse(num: &str, parse_settings: &NumInfoParseSettings) -> (Self, Range<usize>) {
-        let mut exponent = -1;
-        let mut had_decimal_pt = false;
-        let mut had_digit = false;
-        let mut start = None;
-        let mut sign = Sign::Positive;
-
-        let mut first_char = true;
-
-        for (idx, char) in num.char_indices() {
-            if first_char && char.is_whitespace() {
-                continue;
-            }
-
-            if first_char && char == '-' {
-                sign = Sign::Negative;
-                first_char = false;
-                continue;
-            }
-            first_char = false;
-
-            if matches!(
-                parse_settings.thousands_separator,
-                Some(c) if c == char
-            ) {
-                continue;
-            }
-
-            if Self::is_invalid_char(char, &mut had_decimal_pt, parse_settings) {
-                return if let Some(start) = start {
-                    let has_si_unit = parse_settings.accept_si_units
-                        && matches!(char, 'K' | 'k' | 'M' | 'G' | 'T' | 'P' | 'E' | 'Z' | 'Y');
-                    (
-                        Self { exponent, sign },
-                        start..if has_si_unit { idx + 1 } else { idx },
-                    )
-                } else {
-                    (
-                        Self {
-                            sign: Sign::Positive,
-                            exponent: 0,
-                        },
-                        if had_digit {
-                            // In this case there were only zeroes.
-                            // For debug output to work properly, we have to match the character after the last zero.
-                            idx..idx
-                        } else {
-                            // This was no number at all.
-                            // For debug output to work properly, we have to match 0..0.
-                            0..0
-                        },
-                    )
-                };
-            }
-            if Some(char) == parse_settings.decimal_pt {
-                continue;
-            }
-            had_digit = true;
-            if start.is_none() && char == '0' {
-                if had_decimal_pt {
-                    // We're parsing a number whose first nonzero digit is after the decimal point.
-                    exponent -= 1;
-                } else {
-                    // Skip leading zeroes
-                    continue;
-                }
-            }
-            if !had_decimal_pt {
-                exponent += 1;
-            }
-            if start.is_none() && char != '0' {
-                start = Some(idx);
-            }
-        }
-        if let Some(start) = start {
-            (Self { exponent, sign }, start..num.len())
-        } else {
-            (
-                Self {
-                    sign: Sign::Positive,
-                    exponent: 0,
-                },
-                if had_digit {
-                    // In this case there were only zeroes.
-                    // For debug output to work properly, we have to claim to match the end of the number.
-                    num.len()..num.len()
-                } else {
-                    // This was no number at all.
-                    // For debug output to work properly, we have to claim to match the start of the number.
-                    0..0
-                },
-            )
-        }
-    }
-
-    fn is_invalid_char(
-        c: char,
-        had_decimal_pt: &mut bool,
-        parse_settings: &NumInfoParseSettings,
-    ) -> bool {
-        if Some(c) == parse_settings.decimal_pt {
-            if *had_decimal_pt {
-                // this is a decimal pt but we already had one, so it is invalid
-                true
-            } else {
-                *had_decimal_pt = true;
-                false
-            }
-        } else {
-            !c.is_ascii_digit()
-        }
-    }
-}
-
-fn get_unit(unit: Option<char>) -> u8 {
-    if let Some(unit) = unit {
-        match unit {
-            'K' | 'k' => 1,
-            'M' => 2,
-            'G' => 3,
-            'T' => 4,
-            'P' => 5,
-            'E' => 6,
-            'Z' => 7,
-            'Y' => 8,
-            _ => 0,
-        }
-    } else {
-        0
-    }
-}
-
-/// Compare two numbers according to the rules of human numeric comparison.
-/// The SI-Unit takes precedence over the actual value (i.e. 2000M < 1G).
-pub fn human_numeric_str_cmp(
-    (a, a_info): (&str, &NumInfo),
-    (b, b_info): (&str, &NumInfo),
-) -> Ordering {
-    // 1. Sign
-    if a_info.sign != b_info.sign {
-        return a_info.sign.cmp(&b_info.sign);
-    }
-    // 2. Unit
-    let a_unit = get_unit(a.chars().next_back());
-    let b_unit = get_unit(b.chars().next_back());
-    let ordering = a_unit.cmp(&b_unit);
-    if ordering == Ordering::Equal {
-        // 3. Number
-        numeric_str_cmp((a, a_info), (b, b_info))
-    } else if a_info.sign == Sign::Negative {
-        ordering.reverse()
-    } else {
-        ordering
-    }
-}
-
-/// Compare two numbers as strings without parsing them as a number first. This should be more performant and can handle numbers more precisely.
-/// NumInfo is needed to provide a fast path for most numbers.
-#[inline(always)]
-pub fn numeric_str_cmp((a, a_info): (&str, &NumInfo), (b, b_info): (&str, &NumInfo)) -> Ordering {
-    // check for a difference in the sign
-    if a_info.sign != b_info.sign {
-        return a_info.sign.cmp(&b_info.sign);
-    }
-
-    // check for a difference in the exponent
-    let ordering = if a_info.exponent != b_info.exponent && !a.is_empty() && !b.is_empty() {
-        a_info.exponent.cmp(&b_info.exponent)
-    } else {
-        // walk the characters from the front until we find a difference
-        let mut a_chars = a.chars().filter(|c| c.is_ascii_digit());
-        let mut b_chars = b.chars().filter(|c| c.is_ascii_digit());
-        loop {
-            let a_next = a_chars.next();
-            let b_next = b_chars.next();
-            match (a_next, b_next) {
-                (None, None) => break Ordering::Equal,
-                (Some(c), None) => {
-                    break if c == '0' && a_chars.all(|c| c == '0') {
-                        Ordering::Equal
-                    } else {
-                        Ordering::Greater
-                    }
-                }
-                (None, Some(c)) => {
-                    break if c == '0' && b_chars.all(|c| c == '0') {
-                        Ordering::Equal
-                    } else {
-                        Ordering::Less
-                    }
-                }
-                (Some(a_char), Some(b_char)) => {
-                    let ord = a_char.cmp(&b_char);
-                    if ord != Ordering::Equal {
-                        break ord;
-                    }
-                }
-            }
-        }
-    };
-
-    if a_info.sign == Sign::Negative {
-        ordering.reverse()
-    } else {
-        ordering
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    fn parses_exp() {
-        let n = "1";
-        assert_eq!(
-            NumInfo::parse(n, &NumInfoParseSettings::default()),
-            (
-                NumInfo {
-                    exponent: 0,
-                    sign: Sign::Positive
-                },
-                0..1
-            )
-        );
-        let n = "100";
-        assert_eq!(
-            NumInfo::parse(n, &NumInfoParseSettings::default()),
-            (
-                NumInfo {
-                    exponent: 2,
-                    sign: Sign::Positive
-                },
-                0..3
-            )
-        );
-        let n = "1,000";
-        assert_eq!(
-            NumInfo::parse(
-                n,
-                &NumInfoParseSettings {
-                    thousands_separator: Some(','),
-                    ..Default::default()
-                }
-            ),
-            (
-                NumInfo {
-                    exponent: 3,
-                    sign: Sign::Positive
-                },
-                0..5
-            )
-        );
-        let n = "1,000";
-        assert_eq!(
-            NumInfo::parse(n, &NumInfoParseSettings::default()),
-            (
-                NumInfo {
-                    exponent: 0,
-                    sign: Sign::Positive
-                },
-                0..1
-            )
-        );
-        let n = "1000.00";
-        assert_eq!(
-            NumInfo::parse(n, &NumInfoParseSettings::default()),
-            (
-                NumInfo {
-                    exponent: 3,
-                    sign: Sign::Positive
-                },
-                0..7
-            )
-        );
-    }
-    #[test]
-    fn parses_negative_exp() {
-        let n = "0.00005";
-        assert_eq!(
-            NumInfo::parse(n, &NumInfoParseSettings::default()),
-            (
-                NumInfo {
-                    exponent: -5,
-                    sign: Sign::Positive
-                },
-                6..7
-            )
-        );
-        let n = "00000.00005";
-        assert_eq!(
-            NumInfo::parse(n, &NumInfoParseSettings::default()),
-            (
-                NumInfo {
-                    exponent: -5,
-                    sign: Sign::Positive
-                },
-                10..11
-            )
-        );
-    }
-
-    #[test]
-    fn parses_sign() {
-        let n = "5";
-        assert_eq!(
-            NumInfo::parse(n, &NumInfoParseSettings::default()),
-            (
-                NumInfo {
-                    exponent: 0,
-                    sign: Sign::Positive
-                },
-                0..1
-            )
-        );
-        let n = "-5";
-        assert_eq!(
-            NumInfo::parse(n, &NumInfoParseSettings::default()),
-            (
-                NumInfo {
-                    exponent: 0,
-                    sign: Sign::Negative
-                },
-                1..2
-            )
-        );
-        let n = "    -5";
-        assert_eq!(
-            NumInfo::parse(n, &NumInfoParseSettings::default()),
-            (
-                NumInfo {
-                    exponent: 0,
-                    sign: Sign::Negative
-                },
-                5..6
-            )
-        );
-    }
-
-    fn test_helper(a: &str, b: &str, expected: Ordering) {
-        let (a_info, a_range) = NumInfo::parse(a, &NumInfoParseSettings::default());
-        let (b_info, b_range) = NumInfo::parse(b, &NumInfoParseSettings::default());
-        let ordering = numeric_str_cmp(
-            (&a[a_range.to_owned()], &a_info),
-            (&b[b_range.to_owned()], &b_info),
-        );
-        assert_eq!(ordering, expected);
-        let ordering = numeric_str_cmp((&b[b_range], &b_info), (&a[a_range], &a_info));
-        assert_eq!(ordering, expected.reverse());
-    }
-    #[test]
-    fn test_single_digit() {
-        test_helper("1", "2", Ordering::Less);
-        test_helper("0", "0", Ordering::Equal);
-    }
-    #[test]
-    fn test_minus() {
-        test_helper("-1", "-2", Ordering::Greater);
-        test_helper("-0", "-0", Ordering::Equal);
-    }
-    #[test]
-    fn test_different_len() {
-        test_helper("-20", "-100", Ordering::Greater);
-        test_helper("10.0", "2.000000", Ordering::Greater);
-    }
-    #[test]
-    fn test_decimal_digits() {
-        test_helper("20.1", "20.2", Ordering::Less);
-        test_helper("20.1", "20.15", Ordering::Less);
-        test_helper("-20.1", "+20.15", Ordering::Less);
-        test_helper("-20.1", "-20", Ordering::Less);
-    }
-    #[test]
-    fn test_trailing_zeroes() {
-        test_helper("20.00000", "20.1", Ordering::Less);
-        test_helper("20.00000", "20.0", Ordering::Equal);
-    }
-    #[test]
-    fn test_invalid_digits() {
-        test_helper("foo", "bar", Ordering::Equal);
-        test_helper("20.1", "a", Ordering::Greater);
-        test_helper("-20.1", "a", Ordering::Less);
-        test_helper("a", "0.15", Ordering::Less);
-    }
-    #[test]
-    fn test_multiple_decimal_pts() {
-        test_helper("10.0.0", "50.0.0", Ordering::Less);
-        test_helper("0.1.", "0.2.0", Ordering::Less);
-        test_helper("1.1.", "0", Ordering::Greater);
-        test_helper("1.1.", "-0", Ordering::Greater);
-    }
-    #[test]
-    fn test_leading_decimal_pts() {
-        test_helper(".0", ".0", Ordering::Equal);
-        test_helper(".1", ".0", Ordering::Greater);
-        test_helper(".02", "0", Ordering::Greater);
-    }
-    #[test]
-    fn test_leading_zeroes() {
-        test_helper("000000.0", ".0", Ordering::Equal);
-        test_helper("0.1", "0000000000000.0", Ordering::Greater);
-        test_helper("-01", "-2", Ordering::Greater);
-    }
-
-    #[test]
-    fn minus_zero() {
-        // This matches GNU sort behavior.
-        test_helper("-0", "0", Ordering::Equal);
-        test_helper("-0x", "0", Ordering::Equal);
-    }
-    #[test]
-    fn double_minus() {
-        test_helper("--1", "0", Ordering::Equal);
-    }
-    #[test]
-    fn single_minus() {
-        let info = NumInfo::parse("-", &NumInfoParseSettings::default());
-        assert_eq!(
-            info,
-            (
-                NumInfo {
-                    exponent: 0,
-                    sign: Sign::Positive
-                },
-                0..0
-            )
-        );
-    }
-    #[test]
-    fn invalid_with_unit() {
-        let info = NumInfo::parse(
-            "-K",
-            &NumInfoParseSettings {
-                accept_si_units: true,
-                ..Default::default()
-            },
-        );
-        assert_eq!(
-            info,
-            (
-                NumInfo {
-                    exponent: 0,
-                    sign: Sign::Positive
-                },
-                0..0
-            )
-        );
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sort/sort.rs.html b/coreutils/dev/src/uu_sort/sort.rs.html deleted file mode 100644 index c632c530e..000000000 --- a/coreutils/dev/src/uu_sort/sort.rs.html +++ /dev/null @@ -1,4001 +0,0 @@ -sort.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
-1143
-1144
-1145
-1146
-1147
-1148
-1149
-1150
-1151
-1152
-1153
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162
-1163
-1164
-1165
-1166
-1167
-1168
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179
-1180
-1181
-1182
-1183
-1184
-1185
-1186
-1187
-1188
-1189
-1190
-1191
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200
-1201
-1202
-1203
-1204
-1205
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214
-1215
-1216
-1217
-1218
-1219
-1220
-1221
-1222
-1223
-1224
-1225
-1226
-1227
-1228
-1229
-1230
-1231
-1232
-1233
-1234
-1235
-1236
-1237
-1238
-1239
-1240
-1241
-1242
-1243
-1244
-1245
-1246
-1247
-1248
-1249
-1250
-1251
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-1265
-1266
-1267
-1268
-1269
-1270
-1271
-1272
-1273
-1274
-1275
-1276
-1277
-1278
-1279
-1280
-1281
-1282
-1283
-1284
-1285
-1286
-1287
-1288
-1289
-1290
-1291
-1292
-1293
-1294
-1295
-1296
-1297
-1298
-1299
-1300
-1301
-1302
-1303
-1304
-1305
-1306
-1307
-1308
-1309
-1310
-1311
-1312
-1313
-1314
-1315
-1316
-1317
-1318
-1319
-1320
-1321
-1322
-1323
-1324
-1325
-1326
-1327
-1328
-1329
-1330
-1331
-1332
-1333
-1334
-1335
-1336
-1337
-1338
-1339
-1340
-1341
-1342
-1343
-1344
-1345
-1346
-1347
-1348
-1349
-1350
-1351
-1352
-1353
-1354
-1355
-1356
-1357
-1358
-1359
-1360
-1361
-1362
-1363
-1364
-1365
-1366
-1367
-1368
-1369
-1370
-1371
-1372
-1373
-1374
-1375
-1376
-1377
-1378
-1379
-1380
-1381
-1382
-1383
-1384
-1385
-1386
-1387
-1388
-1389
-1390
-1391
-1392
-1393
-1394
-1395
-1396
-1397
-1398
-1399
-1400
-1401
-1402
-1403
-1404
-1405
-1406
-1407
-1408
-1409
-1410
-1411
-1412
-1413
-1414
-1415
-1416
-1417
-1418
-1419
-1420
-1421
-1422
-1423
-1424
-1425
-1426
-1427
-1428
-1429
-1430
-1431
-1432
-1433
-1434
-1435
-1436
-1437
-1438
-1439
-1440
-1441
-1442
-1443
-1444
-1445
-1446
-1447
-1448
-1449
-1450
-1451
-1452
-1453
-1454
-1455
-1456
-1457
-1458
-1459
-1460
-1461
-1462
-1463
-1464
-1465
-1466
-1467
-1468
-1469
-1470
-1471
-1472
-1473
-1474
-1475
-1476
-1477
-1478
-1479
-1480
-1481
-1482
-1483
-1484
-1485
-1486
-1487
-1488
-1489
-1490
-1491
-1492
-1493
-1494
-1495
-1496
-1497
-1498
-1499
-1500
-1501
-1502
-1503
-1504
-1505
-1506
-1507
-1508
-1509
-1510
-1511
-1512
-1513
-1514
-1515
-1516
-1517
-1518
-1519
-1520
-1521
-1522
-1523
-1524
-1525
-1526
-1527
-1528
-1529
-1530
-1531
-1532
-1533
-1534
-1535
-1536
-1537
-1538
-1539
-1540
-1541
-1542
-1543
-1544
-1545
-1546
-1547
-1548
-1549
-1550
-1551
-1552
-1553
-1554
-1555
-1556
-1557
-1558
-1559
-1560
-1561
-1562
-1563
-1564
-1565
-1566
-1567
-1568
-1569
-1570
-1571
-1572
-1573
-1574
-1575
-1576
-1577
-1578
-1579
-1580
-1581
-1582
-1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590
-1591
-1592
-1593
-1594
-1595
-1596
-1597
-1598
-1599
-1600
-1601
-1602
-1603
-1604
-1605
-1606
-1607
-1608
-1609
-1610
-1611
-1612
-1613
-1614
-1615
-1616
-1617
-1618
-1619
-1620
-1621
-1622
-1623
-1624
-1625
-1626
-1627
-1628
-1629
-1630
-1631
-1632
-1633
-1634
-1635
-1636
-1637
-1638
-1639
-1640
-1641
-1642
-1643
-1644
-1645
-1646
-1647
-1648
-1649
-1650
-1651
-1652
-1653
-1654
-1655
-1656
-1657
-1658
-1659
-1660
-1661
-1662
-1663
-1664
-1665
-1666
-1667
-1668
-1669
-1670
-1671
-1672
-1673
-1674
-1675
-1676
-1677
-1678
-1679
-1680
-1681
-1682
-1683
-1684
-1685
-1686
-1687
-1688
-1689
-1690
-1691
-1692
-1693
-1694
-1695
-1696
-1697
-1698
-1699
-1700
-1701
-1702
-1703
-1704
-1705
-1706
-1707
-1708
-1709
-1710
-1711
-1712
-1713
-1714
-1715
-1716
-1717
-1718
-1719
-1720
-1721
-1722
-1723
-1724
-1725
-1726
-1727
-1728
-1729
-1730
-1731
-1732
-1733
-1734
-1735
-1736
-1737
-1738
-1739
-1740
-1741
-1742
-1743
-1744
-1745
-1746
-1747
-1748
-1749
-1750
-1751
-1752
-1753
-1754
-1755
-1756
-1757
-1758
-1759
-1760
-1761
-1762
-1763
-1764
-1765
-1766
-1767
-1768
-1769
-1770
-1771
-1772
-1773
-1774
-1775
-1776
-1777
-1778
-1779
-1780
-1781
-1782
-1783
-1784
-1785
-1786
-1787
-1788
-1789
-1790
-1791
-1792
-1793
-1794
-1795
-1796
-1797
-1798
-1799
-1800
-1801
-1802
-1803
-1804
-1805
-1806
-1807
-1808
-1809
-1810
-1811
-1812
-1813
-1814
-1815
-1816
-1817
-1818
-1819
-1820
-1821
-1822
-1823
-1824
-1825
-1826
-1827
-1828
-1829
-1830
-1831
-1832
-1833
-1834
-1835
-1836
-1837
-1838
-1839
-1840
-1841
-1842
-1843
-1844
-1845
-1846
-1847
-1848
-1849
-1850
-1851
-1852
-1853
-1854
-1855
-1856
-1857
-1858
-1859
-1860
-1861
-1862
-1863
-1864
-1865
-1866
-1867
-1868
-1869
-1870
-1871
-1872
-1873
-1874
-1875
-1876
-1877
-1878
-1879
-1880
-1881
-1882
-1883
-1884
-1885
-1886
-1887
-1888
-1889
-1890
-1891
-1892
-1893
-1894
-1895
-1896
-1897
-1898
-1899
-1900
-1901
-1902
-1903
-1904
-1905
-1906
-1907
-1908
-1909
-1910
-1911
-1912
-1913
-1914
-1915
-1916
-1917
-1918
-1919
-1920
-1921
-1922
-1923
-1924
-1925
-1926
-1927
-1928
-1929
-1930
-1931
-1932
-1933
-1934
-1935
-1936
-1937
-1938
-1939
-1940
-1941
-1942
-1943
-1944
-1945
-1946
-1947
-1948
-1949
-1950
-1951
-1952
-1953
-1954
-1955
-1956
-1957
-1958
-1959
-1960
-1961
-1962
-1963
-1964
-1965
-1966
-1967
-1968
-1969
-1970
-1971
-1972
-1973
-1974
-1975
-1976
-1977
-1978
-1979
-1980
-1981
-1982
-1983
-1984
-1985
-1986
-1987
-1988
-1989
-1990
-1991
-1992
-1993
-1994
-1995
-1996
-1997
-1998
-1999
-2000
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Michael Yin <mikeyin@mikeyin.org>
-//  * (c) Robert Swinford <robert.swinford..AT..gmail.com>
-//  * (c) Michael Debertol <michael.debertol..AT..gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// Although these links don't always seem to describe reality, check out the POSIX and GNU specs:
-// https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sort.html
-// https://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html
-
-// spell-checker:ignore (misc) HFKJFK Mbdfhn
-
-mod check;
-mod chunks;
-mod custom_str_cmp;
-mod ext_sort;
-mod merge;
-mod numeric_str_cmp;
-mod tmp_dir;
-
-use chunks::LineData;
-use clap::builder::ValueParser;
-use clap::{crate_version, Arg, ArgAction, Command};
-use custom_str_cmp::custom_str_cmp;
-use ext_sort::ext_sort;
-use fnv::FnvHasher;
-use numeric_str_cmp::{human_numeric_str_cmp, numeric_str_cmp, NumInfo, NumInfoParseSettings};
-use rand::{thread_rng, Rng};
-use rayon::prelude::*;
-use std::cmp::Ordering;
-use std::env;
-use std::error::Error;
-use std::ffi::{OsStr, OsString};
-use std::fmt::Display;
-use std::fs::{File, OpenOptions};
-use std::hash::{Hash, Hasher};
-use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write};
-use std::ops::Range;
-use std::path::Path;
-use std::path::PathBuf;
-use std::str::Utf8Error;
-use unicode_width::UnicodeWidthStr;
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, strip_errno, UError, UResult, USimpleError, UUsageError};
-use uucore::line_ending::LineEnding;
-use uucore::parse_size::{ParseSizeError, Parser};
-use uucore::version_cmp::version_cmp;
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-use crate::tmp_dir::TmpDirWrapper;
-
-const ABOUT: &str = help_about!("sort.md");
-const USAGE: &str = help_usage!("sort.md");
-const AFTER_HELP: &str = help_section!("after help", "sort.md");
-
-mod options {
-    pub mod modes {
-        pub const SORT: &str = "sort";
-
-        pub const HUMAN_NUMERIC: &str = "human-numeric-sort";
-        pub const MONTH: &str = "month-sort";
-        pub const NUMERIC: &str = "numeric-sort";
-        pub const GENERAL_NUMERIC: &str = "general-numeric-sort";
-        pub const VERSION: &str = "version-sort";
-        pub const RANDOM: &str = "random-sort";
-
-        pub const ALL_SORT_MODES: [&str; 6] = [
-            GENERAL_NUMERIC,
-            HUMAN_NUMERIC,
-            MONTH,
-            NUMERIC,
-            VERSION,
-            RANDOM,
-        ];
-    }
-
-    pub mod check {
-        pub const CHECK: &str = "check";
-        pub const CHECK_SILENT: &str = "check-silent";
-        pub const SILENT: &str = "silent";
-        pub const QUIET: &str = "quiet";
-        pub const DIAGNOSE_FIRST: &str = "diagnose-first";
-    }
-
-    pub const HELP: &str = "help";
-    pub const VERSION: &str = "version";
-    pub const DICTIONARY_ORDER: &str = "dictionary-order";
-    pub const MERGE: &str = "merge";
-    pub const DEBUG: &str = "debug";
-    pub const IGNORE_CASE: &str = "ignore-case";
-    pub const IGNORE_LEADING_BLANKS: &str = "ignore-leading-blanks";
-    pub const IGNORE_NONPRINTING: &str = "ignore-nonprinting";
-    pub const OUTPUT: &str = "output";
-    pub const REVERSE: &str = "reverse";
-    pub const STABLE: &str = "stable";
-    pub const UNIQUE: &str = "unique";
-    pub const KEY: &str = "key";
-    pub const SEPARATOR: &str = "field-separator";
-    pub const ZERO_TERMINATED: &str = "zero-terminated";
-    pub const PARALLEL: &str = "parallel";
-    pub const FILES0_FROM: &str = "files0-from";
-    pub const BUF_SIZE: &str = "buffer-size";
-    pub const TMP_DIR: &str = "temporary-directory";
-    pub const COMPRESS_PROG: &str = "compress-program";
-    pub const BATCH_SIZE: &str = "batch-size";
-
-    pub const FILES: &str = "files";
-}
-
-const DECIMAL_PT: char = '.';
-
-const NEGATIVE: char = '-';
-const POSITIVE: char = '+';
-
-// Choosing a higher buffer size does not result in performance improvements
-// (at least not on my machine). TODO: In the future, we should also take the amount of
-// available memory into consideration, instead of relying on this constant only.
-const DEFAULT_BUF_SIZE: usize = 1_000_000_000; // 1 GB
-
-#[derive(Debug)]
-enum SortError {
-    Disorder {
-        file: OsString,
-        line_number: usize,
-        line: String,
-        silent: bool,
-    },
-    OpenFailed {
-        path: String,
-        error: std::io::Error,
-    },
-    ReadFailed {
-        path: PathBuf,
-        error: std::io::Error,
-    },
-    ParseKeyError {
-        key: String,
-        msg: String,
-    },
-    OpenTmpFileFailed {
-        error: std::io::Error,
-    },
-    CompressProgExecutionFailed {
-        code: i32,
-    },
-    CompressProgTerminatedAbnormally {
-        prog: String,
-    },
-    TmpDirCreationFailed,
-    Uft8Error {
-        error: Utf8Error,
-    },
-}
-
-impl Error for SortError {}
-
-impl UError for SortError {
-    fn code(&self) -> i32 {
-        match self {
-            Self::Disorder { .. } => 1,
-            _ => 2,
-        }
-    }
-}
-
-impl Display for SortError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::Disorder {
-                file,
-                line_number,
-                line,
-                silent,
-            } => {
-                if *silent {
-                    Ok(())
-                } else {
-                    write!(
-                        f,
-                        "{}:{}: disorder: {}",
-                        file.maybe_quote(),
-                        line_number,
-                        line
-                    )
-                }
-            }
-            Self::OpenFailed { path, error } => {
-                write!(
-                    f,
-                    "open failed: {}: {}",
-                    path.maybe_quote(),
-                    strip_errno(error)
-                )
-            }
-            Self::ParseKeyError { key, msg } => {
-                write!(f, "failed to parse key {}: {}", key.quote(), msg)
-            }
-            Self::ReadFailed { path, error } => {
-                write!(
-                    f,
-                    "cannot read: {}: {}",
-                    path.maybe_quote(),
-                    strip_errno(error)
-                )
-            }
-            Self::OpenTmpFileFailed { error } => {
-                write!(f, "failed to open temporary file: {}", strip_errno(error))
-            }
-            Self::CompressProgExecutionFailed { code } => {
-                write!(f, "couldn't execute compress program: errno {code}")
-            }
-            Self::CompressProgTerminatedAbnormally { prog } => {
-                write!(f, "{} terminated abnormally", prog.quote())
-            }
-            Self::TmpDirCreationFailed => write!(f, "could not create temporary directory"),
-            Self::Uft8Error { error } => write!(f, "{error}"),
-        }
-    }
-}
-
-#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Copy, Debug)]
-enum SortMode {
-    Numeric,
-    HumanNumeric,
-    GeneralNumeric,
-    Month,
-    Version,
-    Random,
-    Default,
-}
-
-impl SortMode {
-    fn get_short_name(&self) -> Option<char> {
-        match self {
-            Self::Numeric => Some('n'),
-            Self::HumanNumeric => Some('h'),
-            Self::GeneralNumeric => Some('g'),
-            Self::Month => Some('M'),
-            Self::Version => Some('V'),
-            Self::Random => Some('R'),
-            Self::Default => None,
-        }
-    }
-}
-
-pub struct Output {
-    file: Option<(String, File)>,
-}
-
-impl Output {
-    fn new(name: Option<&str>) -> UResult<Self> {
-        let file = if let Some(name) = name {
-            // This is different from `File::create()` because we don't truncate the output yet.
-            // This allows using the output file as an input file.
-            let file = OpenOptions::new()
-                .write(true)
-                .create(true)
-                .open(name)
-                .map_err(|e| SortError::OpenFailed {
-                    path: name.to_owned(),
-                    error: e,
-                })?;
-            Some((name.to_owned(), file))
-        } else {
-            None
-        };
-        Ok(Self { file })
-    }
-
-    fn into_write(self) -> BufWriter<Box<dyn Write>> {
-        BufWriter::new(match self.file {
-            Some((_name, file)) => {
-                // truncate the file
-                let _ = file.set_len(0);
-                Box::new(file)
-            }
-            None => Box::new(stdout()),
-        })
-    }
-
-    fn as_output_name(&self) -> Option<&str> {
-        match &self.file {
-            Some((name, _file)) => Some(name),
-            None => None,
-        }
-    }
-}
-
-#[derive(Clone)]
-pub struct GlobalSettings {
-    mode: SortMode,
-    debug: bool,
-    ignore_leading_blanks: bool,
-    ignore_case: bool,
-    dictionary_order: bool,
-    ignore_non_printing: bool,
-    merge: bool,
-    reverse: bool,
-    stable: bool,
-    unique: bool,
-    check: bool,
-    check_silent: bool,
-    salt: Option<[u8; 16]>,
-    selectors: Vec<FieldSelector>,
-    separator: Option<char>,
-    threads: String,
-    line_ending: LineEnding,
-    buffer_size: usize,
-    compress_prog: Option<String>,
-    merge_batch_size: usize,
-    precomputed: Precomputed,
-}
-
-/// Data needed for sorting. Should be computed once before starting to sort
-/// by calling `GlobalSettings::init_precomputed`.
-#[derive(Clone, Debug, Default)]
-struct Precomputed {
-    needs_tokens: bool,
-    num_infos_per_line: usize,
-    floats_per_line: usize,
-    selections_per_line: usize,
-}
-
-impl GlobalSettings {
-    /// Parse a SIZE string into a number of bytes.
-    /// A size string comprises an integer and an optional unit.
-    /// The unit may be k, K, m, M, g, G, t, T, P, E, Z, Y (powers of 1024), or b which is 1.
-    /// Default is K.
-    fn parse_byte_count(input: &str) -> Result<usize, ParseSizeError> {
-        // GNU sort (8.32)   valid: 1b,        k, K, m, M, g, G, t, T, P, E, Z, Y
-        // GNU sort (8.32) invalid:  b, B, 1B,                         p, e, z, y
-        let size = Parser::default()
-            .with_allow_list(&[
-                "b", "k", "K", "m", "M", "g", "G", "t", "T", "P", "E", "Z", "Y",
-            ])
-            .with_default_unit("K")
-            .with_b_byte_count(true)
-            .parse(input.trim())?;
-
-        usize::try_from(size).map_err(|_| {
-            ParseSizeError::SizeTooBig(format!("Buffer size {size} does not fit in address space"))
-        })
-    }
-
-    /// Precompute some data needed for sorting.
-    /// This function **must** be called before starting to sort, and `GlobalSettings` may not be altered
-    /// afterwards.
-    fn init_precomputed(&mut self) {
-        self.precomputed.needs_tokens = self.selectors.iter().any(|s| s.needs_tokens);
-        self.precomputed.selections_per_line =
-            self.selectors.iter().filter(|s| s.needs_selection).count();
-        self.precomputed.num_infos_per_line = self
-            .selectors
-            .iter()
-            .filter(|s| matches!(s.settings.mode, SortMode::Numeric | SortMode::HumanNumeric))
-            .count();
-        self.precomputed.floats_per_line = self
-            .selectors
-            .iter()
-            .filter(|s| matches!(s.settings.mode, SortMode::GeneralNumeric))
-            .count();
-    }
-}
-
-impl Default for GlobalSettings {
-    fn default() -> Self {
-        Self {
-            mode: SortMode::Default,
-            debug: false,
-            ignore_leading_blanks: false,
-            ignore_case: false,
-            dictionary_order: false,
-            ignore_non_printing: false,
-            merge: false,
-            reverse: false,
-            stable: false,
-            unique: false,
-            check: false,
-            check_silent: false,
-            salt: None,
-            selectors: vec![],
-            separator: None,
-            threads: String::new(),
-            line_ending: LineEnding::Newline,
-            buffer_size: DEFAULT_BUF_SIZE,
-            compress_prog: None,
-            merge_batch_size: 32,
-            precomputed: Precomputed::default(),
-        }
-    }
-}
-
-#[derive(Clone, PartialEq, Debug)]
-struct KeySettings {
-    mode: SortMode,
-    ignore_blanks: bool,
-    ignore_case: bool,
-    dictionary_order: bool,
-    ignore_non_printing: bool,
-    reverse: bool,
-}
-
-impl KeySettings {
-    /// Checks if the supplied combination of `mode`, `ignore_non_printing` and `dictionary_order` is allowed.
-    fn check_compatibility(
-        mode: SortMode,
-        ignore_non_printing: bool,
-        dictionary_order: bool,
-    ) -> Result<(), String> {
-        if matches!(
-            mode,
-            SortMode::Numeric | SortMode::HumanNumeric | SortMode::GeneralNumeric | SortMode::Month
-        ) {
-            if dictionary_order {
-                return Err(format!(
-                    "options '-{}{}' are incompatible",
-                    'd',
-                    mode.get_short_name().unwrap()
-                ));
-            } else if ignore_non_printing {
-                return Err(format!(
-                    "options '-{}{}' are incompatible",
-                    'i',
-                    mode.get_short_name().unwrap()
-                ));
-            }
-        }
-        Ok(())
-    }
-
-    fn set_sort_mode(&mut self, mode: SortMode) -> Result<(), String> {
-        if self.mode != SortMode::Default && self.mode != mode {
-            return Err(format!(
-                "options '-{}{}' are incompatible",
-                self.mode.get_short_name().unwrap(),
-                mode.get_short_name().unwrap()
-            ));
-        }
-        Self::check_compatibility(mode, self.ignore_non_printing, self.dictionary_order)?;
-        self.mode = mode;
-        Ok(())
-    }
-
-    fn set_dictionary_order(&mut self) -> Result<(), String> {
-        Self::check_compatibility(self.mode, self.ignore_non_printing, true)?;
-        self.dictionary_order = true;
-        Ok(())
-    }
-
-    fn set_ignore_non_printing(&mut self) -> Result<(), String> {
-        Self::check_compatibility(self.mode, true, self.dictionary_order)?;
-        self.ignore_non_printing = true;
-        Ok(())
-    }
-}
-
-impl From<&GlobalSettings> for KeySettings {
-    fn from(settings: &GlobalSettings) -> Self {
-        Self {
-            mode: settings.mode,
-            ignore_blanks: settings.ignore_leading_blanks,
-            ignore_case: settings.ignore_case,
-            ignore_non_printing: settings.ignore_non_printing,
-            reverse: settings.reverse,
-            dictionary_order: settings.dictionary_order,
-        }
-    }
-}
-
-impl Default for KeySettings {
-    fn default() -> Self {
-        Self::from(&GlobalSettings::default())
-    }
-}
-enum Selection<'a> {
-    AsF64(GeneralF64ParseResult),
-    WithNumInfo(&'a str, NumInfo),
-    Str(&'a str),
-}
-
-type Field = Range<usize>;
-
-#[derive(Clone, Debug)]
-pub struct Line<'a> {
-    line: &'a str,
-    index: usize,
-}
-
-impl<'a> Line<'a> {
-    /// Creates a new `Line`.
-    ///
-    /// If additional data is needed for sorting it is added to `line_data`.
-    /// `token_buffer` allows to reuse the allocation for tokens.
-    fn create(
-        line: &'a str,
-        index: usize,
-        line_data: &mut LineData<'a>,
-        token_buffer: &mut Vec<Field>,
-        settings: &GlobalSettings,
-    ) -> Self {
-        token_buffer.clear();
-        if settings.precomputed.needs_tokens {
-            tokenize(line, settings.separator, token_buffer);
-        }
-        for (selector, selection) in settings
-            .selectors
-            .iter()
-            .map(|selector| (selector, selector.get_selection(line, token_buffer)))
-        {
-            match selection {
-                Selection::AsF64(parsed_float) => line_data.parsed_floats.push(parsed_float),
-                Selection::WithNumInfo(str, num_info) => {
-                    line_data.num_infos.push(num_info);
-                    line_data.selections.push(str);
-                }
-                Selection::Str(str) => {
-                    if selector.needs_selection {
-                        line_data.selections.push(str);
-                    }
-                }
-            }
-        }
-        Self { line, index }
-    }
-
-    fn print(&self, writer: &mut impl Write, settings: &GlobalSettings) {
-        if settings.debug {
-            self.print_debug(settings, writer).unwrap();
-        } else {
-            writer.write_all(self.line.as_bytes()).unwrap();
-            writer.write_all(&[settings.line_ending.into()]).unwrap();
-        }
-    }
-
-    /// Writes indicators for the selections this line matched. The original line content is NOT expected
-    /// to be already printed.
-    fn print_debug(
-        &self,
-        settings: &GlobalSettings,
-        writer: &mut impl Write,
-    ) -> std::io::Result<()> {
-        // We do not consider this function performance critical, as debug output is only useful for small files,
-        // which are not a performance problem in any case. Therefore there aren't any special performance
-        // optimizations here.
-
-        let line = self.line.replace('\t', ">");
-        writeln!(writer, "{line}")?;
-
-        let mut fields = vec![];
-        tokenize(self.line, settings.separator, &mut fields);
-        for selector in &settings.selectors {
-            let mut selection = selector.get_range(self.line, Some(&fields));
-            match selector.settings.mode {
-                SortMode::Numeric | SortMode::HumanNumeric => {
-                    // find out which range is used for numeric comparisons
-                    let (_, num_range) = NumInfo::parse(
-                        &self.line[selection.clone()],
-                        &NumInfoParseSettings {
-                            accept_si_units: selector.settings.mode == SortMode::HumanNumeric,
-                            ..Default::default()
-                        },
-                    );
-                    let initial_selection = selection.clone();
-
-                    // Shorten selection to num_range.
-                    selection.start += num_range.start;
-                    selection.end = selection.start + num_range.len();
-
-                    if num_range == (0..0) {
-                        // This was not a valid number.
-                        // Report no match at the first non-whitespace character.
-                        let leading_whitespace = self.line[selection.clone()]
-                            .find(|c: char| !c.is_whitespace())
-                            .unwrap_or(0);
-                        selection.start += leading_whitespace;
-                        selection.end += leading_whitespace;
-                    } else {
-                        // include a trailing si unit
-                        if selector.settings.mode == SortMode::HumanNumeric
-                            && self.line[selection.end..initial_selection.end]
-                                .starts_with(&['k', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'][..])
-                        {
-                            selection.end += 1;
-                        }
-
-                        // include leading zeroes, a leading minus or a leading decimal point
-                        while self.line[initial_selection.start..selection.start]
-                            .ends_with(&['-', '0', '.'][..])
-                        {
-                            selection.start -= 1;
-                        }
-                    }
-                }
-                SortMode::GeneralNumeric => {
-                    let initial_selection = &self.line[selection.clone()];
-
-                    let leading = get_leading_gen(initial_selection);
-
-                    // Shorten selection to leading.
-                    selection.start += leading.start;
-                    selection.end = selection.start + leading.len();
-                }
-                SortMode::Month => {
-                    let initial_selection = &self.line[selection.clone()];
-
-                    let mut month_chars = initial_selection
-                        .char_indices()
-                        .skip_while(|(_, c)| c.is_whitespace());
-
-                    let month = if month_parse(initial_selection) == Month::Unknown {
-                        // We failed to parse a month, which is equivalent to matching nothing.
-                        // Add the "no match for key" marker to the first non-whitespace character.
-                        let first_non_whitespace = month_chars.next();
-                        first_non_whitespace.map_or(
-                            initial_selection.len()..initial_selection.len(),
-                            |(idx, _)| idx..idx,
-                        )
-                    } else {
-                        // We parsed a month. Match the first three non-whitespace characters, which must be the month we parsed.
-                        month_chars.next().unwrap().0
-                            ..month_chars
-                                .nth(2)
-                                .map_or(initial_selection.len(), |(idx, _)| idx)
-                    };
-
-                    // Shorten selection to month.
-                    selection.start += month.start;
-                    selection.end = selection.start + month.len();
-                }
-                _ => {}
-            }
-
-            write!(
-                writer,
-                "{}",
-                " ".repeat(UnicodeWidthStr::width(&line[..selection.start]))
-            )?;
-
-            if selection.is_empty() {
-                writeln!(writer, "^ no match for key")?;
-            } else {
-                writeln!(
-                    writer,
-                    "{}",
-                    "_".repeat(UnicodeWidthStr::width(&line[selection]))
-                )?;
-            }
-        }
-        if settings.mode != SortMode::Random
-            && !settings.stable
-            && !settings.unique
-            && (settings.dictionary_order
-                || settings.ignore_leading_blanks
-                || settings.ignore_case
-                || settings.ignore_non_printing
-                || settings.mode != SortMode::Default
-                || settings
-                    .selectors
-                    .last()
-                    .map_or(true, |selector| selector != &FieldSelector::default()))
-        {
-            // A last resort comparator is in use, underline the whole line.
-            if self.line.is_empty() {
-                writeln!(writer, "^ no match for key")?;
-            } else {
-                writeln!(
-                    writer,
-                    "{}",
-                    "_".repeat(UnicodeWidthStr::width(line.as_str()))
-                )?;
-            }
-        }
-        Ok(())
-    }
-}
-
-/// Tokenize a line into fields. The result is stored into `token_buffer`.
-fn tokenize(line: &str, separator: Option<char>, token_buffer: &mut Vec<Field>) {
-    assert!(token_buffer.is_empty());
-    if let Some(separator) = separator {
-        tokenize_with_separator(line, separator, token_buffer);
-    } else {
-        tokenize_default(line, token_buffer);
-    }
-}
-
-/// By default fields are separated by the first whitespace after non-whitespace.
-/// Whitespace is included in fields at the start.
-/// The result is stored into `token_buffer`.
-fn tokenize_default(line: &str, token_buffer: &mut Vec<Field>) {
-    token_buffer.push(0..0);
-    // pretend that there was whitespace in front of the line
-    let mut previous_was_whitespace = true;
-    for (idx, char) in line.char_indices() {
-        if char.is_whitespace() {
-            if !previous_was_whitespace {
-                token_buffer.last_mut().unwrap().end = idx;
-                token_buffer.push(idx..0);
-            }
-            previous_was_whitespace = true;
-        } else {
-            previous_was_whitespace = false;
-        }
-    }
-    token_buffer.last_mut().unwrap().end = line.len();
-}
-
-/// Split between separators. These separators are not included in fields.
-/// The result is stored into `token_buffer`.
-fn tokenize_with_separator(line: &str, separator: char, token_buffer: &mut Vec<Field>) {
-    let separator_indices =
-        line.char_indices()
-            .filter_map(|(i, c)| if c == separator { Some(i) } else { None });
-    let mut start = 0;
-    for sep_idx in separator_indices {
-        token_buffer.push(start..sep_idx);
-        start = sep_idx + 1;
-    }
-    if start < line.len() {
-        token_buffer.push(start..line.len());
-    }
-}
-
-#[derive(Clone, PartialEq, Debug)]
-struct KeyPosition {
-    /// 1-indexed, 0 is invalid.
-    field: usize,
-    /// 1-indexed, 0 is end of field.
-    char: usize,
-    ignore_blanks: bool,
-}
-
-impl KeyPosition {
-    fn new(key: &str, default_char_index: usize, ignore_blanks: bool) -> Result<Self, String> {
-        let mut field_and_char = key.split('.');
-
-        let field = field_and_char
-            .next()
-            .ok_or_else(|| format!("invalid key {}", key.quote()))?;
-        let char = field_and_char.next();
-
-        let field = field
-            .parse()
-            .map_err(|e| format!("failed to parse field index {}: {}", field.quote(), e))?;
-        if field == 0 {
-            return Err("field index can not be 0".to_string());
-        }
-
-        let char = char.map_or(Ok(default_char_index), |char| {
-            char.parse()
-                .map_err(|e| format!("failed to parse character index {}: {}", char.quote(), e))
-        })?;
-
-        Ok(Self {
-            field,
-            char,
-            ignore_blanks,
-        })
-    }
-}
-
-impl Default for KeyPosition {
-    fn default() -> Self {
-        Self {
-            field: 1,
-            char: 1,
-            ignore_blanks: false,
-        }
-    }
-}
-
-#[derive(Clone, PartialEq, Debug, Default)]
-struct FieldSelector {
-    from: KeyPosition,
-    to: Option<KeyPosition>,
-    settings: KeySettings,
-    needs_tokens: bool,
-    // Whether this selector operates on a sub-slice of a line.
-    // Selections are therefore not needed when this selector matches the whole line
-    // or the sort mode is general-numeric.
-    needs_selection: bool,
-}
-
-impl FieldSelector {
-    /// Splits this position into the actual position and the attached options.
-    fn split_key_options(position: &str) -> (&str, &str) {
-        if let Some((options_start, _)) = position.char_indices().find(|(_, c)| c.is_alphabetic()) {
-            position.split_at(options_start)
-        } else {
-            (position, "")
-        }
-    }
-
-    fn parse(key: &str, global_settings: &GlobalSettings) -> UResult<Self> {
-        let mut from_to = key.split(',');
-        let (from, from_options) = Self::split_key_options(from_to.next().unwrap());
-        let to = from_to.next().map(Self::split_key_options);
-        let options_are_empty = from_options.is_empty() && matches!(to, None | Some((_, "")));
-
-        if options_are_empty {
-            // Inherit the global settings if there are no options attached to this key.
-            (|| {
-                // This would be ideal for a try block, I think. In the meantime this closure allows
-                // to use the `?` operator here.
-                Self::new(
-                    KeyPosition::new(from, 1, global_settings.ignore_leading_blanks)?,
-                    to.map(|(to, _)| {
-                        KeyPosition::new(to, 0, global_settings.ignore_leading_blanks)
-                    })
-                    .transpose()?,
-                    KeySettings::from(global_settings),
-                )
-            })()
-        } else {
-            // Do not inherit from `global_settings`, as there are options attached to this key.
-            Self::parse_with_options((from, from_options), to)
-        }
-        .map_err(|msg| {
-            SortError::ParseKeyError {
-                key: key.to_owned(),
-                msg,
-            }
-            .into()
-        })
-    }
-
-    fn parse_with_options(
-        (from, from_options): (&str, &str),
-        to: Option<(&str, &str)>,
-    ) -> Result<Self, String> {
-        /// Applies `options` to `key_settings`, returning if the 'b'-flag (ignore blanks) was present.
-        fn parse_key_settings(
-            options: &str,
-            key_settings: &mut KeySettings,
-        ) -> Result<bool, String> {
-            let mut ignore_blanks = false;
-            for option in options.chars() {
-                match option {
-                    'M' => key_settings.set_sort_mode(SortMode::Month)?,
-                    'b' => ignore_blanks = true,
-                    'd' => key_settings.set_dictionary_order()?,
-                    'f' => key_settings.ignore_case = true,
-                    'g' => key_settings.set_sort_mode(SortMode::GeneralNumeric)?,
-                    'h' => key_settings.set_sort_mode(SortMode::HumanNumeric)?,
-                    'i' => key_settings.set_ignore_non_printing()?,
-                    'n' => key_settings.set_sort_mode(SortMode::Numeric)?,
-                    'R' => key_settings.set_sort_mode(SortMode::Random)?,
-                    'r' => key_settings.reverse = true,
-                    'V' => key_settings.set_sort_mode(SortMode::Version)?,
-                    c => return Err(format!("invalid option: '{c}'")),
-                }
-            }
-            Ok(ignore_blanks)
-        }
-
-        let mut key_settings = KeySettings::default();
-        let from = parse_key_settings(from_options, &mut key_settings)
-            .map(|ignore_blanks| KeyPosition::new(from, 1, ignore_blanks))??;
-        let to = if let Some((to, to_options)) = to {
-            Some(
-                parse_key_settings(to_options, &mut key_settings)
-                    .map(|ignore_blanks| KeyPosition::new(to, 0, ignore_blanks))??,
-            )
-        } else {
-            None
-        };
-        Self::new(from, to, key_settings)
-    }
-
-    fn new(
-        from: KeyPosition,
-        to: Option<KeyPosition>,
-        settings: KeySettings,
-    ) -> Result<Self, String> {
-        if from.char == 0 {
-            Err("invalid character index 0 for the start position of a field".to_string())
-        } else {
-            Ok(Self {
-                needs_selection: (from.field != 1
-                    || from.char != 1
-                    || to.is_some()
-                    || matches!(settings.mode, SortMode::Numeric | SortMode::HumanNumeric)
-                    || from.ignore_blanks)
-                    && !matches!(settings.mode, SortMode::GeneralNumeric),
-                needs_tokens: from.field != 1 || from.char == 0 || to.is_some(),
-                from,
-                to,
-                settings,
-            })
-        }
-    }
-
-    /// Get the selection that corresponds to this selector for the line.
-    /// If needs_fields returned false, tokens may be empty.
-    fn get_selection<'a>(&self, line: &'a str, tokens: &[Field]) -> Selection<'a> {
-        // `get_range` expects `None` when we don't need tokens and would get confused by an empty vector.
-        let tokens = if self.needs_tokens {
-            Some(tokens)
-        } else {
-            None
-        };
-        let mut range = &line[self.get_range(line, tokens)];
-        if self.settings.mode == SortMode::Numeric || self.settings.mode == SortMode::HumanNumeric {
-            // Parse NumInfo for this number.
-            let (info, num_range) = NumInfo::parse(
-                range,
-                &NumInfoParseSettings {
-                    accept_si_units: self.settings.mode == SortMode::HumanNumeric,
-                    ..Default::default()
-                },
-            );
-            // Shorten the range to what we need to pass to numeric_str_cmp later.
-            range = &range[num_range];
-            Selection::WithNumInfo(range, info)
-        } else if self.settings.mode == SortMode::GeneralNumeric {
-            // Parse this number as f64, as this is the requirement for general numeric sorting.
-            Selection::AsF64(general_f64_parse(&range[get_leading_gen(range)]))
-        } else {
-            // This is not a numeric sort, so we don't need a NumCache.
-            Selection::Str(range)
-        }
-    }
-
-    /// Look up the range in the line that corresponds to this selector.
-    /// If needs_fields returned false, tokens must be None.
-    fn get_range(&self, line: &str, tokens: Option<&[Field]>) -> Range<usize> {
-        enum Resolution {
-            // The start index of the resolved character, inclusive
-            StartOfChar(usize),
-            // The end index of the resolved character, exclusive.
-            // This is only returned if the character index is 0.
-            EndOfChar(usize),
-            // The resolved character would be in front of the first character
-            TooLow,
-            // The resolved character would be after the last character
-            TooHigh,
-        }
-
-        // Get the index for this line given the KeyPosition
-        fn resolve_index(
-            line: &str,
-            tokens: Option<&[Field]>,
-            position: &KeyPosition,
-        ) -> Resolution {
-            if matches!(tokens, Some(tokens) if tokens.len() < position.field) {
-                Resolution::TooHigh
-            } else if position.char == 0 {
-                let end = tokens.unwrap()[position.field - 1].end;
-                if end == 0 {
-                    Resolution::TooLow
-                } else {
-                    Resolution::EndOfChar(end)
-                }
-            } else {
-                let mut idx = if position.field == 1 {
-                    // The first field always starts at 0.
-                    // We don't need tokens for this case.
-                    0
-                } else {
-                    tokens.unwrap()[position.field - 1].start
-                };
-                // strip blanks if needed
-                if position.ignore_blanks {
-                    idx += line[idx..]
-                        .char_indices()
-                        .find(|(_, c)| !c.is_whitespace())
-                        .map_or(line[idx..].len(), |(idx, _)| idx);
-                }
-                // apply the character index
-                idx += line[idx..]
-                    .char_indices()
-                    .nth(position.char - 1)
-                    .map_or(line[idx..].len(), |(idx, _)| idx);
-                if idx >= line.len() {
-                    Resolution::TooHigh
-                } else {
-                    Resolution::StartOfChar(idx)
-                }
-            }
-        }
-
-        match resolve_index(line, tokens, &self.from) {
-            Resolution::StartOfChar(from) => {
-                let to = self.to.as_ref().map(|to| resolve_index(line, tokens, to));
-
-                let mut range = match to {
-                    Some(Resolution::StartOfChar(mut to)) => {
-                        // We need to include the character at `to`.
-                        to += line[to..].chars().next().map_or(1, |c| c.len_utf8());
-                        from..to
-                    }
-                    Some(Resolution::EndOfChar(to)) => from..to,
-                    // If `to` was not given or the match would be after the end of the line,
-                    // match everything until the end of the line.
-                    None | Some(Resolution::TooHigh) => from..line.len(),
-                    // If `to` is before the start of the line, report no match.
-                    // This can happen if the line starts with a separator.
-                    Some(Resolution::TooLow) => 0..0,
-                };
-                if range.start > range.end {
-                    range.end = range.start;
-                }
-                range
-            }
-            Resolution::TooLow | Resolution::EndOfChar(_) => {
-                unreachable!("This should only happen if the field start index is 0, but that should already have caused an error.")
-            }
-            // While for comparisons it's only important that this is an empty slice,
-            // to produce accurate debug output we need to match an empty slice at the end of the line.
-            Resolution::TooHigh => line.len()..line.len(),
-        }
-    }
-}
-
-/// Creates an `Arg` that conflicts with all other sort modes.
-fn make_sort_mode_arg(mode: &'static str, short: char, help: &'static str) -> Arg {
-    let mut arg = Arg::new(mode)
-        .short(short)
-        .long(mode)
-        .help(help)
-        .action(ArgAction::SetTrue);
-    for possible_mode in &options::modes::ALL_SORT_MODES {
-        if *possible_mode != mode {
-            arg = arg.conflicts_with(possible_mode);
-        }
-    }
-    arg
-}
-
-#[uucore::main]
-#[allow(clippy::cognitive_complexity)]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-    let mut settings = GlobalSettings::default();
-
-    let matches = match uu_app().try_get_matches_from(args) {
-        Ok(t) => t,
-        Err(e) => {
-            // not all clap "Errors" are because of a failure to parse arguments.
-            // "--version" also causes an Error to be returned, but we should not print to stderr
-            // nor return with a non-zero exit code in this case (we should print to stdout and return 0).
-            // This logic is similar to the code in clap, but we return 2 as the exit code in case of real failure
-            // (clap returns 1).
-            e.print().unwrap();
-            if e.use_stderr() {
-                set_exit_code(2);
-            }
-            return Ok(());
-        }
-    };
-
-    settings.debug = matches.get_flag(options::DEBUG);
-
-    // check whether user specified a zero terminated list of files for input, otherwise read files from args
-    let mut files: Vec<OsString> = if matches.contains_id(options::FILES0_FROM) {
-        let files0_from: Vec<OsString> = matches
-            .get_many::<OsString>(options::FILES0_FROM)
-            .map(|v| v.map(ToOwned::to_owned).collect())
-            .unwrap_or_default();
-
-        let mut files = Vec::new();
-        for path in &files0_from {
-            let reader = open(path)?;
-            let buf_reader = BufReader::new(reader);
-            for line in buf_reader.split(b'\0').flatten() {
-                files.push(OsString::from(
-                    std::str::from_utf8(&line)
-                        .expect("Could not parse string from zero terminated input."),
-                ));
-            }
-        }
-        files
-    } else {
-        matches
-            .get_many::<OsString>(options::FILES)
-            .map(|v| v.map(ToOwned::to_owned).collect())
-            .unwrap_or_default()
-    };
-
-    settings.mode = if matches.get_flag(options::modes::HUMAN_NUMERIC)
-        || matches
-            .get_one::<String>(options::modes::SORT)
-            .map(|s| s.as_str())
-            == Some("human-numeric")
-    {
-        SortMode::HumanNumeric
-    } else if matches.get_flag(options::modes::MONTH)
-        || matches
-            .get_one::<String>(options::modes::SORT)
-            .map(|s| s.as_str())
-            == Some("month")
-    {
-        SortMode::Month
-    } else if matches.get_flag(options::modes::GENERAL_NUMERIC)
-        || matches
-            .get_one::<String>(options::modes::SORT)
-            .map(|s| s.as_str())
-            == Some("general-numeric")
-    {
-        SortMode::GeneralNumeric
-    } else if matches.get_flag(options::modes::NUMERIC)
-        || matches
-            .get_one::<String>(options::modes::SORT)
-            .map(|s| s.as_str())
-            == Some("numeric")
-    {
-        SortMode::Numeric
-    } else if matches.get_flag(options::modes::VERSION)
-        || matches
-            .get_one::<String>(options::modes::SORT)
-            .map(|s| s.as_str())
-            == Some("version")
-    {
-        SortMode::Version
-    } else if matches.get_flag(options::modes::RANDOM)
-        || matches
-            .get_one::<String>(options::modes::SORT)
-            .map(|s| s.as_str())
-            == Some("random")
-    {
-        settings.salt = Some(get_rand_string());
-        SortMode::Random
-    } else {
-        SortMode::Default
-    };
-
-    settings.dictionary_order = matches.get_flag(options::DICTIONARY_ORDER);
-    settings.ignore_non_printing = matches.get_flag(options::IGNORE_NONPRINTING);
-    if matches.contains_id(options::PARALLEL) {
-        // "0" is default - threads = num of cores
-        settings.threads = matches
-            .get_one::<String>(options::PARALLEL)
-            .map(String::from)
-            .unwrap_or_else(|| "0".to_string());
-        env::set_var("RAYON_NUM_THREADS", &settings.threads);
-    }
-
-    settings.buffer_size =
-        matches
-            .get_one::<String>(options::BUF_SIZE)
-            .map_or(Ok(DEFAULT_BUF_SIZE), |s| {
-                GlobalSettings::parse_byte_count(s).map_err(|e| {
-                    USimpleError::new(2, format_error_message(&e, s, options::BUF_SIZE))
-                })
-            })?;
-
-    let mut tmp_dir = TmpDirWrapper::new(
-        matches
-            .get_one::<String>(options::TMP_DIR)
-            .map(PathBuf::from)
-            .unwrap_or_else(env::temp_dir),
-    );
-
-    settings.compress_prog = matches
-        .get_one::<String>(options::COMPRESS_PROG)
-        .map(String::from);
-
-    if let Some(n_merge) = matches.get_one::<String>(options::BATCH_SIZE) {
-        settings.merge_batch_size = n_merge.parse().map_err(|_| {
-            UUsageError::new(
-                2,
-                format!("invalid --batch-size argument {}", n_merge.quote()),
-            )
-        })?;
-    }
-
-    settings.line_ending = LineEnding::from_zero_flag(matches.get_flag(options::ZERO_TERMINATED));
-    settings.merge = matches.get_flag(options::MERGE);
-
-    settings.check = matches.contains_id(options::check::CHECK);
-    if matches.get_flag(options::check::CHECK_SILENT)
-        || matches!(
-            matches
-                .get_one::<String>(options::check::CHECK)
-                .map(|s| s.as_str()),
-            Some(options::check::SILENT | options::check::QUIET)
-        )
-    {
-        settings.check_silent = true;
-        settings.check = true;
-    };
-
-    settings.ignore_case = matches.get_flag(options::IGNORE_CASE);
-
-    settings.ignore_leading_blanks = matches.get_flag(options::IGNORE_LEADING_BLANKS);
-
-    settings.reverse = matches.get_flag(options::REVERSE);
-    settings.stable = matches.get_flag(options::STABLE);
-    settings.unique = matches.get_flag(options::UNIQUE);
-
-    if files.is_empty() {
-        /* if no file, default to stdin */
-        files.push("-".to_string().into());
-    } else if settings.check && files.len() != 1 {
-        return Err(UUsageError::new(
-            2,
-            format!("extra operand {} not allowed with -c", files[1].quote()),
-        ));
-    }
-
-    if let Some(arg) = matches.get_one::<OsString>(options::SEPARATOR) {
-        let mut separator = arg.to_str().ok_or_else(|| {
-            UUsageError::new(
-                2,
-                format!("separator is not valid unicode: {}", arg.quote()),
-            )
-        })?;
-        if separator == "\\0" {
-            separator = "\0";
-        }
-        // This rejects non-ASCII codepoints, but perhaps we don't have to.
-        // On the other hand GNU accepts any single byte, valid unicode or not.
-        // (Supporting multi-byte chars would require changes in tokenize_with_separator().)
-        if separator.len() != 1 {
-            return Err(UUsageError::new(
-                2,
-                format!(
-                    "separator must be exactly one character long: {}",
-                    separator.quote()
-                ),
-            ));
-        }
-        settings.separator = Some(separator.chars().next().unwrap());
-    }
-
-    if let Some(values) = matches.get_many::<String>(options::KEY) {
-        for value in values {
-            let selector = FieldSelector::parse(value, &settings)?;
-            if selector.settings.mode == SortMode::Random && settings.salt.is_none() {
-                settings.salt = Some(get_rand_string());
-            }
-            settings.selectors.push(selector);
-        }
-    }
-
-    if !matches.contains_id(options::KEY) {
-        // add a default selector matching the whole line
-        let key_settings = KeySettings::from(&settings);
-        settings.selectors.push(
-            FieldSelector::new(
-                KeyPosition {
-                    field: 1,
-                    char: 1,
-                    ignore_blanks: key_settings.ignore_blanks,
-                },
-                None,
-                key_settings,
-            )
-            .unwrap(),
-        );
-    }
-
-    // Verify that we can open all input files.
-    // It is the correct behavior to close all files afterwards,
-    // and to reopen them at a later point. This is different from how the output file is handled,
-    // probably to prevent running out of file descriptors.
-    for file in &files {
-        open(file)?;
-    }
-
-    let output = Output::new(
-        matches
-            .get_one::<String>(options::OUTPUT)
-            .map(|s| s.as_str()),
-    )?;
-
-    settings.init_precomputed();
-
-    let result = exec(&mut files, &settings, output, &mut tmp_dir);
-    // Wait here if `SIGINT` was received,
-    // for signal handler to do its work and terminate the program.
-    tmp_dir.wait_if_signal();
-    result
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .disable_version_flag(true)
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new(options::VERSION)
-                .long(options::VERSION)
-                .help("Print version information.")
-                .action(ArgAction::Version),
-        )
-        .arg(
-            Arg::new(options::modes::SORT)
-                .long(options::modes::SORT)
-                .value_parser([
-                    "general-numeric",
-                    "human-numeric",
-                    "month",
-                    "numeric",
-                    "version",
-                    "random",
-                ])
-                .conflicts_with_all(options::modes::ALL_SORT_MODES),
-        )
-        .arg(make_sort_mode_arg(
-            options::modes::HUMAN_NUMERIC,
-            'h',
-            "compare according to human readable sizes, eg 1M > 100k",
-        ))
-        .arg(make_sort_mode_arg(
-            options::modes::MONTH,
-            'M',
-            "compare according to month name abbreviation",
-        ))
-        .arg(make_sort_mode_arg(
-            options::modes::NUMERIC,
-            'n',
-            "compare according to string numerical value",
-        ))
-        .arg(make_sort_mode_arg(
-            options::modes::GENERAL_NUMERIC,
-            'g',
-            "compare according to string general numerical value",
-        ))
-        .arg(make_sort_mode_arg(
-            options::modes::VERSION,
-            'V',
-            "Sort by SemVer version number, eg 1.12.2 > 1.1.2",
-        ))
-        .arg(make_sort_mode_arg(
-            options::modes::RANDOM,
-            'R',
-            "shuffle in random order",
-        ))
-        .arg(
-            Arg::new(options::DICTIONARY_ORDER)
-                .short('d')
-                .long(options::DICTIONARY_ORDER)
-                .help("consider only blanks and alphanumeric characters")
-                .conflicts_with_all([
-                    options::modes::NUMERIC,
-                    options::modes::GENERAL_NUMERIC,
-                    options::modes::HUMAN_NUMERIC,
-                    options::modes::MONTH,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::MERGE)
-                .short('m')
-                .long(options::MERGE)
-                .help("merge already sorted files; do not sort")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::check::CHECK)
-                .short('c')
-                .long(options::check::CHECK)
-                .require_equals(true)
-                .num_args(0..)
-                .value_parser([
-                    options::check::SILENT,
-                    options::check::QUIET,
-                    options::check::DIAGNOSE_FIRST,
-                ])
-                .conflicts_with(options::OUTPUT)
-                .help("check for sorted input; do not sort"),
-        )
-        .arg(
-            Arg::new(options::check::CHECK_SILENT)
-                .short('C')
-                .long(options::check::CHECK_SILENT)
-                .conflicts_with(options::OUTPUT)
-                .help(
-                    "exit successfully if the given file is already sorted, \
-                and exit with status 1 otherwise.",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::IGNORE_CASE)
-                .short('f')
-                .long(options::IGNORE_CASE)
-                .help("fold lower case to upper case characters")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::IGNORE_NONPRINTING)
-                .short('i')
-                .long(options::IGNORE_NONPRINTING)
-                .help("ignore nonprinting characters")
-                .conflicts_with_all([
-                    options::modes::NUMERIC,
-                    options::modes::GENERAL_NUMERIC,
-                    options::modes::HUMAN_NUMERIC,
-                    options::modes::MONTH,
-                ])
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::IGNORE_LEADING_BLANKS)
-                .short('b')
-                .long(options::IGNORE_LEADING_BLANKS)
-                .help("ignore leading blanks when finding sort keys in each line")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OUTPUT)
-                .short('o')
-                .long(options::OUTPUT)
-                .help("write output to FILENAME instead of stdout")
-                .value_name("FILENAME")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::REVERSE)
-                .short('r')
-                .long(options::REVERSE)
-                .help("reverse the output")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::STABLE)
-                .short('s')
-                .long(options::STABLE)
-                .help("stabilize sort by disabling last-resort comparison")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::UNIQUE)
-                .short('u')
-                .long(options::UNIQUE)
-                .help("output only the first of an equal run")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::KEY)
-                .short('k')
-                .long(options::KEY)
-                .help("sort by a key")
-                .action(ArgAction::Append)
-                .num_args(1),
-        )
-        .arg(
-            Arg::new(options::SEPARATOR)
-                .short('t')
-                .long(options::SEPARATOR)
-                .help("custom separator for -k")
-                .value_parser(ValueParser::os_string()),
-        )
-        .arg(
-            Arg::new(options::ZERO_TERMINATED)
-                .short('z')
-                .long(options::ZERO_TERMINATED)
-                .help("line delimiter is NUL, not newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PARALLEL)
-                .long(options::PARALLEL)
-                .help("change the number of threads running concurrently to NUM_THREADS")
-                .value_name("NUM_THREADS"),
-        )
-        .arg(
-            Arg::new(options::BUF_SIZE)
-                .short('S')
-                .long(options::BUF_SIZE)
-                .help("sets the maximum SIZE of each segment in number of sorted items")
-                .value_name("SIZE"),
-        )
-        .arg(
-            Arg::new(options::TMP_DIR)
-                .short('T')
-                .long(options::TMP_DIR)
-                .help("use DIR for temporaries, not $TMPDIR or /tmp")
-                .value_name("DIR")
-                .value_hint(clap::ValueHint::DirPath),
-        )
-        .arg(
-            Arg::new(options::COMPRESS_PROG)
-                .long(options::COMPRESS_PROG)
-                .help("compress temporary files with PROG, decompress with PROG -d; PROG has to take input from stdin and output to stdout")
-                .value_name("PROG")
-                .value_hint(clap::ValueHint::CommandName),
-        )
-        .arg(
-            Arg::new(options::BATCH_SIZE)
-                .long(options::BATCH_SIZE)
-                .help("Merge at most N_MERGE inputs at once.")
-                .value_name("N_MERGE"),
-        )
-        .arg(
-            Arg::new(options::FILES0_FROM)
-                .long(options::FILES0_FROM)
-                .help("read input from the files specified by NUL-terminated NUL_FILES")
-                .value_name("NUL_FILES")
-                .action(ArgAction::Append)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::DEBUG)
-                .long(options::DEBUG)
-                .help("underline the parts of the line that are actually used for sorting")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILES)
-                .action(ArgAction::Append)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-fn exec(
-    files: &mut [OsString],
-    settings: &GlobalSettings,
-    output: Output,
-    tmp_dir: &mut TmpDirWrapper,
-) -> UResult<()> {
-    if settings.merge {
-        let file_merger = merge::merge(files, settings, output.as_output_name(), tmp_dir)?;
-        file_merger.write_all(settings, output)
-    } else if settings.check {
-        if files.len() > 1 {
-            Err(UUsageError::new(2, "only one file allowed with -c"))
-        } else {
-            check::check(files.first().unwrap(), settings)
-        }
-    } else {
-        let mut lines = files.iter().map(open);
-        ext_sort(&mut lines, settings, output, tmp_dir)
-    }
-}
-
-fn sort_by<'a>(unsorted: &mut Vec<Line<'a>>, settings: &GlobalSettings, line_data: &LineData<'a>) {
-    if settings.stable || settings.unique {
-        unsorted.par_sort_by(|a, b| compare_by(a, b, settings, line_data, line_data));
-    } else {
-        unsorted.par_sort_unstable_by(|a, b| compare_by(a, b, settings, line_data, line_data));
-    }
-}
-
-fn compare_by<'a>(
-    a: &Line<'a>,
-    b: &Line<'a>,
-    global_settings: &GlobalSettings,
-    a_line_data: &LineData<'a>,
-    b_line_data: &LineData<'a>,
-) -> Ordering {
-    let mut selection_index = 0;
-    let mut num_info_index = 0;
-    let mut parsed_float_index = 0;
-    for selector in &global_settings.selectors {
-        let (a_str, b_str) = if selector.needs_selection {
-            let selections = (
-                a_line_data.selections
-                    [a.index * global_settings.precomputed.selections_per_line + selection_index],
-                b_line_data.selections
-                    [b.index * global_settings.precomputed.selections_per_line + selection_index],
-            );
-            selection_index += 1;
-            selections
-        } else {
-            // We can select the whole line.
-            (a.line, b.line)
-        };
-
-        let settings = &selector.settings;
-
-        let cmp: Ordering = match settings.mode {
-            SortMode::Random => {
-                // check if the two strings are equal
-                if custom_str_cmp(
-                    a_str,
-                    b_str,
-                    settings.ignore_non_printing,
-                    settings.dictionary_order,
-                    settings.ignore_case,
-                ) == Ordering::Equal
-                {
-                    Ordering::Equal
-                } else {
-                    // Only if they are not equal compare by the hash
-                    random_shuffle(a_str, b_str, &global_settings.salt.unwrap())
-                }
-            }
-            SortMode::Numeric => {
-                let a_num_info = &a_line_data.num_infos
-                    [a.index * global_settings.precomputed.num_infos_per_line + num_info_index];
-                let b_num_info = &b_line_data.num_infos
-                    [b.index * global_settings.precomputed.num_infos_per_line + num_info_index];
-                num_info_index += 1;
-                numeric_str_cmp((a_str, a_num_info), (b_str, b_num_info))
-            }
-            SortMode::HumanNumeric => {
-                let a_num_info = &a_line_data.num_infos
-                    [a.index * global_settings.precomputed.num_infos_per_line + num_info_index];
-                let b_num_info = &b_line_data.num_infos
-                    [b.index * global_settings.precomputed.num_infos_per_line + num_info_index];
-                num_info_index += 1;
-                human_numeric_str_cmp((a_str, a_num_info), (b_str, b_num_info))
-            }
-            SortMode::GeneralNumeric => {
-                let a_float = &a_line_data.parsed_floats
-                    [a.index * global_settings.precomputed.floats_per_line + parsed_float_index];
-                let b_float = &b_line_data.parsed_floats
-                    [b.index * global_settings.precomputed.floats_per_line + parsed_float_index];
-                parsed_float_index += 1;
-                general_numeric_compare(a_float, b_float)
-            }
-            SortMode::Month => month_compare(a_str, b_str),
-            SortMode::Version => version_cmp(a_str, b_str),
-            SortMode::Default => custom_str_cmp(
-                a_str,
-                b_str,
-                settings.ignore_non_printing,
-                settings.dictionary_order,
-                settings.ignore_case,
-            ),
-        };
-        if cmp != Ordering::Equal {
-            return if settings.reverse { cmp.reverse() } else { cmp };
-        }
-    }
-
-    // Call "last resort compare" if all selectors returned Equal
-    let cmp = if global_settings.mode == SortMode::Random
-        || global_settings.stable
-        || global_settings.unique
-    {
-        Ordering::Equal
-    } else {
-        a.line.cmp(b.line)
-    };
-
-    if global_settings.reverse {
-        cmp.reverse()
-    } else {
-        cmp
-    }
-}
-
-// This function cleans up the initial comparison done by leading_num_common for a general numeric compare.
-// In contrast to numeric compare, GNU general numeric/FP sort *should* recognize positive signs and
-// scientific notation, so we strip those lines only after the end of the following numeric string.
-// For example, 5e10KFD would be 5e10 or 5x10^10 and +10000HFKJFK would become 10000.
-#[allow(clippy::cognitive_complexity)]
-fn get_leading_gen(input: &str) -> Range<usize> {
-    let trimmed = input.trim_start();
-    let leading_whitespace_len = input.len() - trimmed.len();
-
-    // check for inf, -inf and nan
-    for allowed_prefix in ["inf", "-inf", "nan"] {
-        if trimmed.is_char_boundary(allowed_prefix.len())
-            && trimmed[..allowed_prefix.len()].eq_ignore_ascii_case(allowed_prefix)
-        {
-            return leading_whitespace_len..(leading_whitespace_len + allowed_prefix.len());
-        }
-    }
-    // Make this iter peekable to see if next char is numeric
-    let mut char_indices = itertools::peek_nth(trimmed.char_indices());
-
-    let first = char_indices.peek();
-
-    if matches!(first, Some((_, NEGATIVE) | (_, POSITIVE))) {
-        char_indices.next();
-    }
-
-    let mut had_e_notation = false;
-    let mut had_decimal_pt = false;
-    while let Some((idx, c)) = char_indices.next() {
-        if c.is_ascii_digit() {
-            continue;
-        }
-        if c == DECIMAL_PT && !had_decimal_pt && !had_e_notation {
-            had_decimal_pt = true;
-            continue;
-        }
-        if (c == 'e' || c == 'E') && !had_e_notation {
-            // we can only consume the 'e' if what follow is either a digit, or a sign followed by a digit.
-            if let Some(&(_, next_char)) = char_indices.peek() {
-                if (next_char == '+' || next_char == '-')
-                    && matches!(
-                        char_indices.peek_nth(2),
-                        Some((_, c)) if c.is_ascii_digit()
-                    )
-                {
-                    // Consume the sign. The following digits will be consumed by the main loop.
-                    char_indices.next();
-                    had_e_notation = true;
-                    continue;
-                }
-                if next_char.is_ascii_digit() {
-                    had_e_notation = true;
-                    continue;
-                }
-            }
-        }
-        return leading_whitespace_len..(leading_whitespace_len + idx);
-    }
-    leading_whitespace_len..input.len()
-}
-
-#[derive(Copy, Clone, PartialEq, PartialOrd, Debug)]
-pub enum GeneralF64ParseResult {
-    Invalid,
-    NaN,
-    NegInfinity,
-    Number(f64),
-    Infinity,
-}
-
-/// Parse the beginning string into a GeneralF64ParseResult.
-/// Using a GeneralF64ParseResult instead of f64 is necessary to correctly order floats.
-#[inline(always)]
-fn general_f64_parse(a: &str) -> GeneralF64ParseResult {
-    // The actual behavior here relies on Rust's implementation of parsing floating points.
-    // For example "nan", "inf" (ignoring the case) and "infinity" are only parsed to floats starting from 1.53.
-    // TODO: Once our minimum supported Rust version is 1.53 or above, we should add tests for those cases.
-    match a.parse::<f64>() {
-        Ok(a) if a.is_nan() => GeneralF64ParseResult::NaN,
-        Ok(a) if a == std::f64::NEG_INFINITY => GeneralF64ParseResult::NegInfinity,
-        Ok(a) if a == std::f64::INFINITY => GeneralF64ParseResult::Infinity,
-        Ok(a) => GeneralF64ParseResult::Number(a),
-        Err(_) => GeneralF64ParseResult::Invalid,
-    }
-}
-
-/// Compares two floats, with errors and non-numerics assumed to be -inf.
-/// Stops coercing at the first non-numeric char.
-/// We explicitly need to convert to f64 in this case.
-fn general_numeric_compare(a: &GeneralF64ParseResult, b: &GeneralF64ParseResult) -> Ordering {
-    a.partial_cmp(b).unwrap()
-}
-
-fn get_rand_string() -> [u8; 16] {
-    thread_rng().sample(rand::distributions::Standard)
-}
-
-fn get_hash<T: Hash>(t: &T) -> u64 {
-    let mut s = FnvHasher::default();
-    t.hash(&mut s);
-    s.finish()
-}
-
-fn random_shuffle(a: &str, b: &str, salt: &[u8]) -> Ordering {
-    let da = get_hash(&(a, salt));
-    let db = get_hash(&(b, salt));
-    da.cmp(&db)
-}
-
-#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Copy)]
-enum Month {
-    Unknown,
-    January,
-    February,
-    March,
-    April,
-    May,
-    June,
-    July,
-    August,
-    September,
-    October,
-    November,
-    December,
-}
-
-/// Parse the beginning string into a Month, returning Month::Unknown on errors.
-fn month_parse(line: &str) -> Month {
-    let line = line.trim();
-
-    const MONTHS: [(&str, Month); 12] = [
-        ("JAN", Month::January),
-        ("FEB", Month::February),
-        ("MAR", Month::March),
-        ("APR", Month::April),
-        ("MAY", Month::May),
-        ("JUN", Month::June),
-        ("JUL", Month::July),
-        ("AUG", Month::August),
-        ("SEP", Month::September),
-        ("OCT", Month::October),
-        ("NOV", Month::November),
-        ("DEC", Month::December),
-    ];
-
-    for (month_str, month) in &MONTHS {
-        if line.is_char_boundary(month_str.len())
-            && line[..month_str.len()].eq_ignore_ascii_case(month_str)
-        {
-            return *month;
-        }
-    }
-
-    Month::Unknown
-}
-
-fn month_compare(a: &str, b: &str) -> Ordering {
-    #![allow(clippy::comparison_chain)]
-    let ma = month_parse(a);
-    let mb = month_parse(b);
-
-    if ma > mb {
-        Ordering::Greater
-    } else if ma < mb {
-        Ordering::Less
-    } else {
-        Ordering::Equal
-    }
-}
-
-fn print_sorted<'a, T: Iterator<Item = &'a Line<'a>>>(
-    iter: T,
-    settings: &GlobalSettings,
-    output: Output,
-) {
-    let mut writer = output.into_write();
-    for line in iter {
-        line.print(&mut writer, settings);
-    }
-}
-
-fn open(path: impl AsRef<OsStr>) -> UResult<Box<dyn Read + Send>> {
-    let path = path.as_ref();
-    if path == "-" {
-        let stdin = stdin();
-        return Ok(Box::new(stdin) as Box<dyn Read + Send>);
-    }
-
-    let path = Path::new(path);
-
-    match File::open(path) {
-        Ok(f) => Ok(Box::new(f) as Box<dyn Read + Send>),
-        Err(error) => Err(SortError::ReadFailed {
-            path: path.to_owned(),
-            error,
-        }
-        .into()),
-    }
-}
-
-fn format_error_message(error: &ParseSizeError, s: &str, option: &str) -> String {
-    // NOTE:
-    // GNU's sort echos affected flag, -S or --buffer-size, depending user's selection
-    match error {
-        ParseSizeError::InvalidSuffix(_) => {
-            format!("invalid suffix in --{} argument {}", option, s.quote())
-        }
-        ParseSizeError::ParseFailure(_) => format!("invalid --{} argument {}", option, s.quote()),
-        ParseSizeError::SizeTooBig(_) => format!("--{} argument {} too large", option, s.quote()),
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use super::*;
-
-    fn tokenize_helper(line: &str, separator: Option<char>) -> Vec<Field> {
-        let mut buffer = vec![];
-        tokenize(line, separator, &mut buffer);
-        buffer
-    }
-
-    #[test]
-    fn test_get_hash() {
-        let a = "Ted".to_string();
-
-        assert_eq!(2_646_829_031_758_483_623, get_hash(&a));
-    }
-
-    #[test]
-    fn test_random_shuffle() {
-        let a = "Ted";
-        let b = "Ted";
-        let c = get_rand_string();
-
-        assert_eq!(Ordering::Equal, random_shuffle(a, b, &c));
-    }
-
-    #[test]
-    fn test_month_compare() {
-        let a = "JaN";
-        let b = "OCt";
-
-        assert_eq!(Ordering::Less, month_compare(a, b));
-    }
-    #[test]
-    fn test_version_compare() {
-        let a = "1.2.3-alpha2";
-        let b = "1.4.0";
-
-        assert_eq!(Ordering::Less, version_cmp(a, b));
-    }
-
-    #[test]
-    fn test_random_compare() {
-        let a = "9";
-        let b = "9";
-        let c = get_rand_string();
-
-        assert_eq!(Ordering::Equal, random_shuffle(a, b, &c));
-    }
-
-    #[test]
-    fn test_tokenize_fields() {
-        let line = "foo bar b    x";
-        assert_eq!(tokenize_helper(line, None), vec![0..3, 3..7, 7..9, 9..14,],);
-    }
-
-    #[test]
-    fn test_tokenize_fields_leading_whitespace() {
-        let line = "    foo bar b    x";
-        assert_eq!(
-            tokenize_helper(line, None),
-            vec![0..7, 7..11, 11..13, 13..18,]
-        );
-    }
-
-    #[test]
-    fn test_tokenize_fields_custom_separator() {
-        let line = "aaa foo bar b    x";
-        assert_eq!(
-            tokenize_helper(line, Some('a')),
-            vec![0..0, 1..1, 2..2, 3..9, 10..18,]
-        );
-    }
-
-    #[test]
-    fn test_tokenize_fields_trailing_custom_separator() {
-        let line = "a";
-        assert_eq!(tokenize_helper(line, Some('a')), vec![0..0]);
-        let line = "aa";
-        assert_eq!(tokenize_helper(line, Some('a')), vec![0..0, 1..1]);
-        let line = "..a..a";
-        assert_eq!(tokenize_helper(line, Some('a')), vec![0..2, 3..5]);
-    }
-
-    #[test]
-    #[cfg(target_pointer_width = "64")]
-    fn test_line_size() {
-        // We should make sure to not regress the size of the Line struct because
-        // it is unconditional overhead for every line we sort.
-        assert_eq!(std::mem::size_of::<Line>(), 24);
-    }
-
-    #[test]
-    fn test_parse_byte_count() {
-        let valid_input = [
-            ("0", 0),
-            ("50K", 50 * 1024),
-            ("50k", 50 * 1024),
-            ("1M", 1024 * 1024),
-            ("100M", 100 * 1024 * 1024),
-            #[cfg(not(target_pointer_width = "32"))]
-            ("1000G", 1000 * 1024 * 1024 * 1024),
-            #[cfg(not(target_pointer_width = "32"))]
-            ("10T", 10 * 1024 * 1024 * 1024 * 1024),
-            ("1b", 1),
-            ("1024b", 1024),
-            ("1024Mb", 1024 * 1024 * 1024), // NOTE: This might not be how GNU `sort` behaves for 'Mb'
-            ("1", 1024),                    // K is default
-            ("50", 50 * 1024),
-            ("K", 1024),
-            ("k", 1024),
-            ("m", 1024 * 1024),
-            #[cfg(not(target_pointer_width = "32"))]
-            ("E", 1024 * 1024 * 1024 * 1024 * 1024 * 1024),
-        ];
-        for (input, expected_output) in &valid_input {
-            assert_eq!(
-                GlobalSettings::parse_byte_count(input),
-                Ok(*expected_output)
-            );
-        }
-
-        // SizeTooBig
-        let invalid_input = ["500E", "1Y"];
-        for input in &invalid_input {
-            #[cfg(not(target_pointer_width = "128"))]
-            assert!(GlobalSettings::parse_byte_count(input).is_err());
-        }
-
-        // ParseFailure
-        let invalid_input = ["nonsense", "1B", "B", "b", "p", "e", "z", "y"];
-        for input in &invalid_input {
-            assert!(GlobalSettings::parse_byte_count(input).is_err());
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sort/tmp_dir.rs.html b/coreutils/dev/src/uu_sort/tmp_dir.rs.html deleted file mode 100644 index 8b35f2358..000000000 --- a/coreutils/dev/src/uu_sort/tmp_dir.rs.html +++ /dev/null @@ -1,189 +0,0 @@ -tmp_dir.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-
use std::{
-    fs::File,
-    path::{Path, PathBuf},
-    sync::{Arc, Mutex},
-};
-
-use tempfile::TempDir;
-use uucore::{
-    error::{UResult, USimpleError},
-    show_error,
-};
-
-use crate::SortError;
-
-/// A wrapper around TempDir that may only exist once in a process.
-///
-/// `TmpDirWrapper` handles the allocation of new temporary files in this temporary directory and
-/// deleting the whole directory when `SIGINT` is received. Creating a second `TmpDirWrapper` will
-/// fail because `ctrlc::set_handler()` fails when there's already a handler.
-/// The directory is only created once the first file is requested.
-pub struct TmpDirWrapper {
-    temp_dir: Option<TempDir>,
-    parent_path: PathBuf,
-    size: usize,
-    lock: Arc<Mutex<()>>,
-}
-
-impl TmpDirWrapper {
-    pub fn new(path: PathBuf) -> Self {
-        Self {
-            parent_path: path,
-            size: 0,
-            temp_dir: None,
-            lock: Arc::default(),
-        }
-    }
-
-    fn init_tmp_dir(&mut self) -> UResult<()> {
-        assert!(self.temp_dir.is_none());
-        assert_eq!(self.size, 0);
-        self.temp_dir = Some(
-            tempfile::Builder::new()
-                .prefix("uutils_sort")
-                .tempdir_in(&self.parent_path)
-                .map_err(|_| SortError::TmpDirCreationFailed)?,
-        );
-
-        let path = self.temp_dir.as_ref().unwrap().path().to_owned();
-        let lock = self.lock.clone();
-        ctrlc::set_handler(move || {
-            // Take the lock so that `next_file_path` returns no new file path,
-            // and the program doesn't terminate before the handler has finished
-            let _lock = lock.lock().unwrap();
-            if let Err(e) = remove_tmp_dir(&path) {
-                show_error!("failed to delete temporary directory: {}", e);
-            }
-            std::process::exit(2)
-        })
-        .map_err(|e| USimpleError::new(2, format!("failed to set up signal handler: {e}")))
-    }
-
-    pub fn next_file(&mut self) -> UResult<(File, PathBuf)> {
-        if self.temp_dir.is_none() {
-            self.init_tmp_dir()?;
-        }
-
-        let _lock = self.lock.lock().unwrap();
-        let file_name = self.size.to_string();
-        self.size += 1;
-        let path = self.temp_dir.as_ref().unwrap().path().join(file_name);
-        Ok((
-            File::create(&path).map_err(|error| SortError::OpenTmpFileFailed { error })?,
-            path,
-        ))
-    }
-
-    /// Function just waits if signal handler was called
-    pub fn wait_if_signal(&self) {
-        let _lock = self.lock.lock().unwrap();
-    }
-}
-
-/// Remove the directory at `path` by deleting its child files and then itself.
-/// Errors while deleting child files are ignored.
-fn remove_tmp_dir(path: &Path) -> std::io::Result<()> {
-    if let Ok(read_dir) = std::fs::read_dir(path) {
-        for file in read_dir.flatten() {
-            // if we fail to delete the file here it was probably deleted by another thread
-            // in the meantime, but that's ok.
-            let _ = std::fs::remove_file(file.path());
-        }
-    }
-    std::fs::remove_dir(path)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_split/filenames.rs.html b/coreutils/dev/src/uu_split/filenames.rs.html deleted file mode 100644 index 0ff4e2e56..000000000 --- a/coreutils/dev/src/uu_split/filenames.rs.html +++ /dev/null @@ -1,513 +0,0 @@ -filenames.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore zaaa zaab
-//! Compute filenames from a given index.
-//!
-//! The [`FilenameIterator`] yields filenames for use with ``split``.
-//!
-//! # Examples
-//!
-//! Create filenames of the form `chunk_??.txt`:
-//!
-//! ```rust,ignore
-//! use crate::filenames::FilenameIterator;
-//! use crate::filenames::SuffixType;
-//!
-//! let prefix = "chunk_".to_string();
-//! let suffix = ".txt".to_string();
-//! let width = 2;
-//! let suffix_type = SuffixType::Alphabetic;
-//! let it = FilenameIterator::new(prefix, suffix, width, suffix_type);
-//!
-//! assert_eq!(it.next().unwrap(), "chunk_aa.txt");
-//! assert_eq!(it.next().unwrap(), "chunk_ab.txt");
-//! assert_eq!(it.next().unwrap(), "chunk_ac.txt");
-//! ```
-use crate::number::DynamicWidthNumber;
-use crate::number::FixedWidthNumber;
-use crate::number::Number;
-use uucore::error::{UResult, USimpleError};
-
-/// The format to use for suffixes in the filename for each output chunk.
-#[derive(Clone, Copy)]
-pub enum SuffixType {
-    /// Lowercase ASCII alphabetic characters.
-    Alphabetic,
-
-    /// Decimal numbers.
-    Decimal,
-
-    /// Hexadecimal numbers.
-    Hexadecimal,
-}
-
-impl SuffixType {
-    /// The radix to use when representing the suffix string as digits.
-    pub fn radix(&self) -> u8 {
-        match self {
-            Self::Alphabetic => 26,
-            Self::Decimal => 10,
-            Self::Hexadecimal => 16,
-        }
-    }
-}
-
-/// Compute filenames from a given index.
-///
-/// This iterator yields filenames for use with ``split``.
-///
-/// The `prefix` is prepended to each filename and the
-/// `additional_suffix1` is appended to each filename.
-///
-/// If `suffix_length` is 0, then the variable portion of the filename
-/// that identifies the current chunk will have a dynamically
-/// increasing width. If `suffix_length` is greater than zero, then
-/// the variable portion of the filename will always be exactly that
-/// width in characters. In that case, after the iterator yields each
-/// string of that width, the iterator is exhausted.
-///
-/// Finally, `suffix_type` controls which type of suffix to produce,
-/// alphabetic or numeric.
-///
-/// # Examples
-///
-/// Create filenames of the form `chunk_??.txt`, where the `?`
-/// characters are lowercase ASCII alphabetic characters:
-///
-/// ```rust,ignore
-/// use crate::filenames::FilenameIterator;
-/// use crate::filenames::SuffixType;
-///
-/// let prefix = "chunk_".to_string();
-/// let suffix = ".txt".to_string();
-/// let width = 2;
-/// let suffix_type = SuffixType::Alphabetic;
-/// let it = FilenameIterator::new(prefix, suffix, width, suffix_type);
-///
-/// assert_eq!(it.next().unwrap(), "chunk_aa.txt");
-/// assert_eq!(it.next().unwrap(), "chunk_ab.txt");
-/// assert_eq!(it.next().unwrap(), "chunk_ac.txt");
-/// ```
-///
-/// For decimal numeric filenames, use `SuffixType::Decimal`:
-///
-/// ```rust,ignore
-/// use crate::filenames::FilenameIterator;
-/// use crate::filenames::SuffixType;
-///
-/// let prefix = "chunk_".to_string();
-/// let suffix = ".txt".to_string();
-/// let width = 2;
-/// let suffix_type = SuffixType::Decimal;
-/// let it = FilenameIterator::new(prefix, suffix, width, suffix_type);
-///
-/// assert_eq!(it.next().unwrap(), "chunk_00.txt");
-/// assert_eq!(it.next().unwrap(), "chunk_01.txt");
-/// assert_eq!(it.next().unwrap(), "chunk_02.txt");
-/// ```
-pub struct FilenameIterator<'a> {
-    additional_suffix: &'a str,
-    prefix: &'a str,
-    number: Number,
-    first_iteration: bool,
-}
-
-impl<'a> FilenameIterator<'a> {
-    pub fn new(
-        prefix: &'a str,
-        additional_suffix: &'a str,
-        suffix_length: usize,
-        suffix_type: SuffixType,
-        suffix_start: usize,
-    ) -> UResult<FilenameIterator<'a>> {
-        let radix = suffix_type.radix();
-        let number = if suffix_length == 0 {
-            Number::DynamicWidth(DynamicWidthNumber::new(radix, suffix_start))
-        } else {
-            Number::FixedWidth(
-                FixedWidthNumber::new(radix, suffix_length, suffix_start).map_err(|_| {
-                    USimpleError::new(
-                        1,
-                        "numerical suffix start value is too large for the suffix length",
-                    )
-                })?,
-            )
-        };
-
-        Ok(FilenameIterator {
-            prefix,
-            additional_suffix,
-            number,
-            first_iteration: true,
-        })
-    }
-}
-
-impl<'a> Iterator for FilenameIterator<'a> {
-    type Item = String;
-
-    fn next(&mut self) -> Option<Self::Item> {
-        if self.first_iteration {
-            self.first_iteration = false;
-        } else {
-            self.number.increment().ok()?;
-        }
-        // The first and third parts are just taken directly from the
-        // struct parameters unchanged.
-        Some(format!(
-            "{}{}{}",
-            self.prefix, self.number, self.additional_suffix
-        ))
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::filenames::FilenameIterator;
-    use crate::filenames::SuffixType;
-
-    #[test]
-    fn test_filename_iterator_alphabetic_fixed_width() {
-        let mut it = FilenameIterator::new("chunk_", ".txt", 2, SuffixType::Alphabetic, 0).unwrap();
-        assert_eq!(it.next().unwrap(), "chunk_aa.txt");
-        assert_eq!(it.next().unwrap(), "chunk_ab.txt");
-        assert_eq!(it.next().unwrap(), "chunk_ac.txt");
-
-        let mut it = FilenameIterator::new("chunk_", ".txt", 2, SuffixType::Alphabetic, 0).unwrap();
-        assert_eq!(it.nth(26 * 26 - 1).unwrap(), "chunk_zz.txt");
-        assert_eq!(it.next(), None);
-    }
-
-    #[test]
-    fn test_filename_iterator_numeric_fixed_width() {
-        let mut it = FilenameIterator::new("chunk_", ".txt", 2, SuffixType::Decimal, 0).unwrap();
-        assert_eq!(it.next().unwrap(), "chunk_00.txt");
-        assert_eq!(it.next().unwrap(), "chunk_01.txt");
-        assert_eq!(it.next().unwrap(), "chunk_02.txt");
-
-        let mut it = FilenameIterator::new("chunk_", ".txt", 2, SuffixType::Decimal, 0).unwrap();
-        assert_eq!(it.nth(10 * 10 - 1).unwrap(), "chunk_99.txt");
-        assert_eq!(it.next(), None);
-    }
-
-    #[test]
-    fn test_filename_iterator_alphabetic_dynamic_width() {
-        let mut it = FilenameIterator::new("chunk_", ".txt", 0, SuffixType::Alphabetic, 0).unwrap();
-        assert_eq!(it.next().unwrap(), "chunk_aa.txt");
-        assert_eq!(it.next().unwrap(), "chunk_ab.txt");
-        assert_eq!(it.next().unwrap(), "chunk_ac.txt");
-
-        let mut it = FilenameIterator::new("chunk_", ".txt", 0, SuffixType::Alphabetic, 0).unwrap();
-        assert_eq!(it.nth(26 * 25 - 1).unwrap(), "chunk_yz.txt");
-        assert_eq!(it.next().unwrap(), "chunk_zaaa.txt");
-        assert_eq!(it.next().unwrap(), "chunk_zaab.txt");
-    }
-
-    #[test]
-    fn test_filename_iterator_numeric_dynamic_width() {
-        let mut it = FilenameIterator::new("chunk_", ".txt", 0, SuffixType::Decimal, 0).unwrap();
-        assert_eq!(it.next().unwrap(), "chunk_00.txt");
-        assert_eq!(it.next().unwrap(), "chunk_01.txt");
-        assert_eq!(it.next().unwrap(), "chunk_02.txt");
-
-        let mut it = FilenameIterator::new("chunk_", ".txt", 0, SuffixType::Decimal, 0).unwrap();
-        assert_eq!(it.nth(10 * 9 - 1).unwrap(), "chunk_89.txt");
-        assert_eq!(it.next().unwrap(), "chunk_9000.txt");
-        assert_eq!(it.next().unwrap(), "chunk_9001.txt");
-    }
-
-    #[test]
-    fn test_filename_iterator_numeric_suffix_decimal() {
-        let mut it = FilenameIterator::new("chunk_", ".txt", 0, SuffixType::Decimal, 5).unwrap();
-        assert_eq!(it.next().unwrap(), "chunk_05.txt");
-        assert_eq!(it.next().unwrap(), "chunk_06.txt");
-        assert_eq!(it.next().unwrap(), "chunk_07.txt");
-    }
-
-    #[test]
-    fn test_filename_iterator_numeric_suffix_hex() {
-        let mut it =
-            FilenameIterator::new("chunk_", ".txt", 0, SuffixType::Hexadecimal, 9).unwrap();
-        assert_eq!(it.next().unwrap(), "chunk_09.txt");
-        assert_eq!(it.next().unwrap(), "chunk_0a.txt");
-        assert_eq!(it.next().unwrap(), "chunk_0b.txt");
-    }
-
-    #[test]
-    fn test_filename_iterator_numeric_suffix_err() {
-        let mut it = FilenameIterator::new("chunk_", ".txt", 3, SuffixType::Decimal, 999).unwrap();
-        assert_eq!(it.next().unwrap(), "chunk_999.txt");
-        assert!(it.next().is_none());
-
-        let it = FilenameIterator::new("chunk_", ".txt", 3, SuffixType::Decimal, 1000);
-        assert!(it.is_err());
-
-        let mut it =
-            FilenameIterator::new("chunk_", ".txt", 3, SuffixType::Hexadecimal, 0xfff).unwrap();
-        assert_eq!(it.next().unwrap(), "chunk_fff.txt");
-        assert!(it.next().is_none());
-
-        let it = FilenameIterator::new("chunk_", ".txt", 3, SuffixType::Hexadecimal, 0x1000);
-        assert!(it.is_err());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_split/number.rs.html b/coreutils/dev/src/uu_split/number.rs.html deleted file mode 100644 index 6cc36d6bc..000000000 --- a/coreutils/dev/src/uu_split/number.rs.html +++ /dev/null @@ -1,1165 +0,0 @@ -number.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore zaaa zaab
-//! A number in arbitrary radix expressed in a positional notation.
-//!
-//! Use the [`Number`] enum to represent an arbitrary number in an
-//! arbitrary radix. A number can be incremented and can be
-//! displayed. See the [`Number`] documentation for more information.
-//!
-//! See the Wikipedia articles on [radix] and [positional notation]
-//! for more background information on those topics.
-//!
-//! [radix]: https://en.wikipedia.org/wiki/Radix
-//! [positional notation]: https://en.wikipedia.org/wiki/Positional_notation
-use std::error::Error;
-use std::fmt::{self, Display, Formatter};
-
-/// An overflow due to incrementing a number beyond its representable limit.
-#[derive(Debug)]
-pub struct Overflow;
-
-impl fmt::Display for Overflow {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        write!(f, "Overflow")
-    }
-}
-
-impl Error for Overflow {}
-
-/// A number in arbitrary radix expressed in a positional notation.
-///
-/// Use the [`Number`] enum to represent an arbitrary number in an
-/// arbitrary radix. A number can be incremented with
-/// [`Number::increment`].  The [`FixedWidthNumber`] overflows when
-/// attempting to increment it beyond the maximum number that can be
-/// represented in the specified width. The [`DynamicWidthNumber`]
-/// follows a non-standard incrementing procedure that is used
-/// specifically for the `split` program. See the
-/// [`DynamicWidthNumber`] documentation for more information.
-///
-/// Numbers of radix
-///
-/// * 10 are displayable and rendered as decimal numbers (for example,
-///   "00" or "917"),
-/// * 16 are displayable and rendered as hexadecimal numbers (for example,
-///   "00" or "e7f"),
-/// * 26 are displayable and rendered as lowercase ASCII alphabetic
-///   characters (for example, "aa" or "zax").
-///
-/// Numbers of other radices cannot be displayed. The display of a
-/// [`DynamicWidthNumber`] includes a prefix whose length depends on
-/// the width of the number. See the [`DynamicWidthNumber`]
-/// documentation for more information.
-///
-/// The digits of a number are accessible via the [`Number::digits`]
-/// method. The digits are represented as a [`Vec<u8>`] with the most
-/// significant digit on the left and the least significant digit on
-/// the right. Each digit is a nonnegative integer less than the
-/// radix. For example, if the radix is 3, then `vec![1, 0, 2]`
-/// represents the decimal number 11:
-///
-/// ```ignore
-/// 1 * 3^2 + 0 * 3^1 + 2 * 3^0 = 9 + 0 + 2 = 11
-/// ```
-///
-/// For the [`DynamicWidthNumber`], the digits are not unique in the
-/// sense that repeatedly incrementing the number will eventually
-/// yield `vec![0, 0]`, `vec![0, 0, 0]`, `vec![0, 0, 0, 0]`, etc.
-/// That's okay because each of these numbers will be displayed
-/// differently and we only intend to use these numbers for display
-/// purposes and not for mathematical purposes.
-#[derive(Clone)]
-pub enum Number {
-    /// A fixed-width representation of a number.
-    FixedWidth(FixedWidthNumber),
-
-    /// A representation of a number with a dynamically growing width.
-    DynamicWidth(DynamicWidthNumber),
-}
-
-impl Number {
-    /// The digits of this number in decreasing order of significance.
-    ///
-    /// The digits are represented as a [`Vec<u8>`] with the most
-    /// significant digit on the left and the least significant digit
-    /// on the right. Each digit is a nonnegative integer less than
-    /// the radix. For example, if the radix is 3, then `vec![1, 0,
-    /// 2]` represents the decimal number 11:
-    ///
-    /// ```ignore
-    /// 1 * 3^2 + 0 * 3^1 + 2 * 3^0 = 9 + 0 + 2 = 11
-    /// ```
-    ///
-    /// For the [`DynamicWidthNumber`], the digits are not unique in the
-    /// sense that repeatedly incrementing the number will eventually
-    /// yield `vec![0, 0]`, `vec![0, 0, 0]`, `vec![0, 0, 0, 0]`, etc.
-    /// That's okay because each of these numbers will be displayed
-    /// differently and we only intend to use these numbers for display
-    /// purposes and not for mathematical purposes.
-    #[allow(dead_code)]
-    fn digits(&self) -> Vec<u8> {
-        match self {
-            Self::FixedWidth(number) => number.digits.clone(),
-            Self::DynamicWidth(number) => number.digits(),
-        }
-    }
-
-    /// Increment this number to its successor.
-    ///
-    /// If incrementing this number would result in an overflow beyond
-    /// the maximum representable number, then return
-    /// [`Err(Overflow)`]. The [`FixedWidthNumber`] overflows, but
-    /// [`DynamicWidthNumber`] does not.
-    ///
-    /// The [`DynamicWidthNumber`] follows a non-standard incrementing
-    /// procedure that is used specifically for the `split` program.
-    /// See the [`DynamicWidthNumber`] documentation for more
-    /// information.
-    ///
-    /// # Errors
-    ///
-    /// This method returns [`Err(Overflow)`] when attempting to
-    /// increment beyond the largest representable number.
-    ///
-    /// # Examples
-    ///
-    /// Overflowing:
-    ///
-    /// ```rust,ignore
-    ///
-    /// use crate::number::FixedWidthNumber;
-    /// use crate::number::Number;
-    /// use crate::number::Overflow;
-    ///
-    /// // Radix 3, width of 1 digit.
-    /// let mut number = Number::FixedWidth(FixedWidthNumber::new(3, 1));
-    /// number.increment().unwrap();  // from 0 to 1
-    /// number.increment().unwrap();  // from 1 to 2
-    /// assert!(number.increment().is_err());
-    /// ```
-    pub fn increment(&mut self) -> Result<(), Overflow> {
-        match self {
-            Self::FixedWidth(number) => number.increment(),
-            Self::DynamicWidth(number) => number.increment(),
-        }
-    }
-}
-
-impl Display for Number {
-    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
-        match self {
-            Self::FixedWidth(number) => number.fmt(f),
-            Self::DynamicWidth(number) => number.fmt(f),
-        }
-    }
-}
-
-/// A positional notation representation of a fixed-width number.
-///
-/// The digits are represented as a [`Vec<u8>`] with the most
-/// significant digit on the left and the least significant digit on
-/// the right. Each digit is a nonnegative integer less than the
-/// radix.
-///
-/// # Incrementing
-///
-/// This number starts at `vec![0; width]`, representing the number 0
-/// width the specified number of digits. Incrementing this number
-/// with [`Number::increment`] causes it to increase its value by 1 in
-/// the usual sense. If the digits are `vec![radix - 1; width]`, then
-/// an overflow would occur and the [`Number::increment`] method
-/// returns an error.
-///
-/// # Displaying
-///
-/// This number is only displayable if `radix` is 10, 16, or 26. If
-/// `radix` is 10 or 16, then the digits are concatenated and
-/// displayed as a fixed-width decimal or hexadecimal number,
-/// respectively. If `radix` is 26, then each digit is translated to
-/// the corresponding lowercase ASCII alphabetic character (that is,
-/// 'a', 'b', 'c', etc.) and concatenated.
-#[derive(Clone)]
-pub struct FixedWidthNumber {
-    radix: u8,
-    digits: Vec<u8>,
-}
-
-impl FixedWidthNumber {
-    /// Instantiate a number of the given radix and width.
-    pub fn new(radix: u8, width: usize, mut suffix_start: usize) -> Result<Self, Overflow> {
-        let mut digits = vec![0_u8; width];
-
-        for i in (0..digits.len()).rev() {
-            let remainder = (suffix_start % (radix as usize)) as u8;
-            suffix_start /= radix as usize;
-            digits[i] = remainder;
-            if suffix_start == 0 {
-                break;
-            }
-        }
-        if suffix_start == 0 {
-            Ok(Self { radix, digits })
-        } else {
-            Err(Overflow)
-        }
-    }
-
-    /// Increment this number.
-    ///
-    /// This method adds one to this number. If incrementing this
-    /// number would require more digits than are available with the
-    /// specified width, then this method returns [`Err(Overflow)`].
-    fn increment(&mut self) -> Result<(), Overflow> {
-        for i in (0..self.digits.len()).rev() {
-            // Increment the current digit.
-            self.digits[i] += 1;
-
-            // If the digit overflows, then set it to 0 and continue
-            // to the next iteration to increment the next most
-            // significant digit. Otherwise, terminate the loop, since
-            // there will be no further changes to any higher order
-            // digits.
-            if self.digits[i] == self.radix {
-                self.digits[i] = 0;
-            } else {
-                break;
-            }
-        }
-
-        // Return an error on overflow, which is signified by all zeros.
-        if self.digits == vec![0; self.digits.len()] {
-            Err(Overflow)
-        } else {
-            Ok(())
-        }
-    }
-}
-
-impl Display for FixedWidthNumber {
-    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
-        let digits: String = self
-            .digits
-            .iter()
-            .map(|d| map_digit(self.radix, *d))
-            .collect();
-        write!(f, "{digits}")
-    }
-}
-
-/// A positional notation representation of a number of dynamically growing width.
-///
-/// The digits are represented as a [`Vec<u8>`] with the most
-/// significant digit on the left and the least significant digit on
-/// the right. Each digit is a nonnegative integer less than the
-/// radix.
-///
-/// # Incrementing
-///
-/// This number starts at `vec![0, 0]`, representing the number 0 with
-/// a width of 2 digits. Incrementing this number with
-/// [`Number::increment`] causes it to increase its value by 1. When
-/// incrementing the number would have caused it to change from
-/// `vec![radix - 2, radix - 1]` to `vec![radix - 1, 0]`, it instead
-/// increases its width by one and resets its value to 0. For example,
-/// if the radix were 3, the digits were `vec![1, 2]`, and we called
-/// [`Number::increment`], then the digits would become `vec![0, 0,
-/// 0]`. In this way, the width grows by one each time the most
-/// significant digit would have achieved its maximum value.
-///
-/// This notion of "incrementing" here does not match the notion of
-/// incrementing the *value* of the number, it is just an abstract way
-/// of updating the representation of the number in a way that is only
-/// useful for the purposes of the `split` program.
-///
-/// # Displaying
-///
-/// This number is only displayable if `radix` is 10, 16, or 26. If
-/// `radix` is 10 or 16, then the digits are concatenated and
-/// displayed as a fixed-width decimal or hexadecimal number,
-/// respectively, with a prefix of `n - 2` instances of the character
-/// '9' of 'f', respectively, where `n` is the number of digits.  If
-/// `radix` is 26, then each digit is translated to the corresponding
-/// lowercase ASCII alphabetic character (that is, 'a', 'b', 'c',
-/// etc.) and concatenated with a prefix of `n - 2` instances of the
-/// character 'z'.
-///
-/// This notion of displaying the number is specific to the `split`
-/// program.
-#[derive(Clone)]
-pub struct DynamicWidthNumber {
-    radix: u8,
-    current: usize,
-}
-
-impl DynamicWidthNumber {
-    pub fn new(radix: u8, suffix_start: usize) -> Self {
-        Self {
-            radix,
-            current: suffix_start,
-        }
-    }
-
-    fn increment(&mut self) -> Result<(), Overflow> {
-        self.current += 1;
-        Ok(())
-    }
-
-    fn digits(&self) -> Vec<u8> {
-        let radix = self.radix as usize;
-        let mut remaining = self.current;
-        let mut sub_value = (radix - 1) * radix;
-        let mut num_fill_chars = 2;
-
-        // Convert the number into "num_fill_chars" and "remaining"
-        while remaining >= sub_value {
-            remaining -= sub_value;
-            sub_value *= radix;
-            num_fill_chars += 1;
-        }
-
-        // Convert the "remainder" to digits
-        let mut digits = Vec::new();
-        while remaining > 0 {
-            digits.push((remaining % radix) as u8);
-            remaining /= radix;
-        }
-        // Left pad the vec
-        digits.resize(num_fill_chars, 0);
-        digits.reverse();
-        digits
-    }
-}
-
-fn map_digit(radix: u8, d: u8) -> char {
-    (match radix {
-        10 => b'0' + d,
-        16 => {
-            if d < 10 {
-                b'0' + d
-            } else {
-                b'a' + (d - 10)
-            }
-        }
-        26 => b'a' + d,
-        _ => 0,
-    }) as char
-}
-
-impl Display for DynamicWidthNumber {
-    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
-        let digits: String = self
-            .digits()
-            .iter()
-            .map(|d| map_digit(self.radix, *d))
-            .collect();
-        let fill: String = (0..digits.len() - 2)
-            .map(|_| map_digit(self.radix, self.radix - 1))
-            .collect();
-        write!(f, "{fill}{digits}")
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::number::DynamicWidthNumber;
-    use crate::number::FixedWidthNumber;
-    use crate::number::Number;
-    use crate::number::Overflow;
-
-    #[test]
-    fn test_dynamic_width_number_increment() {
-        println!("Here");
-        let mut n = Number::DynamicWidth(DynamicWidthNumber::new(3, 0));
-        assert_eq!(n.digits(), vec![0, 0]);
-
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![0, 1]);
-
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![0, 2]);
-
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![1, 0]);
-
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![1, 1]);
-
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![1, 2]);
-
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![0, 0, 0]);
-
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![0, 0, 1]);
-    }
-
-    #[test]
-    fn test_dynamic_width_number_display_alphabetic() {
-        fn num(n: usize) -> Number {
-            let mut number = Number::DynamicWidth(DynamicWidthNumber::new(26, 0));
-            for _ in 0..n {
-                number.increment().unwrap();
-            }
-            number
-        }
-
-        assert_eq!(format!("{}", num(0)), "aa");
-        assert_eq!(format!("{}", num(1)), "ab");
-        assert_eq!(format!("{}", num(2)), "ac");
-        assert_eq!(format!("{}", num(25)), "az");
-        assert_eq!(format!("{}", num(26)), "ba");
-        assert_eq!(format!("{}", num(27)), "bb");
-        assert_eq!(format!("{}", num(28)), "bc");
-        assert_eq!(format!("{}", num(26 + 25)), "bz");
-        assert_eq!(format!("{}", num(26 + 26)), "ca");
-        assert_eq!(format!("{}", num(26 * 25 - 1)), "yz");
-        assert_eq!(format!("{}", num(26 * 25)), "zaaa");
-        assert_eq!(format!("{}", num(26 * 25 + 1)), "zaab");
-    }
-
-    #[test]
-    fn test_dynamic_width_number_display_numeric_decimal() {
-        fn num(n: usize) -> Number {
-            let mut number = Number::DynamicWidth(DynamicWidthNumber::new(10, 0));
-            for _ in 0..n {
-                number.increment().unwrap();
-            }
-            number
-        }
-
-        assert_eq!(format!("{}", num(0)), "00");
-        assert_eq!(format!("{}", num(9)), "09");
-        assert_eq!(format!("{}", num(17)), "17");
-        assert_eq!(format!("{}", num(10 * 9 - 1)), "89");
-        assert_eq!(format!("{}", num(10 * 9)), "9000");
-        assert_eq!(format!("{}", num(10 * 9 + 1)), "9001");
-        assert_eq!(format!("{}", num(10 * 99 - 1)), "9899");
-        assert_eq!(format!("{}", num(10 * 99)), "990000");
-        assert_eq!(format!("{}", num(10 * 99 + 1)), "990001");
-    }
-
-    #[test]
-    fn test_dynamic_width_number_display_numeric_hexadecimal() {
-        fn num(n: usize) -> Number {
-            let mut number = Number::DynamicWidth(DynamicWidthNumber::new(16, 0));
-            for _ in 0..n {
-                number.increment().unwrap();
-            }
-            number
-        }
-
-        assert_eq!(format!("{}", num(0)), "00");
-        assert_eq!(format!("{}", num(15)), "0f");
-        assert_eq!(format!("{}", num(16)), "10");
-        assert_eq!(format!("{}", num(17)), "11");
-        assert_eq!(format!("{}", num(18)), "12");
-
-        assert_eq!(format!("{}", num(16 * 15 - 1)), "ef");
-        assert_eq!(format!("{}", num(16 * 15)), "f000");
-        assert_eq!(format!("{}", num(16 * 15 + 1)), "f001");
-        assert_eq!(format!("{}", num(16 * 255 - 1)), "feff");
-        assert_eq!(format!("{}", num(16 * 255)), "ff0000");
-        assert_eq!(format!("{}", num(16 * 255 + 1)), "ff0001");
-    }
-
-    #[test]
-    fn test_fixed_width_number_increment() {
-        let mut n = Number::FixedWidth(FixedWidthNumber::new(3, 2, 0).unwrap());
-        assert_eq!(n.digits(), vec![0, 0]);
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![0, 1]);
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![0, 2]);
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![1, 0]);
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![1, 1]);
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![1, 2]);
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![2, 0]);
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![2, 1]);
-        n.increment().unwrap();
-        assert_eq!(n.digits(), vec![2, 2]);
-        assert!(n.increment().is_err());
-    }
-
-    #[test]
-    fn test_fixed_width_number_display_alphabetic() {
-        fn num(n: usize) -> Result<Number, Overflow> {
-            let mut number = Number::FixedWidth(FixedWidthNumber::new(26, 2, 0).unwrap());
-            for _ in 0..n {
-                number.increment()?;
-            }
-            Ok(number)
-        }
-
-        assert_eq!(format!("{}", num(0).unwrap()), "aa");
-        assert_eq!(format!("{}", num(1).unwrap()), "ab");
-        assert_eq!(format!("{}", num(2).unwrap()), "ac");
-        assert_eq!(format!("{}", num(25).unwrap()), "az");
-        assert_eq!(format!("{}", num(26).unwrap()), "ba");
-        assert_eq!(format!("{}", num(27).unwrap()), "bb");
-        assert_eq!(format!("{}", num(28).unwrap()), "bc");
-        assert_eq!(format!("{}", num(26 + 25).unwrap()), "bz");
-        assert_eq!(format!("{}", num(26 + 26).unwrap()), "ca");
-        assert_eq!(format!("{}", num(26 * 25 - 1).unwrap()), "yz");
-        assert_eq!(format!("{}", num(26 * 25).unwrap()), "za");
-        assert_eq!(format!("{}", num(26 * 26 - 1).unwrap()), "zz");
-        assert!(num(26 * 26).is_err());
-    }
-
-    #[test]
-    fn test_fixed_width_number_display_numeric_decimal() {
-        fn num(n: usize) -> Result<Number, Overflow> {
-            let mut number = Number::FixedWidth(FixedWidthNumber::new(10, 2, 0).unwrap());
-            for _ in 0..n {
-                number.increment()?;
-            }
-            Ok(number)
-        }
-
-        assert_eq!(format!("{}", num(0).unwrap()), "00");
-        assert_eq!(format!("{}", num(9).unwrap()), "09");
-        assert_eq!(format!("{}", num(17).unwrap()), "17");
-        assert_eq!(format!("{}", num(10 * 9 - 1).unwrap()), "89");
-        assert_eq!(format!("{}", num(10 * 9).unwrap()), "90");
-        assert_eq!(format!("{}", num(10 * 10 - 1).unwrap()), "99");
-        assert!(num(10 * 10).is_err());
-    }
-
-    #[test]
-    fn test_fixed_width_number_display_numeric_hexadecimal() {
-        fn num(n: usize) -> Result<Number, Overflow> {
-            let mut number = Number::FixedWidth(FixedWidthNumber::new(16, 2, 0).unwrap());
-            for _ in 0..n {
-                number.increment()?;
-            }
-            Ok(number)
-        }
-
-        assert_eq!(format!("{}", num(0).unwrap()), "00");
-        assert_eq!(format!("{}", num(15).unwrap()), "0f");
-        assert_eq!(format!("{}", num(17).unwrap()), "11");
-        assert_eq!(format!("{}", num(16 * 15 - 1).unwrap()), "ef");
-        assert_eq!(format!("{}", num(16 * 15).unwrap()), "f0");
-        assert_eq!(format!("{}", num(16 * 16 - 1).unwrap()), "ff");
-        assert!(num(16 * 16).is_err());
-    }
-
-    #[test]
-    fn test_fixed_width_number_start_suffix() {
-        fn num(n: usize) -> Result<Number, Overflow> {
-            let mut number = Number::FixedWidth(FixedWidthNumber::new(16, 2, 0x14)?);
-            for _ in 0..n {
-                number.increment()?;
-            }
-            Ok(number)
-        }
-
-        assert_eq!(format!("{}", num(0).unwrap()), "14");
-        assert_eq!(format!("{}", num(0xf).unwrap()), "23");
-    }
-
-    #[test]
-    fn test_dynamic_width_number_start_suffix() {
-        fn num(n: usize) -> Result<Number, Overflow> {
-            let mut number = Number::DynamicWidth(DynamicWidthNumber::new(10, 8));
-            for _ in 0..n {
-                number.increment()?;
-            }
-            Ok(number)
-        }
-
-        assert_eq!(format!("{}", num(0).unwrap()), "08");
-        assert_eq!(format!("{}", num(8).unwrap()), "16");
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_split/platform/mod.rs.html b/coreutils/dev/src/uu_split/platform/mod.rs.html deleted file mode 100644 index d41e36ab6..000000000 --- a/coreutils/dev/src/uu_split/platform/mod.rs.html +++ /dev/null @@ -1,31 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-
#[cfg(unix)]
-pub use self::unix::instantiate_current_writer;
-#[cfg(unix)]
-pub use self::unix::paths_refer_to_same_file;
-
-#[cfg(windows)]
-pub use self::windows::instantiate_current_writer;
-#[cfg(windows)]
-pub use self::windows::paths_refer_to_same_file;
-
-#[cfg(unix)]
-mod unix;
-
-#[cfg(windows)]
-mod windows;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_split/platform/unix.rs.html b/coreutils/dev/src/uu_split/platform/unix.rs.html deleted file mode 100644 index 3eb3d0dcb..000000000 --- a/coreutils/dev/src/uu_split/platform/unix.rs.html +++ /dev/null @@ -1,287 +0,0 @@ -unix.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-
use std::env;
-use std::io::Write;
-use std::io::{BufWriter, Error, ErrorKind, Result};
-use std::path::Path;
-use std::process::{Child, Command, Stdio};
-use uucore::crash;
-use uucore::fs;
-use uucore::fs::FileInformation;
-
-/// A writer that writes to a shell_process' stdin
-///
-/// We use a shell process (not directly calling a sub-process) so we can forward the name of the
-/// corresponding output file (xaa, xab, xac… ). This is the way it was implemented in GNU split.
-struct FilterWriter {
-    /// Running shell process
-    shell_process: Child,
-}
-
-impl Write for FilterWriter {
-    fn write(&mut self, buf: &[u8]) -> Result<usize> {
-        self.shell_process
-            .stdin
-            .as_mut()
-            .expect("failed to get shell stdin")
-            .write(buf)
-    }
-    fn flush(&mut self) -> Result<()> {
-        self.shell_process
-            .stdin
-            .as_mut()
-            .expect("failed to get shell stdin")
-            .flush()
-    }
-}
-
-/// Have an environment variable set at a value during this lifetime
-struct WithEnvVarSet {
-    /// Env var key
-    _previous_var_key: String,
-    /// Previous value set to this key
-    _previous_var_value: std::result::Result<String, env::VarError>,
-}
-impl WithEnvVarSet {
-    /// Save previous value assigned to key, set key=value
-    fn new(key: &str, value: &str) -> Self {
-        let previous_env_value = env::var(key);
-        env::set_var(key, value);
-        Self {
-            _previous_var_key: String::from(key),
-            _previous_var_value: previous_env_value,
-        }
-    }
-}
-
-impl Drop for WithEnvVarSet {
-    /// Restore previous value now that this is being dropped by context
-    fn drop(&mut self) {
-        if let Ok(ref prev_value) = self._previous_var_value {
-            env::set_var(&self._previous_var_key, prev_value);
-        } else {
-            env::remove_var(&self._previous_var_key);
-        }
-    }
-}
-impl FilterWriter {
-    /// Create a new filter running a command with $FILE pointing at the output name
-    ///
-    /// #Arguments
-    ///
-    /// * `command` - The shell command to execute
-    /// * `filepath` - Path of the output file (forwarded to command as $FILE)
-    fn new(command: &str, filepath: &str) -> Result<Self> {
-        // set $FILE, save previous value (if there was one)
-        let _with_env_var_set = WithEnvVarSet::new("FILE", filepath);
-
-        let shell_process =
-            Command::new(env::var("SHELL").unwrap_or_else(|_| "/bin/sh".to_owned()))
-                .arg("-c")
-                .arg(command)
-                .stdin(Stdio::piped())
-                .spawn()?;
-
-        Ok(Self { shell_process })
-    }
-}
-
-impl Drop for FilterWriter {
-    /// flush stdin, close it and wait on `shell_process` before dropping self
-    fn drop(&mut self) {
-        {
-            // close stdin by dropping it
-            let _stdin = self.shell_process.stdin.as_mut();
-        }
-        let exit_status = self
-            .shell_process
-            .wait()
-            .expect("Couldn't wait for child process");
-        if let Some(return_code) = exit_status.code() {
-            if return_code != 0 {
-                crash!(1, "Shell process returned {}", return_code);
-            }
-        } else {
-            crash!(1, "Shell process terminated by signal")
-        }
-    }
-}
-
-/// Instantiate either a file writer or a "write to shell process's stdin" writer
-pub fn instantiate_current_writer(
-    filter: &Option<String>,
-    filename: &str,
-) -> Result<BufWriter<Box<dyn Write>>> {
-    match filter {
-        None => Ok(BufWriter::new(Box::new(
-            // write to the next file
-            std::fs::OpenOptions::new()
-                .write(true)
-                .create(true)
-                .truncate(true)
-                .open(std::path::Path::new(&filename))
-                .map_err(|_| {
-                    Error::new(
-                        ErrorKind::Other,
-                        format!("unable to open '{filename}'; aborting"),
-                    )
-                })?,
-        ) as Box<dyn Write>)),
-        Some(ref filter_command) => Ok(BufWriter::new(Box::new(
-            // spawn a shell command and write to it
-            FilterWriter::new(filter_command, filename)?,
-        ) as Box<dyn Write>)),
-    }
-}
-
-pub fn paths_refer_to_same_file(p1: &str, p2: &str) -> bool {
-    // We have to take symlinks and relative paths into account.
-    let p1 = if p1 == "-" {
-        FileInformation::from_file(&std::io::stdin())
-    } else {
-        FileInformation::from_path(Path::new(&p1), true)
-    };
-    fs::infos_refer_to_same_file(p1, FileInformation::from_path(Path::new(p2), true))
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_split/split.rs.html b/coreutils/dev/src/uu_split/split.rs.html deleted file mode 100644 index 2d5e57c51..000000000 --- a/coreutils/dev/src/uu_split/split.rs.html +++ /dev/null @@ -1,2899 +0,0 @@ -split.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
-1143
-1144
-1145
-1146
-1147
-1148
-1149
-1150
-1151
-1152
-1153
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162
-1163
-1164
-1165
-1166
-1167
-1168
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179
-1180
-1181
-1182
-1183
-1184
-1185
-1186
-1187
-1188
-1189
-1190
-1191
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200
-1201
-1202
-1203
-1204
-1205
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214
-1215
-1216
-1217
-1218
-1219
-1220
-1221
-1222
-1223
-1224
-1225
-1226
-1227
-1228
-1229
-1230
-1231
-1232
-1233
-1234
-1235
-1236
-1237
-1238
-1239
-1240
-1241
-1242
-1243
-1244
-1245
-1246
-1247
-1248
-1249
-1250
-1251
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-1265
-1266
-1267
-1268
-1269
-1270
-1271
-1272
-1273
-1274
-1275
-1276
-1277
-1278
-1279
-1280
-1281
-1282
-1283
-1284
-1285
-1286
-1287
-1288
-1289
-1290
-1291
-1292
-1293
-1294
-1295
-1296
-1297
-1298
-1299
-1300
-1301
-1302
-1303
-1304
-1305
-1306
-1307
-1308
-1309
-1310
-1311
-1312
-1313
-1314
-1315
-1316
-1317
-1318
-1319
-1320
-1321
-1322
-1323
-1324
-1325
-1326
-1327
-1328
-1329
-1330
-1331
-1332
-1333
-1334
-1335
-1336
-1337
-1338
-1339
-1340
-1341
-1342
-1343
-1344
-1345
-1346
-1347
-1348
-1349
-1350
-1351
-1352
-1353
-1354
-1355
-1356
-1357
-1358
-1359
-1360
-1361
-1362
-1363
-1364
-1365
-1366
-1367
-1368
-1369
-1370
-1371
-1372
-1373
-1374
-1375
-1376
-1377
-1378
-1379
-1380
-1381
-1382
-1383
-1384
-1385
-1386
-1387
-1388
-1389
-1390
-1391
-1392
-1393
-1394
-1395
-1396
-1397
-1398
-1399
-1400
-1401
-1402
-1403
-1404
-1405
-1406
-1407
-1408
-1409
-1410
-1411
-1412
-1413
-1414
-1415
-1416
-1417
-1418
-1419
-1420
-1421
-1422
-1423
-1424
-1425
-1426
-1427
-1428
-1429
-1430
-1431
-1432
-1433
-1434
-1435
-1436
-1437
-1438
-1439
-1440
-1441
-1442
-1443
-1444
-1445
-1446
-1447
-1448
-1449
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Akira Hayakawa <ruby.wktk@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore nbbbb ncccc
-
-mod filenames;
-mod number;
-mod platform;
-
-use crate::filenames::FilenameIterator;
-use crate::filenames::SuffixType;
-use clap::ArgAction;
-use clap::{crate_version, parser::ValueSource, Arg, ArgMatches, Command};
-use std::env;
-use std::fmt;
-use std::fs::{metadata, File};
-use std::io;
-use std::io::{stdin, BufRead, BufReader, BufWriter, ErrorKind, Read, Write};
-use std::path::Path;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UIoError, UResult, USimpleError, UUsageError};
-use uucore::parse_size::{parse_size, ParseSizeError};
-use uucore::uio_error;
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-static OPT_BYTES: &str = "bytes";
-static OPT_LINE_BYTES: &str = "line-bytes";
-static OPT_LINES: &str = "lines";
-static OPT_ADDITIONAL_SUFFIX: &str = "additional-suffix";
-static OPT_FILTER: &str = "filter";
-static OPT_NUMBER: &str = "number";
-static OPT_NUMERIC_SUFFIXES: &str = "numeric-suffixes";
-static OPT_HEX_SUFFIXES: &str = "hex-suffixes";
-static OPT_SUFFIX_LENGTH: &str = "suffix-length";
-static OPT_DEFAULT_SUFFIX_LENGTH: &str = "0";
-static OPT_VERBOSE: &str = "verbose";
-//The ---io and ---io-blksize parameters are consumed and ignored.
-//The parameter is included to make GNU coreutils tests pass.
-static OPT_IO: &str = "-io";
-static OPT_IO_BLKSIZE: &str = "-io-blksize";
-static OPT_ELIDE_EMPTY_FILES: &str = "elide-empty-files";
-
-static ARG_INPUT: &str = "input";
-static ARG_PREFIX: &str = "prefix";
-
-const ABOUT: &str = help_about!("split.md");
-const USAGE: &str = help_usage!("split.md");
-const AFTER_HELP: &str = help_section!("after help", "split.md");
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-    match Settings::from(&matches) {
-        Ok(settings) => split(&settings),
-        Err(e) if e.requires_usage() => Err(UUsageError::new(1, format!("{e}"))),
-        Err(e) => Err(USimpleError::new(1, format!("{e}"))),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(AFTER_HELP)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        // strategy (mutually exclusive)
-        .arg(
-            Arg::new(OPT_BYTES)
-                .short('b')
-                .long(OPT_BYTES)
-                .value_name("SIZE")
-                .help("put SIZE bytes per output file"),
-        )
-        .arg(
-            Arg::new(OPT_LINE_BYTES)
-                .short('C')
-                .long(OPT_LINE_BYTES)
-                .value_name("SIZE")
-                .default_value("2")
-                .help("put at most SIZE bytes of lines per output file"),
-        )
-        .arg(
-            Arg::new(OPT_LINES)
-                .short('l')
-                .long(OPT_LINES)
-                .value_name("NUMBER")
-                .default_value("1000")
-                .help("put NUMBER lines/records per output file"),
-        )
-        .arg(
-            Arg::new(OPT_NUMBER)
-                .short('n')
-                .long(OPT_NUMBER)
-                .value_name("CHUNKS")
-                .help("generate CHUNKS output files; see explanation below"),
-        )
-        // rest of the arguments
-        .arg(
-            Arg::new(OPT_ADDITIONAL_SUFFIX)
-                .long(OPT_ADDITIONAL_SUFFIX)
-                .value_name("SUFFIX")
-                .default_value("")
-                .help("additional SUFFIX to append to output file names"),
-        )
-        .arg(
-            Arg::new(OPT_FILTER)
-                .long(OPT_FILTER)
-                .value_name("COMMAND")
-                .value_hint(clap::ValueHint::CommandName)
-                .help(
-                    "write to shell COMMAND; file name is $FILE (Currently not implemented for Windows)",
-                ),
-        )
-        .arg(
-            Arg::new(OPT_ELIDE_EMPTY_FILES)
-                .long(OPT_ELIDE_EMPTY_FILES)
-                .short('e')
-                .help("do not generate empty output files with '-n'")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_NUMERIC_SUFFIXES)
-                .short('d')
-                .long(OPT_NUMERIC_SUFFIXES)
-                .default_missing_value("0")
-                .num_args(0..=1)
-                .help("use numeric suffixes instead of alphabetic"),
-        )
-        .arg(
-            Arg::new(OPT_SUFFIX_LENGTH)
-                .short('a')
-                .long(OPT_SUFFIX_LENGTH)
-                .value_name("N")
-                .default_value(OPT_DEFAULT_SUFFIX_LENGTH)
-                .help("use suffixes of fixed length N. 0 implies dynamic length."),
-        )
-        .arg(
-            Arg::new(OPT_HEX_SUFFIXES)
-                .short('x')
-                .long(OPT_HEX_SUFFIXES)
-                .default_missing_value("0")
-                .num_args(0..=1)
-                .help("use hex suffixes instead of alphabetic"),
-        )
-        .arg(
-            Arg::new(OPT_VERBOSE)
-                .long(OPT_VERBOSE)
-                .help("print a diagnostic just before each output file is opened")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(OPT_IO)
-                .long("io")
-                .alias(OPT_IO)
-                .hide(true),
-        )
-        .arg(
-            Arg::new(OPT_IO_BLKSIZE)
-                .long("io-blksize")
-                .alias(OPT_IO_BLKSIZE)
-                .hide(true),
-        )
-        .arg(
-            Arg::new(ARG_INPUT)
-                .default_value("-")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(ARG_PREFIX)
-                .default_value("x")
-        )
-}
-
-/// Sub-strategy to use when splitting a file into a specific number of chunks.
-#[derive(Debug, PartialEq)]
-enum NumberType {
-    /// Split into a specific number of chunks by byte.
-    Bytes(u64),
-
-    /// Split into a specific number of chunks by line (approximately).
-    Lines(u64),
-
-    /// Split into a specific number of chunks by line
-    /// (approximately), but output only the *k*th chunk.
-    KthLines(u64, u64),
-
-    /// Assign lines via round-robin to the specified number of output chunks.
-    RoundRobin(u64),
-
-    /// Assign lines via round-robin to the specified number of output
-    /// chunks, but output only the *k*th chunk.
-    KthRoundRobin(u64, u64),
-}
-
-impl NumberType {
-    /// The number of chunks for this number type.
-    fn num_chunks(&self) -> u64 {
-        match self {
-            Self::Bytes(n) => *n,
-            Self::Lines(n) => *n,
-            Self::KthLines(_, n) => *n,
-            Self::RoundRobin(n) => *n,
-            Self::KthRoundRobin(_, n) => *n,
-        }
-    }
-}
-
-/// An error due to an invalid parameter to the `-n` command-line option.
-#[derive(Debug, PartialEq)]
-enum NumberTypeError {
-    /// The number of chunks was invalid.
-    ///
-    /// This can happen if the value of `N` in any of the following
-    /// command-line options is not a positive integer:
-    ///
-    /// ```ignore
-    /// -n N
-    /// -n l/N
-    /// -n l/K/N
-    /// -n r/N
-    /// -n r/K/N
-    /// ```
-    NumberOfChunks(String),
-
-    /// The chunk number was invalid.
-    ///
-    /// This can happen if the value of `K` in any of the following
-    /// command-line options is not a positive integer:
-    ///
-    /// ```ignore
-    /// -n l/K/N
-    /// -n r/K/N
-    /// ```
-    ChunkNumber(String),
-}
-
-impl NumberType {
-    /// Parse a `NumberType` from a string.
-    ///
-    /// The following strings are valid arguments:
-    ///
-    /// ```ignore
-    /// "N"
-    /// "l/N"
-    /// "l/K/N"
-    /// "r/N"
-    /// "r/K/N"
-    /// ```
-    ///
-    /// The `N` represents the number of chunks and the `K` represents
-    /// a chunk number.
-    ///
-    /// # Errors
-    ///
-    /// If the string is not one of the valid number types, if `K` is
-    /// not a nonnegative integer, or if `N` is not a positive
-    /// integer, then this function returns [`NumberTypeError`].
-    fn from(s: &str) -> Result<Self, NumberTypeError> {
-        let parts: Vec<&str> = s.split('/').collect();
-        match &parts[..] {
-            [n_str] => {
-                let num_chunks = n_str
-                    .parse()
-                    .map_err(|_| NumberTypeError::NumberOfChunks(n_str.to_string()))?;
-                if num_chunks > 0 {
-                    Ok(Self::Bytes(num_chunks))
-                } else {
-                    Err(NumberTypeError::NumberOfChunks(s.to_string()))
-                }
-            }
-            ["l", n_str] => {
-                let num_chunks = n_str
-                    .parse()
-                    .map_err(|_| NumberTypeError::NumberOfChunks(n_str.to_string()))?;
-                Ok(Self::Lines(num_chunks))
-            }
-            ["l", k_str, n_str] => {
-                let num_chunks = n_str
-                    .parse()
-                    .map_err(|_| NumberTypeError::NumberOfChunks(n_str.to_string()))?;
-                let chunk_number = k_str
-                    .parse()
-                    .map_err(|_| NumberTypeError::ChunkNumber(k_str.to_string()))?;
-                Ok(Self::KthLines(chunk_number, num_chunks))
-            }
-            ["r", n_str] => {
-                let num_chunks = n_str
-                    .parse()
-                    .map_err(|_| NumberTypeError::NumberOfChunks(n_str.to_string()))?;
-                Ok(Self::RoundRobin(num_chunks))
-            }
-            ["r", k_str, n_str] => {
-                let num_chunks = n_str
-                    .parse()
-                    .map_err(|_| NumberTypeError::NumberOfChunks(n_str.to_string()))?;
-                let chunk_number = k_str
-                    .parse()
-                    .map_err(|_| NumberTypeError::ChunkNumber(k_str.to_string()))?;
-                Ok(Self::KthRoundRobin(chunk_number, num_chunks))
-            }
-            _ => Err(NumberTypeError::NumberOfChunks(s.to_string())),
-        }
-    }
-}
-
-/// The strategy for breaking up the input file into chunks.
-enum Strategy {
-    /// Each chunk has the specified number of lines.
-    Lines(u64),
-
-    /// Each chunk has the specified number of bytes.
-    Bytes(u64),
-
-    /// Each chunk has as many lines as possible without exceeding the
-    /// specified number of bytes.
-    LineBytes(u64),
-
-    /// Split the file into this many chunks.
-    ///
-    /// There are several sub-strategies available, as defined by
-    /// [`NumberType`].
-    Number(NumberType),
-}
-
-/// An error when parsing a chunking strategy from command-line arguments.
-enum StrategyError {
-    /// Invalid number of lines.
-    Lines(ParseSizeError),
-
-    /// Invalid number of bytes.
-    Bytes(ParseSizeError),
-
-    /// Invalid number type.
-    NumberType(NumberTypeError),
-
-    /// Multiple chunking strategies were specified (but only one should be).
-    MultipleWays,
-}
-
-impl fmt::Display for StrategyError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match self {
-            Self::Lines(e) => write!(f, "invalid number of lines: {e}"),
-            Self::Bytes(e) => write!(f, "invalid number of bytes: {e}"),
-            Self::NumberType(NumberTypeError::NumberOfChunks(s)) => {
-                write!(f, "invalid number of chunks: {s}")
-            }
-            Self::NumberType(NumberTypeError::ChunkNumber(s)) => {
-                write!(f, "invalid chunk number: {s}")
-            }
-            Self::MultipleWays => write!(f, "cannot split in more than one way"),
-        }
-    }
-}
-
-impl Strategy {
-    /// Parse a strategy from the command-line arguments.
-    fn from(matches: &ArgMatches) -> Result<Self, StrategyError> {
-        fn get_and_parse(
-            matches: &ArgMatches,
-            option: &str,
-            strategy: fn(u64) -> Strategy,
-            error: fn(ParseSizeError) -> StrategyError,
-        ) -> Result<Strategy, StrategyError> {
-            let s = matches.get_one::<String>(option).unwrap();
-            let n = parse_size(s).map_err(error)?;
-            if n > 0 {
-                Ok(strategy(n))
-            } else {
-                Err(error(ParseSizeError::ParseFailure(s.to_string())))
-            }
-        }
-        // Check that the user is not specifying more than one strategy.
-        //
-        // Note: right now, this exact behavior cannot be handled by
-        // `ArgGroup` since `ArgGroup` considers a default value `Arg`
-        // as "defined".
-        match (
-            matches.value_source(OPT_LINES) == Some(ValueSource::CommandLine),
-            matches.value_source(OPT_BYTES) == Some(ValueSource::CommandLine),
-            matches.value_source(OPT_LINE_BYTES) == Some(ValueSource::CommandLine),
-            matches.value_source(OPT_NUMBER) == Some(ValueSource::CommandLine),
-        ) {
-            (false, false, false, false) => Ok(Self::Lines(1000)),
-            (true, false, false, false) => {
-                get_and_parse(matches, OPT_LINES, Self::Lines, StrategyError::Lines)
-            }
-            (false, true, false, false) => {
-                get_and_parse(matches, OPT_BYTES, Self::Bytes, StrategyError::Bytes)
-            }
-            (false, false, true, false) => get_and_parse(
-                matches,
-                OPT_LINE_BYTES,
-                Self::LineBytes,
-                StrategyError::Bytes,
-            ),
-            (false, false, false, true) => {
-                let s = matches.get_one::<String>(OPT_NUMBER).unwrap();
-                let number_type = NumberType::from(s).map_err(StrategyError::NumberType)?;
-                Ok(Self::Number(number_type))
-            }
-            _ => Err(StrategyError::MultipleWays),
-        }
-    }
-}
-
-/// Parse the suffix type from the command-line arguments.
-fn suffix_type_from(matches: &ArgMatches) -> Result<(SuffixType, usize), SettingsError> {
-    if matches.value_source(OPT_NUMERIC_SUFFIXES) == Some(ValueSource::CommandLine) {
-        let suffix_start = matches.get_one::<String>(OPT_NUMERIC_SUFFIXES);
-        let suffix_start = suffix_start.ok_or(SettingsError::SuffixNotParsable(String::new()))?;
-        let suffix_start = suffix_start
-            .parse()
-            .map_err(|_| SettingsError::SuffixNotParsable(suffix_start.to_string()))?;
-        Ok((SuffixType::Decimal, suffix_start))
-    } else if matches.value_source(OPT_HEX_SUFFIXES) == Some(ValueSource::CommandLine) {
-        let suffix_start = matches.get_one::<String>(OPT_HEX_SUFFIXES);
-        let suffix_start = suffix_start.ok_or(SettingsError::SuffixNotParsable(String::new()))?;
-        let suffix_start = usize::from_str_radix(suffix_start, 16)
-            .map_err(|_| SettingsError::SuffixNotParsable(suffix_start.to_string()))?;
-        Ok((SuffixType::Hexadecimal, suffix_start))
-    } else {
-        // no numeric/hex suffix
-        Ok((SuffixType::Alphabetic, 0))
-    }
-}
-
-/// Parameters that control how a file gets split.
-///
-/// You can convert an [`ArgMatches`] instance into a [`Settings`]
-/// instance by calling [`Settings::from`].
-struct Settings {
-    prefix: String,
-    suffix_type: SuffixType,
-    suffix_length: usize,
-    suffix_start: usize,
-    additional_suffix: String,
-    input: String,
-    /// When supplied, a shell command to output to instead of xaa, xab …
-    filter: Option<String>,
-    strategy: Strategy,
-    verbose: bool,
-
-    /// Whether to *not* produce empty files when using `-n`.
-    ///
-    /// The `-n` command-line argument gives a specific number of
-    /// chunks into which the input files will be split. If the number
-    /// of chunks is greater than the number of bytes, and this is
-    /// `false`, then empty files will be created for the excess
-    /// chunks. If this is `false`, then empty files will not be
-    /// created.
-    elide_empty_files: bool,
-}
-
-/// An error when parsing settings from command-line arguments.
-enum SettingsError {
-    /// Invalid chunking strategy.
-    Strategy(StrategyError),
-
-    /// Invalid suffix length parameter.
-    SuffixNotParsable(String),
-
-    /// Suffix contains a directory separator, which is not allowed.
-    SuffixContainsSeparator(String),
-
-    /// Suffix is not large enough to split into specified chunks
-    SuffixTooSmall(usize),
-
-    /// The `--filter` option is not supported on Windows.
-    #[cfg(windows)]
-    NotSupported,
-}
-
-impl SettingsError {
-    /// Whether the error demands a usage message.
-    fn requires_usage(&self) -> bool {
-        matches!(
-            self,
-            Self::Strategy(StrategyError::MultipleWays) | Self::SuffixContainsSeparator(_)
-        )
-    }
-}
-
-impl fmt::Display for SettingsError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match self {
-            Self::Strategy(e) => e.fmt(f),
-            Self::SuffixNotParsable(s) => write!(f, "invalid suffix length: {}", s.quote()),
-            Self::SuffixTooSmall(i) => write!(f, "the suffix length needs to be at least {i}"),
-            Self::SuffixContainsSeparator(s) => write!(
-                f,
-                "invalid suffix {}, contains directory separator",
-                s.quote()
-            ),
-            #[cfg(windows)]
-            Self::NotSupported => write!(
-                f,
-                "{OPT_FILTER} is currently not supported in this platform"
-            ),
-        }
-    }
-}
-
-impl Settings {
-    /// Parse a strategy from the command-line arguments.
-    fn from(matches: &ArgMatches) -> Result<Self, SettingsError> {
-        let additional_suffix = matches
-            .get_one::<String>(OPT_ADDITIONAL_SUFFIX)
-            .unwrap()
-            .to_string();
-        if additional_suffix.contains('/') {
-            return Err(SettingsError::SuffixContainsSeparator(additional_suffix));
-        }
-        let strategy = Strategy::from(matches).map_err(SettingsError::Strategy)?;
-        let (suffix_type, suffix_start) = suffix_type_from(matches)?;
-        let suffix_length_str = matches.get_one::<String>(OPT_SUFFIX_LENGTH).unwrap();
-        let suffix_length: usize = suffix_length_str
-            .parse()
-            .map_err(|_| SettingsError::SuffixNotParsable(suffix_length_str.to_string()))?;
-        if let Strategy::Number(ref number_type) = strategy {
-            let chunks = number_type.num_chunks();
-            if suffix_length != 0 {
-                let required_suffix_length =
-                    (chunks as f64).log(suffix_type.radix() as f64).ceil() as usize;
-                if suffix_length < required_suffix_length {
-                    return Err(SettingsError::SuffixTooSmall(required_suffix_length));
-                }
-            }
-        }
-        let result = Self {
-            suffix_length: suffix_length_str
-                .parse()
-                .map_err(|_| SettingsError::SuffixNotParsable(suffix_length_str.to_string()))?,
-            suffix_type,
-            suffix_start,
-            additional_suffix,
-            verbose: matches.value_source("verbose") == Some(ValueSource::CommandLine),
-            strategy,
-            input: matches.get_one::<String>(ARG_INPUT).unwrap().to_owned(),
-            prefix: matches.get_one::<String>(ARG_PREFIX).unwrap().to_owned(),
-            filter: matches.get_one::<String>(OPT_FILTER).map(|s| s.to_owned()),
-            elide_empty_files: matches.get_flag(OPT_ELIDE_EMPTY_FILES),
-        };
-        #[cfg(windows)]
-        if result.filter.is_some() {
-            // see https://github.com/rust-lang/rust/issues/29494
-            return Err(SettingsError::NotSupported);
-        }
-
-        Ok(result)
-    }
-
-    fn instantiate_current_writer(&self, filename: &str) -> io::Result<BufWriter<Box<dyn Write>>> {
-        if platform::paths_refer_to_same_file(&self.input, filename) {
-            return Err(io::Error::new(
-                ErrorKind::Other,
-                format!("'{filename}' would overwrite input; aborting"),
-            ));
-        }
-
-        platform::instantiate_current_writer(&self.filter, filename)
-    }
-}
-
-/// Write a certain number of bytes to one file, then move on to another one.
-///
-/// This struct maintains an underlying writer representing the
-/// current chunk of the output. If a call to [`write`] would cause
-/// the underlying writer to write more than the allowed number of
-/// bytes, a new writer is created and the excess bytes are written to
-/// that one instead. As many new underlying writers are created as
-/// needed to write all the bytes in the input buffer.
-struct ByteChunkWriter<'a> {
-    /// Parameters for creating the underlying writer for each new chunk.
-    settings: &'a Settings,
-
-    /// The maximum number of bytes allowed for a single chunk of output.
-    chunk_size: u64,
-
-    /// Running total of number of chunks that have been completed.
-    num_chunks_written: u64,
-
-    /// Remaining capacity in number of bytes in the current chunk.
-    ///
-    /// This number starts at `chunk_size` and decreases as bytes are
-    /// written. Once it reaches zero, a writer for a new chunk is
-    /// initialized and this number gets reset to `chunk_size`.
-    num_bytes_remaining_in_current_chunk: u64,
-
-    /// The underlying writer for the current chunk.
-    ///
-    /// Once the number of bytes written to this writer exceeds
-    /// `chunk_size`, a new writer is initialized and assigned to this
-    /// field.
-    inner: BufWriter<Box<dyn Write>>,
-
-    /// Iterator that yields filenames for each chunk.
-    filename_iterator: FilenameIterator<'a>,
-}
-
-impl<'a> ByteChunkWriter<'a> {
-    fn new(chunk_size: u64, settings: &'a Settings) -> UResult<ByteChunkWriter<'a>> {
-        let mut filename_iterator = FilenameIterator::new(
-            &settings.prefix,
-            &settings.additional_suffix,
-            settings.suffix_length,
-            settings.suffix_type,
-            settings.suffix_start,
-        )?;
-        let filename = filename_iterator
-            .next()
-            .ok_or_else(|| USimpleError::new(1, "output file suffixes exhausted"))?;
-        if settings.verbose {
-            println!("creating file {}", filename.quote());
-        }
-        let inner = settings.instantiate_current_writer(&filename)?;
-        Ok(ByteChunkWriter {
-            settings,
-            chunk_size,
-            num_bytes_remaining_in_current_chunk: chunk_size,
-            num_chunks_written: 0,
-            inner,
-            filename_iterator,
-        })
-    }
-}
-
-impl<'a> Write for ByteChunkWriter<'a> {
-    fn write(&mut self, mut buf: &[u8]) -> std::io::Result<usize> {
-        // If the length of `buf` exceeds the number of bytes remaining
-        // in the current chunk, we will need to write to multiple
-        // different underlying writers. In that case, each iteration of
-        // this loop writes to the underlying writer that corresponds to
-        // the current chunk number.
-        let mut carryover_bytes_written: usize = 0;
-        loop {
-            if buf.is_empty() {
-                return Ok(carryover_bytes_written);
-            }
-
-            if self.num_bytes_remaining_in_current_chunk == 0 {
-                // Increment the chunk number, reset the number of bytes remaining, and instantiate the new underlying writer.
-                self.num_chunks_written += 1;
-                self.num_bytes_remaining_in_current_chunk = self.chunk_size;
-
-                // Allocate the new file, since at this point we know there are bytes to be written to it.
-                let filename = self.filename_iterator.next().ok_or_else(|| {
-                    std::io::Error::new(ErrorKind::Other, "output file suffixes exhausted")
-                })?;
-                if self.settings.verbose {
-                    println!("creating file {}", filename.quote());
-                }
-                self.inner = self.settings.instantiate_current_writer(&filename)?;
-            }
-
-            // If the capacity of this chunk is greater than the number of
-            // bytes in `buf`, then write all the bytes in `buf`. Otherwise,
-            // write enough bytes to fill the current chunk, then increment
-            // the chunk number and repeat.
-            let n = buf.len();
-            if (n as u64) < self.num_bytes_remaining_in_current_chunk {
-                let num_bytes_written = self.inner.write(buf)?;
-                self.num_bytes_remaining_in_current_chunk -= num_bytes_written as u64;
-                return Ok(carryover_bytes_written + num_bytes_written);
-            } else {
-                // Write enough bytes to fill the current chunk.
-                //
-                // Conversion to usize is safe because we checked that
-                // self.num_bytes_remaining_in_current_chunk is lower than
-                // n, which is already usize.
-                let i = self.num_bytes_remaining_in_current_chunk as usize;
-                let num_bytes_written = self.inner.write(&buf[..i])?;
-                self.num_bytes_remaining_in_current_chunk -= num_bytes_written as u64;
-
-                // It's possible that the underlying writer did not
-                // write all the bytes.
-                if num_bytes_written < i {
-                    return Ok(carryover_bytes_written + num_bytes_written);
-                } else {
-                    // Move the window to look at only the remaining bytes.
-                    buf = &buf[i..];
-
-                    // Remember for the next iteration that we wrote these bytes.
-                    carryover_bytes_written += num_bytes_written;
-                }
-            }
-        }
-    }
-    fn flush(&mut self) -> std::io::Result<()> {
-        self.inner.flush()
-    }
-}
-
-/// Write a certain number of lines to one file, then move on to another one.
-///
-/// This struct maintains an underlying writer representing the
-/// current chunk of the output. If a call to [`write`] would cause
-/// the underlying writer to write more than the allowed number of
-/// lines, a new writer is created and the excess lines are written to
-/// that one instead. As many new underlying writers are created as
-/// needed to write all the lines in the input buffer.
-struct LineChunkWriter<'a> {
-    /// Parameters for creating the underlying writer for each new chunk.
-    settings: &'a Settings,
-
-    /// The maximum number of lines allowed for a single chunk of output.
-    chunk_size: u64,
-
-    /// Running total of number of chunks that have been completed.
-    num_chunks_written: u64,
-
-    /// Remaining capacity in number of lines in the current chunk.
-    ///
-    /// This number starts at `chunk_size` and decreases as lines are
-    /// written. Once it reaches zero, a writer for a new chunk is
-    /// initialized and this number gets reset to `chunk_size`.
-    num_lines_remaining_in_current_chunk: u64,
-
-    /// The underlying writer for the current chunk.
-    ///
-    /// Once the number of lines written to this writer exceeds
-    /// `chunk_size`, a new writer is initialized and assigned to this
-    /// field.
-    inner: BufWriter<Box<dyn Write>>,
-
-    /// Iterator that yields filenames for each chunk.
-    filename_iterator: FilenameIterator<'a>,
-}
-
-impl<'a> LineChunkWriter<'a> {
-    fn new(chunk_size: u64, settings: &'a Settings) -> UResult<LineChunkWriter<'a>> {
-        let mut filename_iterator = FilenameIterator::new(
-            &settings.prefix,
-            &settings.additional_suffix,
-            settings.suffix_length,
-            settings.suffix_type,
-            settings.suffix_start,
-        )?;
-        let filename = filename_iterator
-            .next()
-            .ok_or_else(|| USimpleError::new(1, "output file suffixes exhausted"))?;
-        if settings.verbose {
-            println!("creating file {}", filename.quote());
-        }
-        let inner = settings.instantiate_current_writer(&filename)?;
-        Ok(LineChunkWriter {
-            settings,
-            chunk_size,
-            num_lines_remaining_in_current_chunk: chunk_size,
-            num_chunks_written: 0,
-            inner,
-            filename_iterator,
-        })
-    }
-}
-
-impl<'a> Write for LineChunkWriter<'a> {
-    fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
-        // If the number of lines in `buf` exceeds the number of lines
-        // remaining in the current chunk, we will need to write to
-        // multiple different underlying writers. In that case, each
-        // iteration of this loop writes to the underlying writer that
-        // corresponds to the current chunk number.
-        let mut prev = 0;
-        let mut total_bytes_written = 0;
-        for i in memchr::memchr_iter(b'\n', buf) {
-            // If we have exceeded the number of lines to write in the
-            // current chunk, then start a new chunk and its
-            // corresponding writer.
-            if self.num_lines_remaining_in_current_chunk == 0 {
-                self.num_chunks_written += 1;
-                let filename = self.filename_iterator.next().ok_or_else(|| {
-                    std::io::Error::new(ErrorKind::Other, "output file suffixes exhausted")
-                })?;
-                if self.settings.verbose {
-                    println!("creating file {}", filename.quote());
-                }
-                self.inner = self.settings.instantiate_current_writer(&filename)?;
-                self.num_lines_remaining_in_current_chunk = self.chunk_size;
-            }
-
-            // Write the line, starting from *after* the previous
-            // newline character and ending *after* the current
-            // newline character.
-            let n = self.inner.write(&buf[prev..i + 1])?;
-            total_bytes_written += n;
-            prev = i + 1;
-            self.num_lines_remaining_in_current_chunk -= 1;
-        }
-
-        let n = self.inner.write(&buf[prev..buf.len()])?;
-        total_bytes_written += n;
-        Ok(total_bytes_written)
-    }
-
-    fn flush(&mut self) -> std::io::Result<()> {
-        self.inner.flush()
-    }
-}
-
-/// Write lines to each sequential output files, limited by bytes.
-///
-/// This struct maintains an underlying writer representing the
-/// current chunk of the output. On each call to [`write`], it writes
-/// as many lines as possible to the current chunk without exceeding
-/// the specified byte limit. If a single line has more bytes than the
-/// limit, then fill an entire single chunk with those bytes and
-/// handle the remainder of the line as if it were its own distinct
-/// line. As many new underlying writers are created as needed to
-/// write all the data in the input buffer.
-struct LineBytesChunkWriter<'a> {
-    /// Parameters for creating the underlying writer for each new chunk.
-    settings: &'a Settings,
-
-    /// The maximum number of bytes allowed for a single chunk of output.
-    chunk_size: u64,
-
-    /// Running total of number of chunks that have been completed.
-    num_chunks_written: usize,
-
-    /// Remaining capacity in number of bytes in the current chunk.
-    ///
-    /// This number starts at `chunk_size` and decreases as lines are
-    /// written. Once it reaches zero, a writer for a new chunk is
-    /// initialized and this number gets reset to `chunk_size`.
-    num_bytes_remaining_in_current_chunk: usize,
-
-    /// The underlying writer for the current chunk.
-    ///
-    /// Once the number of bytes written to this writer exceeds
-    /// `chunk_size`, a new writer is initialized and assigned to this
-    /// field.
-    inner: BufWriter<Box<dyn Write>>,
-
-    /// Iterator that yields filenames for each chunk.
-    filename_iterator: FilenameIterator<'a>,
-}
-
-impl<'a> LineBytesChunkWriter<'a> {
-    fn new(chunk_size: u64, settings: &'a Settings) -> UResult<LineBytesChunkWriter<'a>> {
-        let mut filename_iterator = FilenameIterator::new(
-            &settings.prefix,
-            &settings.additional_suffix,
-            settings.suffix_length,
-            settings.suffix_type,
-            settings.suffix_start,
-        )?;
-        let filename = filename_iterator
-            .next()
-            .ok_or_else(|| USimpleError::new(1, "output file suffixes exhausted"))?;
-        if settings.verbose {
-            println!("creating file {}", filename.quote());
-        }
-        let inner = settings.instantiate_current_writer(&filename)?;
-        Ok(LineBytesChunkWriter {
-            settings,
-            chunk_size,
-            num_bytes_remaining_in_current_chunk: usize::try_from(chunk_size).unwrap(),
-            num_chunks_written: 0,
-            inner,
-            filename_iterator,
-        })
-    }
-}
-
-impl<'a> Write for LineBytesChunkWriter<'a> {
-    /// Write as many lines to a chunk as possible without
-    /// exceeding the byte limit. If a single line has more bytes
-    /// than the limit, then fill an entire single chunk with those
-    /// bytes and handle the remainder of the line as if it were
-    /// its own distinct line.
-    ///
-    /// For example: if the `chunk_size` is 8 and the input is:
-    ///
-    /// ```text
-    /// aaaaaaaaa\nbbbb\ncccc\ndd\nee\n
-    /// ```
-    ///
-    /// then the output gets broken into chunks like this:
-    ///
-    /// ```text
-    /// chunk 0    chunk 1    chunk 2    chunk 3
-    ///
-    /// 0            1             2
-    /// 01234567  89 01234   56789 012   345 6
-    /// |------|  |-------|  |--------|  |---|
-    /// aaaaaaaa  a\nbbbb\n  cccc\ndd\n  ee\n
-    /// ```
-    fn write(&mut self, mut buf: &[u8]) -> std::io::Result<usize> {
-        // The total number of bytes written during the loop below.
-        //
-        // It is necessary to keep this running total because we may
-        // be making multiple calls to `write()` on multiple different
-        // underlying writers and we want the final reported number of
-        // bytes written to reflect the total number of bytes written
-        // to all of the underlying writers.
-        let mut total_bytes_written = 0;
-
-        // Loop until we have written all bytes in the input buffer
-        // (or an IO error occurs).
-        loop {
-            // If the buffer is empty, then we are done writing.
-            if buf.is_empty() {
-                return Ok(total_bytes_written);
-            }
-
-            // If we have filled the current chunk with bytes, then
-            // start a new chunk and initialize its corresponding
-            // writer.
-            if self.num_bytes_remaining_in_current_chunk == 0 {
-                self.num_chunks_written += 1;
-                let filename = self.filename_iterator.next().ok_or_else(|| {
-                    std::io::Error::new(ErrorKind::Other, "output file suffixes exhausted")
-                })?;
-                if self.settings.verbose {
-                    println!("creating file {}", filename.quote());
-                }
-                self.inner = self.settings.instantiate_current_writer(&filename)?;
-                self.num_bytes_remaining_in_current_chunk = self.chunk_size.try_into().unwrap();
-            }
-
-            // Find the first newline character in the buffer.
-            match memchr::memchr(b'\n', buf) {
-                // If there is no newline character and the buffer is
-                // not empty, then write as many bytes as we can and
-                // then move on to the next chunk if necessary.
-                None => {
-                    let end = self.num_bytes_remaining_in_current_chunk;
-
-                    // This is ugly but here to match GNU behavior. If the input
-                    // doesn't end with a \n, pretend that it does for handling
-                    // the second to last segment chunk. See `line-bytes.sh`.
-                    if end == buf.len()
-                        && self.num_bytes_remaining_in_current_chunk
-                            < self.chunk_size.try_into().unwrap()
-                        && buf[buf.len() - 1] != b'\n'
-                    {
-                        self.num_bytes_remaining_in_current_chunk = 0;
-                    } else {
-                        let num_bytes_written = self.inner.write(&buf[..end.min(buf.len())])?;
-                        self.num_bytes_remaining_in_current_chunk -= num_bytes_written;
-                        total_bytes_written += num_bytes_written;
-                        buf = &buf[num_bytes_written..];
-                    }
-                }
-
-                // If there is a newline character and the line
-                // (including the newline character) will fit in the
-                // current chunk, then write the entire line and
-                // continue to the next iteration. (See chunk 1 in the
-                // example comment above.)
-                Some(i) if i < self.num_bytes_remaining_in_current_chunk => {
-                    let num_bytes_written = self.inner.write(&buf[..i + 1])?;
-                    self.num_bytes_remaining_in_current_chunk -= num_bytes_written;
-                    total_bytes_written += num_bytes_written;
-                    buf = &buf[num_bytes_written..];
-                }
-
-                // If there is a newline character, the line
-                // (including the newline character) will not fit in
-                // the current chunk, *and* no other lines have been
-                // written to the current chunk, then write as many
-                // bytes as we can and continue to the next
-                // iteration. (See chunk 0 in the example comment
-                // above.)
-                Some(_)
-                    if self.num_bytes_remaining_in_current_chunk
-                        == self.chunk_size.try_into().unwrap() =>
-                {
-                    let end = self.num_bytes_remaining_in_current_chunk;
-                    let num_bytes_written = self.inner.write(&buf[..end])?;
-                    self.num_bytes_remaining_in_current_chunk -= num_bytes_written;
-                    total_bytes_written += num_bytes_written;
-                    buf = &buf[num_bytes_written..];
-                }
-
-                // If there is a newline character, the line
-                // (including the newline character) will not fit in
-                // the current chunk, and at least one other line has
-                // been written to the current chunk, then signal to
-                // the next iteration that a new chunk needs to be
-                // created and continue to the next iteration of the
-                // loop to try writing the line there.
-                Some(_) => {
-                    self.num_bytes_remaining_in_current_chunk = 0;
-                }
-            }
-        }
-    }
-
-    fn flush(&mut self) -> std::io::Result<()> {
-        self.inner.flush()
-    }
-}
-
-/// Split a file into a specific number of chunks by byte.
-///
-/// This function always creates one output file for each chunk, even
-/// if there is an error reading or writing one of the chunks or if
-/// the input file is truncated. However, if the `filter` option is
-/// being used, then no files are created.
-///
-/// # Errors
-///
-/// This function returns an error if there is a problem reading from
-/// `reader` or writing to one of the output files.
-fn split_into_n_chunks_by_byte<R>(
-    settings: &Settings,
-    reader: &mut R,
-    num_chunks: u64,
-) -> UResult<()>
-where
-    R: Read,
-{
-    // Get the size of the input file in bytes and compute the number
-    // of bytes per chunk.
-    //
-    // If the requested number of chunks exceeds the number of bytes
-    // in the file *and* the `elide_empty_files` parameter is enabled,
-    // then behave as if the number of chunks was set to the number of
-    // bytes in the file. This ensures that we don't write empty
-    // files. Otherwise, just write the `num_chunks - num_bytes` empty
-    // files.
-    let metadata = metadata(&settings.input).map_err(|_| {
-        USimpleError::new(1, format!("{}: cannot determine file size", settings.input))
-    })?;
-
-    let num_bytes = metadata.len();
-    let will_have_empty_files = settings.elide_empty_files && num_chunks > num_bytes;
-    let (num_chunks, chunk_size) = if will_have_empty_files {
-        let num_chunks = num_bytes;
-        let chunk_size = 1;
-        (num_chunks, chunk_size)
-    } else {
-        let chunk_size = (num_bytes / (num_chunks)).max(1);
-        (num_chunks, chunk_size)
-    };
-
-    // If we would have written zero chunks of output, then terminate
-    // immediately. This happens on `split -e -n 3 /dev/null`, for
-    // example.
-    if num_chunks == 0 {
-        return Ok(());
-    }
-
-    let num_chunks: usize = num_chunks
-        .try_into()
-        .map_err(|_| USimpleError::new(1, "Number of chunks too big"))?;
-
-    // This object is responsible for creating the filename for each chunk.
-    let mut filename_iterator = FilenameIterator::new(
-        &settings.prefix,
-        &settings.additional_suffix,
-        settings.suffix_length,
-        settings.suffix_type,
-        settings.suffix_start,
-    )?;
-
-    // Create one writer for each chunk. This will create each
-    // of the underlying files (if not in `--filter` mode).
-    let mut writers = vec![];
-    for _ in 0..num_chunks {
-        let filename = filename_iterator
-            .next()
-            .ok_or_else(|| USimpleError::new(1, "output file suffixes exhausted"))?;
-        let writer = settings.instantiate_current_writer(filename.as_str())?;
-        writers.push(writer);
-    }
-
-    // Capture the result of the `std::io::copy()` calls to check for
-    // `BrokenPipe`.
-    let result: std::io::Result<()> = {
-        // Write `chunk_size` bytes from the reader into each writer
-        // except the last.
-        //
-        // The last writer gets all remaining bytes so that if the number
-        // of bytes in the input file was not evenly divisible by
-        // `num_chunks`, we don't leave any bytes behind.
-        for writer in writers.iter_mut().take(num_chunks - 1) {
-            io::copy(&mut reader.by_ref().take(chunk_size), writer)?;
-        }
-
-        // Write all the remaining bytes to the last chunk.
-        let i = num_chunks - 1;
-        let last_chunk_size = num_bytes - (chunk_size * (num_chunks as u64 - 1));
-        io::copy(&mut reader.by_ref().take(last_chunk_size), &mut writers[i])?;
-
-        Ok(())
-    };
-    match result {
-        Ok(_) => Ok(()),
-        Err(e) if e.kind() == ErrorKind::BrokenPipe => Ok(()),
-        Err(e) => Err(uio_error!(e, "input/output error")),
-    }
-}
-
-/// Split a file into a specific number of chunks by line.
-///
-/// This function always creates one output file for each chunk, even
-/// if there is an error reading or writing one of the chunks or if
-/// the input file is truncated. However, if the `filter` option is
-/// being used, then no files are created.
-///
-/// # Errors
-///
-/// This function returns an error if there is a problem reading from
-/// `reader` or writing to one of the output files.
-///
-/// # See also
-///
-/// * [`kth_chunk_by_line`], which splits its input in the same way,
-///   but writes only one specified chunk to stdout.
-fn split_into_n_chunks_by_line<R>(
-    settings: &Settings,
-    reader: &mut R,
-    num_chunks: u64,
-) -> UResult<()>
-where
-    R: BufRead,
-{
-    // Get the size of the input file in bytes and compute the number
-    // of bytes per chunk.
-    let metadata = metadata(&settings.input).unwrap();
-    let num_bytes = metadata.len();
-    let chunk_size = (num_bytes / num_chunks) as usize;
-
-    // This object is responsible for creating the filename for each chunk.
-    let mut filename_iterator = FilenameIterator::new(
-        &settings.prefix,
-        &settings.additional_suffix,
-        settings.suffix_length,
-        settings.suffix_type,
-        settings.suffix_start,
-    )?;
-
-    // Create one writer for each chunk. This will create each
-    // of the underlying files (if not in `--filter` mode).
-    let mut writers = vec![];
-    for _ in 0..num_chunks {
-        let filename = filename_iterator
-            .next()
-            .ok_or_else(|| USimpleError::new(1, "output file suffixes exhausted"))?;
-        let writer = settings.instantiate_current_writer(filename.as_str())?;
-        writers.push(writer);
-    }
-
-    let mut num_bytes_remaining_in_current_chunk = chunk_size;
-    let mut i = 0;
-    for line_result in reader.lines() {
-        let line = line_result.unwrap();
-        let maybe_writer = writers.get_mut(i);
-        let writer = maybe_writer.unwrap();
-        let bytes = line.as_bytes();
-        writer.write_all(bytes)?;
-        writer.write_all(b"\n")?;
-
-        // Add one byte for the newline character.
-        let num_bytes = bytes.len() + 1;
-        if num_bytes > num_bytes_remaining_in_current_chunk {
-            num_bytes_remaining_in_current_chunk = chunk_size;
-            i += 1;
-        } else {
-            num_bytes_remaining_in_current_chunk -= num_bytes;
-        }
-    }
-
-    Ok(())
-}
-
-/// Print the k-th chunk of a file, splitting by line.
-///
-/// This function is like [`split_into_n_chunks_by_line`], but instead
-/// of writing each chunk to its own file, it only writes to stdout
-/// the contents of the chunk identified by `chunk_number`.
-///
-/// # Errors
-///
-/// This function returns an error if there is a problem reading from
-/// `reader` or writing to one of the output files.
-///
-/// # See also
-///
-/// * [`split_into_n_chunks_by_line`], which splits its input in the
-///   same way, but writes each chunk to its own file.
-fn kth_chunk_by_line<R>(
-    settings: &Settings,
-    reader: &mut R,
-    chunk_number: u64,
-    num_chunks: u64,
-) -> UResult<()>
-where
-    R: BufRead,
-{
-    // Get the size of the input file in bytes and compute the number
-    // of bytes per chunk.
-    let metadata = metadata(&settings.input).unwrap();
-    let num_bytes = metadata.len();
-    let chunk_size = (num_bytes / num_chunks) as usize;
-
-    // Write to stdout instead of to a file.
-    let stdout = std::io::stdout();
-    let mut writer = stdout.lock();
-
-    let mut num_bytes_remaining_in_current_chunk = chunk_size;
-    let mut i = 0;
-    for line_result in reader.lines() {
-        let line = line_result?;
-        let bytes = line.as_bytes();
-        if i == chunk_number {
-            writer.write_all(bytes)?;
-            writer.write_all(b"\n")?;
-        }
-
-        // Add one byte for the newline character.
-        let num_bytes = bytes.len() + 1;
-        if num_bytes >= num_bytes_remaining_in_current_chunk {
-            num_bytes_remaining_in_current_chunk = chunk_size;
-            i += 1;
-        } else {
-            num_bytes_remaining_in_current_chunk -= num_bytes;
-        }
-
-        if i > chunk_number {
-            break;
-        }
-    }
-
-    Ok(())
-}
-
-fn split_into_n_chunks_by_line_round_robin<R>(
-    settings: &Settings,
-    reader: &mut R,
-    num_chunks: u64,
-) -> UResult<()>
-where
-    R: BufRead,
-{
-    // This object is responsible for creating the filename for each chunk.
-    let mut filename_iterator = FilenameIterator::new(
-        &settings.prefix,
-        &settings.additional_suffix,
-        settings.suffix_length,
-        settings.suffix_type,
-        settings.suffix_start,
-    )?;
-
-    // Create one writer for each chunk. This will create each
-    // of the underlying files (if not in `--filter` mode).
-    let mut writers = vec![];
-    for _ in 0..num_chunks {
-        let filename = filename_iterator
-            .next()
-            .ok_or_else(|| USimpleError::new(1, "output file suffixes exhausted"))?;
-        let writer = settings.instantiate_current_writer(filename.as_str())?;
-        writers.push(writer);
-    }
-
-    let num_chunks: usize = num_chunks.try_into().unwrap();
-    for (i, line_result) in reader.lines().enumerate() {
-        let line = line_result.unwrap();
-        let maybe_writer = writers.get_mut(i % num_chunks);
-        let writer = maybe_writer.unwrap();
-        let bytes = line.as_bytes();
-        writer.write_all(bytes)?;
-        writer.write_all(b"\n")?;
-    }
-
-    Ok(())
-}
-
-fn split(settings: &Settings) -> UResult<()> {
-    let mut reader = BufReader::new(if settings.input == "-" {
-        Box::new(stdin()) as Box<dyn Read>
-    } else {
-        let r = File::open(Path::new(&settings.input)).map_err_context(|| {
-            format!(
-                "cannot open {} for reading: No such file or directory",
-                settings.input.quote()
-            )
-        })?;
-        Box::new(r) as Box<dyn Read>
-    });
-
-    match settings.strategy {
-        Strategy::Number(NumberType::Bytes(num_chunks)) => {
-            split_into_n_chunks_by_byte(settings, &mut reader, num_chunks)
-        }
-        Strategy::Number(NumberType::Lines(num_chunks)) => {
-            split_into_n_chunks_by_line(settings, &mut reader, num_chunks)
-        }
-        Strategy::Number(NumberType::KthLines(chunk_number, num_chunks)) => {
-            // The chunk number is given as a 1-indexed number, but it
-            // is a little easier to deal with a 0-indexed number.
-            let chunk_number = chunk_number - 1;
-            kth_chunk_by_line(settings, &mut reader, chunk_number, num_chunks)
-        }
-        Strategy::Number(NumberType::RoundRobin(num_chunks)) => {
-            split_into_n_chunks_by_line_round_robin(settings, &mut reader, num_chunks)
-        }
-        Strategy::Number(_) => Err(USimpleError::new(1, "-n mode not yet fully implemented")),
-        Strategy::Lines(chunk_size) => {
-            let mut writer = LineChunkWriter::new(chunk_size, settings)?;
-            match std::io::copy(&mut reader, &mut writer) {
-                Ok(_) => Ok(()),
-                Err(e) => match e.kind() {
-                    // TODO Since the writer object controls the creation of
-                    // new files, we need to rely on the `std::io::Result`
-                    // returned by its `write()` method to communicate any
-                    // errors to this calling scope. If a new file cannot be
-                    // created because we have exceeded the number of
-                    // allowable filenames, we use `ErrorKind::Other` to
-                    // indicate that. A special error message needs to be
-                    // printed in that case.
-                    ErrorKind::Other => Err(USimpleError::new(1, format!("{e}"))),
-                    ErrorKind::BrokenPipe => Ok(()),
-                    _ => Err(uio_error!(e, "input/output error")),
-                },
-            }
-        }
-        Strategy::Bytes(chunk_size) => {
-            let mut writer = ByteChunkWriter::new(chunk_size, settings)?;
-            match std::io::copy(&mut reader, &mut writer) {
-                Ok(_) => Ok(()),
-                Err(e) => match e.kind() {
-                    // TODO Since the writer object controls the creation of
-                    // new files, we need to rely on the `std::io::Result`
-                    // returned by its `write()` method to communicate any
-                    // errors to this calling scope. If a new file cannot be
-                    // created because we have exceeded the number of
-                    // allowable filenames, we use `ErrorKind::Other` to
-                    // indicate that. A special error message needs to be
-                    // printed in that case.
-                    ErrorKind::Other => Err(USimpleError::new(1, format!("{e}"))),
-                    ErrorKind::BrokenPipe => Ok(()),
-                    _ => Err(uio_error!(e, "input/output error")),
-                },
-            }
-        }
-        Strategy::LineBytes(chunk_size) => {
-            let mut writer = LineBytesChunkWriter::new(chunk_size, settings)?;
-            match std::io::copy(&mut reader, &mut writer) {
-                Ok(_) => Ok(()),
-                Err(e) => match e.kind() {
-                    // TODO Since the writer object controls the creation of
-                    // new files, we need to rely on the `std::io::Result`
-                    // returned by its `write()` method to communicate any
-                    // errors to this calling scope. If a new file cannot be
-                    // created because we have exceeded the number of
-                    // allowable filenames, we use `ErrorKind::Other` to
-                    // indicate that. A special error message needs to be
-                    // printed in that case.
-                    ErrorKind::Other => Err(USimpleError::new(1, format!("{e}"))),
-                    ErrorKind::BrokenPipe => Ok(()),
-                    _ => Err(uio_error!(e, "input/output error")),
-                },
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::NumberType;
-    use crate::NumberTypeError;
-
-    #[test]
-    fn test_number_type_from() {
-        assert_eq!(NumberType::from("123").unwrap(), NumberType::Bytes(123));
-        assert_eq!(NumberType::from("l/123").unwrap(), NumberType::Lines(123));
-        assert_eq!(
-            NumberType::from("l/123/456").unwrap(),
-            NumberType::KthLines(123, 456)
-        );
-        assert_eq!(
-            NumberType::from("r/123").unwrap(),
-            NumberType::RoundRobin(123)
-        );
-        assert_eq!(
-            NumberType::from("r/123/456").unwrap(),
-            NumberType::KthRoundRobin(123, 456)
-        );
-    }
-
-    #[test]
-    fn test_number_type_from_error() {
-        assert_eq!(
-            NumberType::from("xyz").unwrap_err(),
-            NumberTypeError::NumberOfChunks("xyz".to_string())
-        );
-        assert_eq!(
-            NumberType::from("l/xyz").unwrap_err(),
-            NumberTypeError::NumberOfChunks("xyz".to_string())
-        );
-        assert_eq!(
-            NumberType::from("l/123/xyz").unwrap_err(),
-            NumberTypeError::NumberOfChunks("xyz".to_string())
-        );
-        assert_eq!(
-            NumberType::from("l/abc/456").unwrap_err(),
-            NumberTypeError::ChunkNumber("abc".to_string())
-        );
-        // In GNU split, the number of chunks get precedence:
-        //
-        //     $ split -n l/abc/xyz
-        //     split: invalid number of chunks: ‘xyz’
-        //
-        assert_eq!(
-            NumberType::from("l/abc/xyz").unwrap_err(),
-            NumberTypeError::NumberOfChunks("xyz".to_string())
-        );
-        assert_eq!(
-            NumberType::from("r/xyz").unwrap_err(),
-            NumberTypeError::NumberOfChunks("xyz".to_string())
-        );
-        assert_eq!(
-            NumberType::from("r/123/xyz").unwrap_err(),
-            NumberTypeError::NumberOfChunks("xyz".to_string())
-        );
-        assert_eq!(
-            NumberType::from("r/abc/456").unwrap_err(),
-            NumberTypeError::ChunkNumber("abc".to_string())
-        );
-        // In GNU split, the number of chunks get precedence:
-        //
-        //     $ split -n r/abc/xyz
-        //     split: invalid number of chunks: ‘xyz’
-        //
-        assert_eq!(
-            NumberType::from("r/abc/xyz").unwrap_err(),
-            NumberTypeError::NumberOfChunks("xyz".to_string())
-        );
-    }
-
-    #[test]
-    fn test_number_type_num_chunks() {
-        assert_eq!(NumberType::from("123").unwrap().num_chunks(), 123);
-        assert_eq!(NumberType::from("l/123").unwrap().num_chunks(), 123);
-        assert_eq!(NumberType::from("l/123/456").unwrap().num_chunks(), 456);
-        assert_eq!(NumberType::from("r/123").unwrap().num_chunks(), 123);
-        assert_eq!(NumberType::from("r/123/456").unwrap().num_chunks(), 456);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_stat/stat.rs.html b/coreutils/dev/src/uu_stat/stat.rs.html deleted file mode 100644 index e7adc87e8..000000000 --- a/coreutils/dev/src/uu_stat/stat.rs.html +++ /dev/null @@ -1,2085 +0,0 @@ -stat.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-use clap::builder::ValueParser;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::fs::display_permissions;
-use uucore::fsext::{
-    pretty_filetype, pretty_fstype, pretty_time, read_fs_list, statfs, BirthTime, FsMeta,
-};
-use uucore::libc::mode_t;
-use uucore::{
-    entries, format_usage, help_about, help_section, help_usage, show_error, show_warning,
-};
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-use std::borrow::Cow;
-use std::convert::AsRef;
-use std::ffi::{OsStr, OsString};
-use std::fs;
-use std::os::unix::fs::{FileTypeExt, MetadataExt};
-use std::os::unix::prelude::OsStrExt;
-use std::path::Path;
-
-const ABOUT: &str = help_about!("stat.md");
-const USAGE: &str = help_usage!("stat.md");
-const LONG_USAGE: &str = help_section!("long usage", "stat.md");
-
-mod options {
-    pub const DEREFERENCE: &str = "dereference";
-    pub const FILE_SYSTEM: &str = "file-system";
-    pub const FORMAT: &str = "format";
-    pub const PRINTF: &str = "printf";
-    pub const TERSE: &str = "terse";
-    pub const FILES: &str = "files";
-}
-
-#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)]
-struct Flags {
-    alter: bool,
-    zero: bool,
-    left: bool,
-    space: bool,
-    sign: bool,
-    group: bool,
-}
-
-/// checks if the string is within the specified bound,
-/// if it gets out of bound, error out by printing sub-string from index `beg` to`end`,
-/// where `beg` & `end` is the beginning and end index of sub-string, respectively
-fn check_bound(slice: &str, bound: usize, beg: usize, end: usize) -> UResult<()> {
-    if end >= bound {
-        return Err(USimpleError::new(
-            1,
-            format!("{}: invalid directive", slice[beg..end].quote()),
-        ));
-    }
-    Ok(())
-}
-
-enum Padding {
-    Zero,
-    Space,
-}
-
-/// pads the string with zeroes or spaces and prints it
-///
-/// # Example
-/// ```ignore
-/// uu_stat::pad_and_print("1", false, 5, Padding::Zero) == "00001";
-/// ```
-/// currently only supports '0' & ' ' as the padding character
-/// because the format specification of print! does not support general
-/// fill characters.
-fn pad_and_print(result: &str, left: bool, width: usize, padding: Padding) {
-    match (left, padding) {
-        (false, Padding::Zero) => print!("{result:0>width$}"),
-        (false, Padding::Space) => print!("{result:>width$}"),
-        (true, Padding::Zero) => print!("{result:0<width$}"),
-        (true, Padding::Space) => print!("{result:<width$}"),
-    };
-}
-
-#[derive(Debug)]
-pub enum OutputType {
-    Str(String),
-    Integer(i64),
-    Unsigned(u64),
-    UnsignedHex(u64),
-    UnsignedOct(u32),
-    Unknown,
-}
-
-#[derive(Debug, PartialEq, Eq)]
-enum Token {
-    Char(char),
-    Directive {
-        flag: Flags,
-        width: usize,
-        precision: Option<usize>,
-        format: char,
-    },
-}
-
-trait ScanUtil {
-    fn scan_num<F>(&self) -> Option<(F, usize)>
-    where
-        F: std::str::FromStr;
-    fn scan_char(&self, radix: u32) -> Option<(char, usize)>;
-}
-
-impl ScanUtil for str {
-    fn scan_num<F>(&self) -> Option<(F, usize)>
-    where
-        F: std::str::FromStr,
-    {
-        let mut chars = self.chars();
-        let mut i = 0;
-        match chars.next() {
-            Some('-' | '+' | '0'..='9') => i += 1,
-            _ => return None,
-        }
-        for c in chars {
-            match c {
-                '0'..='9' => i += 1,
-                _ => break,
-            }
-        }
-        if i > 0 {
-            F::from_str(&self[..i]).ok().map(|x| (x, i))
-        } else {
-            None
-        }
-    }
-
-    fn scan_char(&self, radix: u32) -> Option<(char, usize)> {
-        let count = match radix {
-            8 => 3,
-            16 => 2,
-            _ => return None,
-        };
-        let chars = self.chars().enumerate();
-        let mut res = 0;
-        let mut offset = 0;
-        for (i, c) in chars {
-            if i >= count {
-                break;
-            }
-            match c.to_digit(radix) {
-                Some(digit) => {
-                    let tmp = res * radix + digit;
-                    if tmp < 256 {
-                        res = tmp;
-                    } else {
-                        break;
-                    }
-                }
-                None => break,
-            }
-            offset = i + 1;
-        }
-        if offset > 0 {
-            Some((res as u8 as char, offset))
-        } else {
-            None
-        }
-    }
-}
-
-fn group_num(s: &str) -> Cow<str> {
-    let is_negative = s.starts_with('-');
-    assert!(is_negative || s.chars().take(1).all(|c| c.is_ascii_digit()));
-    assert!(s.chars().skip(1).all(|c| c.is_ascii_digit()));
-    if s.len() < 4 {
-        return s.into();
-    }
-    let mut res = String::with_capacity((s.len() - 1) / 3);
-    let s = if is_negative {
-        res.push('-');
-        &s[1..]
-    } else {
-        s
-    };
-    let mut alone = (s.len() - 1) % 3 + 1;
-    res.push_str(&s[..alone]);
-    while alone != s.len() {
-        res.push(',');
-        res.push_str(&s[alone..alone + 3]);
-        alone += 3;
-    }
-    res.into()
-}
-
-struct Stater {
-    follow: bool,
-    show_fs: bool,
-    from_user: bool,
-    files: Vec<OsString>,
-    mount_list: Option<Vec<String>>,
-    default_tokens: Vec<Token>,
-    default_dev_tokens: Vec<Token>,
-}
-
-/// Prints a formatted output based on the provided output type, flags, width, and precision.
-///
-/// # Arguments
-///
-/// * `output` - A reference to the OutputType enum containing the value to be printed.
-/// * `flags` - A Flags struct containing formatting flags.
-/// * `width` - The width of the field for the printed output.
-/// * `precision` - An Option containing the precision value.
-///
-/// This function delegates the printing process to more specialized functions depending on the output type.
-fn print_it(output: &OutputType, flags: Flags, width: usize, precision: Option<usize>) {
-    // If the precision is given as just '.', the precision is taken to be zero.
-    // A negative precision is taken as if the precision were omitted.
-    // This gives the minimum number of digits to appear for d, i, o, u, x, and X conversions,
-    // the maximum number of characters to be printed from a string for s and S conversions.
-
-    // #
-    // The value should be converted to an "alternate form".
-    // For o conversions, the first character of the output string  is made  zero  (by  prefixing  a 0 if it was not zero already).
-    // For x and X conversions, a nonzero result has the string "0x" (or "0X" for X conversions) prepended to it.
-
-    // 0
-    // The value should be zero padded.
-    // For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, the converted value is padded on the left with zeros rather than blanks.
-    // If the 0 and - flags both appear, the 0 flag is ignored.
-    // If a precision  is  given with a numeric conversion (d, i, o, u, x, and X), the 0 flag is ignored.
-    // For other conversions, the behavior is undefined.
-
-    // -
-    // The converted value is to be left adjusted on the field boundary.  (The default is right justification.)
-    // The  converted  value  is padded on the right with blanks, rather than on the left with blanks or zeros.
-    // A - overrides a 0 if both are given.
-
-    // ' ' (a space)
-    // A blank should be left before a positive number (or empty string) produced by a signed conversion.
-
-    // +
-    // A sign (+ or -) should always be placed before a number produced by a signed conversion.
-    // By default, a sign  is  used only for negative numbers.
-    // A + overrides a space if both are used.
-    let padding_char = determine_padding_char(&flags, &precision);
-
-    match output {
-        OutputType::Str(s) => print_str(s, &flags, width, precision),
-        OutputType::Integer(num) => print_integer(*num, &flags, width, precision, padding_char),
-        OutputType::Unsigned(num) => print_unsigned(*num, &flags, width, precision, padding_char),
-        OutputType::UnsignedOct(num) => {
-            print_unsigned_oct(*num, &flags, width, precision, padding_char);
-        }
-        OutputType::UnsignedHex(num) => {
-            print_unsigned_hex(*num, &flags, width, precision, padding_char);
-        }
-        OutputType::Unknown => print!("?"),
-    }
-}
-
-/// Determines the padding character based on the provided flags and precision.
-///
-/// # Arguments
-///
-/// * `flags` - A reference to the Flags struct containing formatting flags.
-/// * `precision` - An Option containing the precision value.
-///
-/// # Returns
-///
-/// * Padding - An instance of the Padding enum representing the padding character.
-fn determine_padding_char(flags: &Flags, precision: &Option<usize>) -> Padding {
-    if flags.zero && !flags.left && precision.is_none() {
-        Padding::Zero
-    } else {
-        Padding::Space
-    }
-}
-
-/// Prints a string value based on the provided flags, width, and precision.
-///
-/// # Arguments
-///
-/// * `s` - The string to be printed.
-/// * `flags` - A reference to the Flags struct containing formatting flags.
-/// * `width` - The width of the field for the printed string.
-/// * `precision` - An Option containing the precision value.
-fn print_str(s: &str, flags: &Flags, width: usize, precision: Option<usize>) {
-    let s = match precision {
-        Some(p) if p < s.len() => &s[..p],
-        _ => s,
-    };
-    pad_and_print(s, flags.left, width, Padding::Space);
-}
-
-/// Prints an integer value based on the provided flags, width, and precision.
-///
-/// # Arguments
-///
-/// * `num` - The integer value to be printed.
-/// * `flags` - A reference to the Flags struct containing formatting flags.
-/// * `width` - The width of the field for the printed integer.
-/// * `precision` - An Option containing the precision value.
-/// * `padding_char` - The padding character as determined by `determine_padding_char`.
-fn print_integer(
-    num: i64,
-    flags: &Flags,
-    width: usize,
-    precision: Option<usize>,
-    padding_char: Padding,
-) {
-    let num = num.to_string();
-    let arg = if flags.group {
-        group_num(&num)
-    } else {
-        Cow::Borrowed(num.as_str())
-    };
-    let prefix = if flags.sign {
-        "+"
-    } else if flags.space {
-        " "
-    } else {
-        ""
-    };
-    let extended = format!(
-        "{prefix}{arg:0>precision$}",
-        precision = precision.unwrap_or(0)
-    );
-    pad_and_print(&extended, flags.left, width, padding_char);
-}
-
-/// Prints an unsigned integer value based on the provided flags, width, and precision.
-///
-/// # Arguments
-///
-/// * `num` - The unsigned integer value to be printed.
-/// * `flags` - A reference to the Flags struct containing formatting flags.
-/// * `width` - The width of the field for the printed unsigned integer.
-/// * `precision` - An Option containing the precision value.
-/// * `padding_char` - The padding character as determined by `determine_padding_char`.
-fn print_unsigned(
-    num: u64,
-    flags: &Flags,
-    width: usize,
-    precision: Option<usize>,
-    padding_char: Padding,
-) {
-    let num = num.to_string();
-    let s = if flags.group {
-        group_num(&num)
-    } else {
-        Cow::Borrowed(num.as_str())
-    };
-    let s = format!("{s:0>precision$}", precision = precision.unwrap_or(0));
-    pad_and_print(&s, flags.left, width, padding_char);
-}
-
-/// Prints an unsigned octal integer value based on the provided flags, width, and precision.
-///
-/// # Arguments
-///
-/// * `num` - The unsigned octal integer value to be printed.
-/// * `flags` - A reference to the Flags struct containing formatting flags.
-/// * `width` - The width of the field for the printed unsigned octal integer.
-/// * `precision` - An Option containing the precision value.
-/// * `padding_char` - The padding character as determined by `determine_padding_char`.
-fn print_unsigned_oct(
-    num: u32,
-    flags: &Flags,
-    width: usize,
-    precision: Option<usize>,
-    padding_char: Padding,
-) {
-    let prefix = if flags.alter { "0" } else { "" };
-    let s = format!(
-        "{prefix}{num:0>precision$o}",
-        precision = precision.unwrap_or(0)
-    );
-    pad_and_print(&s, flags.left, width, padding_char);
-}
-
-/// Prints an unsigned hexadecimal integer value based on the provided flags, width, and precision.
-///
-/// # Arguments
-///
-/// * `num` - The unsigned hexadecimal integer value to be printed.
-/// * `flags` - A reference to the Flags struct containing formatting flags.
-/// * `width` - The width of the field for the printed unsigned hexadecimal integer.
-/// * `precision` - An Option containing the precision value.
-/// * `padding_char` - The padding character as determined by `determine_padding_char`.
-fn print_unsigned_hex(
-    num: u64,
-    flags: &Flags,
-    width: usize,
-    precision: Option<usize>,
-    padding_char: Padding,
-) {
-    let prefix = if flags.alter { "0x" } else { "" };
-    let s = format!(
-        "{prefix}{num:0>precision$x}",
-        precision = precision.unwrap_or(0)
-    );
-    pad_and_print(&s, flags.left, width, padding_char);
-}
-
-impl Stater {
-    fn generate_tokens(format_str: &str, use_printf: bool) -> UResult<Vec<Token>> {
-        let mut tokens = Vec::new();
-        let bound = format_str.len();
-        let chars = format_str.chars().collect::<Vec<char>>();
-        let mut i = 0;
-        while i < bound {
-            match chars[i] {
-                '%' => {
-                    let old = i;
-
-                    i += 1;
-                    if i >= bound {
-                        tokens.push(Token::Char('%'));
-                        continue;
-                    }
-                    if chars[i] == '%' {
-                        tokens.push(Token::Char('%'));
-                        i += 1;
-                        continue;
-                    }
-
-                    let mut flag = Flags::default();
-
-                    while i < bound {
-                        match chars[i] {
-                            '#' => flag.alter = true,
-                            '0' => flag.zero = true,
-                            '-' => flag.left = true,
-                            ' ' => flag.space = true,
-                            '+' => flag.sign = true,
-                            '\'' => flag.group = true,
-                            'I' => unimplemented!(),
-                            _ => break,
-                        }
-                        i += 1;
-                    }
-                    check_bound(format_str, bound, old, i)?;
-
-                    let mut width = 0;
-                    let mut precision = None;
-                    let mut j = i;
-
-                    if let Some((field_width, offset)) = format_str[j..].scan_num::<usize>() {
-                        width = field_width;
-                        j += offset;
-                    }
-                    check_bound(format_str, bound, old, j)?;
-
-                    if chars[j] == '.' {
-                        j += 1;
-                        check_bound(format_str, bound, old, j)?;
-
-                        match format_str[j..].scan_num::<i32>() {
-                            Some((value, offset)) => {
-                                if value >= 0 {
-                                    precision = Some(value as usize);
-                                }
-                                j += offset;
-                            }
-                            None => precision = Some(0),
-                        }
-                        check_bound(format_str, bound, old, j)?;
-                    }
-
-                    i = j;
-                    tokens.push(Token::Directive {
-                        width,
-                        flag,
-                        precision,
-                        format: chars[i],
-                    });
-                }
-                '\\' => {
-                    if use_printf {
-                        i += 1;
-                        if i >= bound {
-                            show_warning!("backslash at end of format");
-                            tokens.push(Token::Char('\\'));
-                            continue;
-                        }
-                        match chars[i] {
-                            'x' if i + 1 < bound => {
-                                if let Some((c, offset)) = format_str[i + 1..].scan_char(16) {
-                                    tokens.push(Token::Char(c));
-                                    i += offset;
-                                } else {
-                                    show_warning!("unrecognized escape '\\x'");
-                                    tokens.push(Token::Char('x'));
-                                }
-                            }
-                            '0'..='7' => {
-                                let (c, offset) = format_str[i..].scan_char(8).unwrap();
-                                tokens.push(Token::Char(c));
-                                i += offset - 1;
-                            }
-                            '"' => tokens.push(Token::Char('"')),
-                            '\\' => tokens.push(Token::Char('\\')),
-                            'a' => tokens.push(Token::Char('\x07')),
-                            'b' => tokens.push(Token::Char('\x08')),
-                            'e' => tokens.push(Token::Char('\x1B')),
-                            'f' => tokens.push(Token::Char('\x0C')),
-                            'n' => tokens.push(Token::Char('\n')),
-                            'r' => tokens.push(Token::Char('\r')),
-                            't' => tokens.push(Token::Char('\t')),
-                            'v' => tokens.push(Token::Char('\x0B')),
-                            c => {
-                                show_warning!("unrecognized escape '\\{}'", c);
-                                tokens.push(Token::Char(c));
-                            }
-                        }
-                    } else {
-                        tokens.push(Token::Char('\\'));
-                    }
-                }
-
-                c => tokens.push(Token::Char(c)),
-            }
-            i += 1;
-        }
-        if !use_printf && !format_str.ends_with('\n') {
-            tokens.push(Token::Char('\n'));
-        }
-        Ok(tokens)
-    }
-
-    fn new(matches: &ArgMatches) -> UResult<Self> {
-        let files = matches
-            .get_many::<OsString>(options::FILES)
-            .map(|v| v.map(OsString::from).collect())
-            .unwrap_or_default();
-        let format_str = if matches.contains_id(options::PRINTF) {
-            matches
-                .get_one::<String>(options::PRINTF)
-                .expect("Invalid format string")
-        } else {
-            matches
-                .get_one::<String>(options::FORMAT)
-                .map(|s| s.as_str())
-                .unwrap_or("")
-        };
-
-        let use_printf = matches.contains_id(options::PRINTF);
-        let terse = matches.get_flag(options::TERSE);
-        let show_fs = matches.get_flag(options::FILE_SYSTEM);
-
-        let default_tokens = if format_str.is_empty() {
-            Self::generate_tokens(&Self::default_format(show_fs, terse, false), use_printf)?
-        } else {
-            Self::generate_tokens(format_str, use_printf)?
-        };
-        let default_dev_tokens =
-            Self::generate_tokens(&Self::default_format(show_fs, terse, true), use_printf)?;
-
-        let mount_list = if show_fs {
-            // mount points aren't displayed when showing filesystem information
-            None
-        } else {
-            let mut mount_list = read_fs_list()
-                .map_err_context(|| "cannot read table of mounted file systems".into())?
-                .iter()
-                .map(|mi| mi.mount_dir.clone())
-                .collect::<Vec<String>>();
-            // Reverse sort. The longer comes first.
-            mount_list.sort();
-            mount_list.reverse();
-            Some(mount_list)
-        };
-
-        Ok(Self {
-            follow: matches.get_flag(options::DEREFERENCE),
-            show_fs,
-            from_user: !format_str.is_empty(),
-            files,
-            default_tokens,
-            default_dev_tokens,
-            mount_list,
-        })
-    }
-
-    fn find_mount_point<P: AsRef<Path>>(&self, p: P) -> Option<String> {
-        let path = p.as_ref().canonicalize().ok()?;
-
-        for root in self.mount_list.as_ref()? {
-            if path.starts_with(root) {
-                return Some(root.clone());
-            }
-        }
-        None
-    }
-
-    fn exec(&self) -> i32 {
-        let mut stdin_is_fifo = false;
-        if cfg!(unix) {
-            if let Ok(md) = fs::metadata("/dev/stdin") {
-                stdin_is_fifo = md.file_type().is_fifo();
-            }
-        }
-
-        let mut ret = 0;
-        for f in &self.files {
-            ret |= self.do_stat(f, stdin_is_fifo);
-        }
-        ret
-    }
-
-    fn do_stat(&self, file: &OsStr, stdin_is_fifo: bool) -> i32 {
-        let display_name = file.to_string_lossy();
-        let file = if cfg!(unix) && display_name == "-" {
-            if self.show_fs {
-                show_error!("using '-' to denote standard input does not work in file system mode");
-                return 1;
-            }
-            if let Ok(p) = Path::new("/dev/stdin").canonicalize() {
-                p.into_os_string()
-            } else {
-                OsString::from("/dev/stdin")
-            }
-        } else {
-            OsString::from(file)
-        };
-        if self.show_fs {
-            #[cfg(unix)]
-            let p = file.as_bytes();
-            #[cfg(not(unix))]
-            let p = file.into_string().unwrap();
-            match statfs(p) {
-                Ok(meta) => {
-                    let tokens = &self.default_tokens;
-
-                    for t in tokens.iter() {
-                        match *t {
-                            Token::Char(c) => print!("{c}"),
-                            Token::Directive {
-                                flag,
-                                width,
-                                precision,
-                                format,
-                            } => {
-                                let output = match format {
-                                    // free blocks available to non-superuser
-                                    'a' => OutputType::Unsigned(meta.avail_blocks()),
-                                    // total data blocks in file system
-                                    'b' => OutputType::Unsigned(meta.total_blocks()),
-                                    // total file nodes in file system
-                                    'c' => OutputType::Unsigned(meta.total_file_nodes()),
-                                    // free file nodes in file system
-                                    'd' => OutputType::Unsigned(meta.free_file_nodes()),
-                                    // free blocks in file system
-                                    'f' => OutputType::Unsigned(meta.free_blocks()),
-                                    // file system ID in hex
-                                    'i' => OutputType::UnsignedHex(meta.fsid()),
-                                    // maximum length of filenames
-                                    'l' => OutputType::Unsigned(meta.namelen()),
-                                    // file name
-                                    'n' => OutputType::Str(display_name.to_string()),
-                                    // block size (for faster transfers)
-                                    's' => OutputType::Unsigned(meta.io_size()),
-                                    // fundamental block size (for block counts)
-                                    'S' => OutputType::Integer(meta.block_size()),
-                                    // file system type in hex
-                                    't' => OutputType::UnsignedHex(meta.fs_type() as u64),
-                                    // file system type in human readable form
-                                    'T' => OutputType::Str(pretty_fstype(meta.fs_type()).into()),
-                                    _ => OutputType::Unknown,
-                                };
-
-                                print_it(&output, flag, width, precision);
-                            }
-                        }
-                    }
-                }
-                Err(e) => {
-                    show_error!(
-                        "cannot read file system information for {}: {}",
-                        display_name.quote(),
-                        e
-                    );
-                    return 1;
-                }
-            }
-        } else {
-            let result = if self.follow || stdin_is_fifo && display_name == "-" {
-                fs::metadata(&file)
-            } else {
-                fs::symlink_metadata(&file)
-            };
-            match result {
-                Ok(meta) => {
-                    let file_type = meta.file_type();
-                    let tokens = if self.from_user
-                        || !(file_type.is_char_device() || file_type.is_block_device())
-                    {
-                        &self.default_tokens
-                    } else {
-                        &self.default_dev_tokens
-                    };
-
-                    for t in tokens.iter() {
-                        match *t {
-                            Token::Char(c) => print!("{c}"),
-                            Token::Directive {
-                                flag,
-                                width,
-                                precision,
-                                format,
-                            } => {
-                                let output = match format {
-                                    // access rights in octal
-                                    'a' => OutputType::UnsignedOct(0o7777 & meta.mode()),
-                                    // access rights in human readable form
-                                    'A' => OutputType::Str(display_permissions(&meta, true)),
-                                    // number of blocks allocated (see %B)
-                                    'b' => OutputType::Unsigned(meta.blocks()),
-
-                                    // the size in bytes of each block reported by %b
-                                    // FIXME: blocksize differs on various platform
-                                    // See coreutils/gnulib/lib/stat-size.h ST_NBLOCKSIZE // spell-checker:disable-line
-                                    'B' => OutputType::Unsigned(512),
-
-                                    // device number in decimal
-                                    'd' => OutputType::Unsigned(meta.dev()),
-                                    // device number in hex
-                                    'D' => OutputType::UnsignedHex(meta.dev()),
-                                    // raw mode in hex
-                                    'f' => OutputType::UnsignedHex(meta.mode() as u64),
-                                    // file type
-                                    'F' => OutputType::Str(
-                                        pretty_filetype(meta.mode() as mode_t, meta.len())
-                                            .to_owned(),
-                                    ),
-                                    // group ID of owner
-                                    'g' => OutputType::Unsigned(meta.gid() as u64),
-                                    // group name of owner
-                                    'G' => {
-                                        let group_name = entries::gid2grp(meta.gid())
-                                            .unwrap_or_else(|_| "UNKNOWN".to_owned());
-                                        OutputType::Str(group_name)
-                                    }
-                                    // number of hard links
-                                    'h' => OutputType::Unsigned(meta.nlink()),
-                                    // inode number
-                                    'i' => OutputType::Unsigned(meta.ino()),
-                                    // mount point
-                                    'm' => OutputType::Str(self.find_mount_point(&file).unwrap()),
-                                    // file name
-                                    'n' => OutputType::Str(display_name.to_string()),
-                                    // quoted file name with dereference if symbolic link
-                                    'N' => {
-                                        let file_name = if file_type.is_symlink() {
-                                            let dst = match fs::read_link(&file) {
-                                                Ok(path) => path,
-                                                Err(e) => {
-                                                    println!("{e}");
-                                                    return 1;
-                                                }
-                                            };
-                                            format!("{} -> {}", display_name.quote(), dst.quote())
-                                        } else {
-                                            display_name.to_string()
-                                        };
-                                        OutputType::Str(file_name)
-                                    }
-                                    // optimal I/O transfer size hint
-                                    'o' => OutputType::Unsigned(meta.blksize()),
-                                    // total size, in bytes
-                                    's' => OutputType::Integer(meta.len() as i64),
-                                    // major device type in hex, for character/block device special
-                                    // files
-                                    't' => OutputType::UnsignedHex(meta.rdev() >> 8),
-                                    // minor device type in hex, for character/block device special
-                                    // files
-                                    'T' => OutputType::UnsignedHex(meta.rdev() & 0xff),
-                                    // user ID of owner
-                                    'u' => OutputType::Unsigned(meta.uid() as u64),
-                                    // user name of owner
-                                    'U' => {
-                                        let user_name = entries::uid2usr(meta.uid())
-                                            .unwrap_or_else(|_| "UNKNOWN".to_owned());
-                                        OutputType::Str(user_name)
-                                    }
-
-                                    // time of file birth, human-readable; - if unknown
-                                    'w' => OutputType::Str(meta.pretty_birth()),
-
-                                    // time of file birth, seconds since Epoch; 0 if unknown
-                                    'W' => OutputType::Unsigned(meta.birth()),
-
-                                    // time of last access, human-readable
-                                    'x' => OutputType::Str(pretty_time(
-                                        meta.atime(),
-                                        meta.atime_nsec(),
-                                    )),
-                                    // time of last access, seconds since Epoch
-                                    'X' => OutputType::Integer(meta.atime()),
-                                    // time of last data modification, human-readable
-                                    'y' => OutputType::Str(pretty_time(
-                                        meta.mtime(),
-                                        meta.mtime_nsec(),
-                                    )),
-                                    // time of last data modification, seconds since Epoch
-                                    'Y' => OutputType::Integer(meta.mtime()),
-                                    // time of last status change, human-readable
-                                    'z' => OutputType::Str(pretty_time(
-                                        meta.ctime(),
-                                        meta.ctime_nsec(),
-                                    )),
-                                    // time of last status change, seconds since Epoch
-                                    'Z' => OutputType::Integer(meta.ctime()),
-
-                                    _ => OutputType::Unknown,
-                                };
-                                print_it(&output, flag, width, precision);
-                            }
-                        }
-                    }
-                }
-                Err(e) => {
-                    show_error!("cannot stat {}: {}", display_name.quote(), e);
-                    return 1;
-                }
-            }
-        }
-        0
-    }
-
-    fn default_format(show_fs: bool, terse: bool, show_dev_type: bool) -> String {
-        // SELinux related format is *ignored*
-
-        if show_fs {
-            if terse {
-                "%n %i %l %t %s %S %b %f %a %c %d\n".into()
-            } else {
-                "  File: \"%n\"\n    ID: %-8i Namelen: %-7l Type: %T\nBlock \
-                 size: %-10s Fundamental block size: %S\nBlocks: Total: %-10b \
-                 Free: %-10f Available: %a\nInodes: Total: %-10c Free: %d\n"
-                    .into()
-            }
-        } else if terse {
-            "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o\n".into()
-        } else {
-            [
-                "  File: %N\n  Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n",
-                if show_dev_type {
-                    "Device: %Dh/%dd\tInode: %-10i  Links: %-5h Device type: %t,%T\n"
-                } else {
-                    "Device: %Dh/%dd\tInode: %-10i  Links: %h\n"
-                },
-                "Access: (%04a/%10.10A)  Uid: (%5u/%8U)   Gid: (%5g/%8G)\n",
-                "Access: %x\nModify: %y\nChange: %z\n Birth: %w\n",
-            ]
-            .join("")
-        }
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().after_help(LONG_USAGE).try_get_matches_from(args)?;
-
-    let stater = Stater::new(&matches)?;
-    let exit_status = stater.exec();
-    if exit_status == 0 {
-        Ok(())
-    } else {
-        Err(exit_status.into())
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::DEREFERENCE)
-                .short('L')
-                .long(options::DEREFERENCE)
-                .help("follow links")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILE_SYSTEM)
-                .short('f')
-                .long(options::FILE_SYSTEM)
-                .help("display file system status instead of file status")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::TERSE)
-                .short('t')
-                .long(options::TERSE)
-                .help("print the information in terse form")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FORMAT)
-                .short('c')
-                .long(options::FORMAT)
-                .help(
-                    "use the specified FORMAT instead of the default;
- output a newline after each use of FORMAT",
-                )
-                .value_name("FORMAT"),
-        )
-        .arg(
-            Arg::new(options::PRINTF)
-                .long(options::PRINTF)
-                .value_name("FORMAT")
-                .help(
-                    "like --format, but interpret backslash escapes,
-            and do not output a mandatory trailing newline;
-            if you want a newline, include \n in FORMAT",
-                ),
-        )
-        .arg(
-            Arg::new(options::FILES)
-                .action(ArgAction::Append)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-#[cfg(test)]
-mod tests {
-    use super::{group_num, Flags, ScanUtil, Stater, Token};
-
-    #[test]
-    fn test_scanners() {
-        assert_eq!(Some((-5, 2)), "-5zxc".scan_num::<i32>());
-        assert_eq!(Some((51, 2)), "51zxc".scan_num::<u32>());
-        assert_eq!(Some((192, 4)), "+192zxc".scan_num::<i32>());
-        assert_eq!(None, "z192zxc".scan_num::<i32>());
-
-        assert_eq!(Some(('a', 3)), "141zxc".scan_char(8));
-        assert_eq!(Some(('\n', 2)), "12qzxc".scan_char(8)); // spell-checker:disable-line
-        assert_eq!(Some(('\r', 1)), "dqzxc".scan_char(16)); // spell-checker:disable-line
-        assert_eq!(None, "z2qzxc".scan_char(8)); // spell-checker:disable-line
-    }
-
-    #[test]
-    fn test_group_num() {
-        assert_eq!("12,379,821,234", group_num("12379821234"));
-        assert_eq!("21,234", group_num("21234"));
-        assert_eq!("821,234", group_num("821234"));
-        assert_eq!("1,821,234", group_num("1821234"));
-        assert_eq!("1,234", group_num("1234"));
-        assert_eq!("234", group_num("234"));
-        assert_eq!("24", group_num("24"));
-        assert_eq!("4", group_num("4"));
-        assert_eq!("", group_num(""));
-        assert_eq!("-5", group_num("-5"));
-        assert_eq!("-1,234", group_num("-1234"));
-    }
-
-    #[test]
-    #[should_panic]
-    fn test_group_num_panic_if_invalid_numeric_characters() {
-        group_num("³³³³³");
-    }
-
-    #[test]
-    fn normal_format() {
-        let s = "%'010.2ac%-#5.w\n";
-        let expected = vec![
-            Token::Directive {
-                flag: Flags {
-                    group: true,
-                    zero: true,
-                    ..Default::default()
-                },
-                width: 10,
-                precision: Some(2),
-                format: 'a',
-            },
-            Token::Char('c'),
-            Token::Directive {
-                flag: Flags {
-                    left: true,
-                    alter: true,
-                    ..Default::default()
-                },
-                width: 5,
-                precision: Some(0),
-                format: 'w',
-            },
-            Token::Char('\n'),
-        ];
-        assert_eq!(&expected, &Stater::generate_tokens(s, false).unwrap());
-    }
-
-    #[test]
-    fn printf_format() {
-        let s = r#"%-# 15a\t\r\"\\\a\b\e\f\v%+020.-23w\x12\167\132\112\n"#;
-        let expected = vec![
-            Token::Directive {
-                flag: Flags {
-                    left: true,
-                    alter: true,
-                    space: true,
-                    ..Default::default()
-                },
-                width: 15,
-                precision: None,
-                format: 'a',
-            },
-            Token::Char('\t'),
-            Token::Char('\r'),
-            Token::Char('"'),
-            Token::Char('\\'),
-            Token::Char('\x07'),
-            Token::Char('\x08'),
-            Token::Char('\x1B'),
-            Token::Char('\x0C'),
-            Token::Char('\x0B'),
-            Token::Directive {
-                flag: Flags {
-                    sign: true,
-                    zero: true,
-                    ..Default::default()
-                },
-                width: 20,
-                precision: None,
-                format: 'w',
-            },
-            Token::Char('\x12'),
-            Token::Char('w'),
-            Token::Char('Z'),
-            Token::Char('J'),
-            Token::Char('\n'),
-        ];
-        assert_eq!(&expected, &Stater::generate_tokens(s, true).unwrap());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_stdbuf/stdbuf.rs.html b/coreutils/dev/src/uu_stdbuf/stdbuf.rs.html deleted file mode 100644 index 029e6089b..000000000 --- a/coreutils/dev/src/uu_stdbuf/stdbuf.rs.html +++ /dev/null @@ -1,443 +0,0 @@ -stdbuf.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) Dorota Kapturkiewicz <dokaptur@gmail.com>
-// *
-// * For the full copyright and license information, please view the LICENSE
-// * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) tempdir dyld dylib dragonflybsd optgrps libstdbuf
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-use std::fs::File;
-use std::io::{self, Write};
-use std::os::unix::process::ExitStatusExt;
-use std::path::PathBuf;
-use std::process;
-use tempfile::tempdir;
-use tempfile::TempDir;
-use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
-use uucore::parse_size::parse_size;
-use uucore::{crash, format_usage, help_about, help_section, help_usage};
-
-const ABOUT: &str = help_about!("stdbuf.md");
-const USAGE: &str = help_usage!("stdbuf.md");
-const LONG_HELP: &str = help_section!("after help", "stdbuf.md");
-
-mod options {
-    pub const INPUT: &str = "input";
-    pub const INPUT_SHORT: char = 'i';
-    pub const OUTPUT: &str = "output";
-    pub const OUTPUT_SHORT: char = 'o';
-    pub const ERROR: &str = "error";
-    pub const ERROR_SHORT: char = 'e';
-    pub const COMMAND: &str = "command";
-}
-
-const STDBUF_INJECT: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/libstdbuf.so"));
-
-enum BufferType {
-    Default,
-    Line,
-    Size(usize),
-}
-
-struct ProgramOptions {
-    stdin: BufferType,
-    stdout: BufferType,
-    stderr: BufferType,
-}
-
-impl TryFrom<&ArgMatches> for ProgramOptions {
-    type Error = ProgramOptionsError;
-
-    fn try_from(matches: &ArgMatches) -> Result<Self, Self::Error> {
-        Ok(Self {
-            stdin: check_option(matches, options::INPUT)?,
-            stdout: check_option(matches, options::OUTPUT)?,
-            stderr: check_option(matches, options::ERROR)?,
-        })
-    }
-}
-
-struct ProgramOptionsError(String);
-
-#[cfg(any(
-    target_os = "linux",
-    target_os = "android",
-    target_os = "freebsd",
-    target_os = "netbsd",
-    target_os = "dragonflybsd"
-))]
-fn preload_strings() -> (&'static str, &'static str) {
-    ("LD_PRELOAD", "so")
-}
-
-#[cfg(target_vendor = "apple")]
-fn preload_strings() -> (&'static str, &'static str) {
-    ("DYLD_LIBRARY_PATH", "dylib")
-}
-
-#[cfg(not(any(
-    target_os = "linux",
-    target_os = "android",
-    target_os = "freebsd",
-    target_os = "netbsd",
-    target_os = "dragonflybsd",
-    target_vendor = "apple"
-)))]
-fn preload_strings() -> (&'static str, &'static str) {
-    use uucore::crash;
-
-    crash!(1, "Command not supported for this operating system!")
-}
-
-fn check_option(matches: &ArgMatches, name: &str) -> Result<BufferType, ProgramOptionsError> {
-    match matches.get_one::<String>(name) {
-        Some(value) => match value.as_str() {
-            "L" => {
-                if name == options::INPUT {
-                    Err(ProgramOptionsError(
-                        "line buffering stdin is meaningless".to_string(),
-                    ))
-                } else {
-                    Ok(BufferType::Line)
-                }
-            }
-            x => parse_size(x).map_or_else(
-                |e| crash!(125, "invalid mode {}", e),
-                |m| {
-                    Ok(BufferType::Size(m.try_into().map_err(|_| {
-                        ProgramOptionsError(format!(
-                            "invalid mode '{x}': Value too large for defined data type"
-                        ))
-                    })?))
-                },
-            ),
-        },
-        None => Ok(BufferType::Default),
-    }
-}
-
-fn set_command_env(command: &mut process::Command, buffer_name: &str, buffer_type: &BufferType) {
-    match buffer_type {
-        BufferType::Size(m) => {
-            command.env(buffer_name, m.to_string());
-        }
-        BufferType::Line => {
-            command.env(buffer_name, "L");
-        }
-        BufferType::Default => {}
-    }
-}
-
-fn get_preload_env(tmp_dir: &mut TempDir) -> io::Result<(String, PathBuf)> {
-    let (preload, extension) = preload_strings();
-    let inject_path = tmp_dir.path().join("libstdbuf").with_extension(extension);
-
-    let mut file = File::create(&inject_path)?;
-    file.write_all(STDBUF_INJECT)?;
-
-    Ok((preload.to_owned(), inject_path))
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let options = ProgramOptions::try_from(&matches).map_err(|e| UUsageError::new(125, e.0))?;
-
-    let mut command_values = matches.get_many::<String>(options::COMMAND).unwrap();
-    let mut command = process::Command::new(command_values.next().unwrap());
-    let command_params: Vec<&str> = command_values.map(|s| s.as_ref()).collect();
-
-    let mut tmp_dir = tempdir().unwrap();
-    let (preload_env, libstdbuf) = get_preload_env(&mut tmp_dir).map_err_context(String::new)?;
-    command.env(preload_env, libstdbuf);
-    set_command_env(&mut command, "_STDBUF_I", &options.stdin);
-    set_command_env(&mut command, "_STDBUF_O", &options.stdout);
-    set_command_env(&mut command, "_STDBUF_E", &options.stderr);
-    command.args(command_params);
-
-    let mut process = command
-        .spawn()
-        .map_err_context(|| "failed to execute process".to_string())?;
-    let status = process.wait().map_err_context(String::new)?;
-    match status.code() {
-        Some(i) => {
-            if i == 0 {
-                Ok(())
-            } else {
-                Err(i.into())
-            }
-        }
-        None => Err(USimpleError::new(
-            1,
-            format!("process killed by signal {}", status.signal().unwrap()),
-        )),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .after_help(LONG_HELP)
-        .override_usage(format_usage(USAGE))
-        .trailing_var_arg(true)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::INPUT)
-                .long(options::INPUT)
-                .short(options::INPUT_SHORT)
-                .help("adjust standard input stream buffering")
-                .value_name("MODE")
-                .required_unless_present_any([options::OUTPUT, options::ERROR]),
-        )
-        .arg(
-            Arg::new(options::OUTPUT)
-                .long(options::OUTPUT)
-                .short(options::OUTPUT_SHORT)
-                .help("adjust standard output stream buffering")
-                .value_name("MODE")
-                .required_unless_present_any([options::INPUT, options::ERROR]),
-        )
-        .arg(
-            Arg::new(options::ERROR)
-                .long(options::ERROR)
-                .short(options::ERROR_SHORT)
-                .help("adjust standard error stream buffering")
-                .value_name("MODE")
-                .required_unless_present_any([options::INPUT, options::OUTPUT]),
-        )
-        .arg(
-            Arg::new(options::COMMAND)
-                .action(ArgAction::Append)
-                .hide(true)
-                .required(true)
-                .value_hint(clap::ValueHint::CommandName),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_stty/flags.rs.html b/coreutils/dev/src/uu_stty/flags.rs.html deleted file mode 100644 index d2d4cf477..000000000 --- a/coreutils/dev/src/uu_stty/flags.rs.html +++ /dev/null @@ -1,715 +0,0 @@ -flags.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-
// * This file is part of the uutils coreutils package.
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-// spell-checker:ignore parenb parodd cmspar hupcl cstopb cread clocal crtscts CSIZE
-// spell-checker:ignore ignbrk brkint ignpar parmrk inpck istrip inlcr igncr icrnl ixoff ixon iuclc ixany imaxbel iutf
-// spell-checker:ignore opost olcuc ocrnl onlcr onocr onlret ofill ofdel nldly crdly tabdly bsdly vtdly ffdly
-// spell-checker:ignore isig icanon iexten echoe crterase echok echonl noflsh xcase tostop echoprt prterase echoctl ctlecho echoke crtkill flusho extproc
-// spell-checker:ignore lnext rprnt susp swtch vdiscard veof veol verase vintr vkill vlnext vquit vreprint vstart vstop vsusp vswtc vwerase werase
-// spell-checker:ignore sigquit sigtstp
-
-use crate::Flag;
-
-#[cfg(not(any(
-    target_os = "freebsd",
-    target_os = "dragonfly",
-    target_os = "ios",
-    target_os = "macos",
-    target_os = "netbsd",
-    target_os = "openbsd"
-)))]
-use nix::sys::termios::BaudRate;
-use nix::sys::termios::{
-    ControlFlags as C, InputFlags as I, LocalFlags as L, OutputFlags as O,
-    SpecialCharacterIndices as S,
-};
-
-pub const CONTROL_FLAGS: &[Flag<C>] = &[
-    Flag::new("parenb", C::PARENB),
-    Flag::new("parodd", C::PARODD),
-    #[cfg(any(
-        target_os = "android",
-        all(target_os = "linux", not(target_arch = "mips"))
-    ))]
-    Flag::new("cmspar", C::CMSPAR),
-    Flag::new_grouped("cs5", C::CS5, C::CSIZE),
-    Flag::new_grouped("cs6", C::CS6, C::CSIZE),
-    Flag::new_grouped("cs7", C::CS7, C::CSIZE),
-    Flag::new_grouped("cs8", C::CS8, C::CSIZE).sane(),
-    Flag::new("hupcl", C::HUPCL),
-    Flag::new("cstopb", C::CSTOPB),
-    Flag::new("cread", C::CREAD).sane(),
-    Flag::new("clocal", C::CLOCAL),
-    Flag::new("crtscts", C::CRTSCTS),
-];
-
-pub const INPUT_FLAGS: &[Flag<I>] = &[
-    Flag::new("ignbrk", I::IGNBRK),
-    Flag::new("brkint", I::BRKINT).sane(),
-    Flag::new("ignpar", I::IGNPAR),
-    Flag::new("parmrk", I::PARMRK),
-    Flag::new("inpck", I::INPCK),
-    Flag::new("istrip", I::ISTRIP),
-    Flag::new("inlcr", I::INLCR),
-    Flag::new("igncr", I::IGNCR),
-    Flag::new("icrnl", I::ICRNL).sane(),
-    Flag::new("ixoff", I::IXOFF),
-    Flag::new("tandem", I::IXOFF),
-    Flag::new("ixon", I::IXON),
-    // not supported by nix
-    // Flag::new("iuclc", I::IUCLC),
-    Flag::new("ixany", I::IXANY),
-    Flag::new("imaxbel", I::IMAXBEL).sane(),
-    #[cfg(any(target_os = "android", target_os = "linux", target_os = "macos"))]
-    Flag::new("iutf8", I::IUTF8),
-];
-
-pub const OUTPUT_FLAGS: &[Flag<O>] = &[
-    Flag::new("opost", O::OPOST).sane(),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "linux",
-        target_os = "openbsd"
-    ))]
-    Flag::new("olcuc", O::OLCUC),
-    Flag::new("ocrnl", O::OCRNL),
-    Flag::new("onlcr", O::ONLCR).sane(),
-    Flag::new("onocr", O::ONOCR),
-    Flag::new("onlret", O::ONLRET),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new("ofill", O::OFILL),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new("ofdel", O::OFDEL),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("nl0", O::NL0, O::NLDLY).sane(),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("nl1", O::NL1, O::NLDLY),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("cr0", O::CR0, O::CRDLY).sane(),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("cr1", O::CR1, O::CRDLY),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("cr2", O::CR2, O::CRDLY),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("cr3", O::CR3, O::CRDLY),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("tab0", O::TAB0, O::TABDLY).sane(),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("tab1", O::TAB1, O::TABDLY),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("tab2", O::TAB2, O::TABDLY),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("tab3", O::TAB3, O::TABDLY),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("bs0", O::BS0, O::BSDLY).sane(),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("bs1", O::BS1, O::BSDLY),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("vt0", O::VT0, O::VTDLY).sane(),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("vt1", O::VT1, O::VTDLY),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("ff0", O::FF0, O::FFDLY).sane(),
-    #[cfg(any(
-        target_os = "android",
-        target_os = "haiku",
-        target_os = "ios",
-        target_os = "linux",
-        target_os = "macos"
-    ))]
-    Flag::new_grouped("ff1", O::FF1, O::FFDLY),
-];
-
-pub const LOCAL_FLAGS: &[Flag<L>] = &[
-    Flag::new("isig", L::ISIG).sane(),
-    Flag::new("icanon", L::ICANON).sane(),
-    Flag::new("iexten", L::IEXTEN).sane(),
-    Flag::new("echo", L::ECHO).sane(),
-    Flag::new("echoe", L::ECHOE).sane(),
-    Flag::new("crterase", L::ECHOE).hidden().sane(),
-    Flag::new("echok", L::ECHOK).sane(),
-    Flag::new("echonl", L::ECHONL),
-    Flag::new("noflsh", L::NOFLSH),
-    // Not supported by nix
-    // Flag::new("xcase", L::XCASE),
-    Flag::new("tostop", L::TOSTOP),
-    Flag::new("echoprt", L::ECHOPRT),
-    Flag::new("prterase", L::ECHOPRT).hidden(),
-    Flag::new("echoctl", L::ECHOCTL).sane(),
-    Flag::new("ctlecho", L::ECHOCTL).sane().hidden(),
-    Flag::new("echoke", L::ECHOKE).sane(),
-    Flag::new("crtkill", L::ECHOKE).sane().hidden(),
-    Flag::new("flusho", L::FLUSHO),
-    Flag::new("extproc", L::EXTPROC),
-];
-
-// BSD's use u32 as baud rate, to using the enum is unnecessary.
-#[cfg(not(any(
-    target_os = "freebsd",
-    target_os = "dragonfly",
-    target_os = "ios",
-    target_os = "macos",
-    target_os = "netbsd",
-    target_os = "openbsd"
-)))]
-pub const BAUD_RATES: &[(&str, BaudRate)] = &[
-    ("0", BaudRate::B0),
-    ("50", BaudRate::B50),
-    ("75", BaudRate::B75),
-    ("110", BaudRate::B110),
-    ("134", BaudRate::B134),
-    ("150", BaudRate::B150),
-    ("200", BaudRate::B200),
-    ("300", BaudRate::B300),
-    ("600", BaudRate::B600),
-    ("1200", BaudRate::B1200),
-    ("1800", BaudRate::B1800),
-    ("2400", BaudRate::B2400),
-    ("9600", BaudRate::B9600),
-    ("19200", BaudRate::B19200),
-    ("38400", BaudRate::B38400),
-    ("57600", BaudRate::B57600),
-    ("115200", BaudRate::B115200),
-    ("230400", BaudRate::B230400),
-    #[cfg(any(target_os = "android", target_os = "linux"))]
-    ("500000", BaudRate::B500000),
-    #[cfg(any(target_os = "android", target_os = "linux"))]
-    ("576000", BaudRate::B576000),
-    #[cfg(any(target_os = "android", target_os = "linux",))]
-    ("921600", BaudRate::B921600),
-    #[cfg(any(target_os = "android", target_os = "linux"))]
-    ("1000000", BaudRate::B1000000),
-    #[cfg(any(target_os = "android", target_os = "linux"))]
-    ("1152000", BaudRate::B1152000),
-    #[cfg(any(target_os = "android", target_os = "linux"))]
-    ("1500000", BaudRate::B1500000),
-    #[cfg(any(target_os = "android", target_os = "linux"))]
-    ("2000000", BaudRate::B2000000),
-    #[cfg(any(
-        target_os = "android",
-        all(target_os = "linux", not(target_arch = "sparc64"))
-    ))]
-    ("2500000", BaudRate::B2500000),
-    #[cfg(any(
-        target_os = "android",
-        all(target_os = "linux", not(target_arch = "sparc64"))
-    ))]
-    ("3000000", BaudRate::B3000000),
-    #[cfg(any(
-        target_os = "android",
-        all(target_os = "linux", not(target_arch = "sparc64"))
-    ))]
-    ("3500000", BaudRate::B3500000),
-    #[cfg(any(
-        target_os = "android",
-        all(target_os = "linux", not(target_arch = "sparc64"))
-    ))]
-    ("4000000", BaudRate::B4000000),
-];
-/// Control characters for the stty command.
-///
-/// This constant provides a mapping between the names of control characters
-/// and their corresponding values in the `S` enum.
-pub const CONTROL_CHARS: &[(&str, S)] = &[
-    // Sends an interrupt signal (SIGINT).
-    ("intr", S::VINTR),
-    // Sends a quit signal (SIGQUIT).
-    ("quit", S::VQUIT),
-    // Deletes the last typed character.
-    ("erase", S::VERASE),
-    // Deletes the current line.
-    ("kill", S::VKILL),
-    // Signals the end of input.
-    ("eof", S::VEOF),
-    // Signals the end of line.
-    ("eol", S::VEOL),
-    // Alternate end-of-line character.
-    ("eol2", S::VEOL2),
-    // Switch character (only on Linux).
-    #[cfg(target_os = "linux")]
-    ("swtch", S::VSWTC),
-    // Starts output after it has been stopped.
-    ("start", S::VSTART),
-    // Stops output.
-    ("stop", S::VSTOP),
-    // Sends a suspend signal (SIGTSTP).
-    ("susp", S::VSUSP),
-    // Reprints the current line.
-    ("rprnt", S::VREPRINT),
-    // Deletes the last word typed.
-    ("werase", S::VWERASE),
-    // Enters literal mode (next character is taken literally).
-    ("lnext", S::VLNEXT),
-    // Discards the current line.
-    ("discard", S::VDISCARD),
-];
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_stty/stty.rs.html b/coreutils/dev/src/uu_stty/stty.rs.html deleted file mode 100644 index aa9b4eb00..000000000 --- a/coreutils/dev/src/uu_stty/stty.rs.html +++ /dev/null @@ -1,1027 +0,0 @@ -stty.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-
// * This file is part of the uutils coreutils package.
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-// spell-checker:ignore clocal erange tcgetattr tcsetattr tcsanow tiocgwinsz tiocswinsz cfgetospeed cfsetospeed ushort vmin vtime
-
-mod flags;
-
-use clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
-use nix::libc::{c_ushort, O_NONBLOCK, TIOCGWINSZ, TIOCSWINSZ};
-use nix::sys::termios::{
-    cfgetospeed, cfsetospeed, tcgetattr, tcsetattr, ControlFlags, InputFlags, LocalFlags,
-    OutputFlags, SpecialCharacterIndices, Termios,
-};
-use nix::{ioctl_read_bad, ioctl_write_ptr_bad};
-use std::io::{self, stdout};
-use std::ops::ControlFlow;
-use std::os::unix::fs::OpenOptionsExt;
-use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd};
-use uucore::error::{UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage};
-
-#[cfg(not(any(
-    target_os = "freebsd",
-    target_os = "dragonfly",
-    target_os = "ios",
-    target_os = "macos",
-    target_os = "netbsd",
-    target_os = "openbsd"
-)))]
-use flags::BAUD_RATES;
-use flags::{CONTROL_CHARS, CONTROL_FLAGS, INPUT_FLAGS, LOCAL_FLAGS, OUTPUT_FLAGS};
-
-const USAGE: &str = help_usage!("stty.md");
-const SUMMARY: &str = help_about!("stty.md");
-
-#[derive(Clone, Copy, Debug)]
-pub struct Flag<T> {
-    name: &'static str,
-    flag: T,
-    show: bool,
-    sane: bool,
-    group: Option<T>,
-}
-
-impl<T> Flag<T> {
-    pub const fn new(name: &'static str, flag: T) -> Self {
-        Self {
-            name,
-            flag,
-            show: true,
-            sane: false,
-            group: None,
-        }
-    }
-
-    pub const fn new_grouped(name: &'static str, flag: T, group: T) -> Self {
-        Self {
-            name,
-            flag,
-            show: true,
-            sane: false,
-            group: Some(group),
-        }
-    }
-
-    pub const fn hidden(mut self) -> Self {
-        self.show = false;
-        self
-    }
-
-    pub const fn sane(mut self) -> Self {
-        self.sane = true;
-        self
-    }
-}
-
-trait TermiosFlag: Copy {
-    fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool;
-    fn apply(&self, termios: &mut Termios, val: bool);
-}
-
-mod options {
-    pub const ALL: &str = "all";
-    pub const SAVE: &str = "save";
-    pub const FILE: &str = "file";
-    pub const SETTINGS: &str = "settings";
-}
-
-struct Options<'a> {
-    all: bool,
-    save: bool,
-    file: RawFd,
-    settings: Option<Vec<&'a str>>,
-}
-
-impl<'a> Options<'a> {
-    fn from(matches: &'a ArgMatches) -> io::Result<Self> {
-        Ok(Self {
-            all: matches.get_flag(options::ALL),
-            save: matches.get_flag(options::SAVE),
-            file: match matches.get_one::<String>(options::FILE) {
-                // Two notes here:
-                // 1. O_NONBLOCK is needed because according to GNU docs, a
-                //    POSIX tty can block waiting for carrier-detect if the
-                //    "clocal" flag is not set. If your TTY is not connected
-                //    to a modem, it is probably not relevant though.
-                // 2. We never close the FD that we open here, but the OS
-                //    will clean up the FD for us on exit, so it doesn't
-                //    matter. The alternative would be to have an enum of
-                //    BorrowedFd/OwnedFd to handle both cases.
-                Some(f) => std::fs::OpenOptions::new()
-                    .read(true)
-                    .custom_flags(O_NONBLOCK)
-                    .open(f)?
-                    .into_raw_fd(),
-                None => stdout().as_raw_fd(),
-            },
-            settings: matches
-                .get_many::<String>(options::SETTINGS)
-                .map(|v| v.map(|s| s.as_ref()).collect()),
-        })
-    }
-}
-
-// Needs to be repr(C) because we pass it to the ioctl calls.
-#[repr(C)]
-#[derive(Default, Debug)]
-pub struct TermSize {
-    rows: c_ushort,
-    columns: c_ushort,
-    x: c_ushort,
-    y: c_ushort,
-}
-
-ioctl_read_bad!(
-    /// Get terminal window size
-    tiocgwinsz,
-    TIOCGWINSZ,
-    TermSize
-);
-
-ioctl_write_ptr_bad!(
-    /// Set terminal window size
-    tiocswinsz,
-    TIOCSWINSZ,
-    TermSize
-);
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let opts = Options::from(&matches)?;
-
-    stty(&opts)
-}
-
-fn stty(opts: &Options) -> UResult<()> {
-    if opts.save && opts.all {
-        return Err(USimpleError::new(
-            1,
-            "the options for verbose and stty-readable output styles are mutually exclusive",
-        ));
-    }
-
-    if opts.settings.is_some() && (opts.save || opts.all) {
-        return Err(USimpleError::new(
-            1,
-            "when specifying an output style, modes may not be set",
-        ));
-    }
-
-    // TODO: Figure out the right error message for when tcgetattr fails
-    let mut termios = tcgetattr(opts.file).expect("Could not get terminal attributes");
-
-    if let Some(settings) = &opts.settings {
-        for setting in settings {
-            if let ControlFlow::Break(false) = apply_setting(&mut termios, setting) {
-                return Err(USimpleError::new(
-                    1,
-                    format!("invalid argument '{setting}'"),
-                ));
-            }
-        }
-
-        tcsetattr(opts.file, nix::sys::termios::SetArg::TCSANOW, &termios)
-            .expect("Could not write terminal attributes");
-    } else {
-        print_settings(&termios, opts).expect("TODO: make proper error here from nix error");
-    }
-    Ok(())
-}
-
-fn print_terminal_size(termios: &Termios, opts: &Options) -> nix::Result<()> {
-    let speed = cfgetospeed(termios);
-
-    // BSDs use a u32 for the baud rate, so we can simply print it.
-    #[cfg(any(
-        target_os = "freebsd",
-        target_os = "dragonfly",
-        target_os = "ios",
-        target_os = "macos",
-        target_os = "netbsd",
-        target_os = "openbsd"
-    ))]
-    print!("speed {speed} baud; ");
-
-    // Other platforms need to use the baud rate enum, so printing the right value
-    // becomes slightly more complicated.
-    #[cfg(not(any(
-        target_os = "freebsd",
-        target_os = "dragonfly",
-        target_os = "ios",
-        target_os = "macos",
-        target_os = "netbsd",
-        target_os = "openbsd"
-    )))]
-    for (text, baud_rate) in BAUD_RATES {
-        if *baud_rate == speed {
-            print!("speed {text} baud; ");
-            break;
-        }
-    }
-
-    if opts.all {
-        let mut size = TermSize::default();
-        unsafe { tiocgwinsz(opts.file, &mut size as *mut _)? };
-        print!("rows {}; columns {}; ", size.rows, size.columns);
-    }
-
-    #[cfg(any(target_os = "linux", target_os = "redox"))]
-    {
-        // For some reason the normal nix Termios struct does not expose the line,
-        // so we get the underlying libc::termios struct to get that information.
-        let libc_termios: nix::libc::termios = termios.clone().into();
-        let line = libc_termios.c_line;
-        print!("line = {line};");
-    }
-
-    println!();
-    Ok(())
-}
-
-fn control_char_to_string(cc: nix::libc::cc_t) -> nix::Result<String> {
-    if cc == 0 {
-        return Ok("<undef>".to_string());
-    }
-
-    let (meta_prefix, code) = if cc >= 0x80 {
-        ("M-", cc - 0x80)
-    } else {
-        ("", cc)
-    };
-
-    // Determine the '^'-prefix if applicable and character based on the code
-    let (ctrl_prefix, character) = match code {
-        // Control characters in ASCII range
-        0..=0x1f => Ok(("^", (b'@' + code) as char)),
-        // Printable ASCII characters
-        0x20..=0x7e => Ok(("", code as char)),
-        // DEL character
-        0x7f => Ok(("^", '?')),
-        // Out of range (above 8 bits)
-        _ => Err(nix::errno::Errno::ERANGE),
-    }?;
-
-    Ok(format!("{meta_prefix}{ctrl_prefix}{character}"))
-}
-
-fn print_control_chars(termios: &Termios, opts: &Options) -> nix::Result<()> {
-    if !opts.all {
-        // TODO: this branch should print values that differ from defaults
-        return Ok(());
-    }
-
-    for (text, cc_index) in CONTROL_CHARS {
-        print!(
-            "{text} = {}; ",
-            control_char_to_string(termios.control_chars[*cc_index as usize])?
-        );
-    }
-    println!(
-        "min = {}; time = {};",
-        termios.control_chars[SpecialCharacterIndices::VMIN as usize],
-        termios.control_chars[SpecialCharacterIndices::VTIME as usize]
-    );
-    Ok(())
-}
-
-fn print_in_save_format(termios: &Termios) {
-    print!(
-        "{:x}:{:x}:{:x}:{:x}",
-        termios.input_flags.bits(),
-        termios.output_flags.bits(),
-        termios.control_flags.bits(),
-        termios.local_flags.bits()
-    );
-    for cc in termios.control_chars {
-        print!(":{cc:x}");
-    }
-    println!();
-}
-
-fn print_settings(termios: &Termios, opts: &Options) -> nix::Result<()> {
-    if opts.save {
-        print_in_save_format(termios);
-    } else {
-        print_terminal_size(termios, opts)?;
-        print_control_chars(termios, opts)?;
-        print_flags(termios, opts, CONTROL_FLAGS);
-        print_flags(termios, opts, INPUT_FLAGS);
-        print_flags(termios, opts, OUTPUT_FLAGS);
-        print_flags(termios, opts, LOCAL_FLAGS);
-    }
-    Ok(())
-}
-
-fn print_flags<T: TermiosFlag>(termios: &Termios, opts: &Options, flags: &[Flag<T>]) {
-    let mut printed = false;
-    for &Flag {
-        name,
-        flag,
-        show,
-        sane,
-        group,
-    } in flags
-    {
-        if !show {
-            continue;
-        }
-        let val = flag.is_in(termios, group);
-        if group.is_some() {
-            if val && (!sane || opts.all) {
-                print!("{name} ");
-                printed = true;
-            }
-        } else if opts.all || val != sane {
-            if !val {
-                print!("-");
-            }
-            print!("{name} ");
-            printed = true;
-        }
-    }
-    if printed {
-        println!();
-    }
-}
-
-/// Apply a single setting
-///
-/// The value inside the `Break` variant of the `ControlFlow` indicates whether
-/// the setting has been applied.
-fn apply_setting(termios: &mut Termios, s: &str) -> ControlFlow<bool> {
-    apply_baud_rate_flag(termios, s)?;
-
-    let (remove, name) = match s.strip_prefix('-') {
-        Some(s) => (true, s),
-        None => (false, s),
-    };
-    apply_flag(termios, CONTROL_FLAGS, name, remove)?;
-    apply_flag(termios, INPUT_FLAGS, name, remove)?;
-    apply_flag(termios, OUTPUT_FLAGS, name, remove)?;
-    apply_flag(termios, LOCAL_FLAGS, name, remove)?;
-    ControlFlow::Break(false)
-}
-
-/// Apply a flag to a slice of flags
-///
-/// The value inside the `Break` variant of the `ControlFlow` indicates whether
-/// the setting has been applied.
-fn apply_flag<T: TermiosFlag>(
-    termios: &mut Termios,
-    flags: &[Flag<T>],
-    input: &str,
-    remove: bool,
-) -> ControlFlow<bool> {
-    for Flag {
-        name, flag, group, ..
-    } in flags
-    {
-        if input == *name {
-            // Flags with groups cannot be removed
-            // Since the name matches, we can short circuit and don't have to check the other flags.
-            if remove && group.is_some() {
-                return ControlFlow::Break(false);
-            }
-            // If there is a group, the bits for that group should be cleared before applying the flag
-            if let Some(group) = group {
-                group.apply(termios, false);
-            }
-            flag.apply(termios, !remove);
-            return ControlFlow::Break(true);
-        }
-    }
-    ControlFlow::Continue(())
-}
-
-fn apply_baud_rate_flag(termios: &mut Termios, input: &str) -> ControlFlow<bool> {
-    // BSDs use a u32 for the baud rate, so any decimal number applies.
-    #[cfg(any(
-        target_os = "freebsd",
-        target_os = "dragonfly",
-        target_os = "ios",
-        target_os = "macos",
-        target_os = "netbsd",
-        target_os = "openbsd"
-    ))]
-    if let Ok(n) = input.parse::<u32>() {
-        cfsetospeed(termios, n).expect("Failed to set baud rate");
-        return ControlFlow::Break(true);
-    }
-
-    // Other platforms use an enum.
-    #[cfg(not(any(
-        target_os = "freebsd",
-        target_os = "dragonfly",
-        target_os = "ios",
-        target_os = "macos",
-        target_os = "netbsd",
-        target_os = "openbsd"
-    )))]
-    for (text, baud_rate) in BAUD_RATES {
-        if *text == input {
-            cfsetospeed(termios, *baud_rate).expect("Failed to set baud rate");
-            return ControlFlow::Break(true);
-        }
-    }
-    ControlFlow::Continue(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(SUMMARY)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::ALL)
-                .short('a')
-                .long(options::ALL)
-                .help("print all current settings in human-readable form")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SAVE)
-                .short('g')
-                .long(options::SAVE)
-                .help("print all current settings in a stty-readable form")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .short('F')
-                .long(options::FILE)
-                .value_hint(clap::ValueHint::FilePath)
-                .value_name("DEVICE")
-                .help("open and use the specified DEVICE instead of stdin"),
-        )
-        .arg(
-            Arg::new(options::SETTINGS)
-                .action(ArgAction::Append)
-                .help("settings to change"),
-        )
-}
-
-impl TermiosFlag for ControlFlags {
-    fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
-        termios.control_flags.contains(*self)
-            && group.map_or(true, |g| !termios.control_flags.intersects(g - *self))
-    }
-
-    fn apply(&self, termios: &mut Termios, val: bool) {
-        termios.control_flags.set(*self, val);
-    }
-}
-
-impl TermiosFlag for InputFlags {
-    fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
-        termios.input_flags.contains(*self)
-            && group.map_or(true, |g| !termios.input_flags.intersects(g - *self))
-    }
-
-    fn apply(&self, termios: &mut Termios, val: bool) {
-        termios.input_flags.set(*self, val);
-    }
-}
-
-impl TermiosFlag for OutputFlags {
-    fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
-        termios.output_flags.contains(*self)
-            && group.map_or(true, |g| !termios.output_flags.intersects(g - *self))
-    }
-
-    fn apply(&self, termios: &mut Termios, val: bool) {
-        termios.output_flags.set(*self, val);
-    }
-}
-
-impl TermiosFlag for LocalFlags {
-    fn is_in(&self, termios: &Termios, group: Option<Self>) -> bool {
-        termios.local_flags.contains(*self)
-            && group.map_or(true, |g| !termios.local_flags.intersects(g - *self))
-    }
-
-    fn apply(&self, termios: &mut Termios, val: bool) {
-        termios.local_flags.set(*self, val);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sum/sum.rs.html b/coreutils/dev/src/uu_sum/sum.rs.html deleted file mode 100644 index cbb4a789e..000000000 --- a/coreutils/dev/src/uu_sum/sum.rs.html +++ /dev/null @@ -1,339 +0,0 @@ -sum.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) T. Jameson Little <t.jameson.little@gmail.com>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) sysv
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::fs::File;
-use std::io::{stdin, Read};
-use std::path::Path;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage, show};
-
-const USAGE: &str = help_usage!("sum.md");
-const ABOUT: &str = help_about!("sum.md");
-
-// This can be replaced with usize::div_ceil once it is stabilized.
-// This implementation approach is optimized for when `b` is a constant,
-// particularly a power of two.
-const fn div_ceil(a: usize, b: usize) -> usize {
-    (a + b - 1) / b
-}
-
-fn bsd_sum(mut reader: Box<dyn Read>) -> (usize, u16) {
-    let mut buf = [0; 4096];
-    let mut bytes_read = 0;
-    let mut checksum: u16 = 0;
-    loop {
-        match reader.read(&mut buf) {
-            Ok(n) if n != 0 => {
-                bytes_read += n;
-                for &byte in buf[..n].iter() {
-                    checksum = checksum.rotate_right(1);
-                    checksum = checksum.wrapping_add(u16::from(byte));
-                }
-            }
-            _ => break,
-        }
-    }
-
-    // Report blocks read in terms of 1024-byte blocks.
-    let blocks_read = div_ceil(bytes_read, 1024);
-    (blocks_read, checksum)
-}
-
-fn sysv_sum(mut reader: Box<dyn Read>) -> (usize, u16) {
-    let mut buf = [0; 4096];
-    let mut bytes_read = 0;
-    let mut ret = 0u32;
-
-    loop {
-        match reader.read(&mut buf) {
-            Ok(n) if n != 0 => {
-                bytes_read += n;
-                for &byte in buf[..n].iter() {
-                    ret = ret.wrapping_add(u32::from(byte));
-                }
-            }
-            _ => break,
-        }
-    }
-
-    ret = (ret & 0xffff) + (ret >> 16);
-    ret = (ret & 0xffff) + (ret >> 16);
-
-    // Report blocks read in terms of 512-byte blocks.
-    let blocks_read = div_ceil(bytes_read, 512);
-    (blocks_read, ret as u16)
-}
-
-fn open(name: &str) -> UResult<Box<dyn Read>> {
-    match name {
-        "-" => Ok(Box::new(stdin()) as Box<dyn Read>),
-        _ => {
-            let path = &Path::new(name);
-            if path.is_dir() {
-                return Err(USimpleError::new(
-                    2,
-                    format!("{}: Is a directory", name.maybe_quote()),
-                ));
-            };
-            // Silent the warning as we want to the error message
-            if path.metadata().is_err() {
-                return Err(USimpleError::new(
-                    2,
-                    format!("{}: No such file or directory", name.maybe_quote()),
-                ));
-            };
-            let f = File::open(path).map_err_context(String::new)?;
-            Ok(Box::new(f) as Box<dyn Read>)
-        }
-    }
-}
-
-mod options {
-    pub static FILE: &str = "file";
-    pub static BSD_COMPATIBLE: &str = "r";
-    pub static SYSTEM_V_COMPATIBLE: &str = "sysv";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let files: Vec<String> = match matches.get_many::<String>(options::FILE) {
-        Some(v) => v.clone().map(|v| v.to_owned()).collect(),
-        None => vec!["-".to_owned()],
-    };
-
-    let sysv = matches.get_flag(options::SYSTEM_V_COMPATIBLE);
-
-    let print_names = files.len() > 1 || files[0] != "-";
-    let width = if sysv { 1 } else { 5 };
-
-    for file in &files {
-        let reader = match open(file) {
-            Ok(f) => f,
-            Err(error) => {
-                show!(error);
-                continue;
-            }
-        };
-        let (blocks, sum) = if sysv {
-            sysv_sum(reader)
-        } else {
-            bsd_sum(reader)
-        };
-
-        if print_names {
-            println!("{sum:0width$} {blocks:width$} {file}");
-        } else {
-            println!("{sum:0width$} {blocks:width$}");
-        }
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::FILE)
-                .action(ArgAction::Append)
-                .hide(true)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::BSD_COMPATIBLE)
-                .short('r')
-                .help("use the BSD sum algorithm, use 1K blocks (default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SYSTEM_V_COMPATIBLE)
-                .short('s')
-                .long(options::SYSTEM_V_COMPATIBLE)
-                .help("use System V sum algorithm, use 512 bytes blocks")
-                .action(ArgAction::SetTrue),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_sync/sync.rs.html b/coreutils/dev/src/uu_sync/sync.rs.html deleted file mode 100644 index 7bf01a23d..000000000 --- a/coreutils/dev/src/uu_sync/sync.rs.html +++ /dev/null @@ -1,493 +0,0 @@ -sync.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alexander Fomin <xander.fomin@ya.ru>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-/* Last synced with: sync (GNU coreutils) 8.13 */
-
-use clap::{crate_version, Arg, ArgAction, Command};
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use nix::errno::Errno;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use nix::fcntl::{open, OFlag};
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use nix::sys::stat::Mode;
-use std::path::Path;
-use uucore::display::Quotable;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use uucore::error::FromIo;
-use uucore::error::{UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("sync.md");
-const USAGE: &str = help_usage!("sync.md");
-
-pub mod options {
-    pub static FILE_SYSTEM: &str = "file-system";
-    pub static DATA: &str = "data";
-}
-
-static ARG_FILES: &str = "files";
-
-#[cfg(unix)]
-mod platform {
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    use std::fs::File;
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    use std::os::unix::io::AsRawFd;
-
-    pub unsafe fn do_sync() -> isize {
-        // see https://github.com/rust-lang/libc/pull/2161
-        #[cfg(target_os = "android")]
-        libc::syscall(libc::SYS_sync);
-        #[cfg(not(target_os = "android"))]
-        libc::sync();
-        0
-    }
-
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    pub unsafe fn do_syncfs(files: Vec<String>) -> isize {
-        for path in files {
-            let f = File::open(path).unwrap();
-            let fd = f.as_raw_fd();
-            libc::syscall(libc::SYS_syncfs, fd);
-        }
-        0
-    }
-
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    pub unsafe fn do_fdatasync(files: Vec<String>) -> isize {
-        for path in files {
-            let f = File::open(path).unwrap();
-            let fd = f.as_raw_fd();
-            libc::syscall(libc::SYS_fdatasync, fd);
-        }
-        0
-    }
-}
-
-#[cfg(windows)]
-mod platform {
-    use std::fs::OpenOptions;
-    use std::os::windows::prelude::*;
-    use std::path::Path;
-    use uucore::crash;
-    use uucore::wide::{FromWide, ToWide};
-    use windows_sys::Win32::Foundation::{
-        GetLastError, ERROR_NO_MORE_FILES, HANDLE, INVALID_HANDLE_VALUE, MAX_PATH,
-    };
-    use windows_sys::Win32::Storage::FileSystem::{
-        FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, FlushFileBuffers, GetDriveTypeW,
-    };
-    use windows_sys::Win32::System::WindowsProgramming::DRIVE_FIXED;
-
-    unsafe fn flush_volume(name: &str) {
-        let name_wide = name.to_wide_null();
-        if GetDriveTypeW(name_wide.as_ptr()) == DRIVE_FIXED {
-            let sliced_name = &name[..name.len() - 1]; // eliminate trailing backslash
-            match OpenOptions::new().write(true).open(sliced_name) {
-                Ok(file) => {
-                    if FlushFileBuffers(file.as_raw_handle() as HANDLE) == 0 {
-                        crash!(GetLastError() as i32, "failed to flush file buffer");
-                    }
-                }
-                Err(e) => crash!(
-                    e.raw_os_error().unwrap_or(1),
-                    "failed to create volume handle"
-                ),
-            }
-        }
-    }
-
-    unsafe fn find_first_volume() -> (String, HANDLE) {
-        let mut name: [u16; MAX_PATH as usize] = [0; MAX_PATH as usize];
-        let handle = FindFirstVolumeW(name.as_mut_ptr(), name.len() as u32);
-        if handle == INVALID_HANDLE_VALUE {
-            crash!(GetLastError() as i32, "failed to find first volume");
-        }
-        (String::from_wide_null(&name), handle)
-    }
-
-    unsafe fn find_all_volumes() -> Vec<String> {
-        let (first_volume, next_volume_handle) = find_first_volume();
-        let mut volumes = vec![first_volume];
-        loop {
-            let mut name: [u16; MAX_PATH as usize] = [0; MAX_PATH as usize];
-            if FindNextVolumeW(next_volume_handle, name.as_mut_ptr(), name.len() as u32) == 0 {
-                match GetLastError() {
-                    ERROR_NO_MORE_FILES => {
-                        FindVolumeClose(next_volume_handle);
-                        return volumes;
-                    }
-                    err => crash!(err as i32, "failed to find next volume"),
-                }
-            } else {
-                volumes.push(String::from_wide_null(&name));
-            }
-        }
-    }
-
-    pub unsafe fn do_sync() -> isize {
-        let volumes = find_all_volumes();
-        for vol in &volumes {
-            flush_volume(vol);
-        }
-        0
-    }
-
-    pub unsafe fn do_syncfs(files: Vec<String>) -> isize {
-        for path in files {
-            flush_volume(
-                Path::new(&path)
-                    .components()
-                    .next()
-                    .unwrap()
-                    .as_os_str()
-                    .to_str()
-                    .unwrap(),
-            );
-        }
-        0
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let files: Vec<String> = matches
-        .get_many::<String>(ARG_FILES)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    if matches.get_flag(options::DATA) && files.is_empty() {
-        return Err(USimpleError::new(1, "--data needs at least one argument"));
-    }
-
-    for f in &files {
-        // Use the Nix open to be able to set the NONBLOCK flags for fifo files
-        #[cfg(any(target_os = "linux", target_os = "android"))]
-        {
-            let path = Path::new(&f);
-            if let Err(e) = open(path, OFlag::O_NONBLOCK, Mode::empty()) {
-                if e != Errno::EACCES || (e == Errno::EACCES && path.is_dir()) {
-                    return e.map_err_context(|| format!("error opening {}", f.quote()))?;
-                }
-            }
-        }
-
-        #[cfg(not(any(target_os = "linux", target_os = "android")))]
-        {
-            if !Path::new(&f).exists() {
-                return Err(USimpleError::new(
-                    1,
-                    format!("error opening {}: No such file or directory", f.quote()),
-                ));
-            }
-        }
-    }
-
-    #[allow(clippy::if_same_then_else)]
-    if matches.get_flag(options::FILE_SYSTEM) {
-        #[cfg(any(target_os = "linux", target_os = "android", target_os = "windows"))]
-        syncfs(files);
-    } else if matches.get_flag(options::DATA) {
-        #[cfg(any(target_os = "linux", target_os = "android"))]
-        fdatasync(files);
-    } else {
-        sync();
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::FILE_SYSTEM)
-                .short('f')
-                .long(options::FILE_SYSTEM)
-                .conflicts_with(options::DATA)
-                .help("sync the file systems that contain the files (Linux and Windows only)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DATA)
-                .short('d')
-                .long(options::DATA)
-                .conflicts_with(options::FILE_SYSTEM)
-                .help("sync only file data, no unneeded metadata (Linux only)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
-fn sync() -> isize {
-    unsafe { platform::do_sync() }
-}
-
-#[cfg(any(target_os = "linux", target_os = "android", target_os = "windows"))]
-fn syncfs(files: Vec<String>) -> isize {
-    unsafe { platform::do_syncfs(files) }
-}
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-fn fdatasync(files: Vec<String>) -> isize {
-    unsafe { platform::do_fdatasync(files) }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tac/error.rs.html b/coreutils/dev/src/uu_tac/error.rs.html deleted file mode 100644 index 4e61a4ae6..000000000 --- a/coreutils/dev/src/uu_tac/error.rs.html +++ /dev/null @@ -1,121 +0,0 @@ -error.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-//! Errors returned by tac during processing of a file.
-use std::error::Error;
-use std::fmt::Display;
-
-use uucore::display::Quotable;
-use uucore::error::UError;
-
-#[derive(Debug)]
-pub enum TacError {
-    /// A regular expression given by the user is invalid.
-    InvalidRegex(regex::Error),
-
-    /// An argument to tac is invalid.
-    InvalidArgument(String),
-
-    /// The specified file is not found on the filesystem.
-    FileNotFound(String),
-
-    /// An error reading the contents of a file or stdin.
-    ///
-    /// The parameters are the name of the file and the underlying
-    /// [`std::io::Error`] that caused this error.
-    ReadError(String, std::io::Error),
-
-    /// An error writing the (reversed) contents of a file or stdin.
-    ///
-    /// The parameter is the underlying [`std::io::Error`] that caused
-    /// this error.
-    WriteError(std::io::Error),
-}
-
-impl UError for TacError {
-    fn code(&self) -> i32 {
-        1
-    }
-}
-
-impl Error for TacError {}
-
-impl Display for TacError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::InvalidRegex(e) => write!(f, "invalid regular expression: {e}"),
-            Self::InvalidArgument(s) => {
-                write!(f, "{}: read error: Invalid argument", s.maybe_quote())
-            }
-            Self::FileNotFound(s) => write!(
-                f,
-                "failed to open {} for reading: No such file or directory",
-                s.quote()
-            ),
-            Self::ReadError(s, e) => write!(f, "failed to read from {s}: {e}"),
-            Self::WriteError(e) => write!(f, "failed to write to stdout: {e}"),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tac/tac.rs.html b/coreutils/dev/src/uu_tac/tac.rs.html deleted file mode 100644 index 1e82e43c4..000000000 --- a/coreutils/dev/src/uu_tac/tac.rs.html +++ /dev/null @@ -1,635 +0,0 @@ -tac.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) sbytes slen dlen memmem memmap Mmap mmap SIGBUS
-mod error;
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use memchr::memmem;
-use memmap2::Mmap;
-use std::io::{stdin, stdout, BufWriter, Read, Write};
-use std::{
-    fs::{read, File},
-    path::Path,
-};
-use uucore::display::Quotable;
-use uucore::error::UError;
-use uucore::error::UResult;
-use uucore::{format_usage, help_about, help_usage, show};
-
-use crate::error::TacError;
-
-static USAGE: &str = help_usage!("tac.md");
-static ABOUT: &str = help_about!("tac.md");
-
-mod options {
-    pub static BEFORE: &str = "before";
-    pub static REGEX: &str = "regex";
-    pub static SEPARATOR: &str = "separator";
-    pub static FILE: &str = "file";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let before = matches.get_flag(options::BEFORE);
-    let regex = matches.get_flag(options::REGEX);
-    let raw_separator = matches
-        .get_one::<String>(options::SEPARATOR)
-        .map(|s| s.as_str())
-        .unwrap_or("\n");
-    let separator = if raw_separator.is_empty() {
-        "\0"
-    } else {
-        raw_separator
-    };
-
-    let files: Vec<&str> = match matches.get_many::<String>(options::FILE) {
-        Some(v) => v.map(|s| s.as_str()).collect(),
-        None => vec!["-"],
-    };
-
-    tac(&files, before, regex, separator)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::BEFORE)
-                .short('b')
-                .long(options::BEFORE)
-                .help("attach the separator before instead of after")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::REGEX)
-                .short('r')
-                .long(options::REGEX)
-                .help("interpret the sequence as a regular expression")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SEPARATOR)
-                .short('s')
-                .long(options::SEPARATOR)
-                .help("use STRING as the separator instead of newline")
-                .value_name("STRING"),
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-/// Print lines of a buffer in reverse, with line separator given as a regex.
-///
-/// `data` contains the bytes of the file.
-///
-/// `pattern` is the regular expression given as a
-/// [`regex::bytes::Regex`] (not a [`regex::Regex`], since the input is
-/// given as a slice of bytes). If `before` is `true`, then each match
-/// of this pattern in `data` is interpreted as the start of a line. If
-/// `before` is `false`, then each match of this pattern is interpreted
-/// as the end of a line.
-///
-/// This function writes each line in `data` to [`std::io::Stdout`] in
-/// reverse.
-///
-/// # Errors
-///
-/// If there is a problem writing to `stdout`, then this function
-/// returns [`std::io::Error`].
-fn buffer_tac_regex(
-    data: &[u8],
-    pattern: &regex::bytes::Regex,
-    before: bool,
-) -> std::io::Result<()> {
-    let out = stdout();
-    let mut out = BufWriter::new(out.lock());
-
-    // The index of the line separator for the current line.
-    //
-    // As we scan through the `data` from right to left, we update this
-    // variable each time we find a new line separator. We restrict our
-    // regular expression search to only those bytes up to the line
-    // separator.
-    let mut this_line_end = data.len();
-
-    // The index of the start of the next line in the `data`.
-    //
-    // As we scan through the `data` from right to left, we update this
-    // variable each time we find a new line.
-    //
-    // If `before` is `true`, then each line starts immediately before
-    // the line separator. Otherwise, each line starts immediately after
-    // the line separator.
-    let mut following_line_start = data.len();
-
-    // Iterate over each byte in the buffer in reverse. When we find a
-    // line separator, write the line to stdout.
-    //
-    // The `before` flag controls whether the line separator appears at
-    // the end of the line (as in "abc\ndef\n") or at the beginning of
-    // the line (as in "/abc/def").
-    for i in (0..data.len()).rev() {
-        // Determine if there is a match for `pattern` starting at index
-        // `i` in `data`. Only search up to the line ending that was
-        // found previously.
-        if let Some(match_) = pattern.find_at(&data[..this_line_end], i) {
-            // Record this index as the ending of the current line.
-            this_line_end = i;
-
-            // The length of the match (that is, the line separator), in bytes.
-            let slen = match_.end() - match_.start();
-
-            if before {
-                out.write_all(&data[i..following_line_start])?;
-                following_line_start = i;
-            } else {
-                out.write_all(&data[i + slen..following_line_start])?;
-                following_line_start = i + slen;
-            }
-        }
-    }
-
-    // After the loop terminates, write whatever bytes are remaining at
-    // the beginning of the buffer.
-    out.write_all(&data[0..following_line_start])?;
-    Ok(())
-}
-
-/// Write lines from `data` to stdout in reverse.
-///
-/// This function writes to [`stdout`] each line appearing in `data`,
-/// starting with the last line and ending with the first line. The
-/// `separator` parameter defines what characters to use as a line
-/// separator.
-///
-/// If `before` is `false`, then this function assumes that the
-/// `separator` appears at the end of each line, as in `"abc\ndef\n"`.
-/// If `before` is `true`, then this function assumes that the
-/// `separator` appears at the beginning of each line, as in
-/// `"/abc/def"`.
-fn buffer_tac(data: &[u8], before: bool, separator: &str) -> std::io::Result<()> {
-    let out = stdout();
-    let mut out = BufWriter::new(out.lock());
-
-    // The number of bytes in the line separator.
-    let slen = separator.as_bytes().len();
-
-    // The index of the start of the next line in the `data`.
-    //
-    // As we scan through the `data` from right to left, we update this
-    // variable each time we find a new line.
-    //
-    // If `before` is `true`, then each line starts immediately before
-    // the line separator. Otherwise, each line starts immediately after
-    // the line separator.
-    let mut following_line_start = data.len();
-
-    // Iterate over each byte in the buffer in reverse. When we find a
-    // line separator, write the line to stdout.
-    //
-    // The `before` flag controls whether the line separator appears at
-    // the end of the line (as in "abc\ndef\n") or at the beginning of
-    // the line (as in "/abc/def").
-    for i in memmem::rfind_iter(data, separator) {
-        if before {
-            out.write_all(&data[i..following_line_start])?;
-            following_line_start = i;
-        } else {
-            out.write_all(&data[i + slen..following_line_start])?;
-            following_line_start = i + slen;
-        }
-    }
-
-    // After the loop terminates, write whatever bytes are remaining at
-    // the beginning of the buffer.
-    out.write_all(&data[0..following_line_start])?;
-    Ok(())
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn tac(filenames: &[&str], before: bool, regex: bool, separator: &str) -> UResult<()> {
-    // Compile the regular expression pattern if it is provided.
-    let maybe_pattern = if regex {
-        match regex::bytes::Regex::new(separator) {
-            Ok(p) => Some(p),
-            Err(e) => return Err(TacError::InvalidRegex(e).into()),
-        }
-    } else {
-        None
-    };
-
-    for &filename in filenames {
-        let mmap;
-        let buf;
-
-        let data: &[u8] = if filename == "-" {
-            if let Some(mmap1) = try_mmap_stdin() {
-                mmap = mmap1;
-                &mmap
-            } else {
-                let mut buf1 = Vec::new();
-                if let Err(e) = stdin().read_to_end(&mut buf1) {
-                    let e: Box<dyn UError> = TacError::ReadError("stdin".to_string(), e).into();
-                    show!(e);
-                    continue;
-                }
-                buf = buf1;
-                &buf
-            }
-        } else {
-            let path = Path::new(filename);
-            if path.is_dir() {
-                let e: Box<dyn UError> = TacError::InvalidArgument(String::from(filename)).into();
-                show!(e);
-                continue;
-            }
-
-            if path.metadata().is_err() {
-                let e: Box<dyn UError> = TacError::FileNotFound(String::from(filename)).into();
-                show!(e);
-                continue;
-            }
-
-            if let Some(mmap1) = try_mmap_path(path) {
-                mmap = mmap1;
-                &mmap
-            } else {
-                match read(path) {
-                    Ok(buf1) => {
-                        buf = buf1;
-                        &buf
-                    }
-                    Err(e) => {
-                        let s = format!("{}", filename.quote());
-                        let e: Box<dyn UError> = TacError::ReadError(s.to_string(), e).into();
-                        show!(e);
-                        continue;
-                    }
-                }
-            }
-        };
-
-        // Select the appropriate `tac` algorithm based on whether the
-        // separator is given as a regular expression or a fixed string.
-        let result = match maybe_pattern {
-            Some(ref pattern) => buffer_tac_regex(data, pattern, before),
-            None => buffer_tac(data, before, separator),
-        };
-
-        // If there is any error in writing the output, terminate immediately.
-        if let Err(e) = result {
-            return Err(TacError::WriteError(e).into());
-        }
-    }
-    Ok(())
-}
-
-fn try_mmap_stdin() -> Option<Mmap> {
-    // SAFETY: If the file is truncated while we map it, SIGBUS will be raised
-    // and our process will be terminated, thus preventing access of invalid memory.
-    unsafe { Mmap::map(&stdin()).ok() }
-}
-
-fn try_mmap_path(path: &Path) -> Option<Mmap> {
-    let file = File::open(path).ok()?;
-
-    // SAFETY: If the file is truncated while we map it, SIGBUS will be raised
-    // and our process will be terminated, thus preventing access of invalid memory.
-    let mmap = unsafe { Mmap::map(&file).ok()? };
-
-    Some(mmap)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/args.rs.html b/coreutils/dev/src/uu_tail/args.rs.html deleted file mode 100644 index 25b4a162c..000000000 --- a/coreutils/dev/src/uu_tail/args.rs.html +++ /dev/null @@ -1,1361 +0,0 @@ -args.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) kqueue Signum fundu
-
-use crate::paths::Input;
-use crate::{parse, platform, Quotable};
-use clap::{crate_version, value_parser};
-use clap::{Arg, ArgAction, ArgMatches, Command};
-use fundu::{DurationParser, SaturatingInto};
-use is_terminal::IsTerminal;
-use same_file::Handle;
-use std::ffi::OsString;
-use std::time::Duration;
-use uucore::error::{UResult, USimpleError, UUsageError};
-use uucore::parse_size::{parse_size, ParseSizeError};
-use uucore::{format_usage, help_about, help_usage, show_warning};
-
-const ABOUT: &str = help_about!("tail.md");
-const USAGE: &str = help_usage!("tail.md");
-
-pub mod options {
-    pub mod verbosity {
-        pub const QUIET: &str = "quiet";
-        pub const VERBOSE: &str = "verbose";
-    }
-    pub const BYTES: &str = "bytes";
-    pub const FOLLOW: &str = "follow";
-    pub const LINES: &str = "lines";
-    pub const PID: &str = "pid";
-    pub const SLEEP_INT: &str = "sleep-interval";
-    pub const ZERO_TERM: &str = "zero-terminated";
-    pub const DISABLE_INOTIFY_TERM: &str = "-disable-inotify"; // NOTE: three hyphens is correct
-    pub const USE_POLLING: &str = "use-polling";
-    pub const RETRY: &str = "retry";
-    pub const FOLLOW_RETRY: &str = "F";
-    pub const MAX_UNCHANGED_STATS: &str = "max-unchanged-stats";
-    pub const ARG_FILES: &str = "files";
-    pub const PRESUME_INPUT_PIPE: &str = "-presume-input-pipe"; // NOTE: three hyphens is correct
-}
-
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
-pub enum Signum {
-    Negative(u64),
-    Positive(u64),
-    PlusZero,
-    MinusZero,
-}
-
-#[derive(Debug, PartialEq, Eq)]
-pub enum FilterMode {
-    Bytes(Signum),
-
-    /// Mode for lines delimited by delimiter as u8
-    Lines(Signum, u8),
-}
-
-impl FilterMode {
-    fn from_obsolete_args(args: &parse::ObsoleteArgs) -> Self {
-        let signum = if args.plus {
-            Signum::Positive(args.num)
-        } else {
-            Signum::Negative(args.num)
-        };
-        if args.lines {
-            Self::Lines(signum, b'\n')
-        } else {
-            Self::Bytes(signum)
-        }
-    }
-
-    fn from(matches: &ArgMatches) -> UResult<Self> {
-        let zero_term = matches.get_flag(options::ZERO_TERM);
-        let mode = if let Some(arg) = matches.get_one::<String>(options::BYTES) {
-            match parse_num(arg) {
-                Ok(signum) => Self::Bytes(signum),
-                Err(e) => {
-                    return Err(USimpleError::new(
-                        1,
-                        format!("invalid number of bytes: '{e}'"),
-                    ))
-                }
-            }
-        } else if let Some(arg) = matches.get_one::<String>(options::LINES) {
-            match parse_num(arg) {
-                Ok(signum) => {
-                    let delimiter = if zero_term { 0 } else { b'\n' };
-                    Self::Lines(signum, delimiter)
-                }
-                Err(e) => {
-                    return Err(USimpleError::new(
-                        1,
-                        format!("invalid number of lines: {e}"),
-                    ))
-                }
-            }
-        } else if zero_term {
-            Self::default_zero()
-        } else {
-            Self::default()
-        };
-
-        Ok(mode)
-    }
-
-    fn default_zero() -> Self {
-        Self::Lines(Signum::Negative(10), 0)
-    }
-}
-
-impl Default for FilterMode {
-    fn default() -> Self {
-        Self::Lines(Signum::Negative(10), b'\n')
-    }
-}
-
-#[derive(Debug, PartialEq, Eq, Clone, Copy)]
-pub enum FollowMode {
-    Descriptor,
-    Name,
-}
-
-#[derive(Debug)]
-pub enum VerificationResult {
-    Ok,
-    CannotFollowStdinByName,
-    NoOutput,
-}
-
-#[derive(Debug)]
-pub struct Settings {
-    pub follow: Option<FollowMode>,
-    pub max_unchanged_stats: u32,
-    pub mode: FilterMode,
-    pub pid: platform::Pid,
-    pub retry: bool,
-    pub sleep_sec: Duration,
-    pub use_polling: bool,
-    pub verbose: bool,
-    pub presume_input_pipe: bool,
-    /// `FILE(s)` positional arguments
-    pub inputs: Vec<Input>,
-}
-
-impl Default for Settings {
-    fn default() -> Self {
-        Self {
-            max_unchanged_stats: 5,
-            sleep_sec: Duration::from_secs_f32(1.0),
-            follow: Option::default(),
-            mode: FilterMode::default(),
-            pid: Default::default(),
-            retry: Default::default(),
-            use_polling: Default::default(),
-            verbose: Default::default(),
-            presume_input_pipe: Default::default(),
-            inputs: Vec::default(),
-        }
-    }
-}
-
-impl Settings {
-    pub fn from_obsolete_args(args: &parse::ObsoleteArgs, name: Option<&OsString>) -> Self {
-        let mut settings = Self::default();
-        if args.follow {
-            settings.follow = if name.is_some() {
-                Some(FollowMode::Name)
-            } else {
-                Some(FollowMode::Descriptor)
-            };
-        }
-        settings.mode = FilterMode::from_obsolete_args(args);
-        let input = if let Some(name) = name {
-            Input::from(name)
-        } else {
-            Input::default()
-        };
-        settings.inputs.push(input);
-        settings
-    }
-
-    pub fn from(matches: &clap::ArgMatches) -> UResult<Self> {
-        // We're parsing --follow, -F and --retry under the following conditions:
-        // * -F sets --retry and --follow=name
-        // * plain --follow or short -f is the same like specifying --follow=descriptor
-        // * All these options and flags can occur multiple times as command line arguments
-        let follow_retry = matches.get_flag(options::FOLLOW_RETRY);
-        // We don't need to check for occurrences of --retry if -F was specified which already sets
-        // retry
-        let retry = follow_retry || matches.get_flag(options::RETRY);
-        let follow = match (
-            follow_retry,
-            matches
-                .get_one::<String>(options::FOLLOW)
-                .map(|s| s.as_str()),
-        ) {
-            // -F and --follow if -F is specified after --follow. We don't need to care about the
-            // value of --follow.
-            (true, Some(_))
-                // It's ok to use `index_of` instead of `indices_of` since -F and  --follow
-                // overwrite themselves (not only the value but also the index).
-                if matches.index_of(options::FOLLOW_RETRY) > matches.index_of(options::FOLLOW) =>
-            {
-                Some(FollowMode::Name)
-            }
-            // * -F and --follow=name if --follow=name is specified after -F
-            // * No occurrences of -F but --follow=name
-            // * -F and no occurrences of --follow
-            (_, Some("name")) | (true, None) => Some(FollowMode::Name),
-            // * -F and --follow=descriptor (or plain --follow, -f) if --follow=descriptor is
-            // specified after -F
-            // * No occurrences of -F but --follow=descriptor, --follow, -f
-            (_, Some(_)) => Some(FollowMode::Descriptor),
-            // The default for no occurrences of -F or --follow
-            (false, None) => None,
-        };
-
-        let mut settings: Self = Self {
-            follow,
-            retry,
-            use_polling: matches.get_flag(options::USE_POLLING),
-            mode: FilterMode::from(matches)?,
-            verbose: matches.get_flag(options::verbosity::VERBOSE),
-            presume_input_pipe: matches.get_flag(options::PRESUME_INPUT_PIPE),
-            ..Default::default()
-        };
-
-        if let Some(source) = matches.get_one::<String>(options::SLEEP_INT) {
-            // Advantage of `fundu` over `Duration::(try_)from_secs_f64(source.parse().unwrap())`:
-            // * doesn't panic on errors like `Duration::from_secs_f64` would.
-            // * no precision loss, rounding errors or other floating point problems.
-            // * evaluates to `Duration::MAX` if the parsed number would have exceeded
-            //   `DURATION::MAX` or `infinity` was given
-            // * not applied here but it supports customizable time units and provides better error
-            //   messages
-            settings.sleep_sec = match DurationParser::without_time_units().parse(source) {
-                Ok(duration) => SaturatingInto::<std::time::Duration>::saturating_into(duration),
-                Err(_) => {
-                    return Err(UUsageError::new(
-                        1,
-                        format!("invalid number of seconds: '{source}'"),
-                    ))
-                }
-            }
-        }
-
-        if let Some(s) = matches.get_one::<String>(options::MAX_UNCHANGED_STATS) {
-            settings.max_unchanged_stats = match s.parse::<u32>() {
-                Ok(s) => s,
-                Err(_) => {
-                    return Err(UUsageError::new(
-                        1,
-                        format!(
-                            "invalid maximum number of unchanged stats between opens: {}",
-                            s.quote()
-                        ),
-                    ));
-                }
-            }
-        }
-
-        if let Some(pid_str) = matches.get_one::<String>(options::PID) {
-            match pid_str.parse() {
-                Ok(pid) => {
-                    // NOTE: on unix platform::Pid is i32, on windows platform::Pid is u32
-                    #[cfg(unix)]
-                    if pid < 0 {
-                        // NOTE: tail only accepts an unsigned pid
-                        return Err(USimpleError::new(
-                            1,
-                            format!("invalid PID: {}", pid_str.quote()),
-                        ));
-                    }
-
-                    settings.pid = pid;
-                }
-                Err(e) => {
-                    return Err(USimpleError::new(
-                        1,
-                        format!("invalid PID: {}: {}", pid_str.quote(), e),
-                    ));
-                }
-            }
-        }
-
-        settings.inputs = matches
-            .get_many::<OsString>(options::ARG_FILES)
-            .map(|v| v.map(Input::from).collect())
-            .unwrap_or_else(|| vec![Input::default()]);
-
-        settings.verbose =
-            settings.inputs.len() > 1 && !matches.get_flag(options::verbosity::QUIET);
-
-        Ok(settings)
-    }
-
-    pub fn has_only_stdin(&self) -> bool {
-        self.inputs.iter().all(|input| input.is_stdin())
-    }
-
-    pub fn has_stdin(&self) -> bool {
-        self.inputs.iter().any(|input| input.is_stdin())
-    }
-
-    pub fn num_inputs(&self) -> usize {
-        self.inputs.len()
-    }
-
-    /// Check [`Settings`] for problematic configurations of tail originating from user provided
-    /// command line arguments and print appropriate warnings.
-    pub fn check_warnings(&self) {
-        if self.retry {
-            if self.follow.is_none() {
-                show_warning!("--retry ignored; --retry is useful only when following");
-            } else if self.follow == Some(FollowMode::Descriptor) {
-                show_warning!("--retry only effective for the initial open");
-            }
-        }
-
-        if self.pid != 0 {
-            if self.follow.is_none() {
-                show_warning!("PID ignored; --pid=PID is useful only when following");
-            } else if !platform::supports_pid_checks(self.pid) {
-                show_warning!("--pid=PID is not supported on this system");
-            }
-        }
-
-        // This warning originates from gnu's tail implementation of the equivalent warning. If the
-        // user wants to follow stdin, but tail is blocking indefinitely anyways, because of stdin
-        // as `tty` (but no otherwise blocking stdin), then we print a warning that `--follow`
-        // cannot be applied under these circumstances and is therefore ineffective.
-        if self.follow.is_some() && self.has_stdin() {
-            let blocking_stdin = self.pid == 0
-                && self.follow == Some(FollowMode::Descriptor)
-                && self.num_inputs() == 1
-                && Handle::stdin().map_or(false, |handle| {
-                    handle
-                        .as_file()
-                        .metadata()
-                        .map_or(false, |meta| !meta.is_file())
-                });
-
-            if !blocking_stdin && std::io::stdin().is_terminal() {
-                show_warning!("following standard input indefinitely is ineffective");
-            }
-        }
-    }
-
-    /// Verify [`Settings`] and try to find unsolvable misconfigurations of tail originating from
-    /// user provided command line arguments. In contrast to [`Settings::check_warnings`] these
-    /// misconfigurations usually lead to the immediate exit or abortion of the running `tail`
-    /// process.
-    pub fn verify(&self) -> VerificationResult {
-        // Mimic GNU's tail for `tail -F`
-        if self.inputs.iter().any(|i| i.is_stdin()) && self.follow == Some(FollowMode::Name) {
-            return VerificationResult::CannotFollowStdinByName;
-        }
-
-        // Mimic GNU's tail for -[nc]0 without -f and exit immediately
-        if self.follow.is_none()
-            && matches!(
-                self.mode,
-                FilterMode::Lines(Signum::MinusZero, _) | FilterMode::Bytes(Signum::MinusZero)
-            )
-        {
-            return VerificationResult::NoOutput;
-        }
-
-        VerificationResult::Ok
-    }
-}
-
-pub fn parse_obsolete(arg: &OsString, input: Option<&OsString>) -> UResult<Option<Settings>> {
-    match parse::parse_obsolete(arg) {
-        Some(Ok(args)) => Ok(Some(Settings::from_obsolete_args(&args, input))),
-        None => Ok(None),
-        Some(Err(e)) => {
-            let arg_str = arg.to_string_lossy();
-            Err(USimpleError::new(
-                1,
-                match e {
-                    parse::ParseError::OutOfRange => format!(
-                        "invalid number: {}: Numerical result out of range",
-                        arg_str.quote()
-                    ),
-                    parse::ParseError::Overflow => format!("invalid number: {}", arg_str.quote()),
-                    // this ensures compatibility to GNU's error message (as tested in misc/tail)
-                    parse::ParseError::Context => format!(
-                        "option used in invalid context -- {}",
-                        arg_str.chars().nth(1).unwrap_or_default()
-                    ),
-                    parse::ParseError::InvalidEncoding => {
-                        format!("bad argument encoding: '{arg_str}'")
-                    }
-                },
-            ))
-        }
-    }
-}
-
-fn parse_num(src: &str) -> Result<Signum, ParseSizeError> {
-    let mut size_string = src.trim();
-    let mut starting_with = false;
-
-    if let Some(c) = size_string.chars().next() {
-        if c == '+' || c == '-' {
-            // tail: '-' is not documented (8.32 man pages)
-            size_string = &size_string[1..];
-            if c == '+' {
-                starting_with = true;
-            }
-        }
-    }
-
-    match parse_size(size_string) {
-        Ok(n) => match (n, starting_with) {
-            (0, true) => Ok(Signum::PlusZero),
-            (0, false) => Ok(Signum::MinusZero),
-            (n, true) => Ok(Signum::Positive(n)),
-            (n, false) => Ok(Signum::Negative(n)),
-        },
-        Err(_) => Err(ParseSizeError::ParseFailure(size_string.to_string())),
-    }
-}
-
-pub fn parse_args(args: impl uucore::Args) -> UResult<Settings> {
-    let args_vec: Vec<OsString> = args.collect();
-    let clap_args = uu_app().try_get_matches_from(args_vec.clone());
-    let clap_result = match clap_args {
-        Ok(matches) => Ok(Settings::from(&matches)?),
-        Err(err) => Err(err.into()),
-    };
-
-    // clap isn't able to handle obsolete syntax.
-    // therefore, we want to check further for obsolete arguments.
-    // argv[0] is always present, argv[1] might be obsolete arguments
-    // argv[2] might contain an input file, argv[3] isn't allowed in obsolete mode
-    if args_vec.len() != 2 && args_vec.len() != 3 {
-        return clap_result;
-    }
-
-    // At this point, there are a few possible cases:
-    //
-    //    1. clap has succeeded and the arguments would be invalid for the obsolete syntax.
-    //    2. The case of `tail -c 5` is ambiguous. clap parses this as `tail -c5`,
-    //       but it could also be interpreted as valid obsolete syntax (tail -c on file '5').
-    //       GNU chooses to interpret this as `tail -c5`, like clap.
-    //    3. `tail -f foo` is also ambiguous, but has the same effect in both cases. We can safely
-    //        use the clap result here.
-    //    4. clap succeeded for obsolete arguments starting with '+', but misinterprets them as
-    //       input files (e.g. 'tail +f').
-    //    5. clap failed because of unknown flags, but possibly valid obsolete arguments
-    //        (e.g. tail -l; tail -10c).
-    //
-    // In cases 4 & 5, we want to try parsing the obsolete arguments, which corresponds to
-    // checking whether clap succeeded or the first argument starts with '+'.
-    let possible_obsolete_args = &args_vec[1];
-    if clap_result.is_ok() && !possible_obsolete_args.to_string_lossy().starts_with('+') {
-        return clap_result;
-    }
-    match parse_obsolete(possible_obsolete_args, args_vec.get(2))? {
-        Some(settings) => Ok(settings),
-        None => clap_result,
-    }
-}
-
-pub fn uu_app() -> Command {
-    #[cfg(target_os = "linux")]
-    const POLLING_HELP: &str = "Disable 'inotify' support and use polling instead";
-    #[cfg(all(unix, not(target_os = "linux")))]
-    const POLLING_HELP: &str = "Disable 'kqueue' support and use polling instead";
-    #[cfg(target_os = "windows")]
-    const POLLING_HELP: &str = "Disable 'ReadDirectoryChanges' support and use polling instead";
-
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::BYTES)
-                .short('c')
-                .long(options::BYTES)
-                .allow_hyphen_values(true)
-                .overrides_with_all([options::BYTES, options::LINES])
-                .help("Number of bytes to print"),
-        )
-        .arg(
-            Arg::new(options::FOLLOW)
-                .short('f')
-                .long(options::FOLLOW)
-                .default_missing_value("descriptor")
-                .num_args(0..=1)
-                .require_equals(true)
-                .value_parser(["descriptor", "name"])
-                .overrides_with(options::FOLLOW)
-                .help("Print the file as it grows"),
-        )
-        .arg(
-            Arg::new(options::LINES)
-                .short('n')
-                .long(options::LINES)
-                .allow_hyphen_values(true)
-                .overrides_with_all([options::BYTES, options::LINES])
-                .help("Number of lines to print"),
-        )
-        .arg(
-            Arg::new(options::PID)
-                .long(options::PID)
-                .value_name("PID")
-                .help("With -f, terminate after process ID, PID dies"),
-        )
-        .arg(
-            Arg::new(options::verbosity::QUIET)
-                .short('q')
-                .long(options::verbosity::QUIET)
-                .visible_alias("silent")
-                .overrides_with_all([options::verbosity::QUIET, options::verbosity::VERBOSE])
-                .help("Never output headers giving file names")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SLEEP_INT)
-                .short('s')
-                .value_name("N")
-                .long(options::SLEEP_INT)
-                .help("Number of seconds to sleep between polling the file when running with -f"),
-        )
-        .arg(
-            Arg::new(options::MAX_UNCHANGED_STATS)
-                .value_name("N")
-                .long(options::MAX_UNCHANGED_STATS)
-                .help(
-                    "Reopen a FILE which has not changed size after N (default 5) iterations \
-                        to see if it has been unlinked or renamed (this is the usual case of rotated \
-                        log files); This option is meaningful only when polling \
-                        (i.e., with --use-polling) and when --follow=name",
-                ),
-        )
-        .arg(
-            Arg::new(options::verbosity::VERBOSE)
-                .short('v')
-                .long(options::verbosity::VERBOSE)
-                .overrides_with_all([options::verbosity::QUIET, options::verbosity::VERBOSE])
-                .help("Always output headers giving file names")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ZERO_TERM)
-                .short('z')
-                .long(options::ZERO_TERM)
-                .help("Line delimiter is NUL, not newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::USE_POLLING)
-                .alias(options::DISABLE_INOTIFY_TERM) // NOTE: Used by GNU's test suite
-                .alias("dis") // NOTE: Used by GNU's test suite
-                .long(options::USE_POLLING)
-                .help(POLLING_HELP)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::RETRY)
-                .long(options::RETRY)
-                .help("Keep trying to open a file if it is inaccessible")
-                .overrides_with(options::RETRY)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FOLLOW_RETRY)
-                .short('F')
-                .help("Same as --follow=name --retry")
-                .overrides_with(options::FOLLOW_RETRY)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PRESUME_INPUT_PIPE)
-                .long("presume-input-pipe")
-                .alias(options::PRESUME_INPUT_PIPE)
-                .hide(true)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ARG_FILES)
-                .action(ArgAction::Append)
-                .num_args(1..)
-                .value_parser(value_parser!(OsString))
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-#[cfg(test)]
-mod tests {
-    use rstest::rstest;
-
-    use crate::parse::ObsoleteArgs;
-
-    use super::*;
-
-    #[test]
-    fn test_parse_num_when_sign_is_given() {
-        let result = parse_num("+0");
-        assert!(result.is_ok());
-        assert_eq!(result.unwrap(), Signum::PlusZero);
-
-        let result = parse_num("+1");
-        assert!(result.is_ok());
-        assert_eq!(result.unwrap(), Signum::Positive(1));
-
-        let result = parse_num("-0");
-        assert!(result.is_ok());
-        assert_eq!(result.unwrap(), Signum::MinusZero);
-
-        let result = parse_num("-1");
-        assert!(result.is_ok());
-        assert_eq!(result.unwrap(), Signum::Negative(1));
-    }
-
-    #[test]
-    fn test_parse_num_when_no_sign_is_given() {
-        let result = parse_num("0");
-        assert!(result.is_ok());
-        assert_eq!(result.unwrap(), Signum::MinusZero);
-
-        let result = parse_num("1");
-        assert!(result.is_ok());
-        assert_eq!(result.unwrap(), Signum::Negative(1));
-    }
-
-    #[test]
-    fn test_parse_obsolete_settings_f() {
-        let args = ObsoleteArgs {
-            follow: true,
-            ..Default::default()
-        };
-        let result = Settings::from_obsolete_args(&args, None);
-        assert_eq!(result.follow, Some(FollowMode::Descriptor));
-
-        let result = Settings::from_obsolete_args(&args, Some(&"file".into()));
-        assert_eq!(result.follow, Some(FollowMode::Name));
-    }
-
-    #[rstest]
-    #[case::default(vec![], None, false)]
-    #[case::retry(vec!["--retry"], None, true)]
-    #[case::multiple_retry(vec!["--retry", "--retry"], None, true)]
-    #[case::follow_long(vec!["--follow"], Some(FollowMode::Descriptor), false)]
-    #[case::follow_short(vec!["-f"], Some(FollowMode::Descriptor), false)]
-    #[case::follow_long_with_retry(vec!["--follow", "--retry"], Some(FollowMode::Descriptor), true)]
-    #[case::follow_short_with_retry(vec!["-f", "--retry"], Some(FollowMode::Descriptor), true)]
-    #[case::follow_overwrites_previous_selection_1(vec!["--follow=name", "--follow=descriptor"], Some(FollowMode::Descriptor), false)]
-    #[case::follow_overwrites_previous_selection_2(vec!["--follow=descriptor", "--follow=name"], Some(FollowMode::Name), false)]
-    #[case::big_f(vec!["-F"], Some(FollowMode::Name), true)]
-    #[case::multiple_big_f(vec!["-F", "-F"], Some(FollowMode::Name), true)]
-    #[case::big_f_with_retry_then_does_not_change(vec!["-F", "--retry"], Some(FollowMode::Name), true)]
-    #[case::big_f_with_follow_descriptor_then_change(vec!["-F", "--follow=descriptor"], Some(FollowMode::Descriptor), true)]
-    #[case::multiple_big_f_with_follow_descriptor_then_no_change(vec!["-F", "--follow=descriptor", "-F"], Some(FollowMode::Name), true)]
-    #[case::big_f_with_follow_short_then_change(vec!["-F", "-f"], Some(FollowMode::Descriptor), true)]
-    #[case::follow_descriptor_with_big_f_then_change(vec!["--follow=descriptor", "-F"], Some(FollowMode::Name), true)]
-    #[case::follow_short_with_big_f_then_change(vec!["-f", "-F"], Some(FollowMode::Name), true)]
-    #[case::big_f_with_follow_name_then_not_change(vec!["-F", "--follow=name"], Some(FollowMode::Name), true)]
-    #[case::follow_name_with_big_f_then_not_change(vec!["--follow=name", "-F"], Some(FollowMode::Name), true)]
-    #[case::big_f_with_multiple_long_follow(vec!["--follow=name", "-F", "--follow=descriptor"], Some(FollowMode::Descriptor), true)]
-    #[case::big_f_with_multiple_long_follow_name(vec!["--follow=name", "-F", "--follow=name"], Some(FollowMode::Name), true)]
-    #[case::big_f_with_multiple_short_follow(vec!["-f", "-F", "-f"], Some(FollowMode::Descriptor), true)]
-    #[case::multiple_big_f_with_multiple_short_follow(vec!["-f", "-F", "-f", "-F"], Some(FollowMode::Name), true)]
-    fn test_parse_settings_follow_mode_and_retry(
-        #[case] args: Vec<&str>,
-        #[case] expected_follow_mode: Option<FollowMode>,
-        #[case] expected_retry: bool,
-    ) {
-        let settings =
-            Settings::from(&uu_app().no_binary_name(true).get_matches_from(args)).unwrap();
-        assert_eq!(settings.follow, expected_follow_mode);
-        assert_eq!(settings.retry, expected_retry);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/chunks.rs.html b/coreutils/dev/src/uu_tail/chunks.rs.html deleted file mode 100644 index 83cd1e844..000000000 --- a/coreutils/dev/src/uu_tail/chunks.rs.html +++ /dev/null @@ -1,1409 +0,0 @@ -chunks.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-//! Iterating over a file by chunks, either starting at the end of the file with [`ReverseChunks`]
-//! or at the end of piped stdin with [`LinesChunk`] or [`BytesChunk`].
-//!
-//! Use [`ReverseChunks::new`] to create a new iterator over chunks of bytes from the file.
-
-// spell-checker:ignore (ToDO) filehandle BUFSIZ
-
-use std::collections::VecDeque;
-use std::fs::File;
-use std::io::{BufRead, Read, Seek, SeekFrom, Write};
-use uucore::error::UResult;
-
-/// When reading files in reverse in `bounded_tail`, this is the size of each
-/// block read at a time.
-pub const BLOCK_SIZE: u64 = 1 << 16;
-
-/// The size of the backing buffer of a LinesChunk or BytesChunk in bytes. The value of BUFFER_SIZE
-/// originates from the BUFSIZ constant in stdio.h and the libc crate to make stream IO efficient.
-/// In the latter the value is constantly set to 8192 on all platforms, where the value in stdio.h
-/// is determined on each platform differently. Since libc chose 8192 as a reasonable default the
-/// value here is set to this value, too.
-pub const BUFFER_SIZE: usize = 8192;
-
-/// An iterator over a file in non-overlapping chunks from the end of the file.
-///
-/// Each chunk is a [`Vec`]<[`u8`]> of size [`BLOCK_SIZE`] (except
-/// possibly the last chunk, which might be smaller). Each call to
-/// [`ReverseChunks::next`] will seek backwards through the given file.
-pub struct ReverseChunks<'a> {
-    /// The file to iterate over, by blocks, from the end to the beginning.
-    file: &'a File,
-
-    /// The total number of bytes in the file.
-    size: u64,
-
-    /// The total number of blocks to read.
-    max_blocks_to_read: usize,
-
-    /// The index of the next block to read.
-    block_idx: usize,
-}
-
-impl<'a> ReverseChunks<'a> {
-    pub fn new(file: &'a mut File) -> ReverseChunks<'a> {
-        let current = if cfg!(unix) {
-            file.stream_position().unwrap()
-        } else {
-            0
-        };
-        let size = file.seek(SeekFrom::End(0)).unwrap() - current;
-        let max_blocks_to_read = (size as f64 / BLOCK_SIZE as f64).ceil() as usize;
-        let block_idx = 0;
-        ReverseChunks {
-            file,
-            size,
-            max_blocks_to_read,
-            block_idx,
-        }
-    }
-}
-
-impl<'a> Iterator for ReverseChunks<'a> {
-    type Item = Vec<u8>;
-
-    fn next(&mut self) -> Option<Self::Item> {
-        // If there are no more chunks to read, terminate the iterator.
-        if self.block_idx >= self.max_blocks_to_read {
-            return None;
-        }
-
-        // The chunk size is `BLOCK_SIZE` for all but the last chunk
-        // (that is, the chunk closest to the beginning of the file),
-        // which contains the remainder of the bytes.
-        let block_size = if self.block_idx == self.max_blocks_to_read - 1 {
-            self.size % BLOCK_SIZE
-        } else {
-            BLOCK_SIZE
-        };
-
-        // Seek backwards by the next chunk, read the full chunk into
-        // `buf`, and then seek back to the start of the chunk again.
-        let mut buf = vec![0; BLOCK_SIZE as usize];
-        let pos = self
-            .file
-            .seek(SeekFrom::Current(-(block_size as i64)))
-            .unwrap();
-        self.file
-            .read_exact(&mut buf[0..(block_size as usize)])
-            .unwrap();
-        let pos2 = self
-            .file
-            .seek(SeekFrom::Current(-(block_size as i64)))
-            .unwrap();
-        assert_eq!(pos, pos2);
-
-        self.block_idx += 1;
-
-        Some(buf[0..(block_size as usize)].to_vec())
-    }
-}
-
-/// The type of the backing buffer of [`BytesChunk`] and [`LinesChunk`] which can hold
-/// [`BUFFER_SIZE`] elements at max.
-type ChunkBuffer = [u8; BUFFER_SIZE];
-
-/// A [`BytesChunk`] storing a fixed size number of bytes in a buffer.
-#[derive(Clone, PartialEq, Eq, Debug)]
-pub struct BytesChunk {
-    /// The [`ChunkBuffer`], an array storing the bytes, for example filled by
-    /// [`BytesChunk::fill`]
-    buffer: ChunkBuffer,
-
-    /// Stores the number of bytes, this buffer holds. This is not equal to buffer.len(), since the
-    /// [`BytesChunk`] may store less bytes than the internal buffer can hold. In addition
-    /// [`BytesChunk`] may be reused, what makes it necessary to track the number of stored bytes.
-    /// The choice of usize is sufficient here, since the number of bytes max value is
-    /// [`BUFFER_SIZE`], which is a usize.
-    bytes: usize,
-}
-
-impl BytesChunk {
-    #[allow(clippy::new_without_default)]
-    pub fn new() -> Self {
-        Self {
-            buffer: [0; BUFFER_SIZE],
-            bytes: 0,
-        }
-    }
-
-    /// Create a new chunk from an existing chunk. The new chunk's buffer will be copied from the
-    /// old chunk's buffer, copying the slice `[offset..old_chunk.bytes]` into the new chunk's
-    /// buffer but starting at 0 instead of offset. If the offset is larger or equal to
-    /// `chunk.lines` then a new empty `BytesChunk` is returned.
-    ///
-    /// # Arguments
-    ///
-    /// * `chunk`: The chunk to create a new `BytesChunk` chunk from
-    /// * `offset`: Start to copy the old chunk's buffer from this position. May not be larger
-    ///             than `chunk.bytes`.
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// let mut chunk = BytesChunk::new();
-    /// chunk.buffer[1] = 1;
-    /// chunk.bytes = 2;
-    /// let new_chunk = BytesChunk::from_chunk(&chunk, 0);
-    /// assert_eq!(2, new_chunk.get_buffer().len());
-    /// assert_eq!(&[0, 1], new_chunk.get_buffer());
-    ///
-    /// let new_chunk = BytesChunk::from_chunk(&chunk, 1);
-    /// assert_eq!(1, new_chunk.get_buffer().len());
-    /// assert_eq!(&[1], new_chunk.get_buffer());
-    /// ```
-    fn from_chunk(chunk: &Self, offset: usize) -> Self {
-        if offset >= chunk.bytes {
-            return Self::new();
-        }
-
-        let mut buffer: ChunkBuffer = [0; BUFFER_SIZE];
-        let slice = chunk.get_buffer_with(offset);
-        buffer[..slice.len()].copy_from_slice(slice);
-        Self {
-            buffer,
-            bytes: chunk.bytes - offset,
-        }
-    }
-
-    /// Receive the internal buffer safely, so it returns a slice only containing as many bytes as
-    /// large the `self.bytes` value is.
-    ///
-    /// returns: a slice containing the bytes of the internal buffer from `[0..self.bytes]`
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// let mut chunk = BytesChunk::new();
-    /// chunk.bytes = 1;
-    /// assert_eq!(&[0], chunk.get_buffer());
-    /// ```
-    pub fn get_buffer(&self) -> &[u8] {
-        &self.buffer[..self.bytes]
-    }
-
-    /// Like [`BytesChunk::get_buffer`], but returning a slice from `[offset.self.bytes]`.
-    ///
-    /// returns: a slice containing the bytes of the internal buffer from `[offset..self.bytes]`
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// let mut chunk = BytesChunk::new();
-    /// chunk.bytes = 2;
-    /// assert_eq!(&[0], chunk.get_buffer_with(1));
-    /// ```
-    pub fn get_buffer_with(&self, offset: usize) -> &[u8] {
-        &self.buffer[offset..self.bytes]
-    }
-
-    pub fn has_data(&self) -> bool {
-        self.bytes > 0
-    }
-
-    /// Fills `self.buffer` with maximal [`BUFFER_SIZE`] number of bytes, draining the reader by
-    /// that number of bytes. If EOF is reached (so 0 bytes are read), then returns
-    /// [`UResult<None>`] or else the result with [`Some(bytes)`] where bytes is the number of bytes
-    /// read from the source.
-    pub fn fill(&mut self, filehandle: &mut impl BufRead) -> UResult<Option<usize>> {
-        let num_bytes = filehandle.read(&mut self.buffer)?;
-        self.bytes = num_bytes;
-        if num_bytes == 0 {
-            return Ok(None);
-        }
-
-        Ok(Some(self.bytes))
-    }
-}
-
-/// An abstraction layer on top of [`BytesChunk`] mainly to simplify filling only the needed amount
-/// of chunks. See also [`Self::fill`].
-pub struct BytesChunkBuffer {
-    /// The number of bytes to print
-    num_print: u64,
-    /// The current number of bytes summed over all stored chunks in [`Self::chunks`]. Use u64 here
-    /// to support files > 4GB on 32-bit systems. Note, this differs from `BytesChunk::bytes` which
-    /// is a usize. The choice of u64 is based on `tail::FilterMode::Bytes`.
-    bytes: u64,
-    /// The buffer to store [`BytesChunk`] in
-    chunks: VecDeque<Box<BytesChunk>>,
-}
-
-impl BytesChunkBuffer {
-    /// Creates a new [`BytesChunkBuffer`].
-    ///
-    /// # Arguments
-    ///
-    /// * `num_print`: The number of bytes to print
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// let mut chunk = BytesChunk::new();
-    /// chunk.buffer[1] = 1;
-    /// chunk.bytes = 2;
-    /// let new_chunk = BytesChunk::from_chunk(&chunk, 0);
-    /// assert_eq!(2, new_chunk.get_buffer().len());
-    /// assert_eq!(&[0, 1], new_chunk.get_buffer());
-    ///
-    /// let new_chunk = BytesChunk::from_chunk(&chunk, 1);
-    /// assert_eq!(1, new_chunk.get_buffer().len());
-    /// assert_eq!(&[1], new_chunk.get_buffer());
-    /// ```
-    pub fn new(num_print: u64) -> Self {
-        Self {
-            bytes: 0,
-            num_print,
-            chunks: VecDeque::new(),
-        }
-    }
-
-    /// Fills this buffer with chunks and consumes the reader completely. This method ensures that
-    /// there are exactly as many chunks as needed to match `self.num_print` bytes, so there are
-    /// in sum exactly `self.num_print` bytes stored in all chunks. The method returns an iterator
-    /// over these chunks. If there are no chunks, for example because the piped stdin contained no
-    /// bytes, or `num_print = 0` then `iterator.next` returns None.
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// use crate::chunks::BytesChunkBuffer;
-    /// use std::io::{BufReader, Cursor};
-    ///
-    /// let mut reader = BufReader::new(Cursor::new(""));
-    /// let num_print = 0;
-    /// let mut chunks = BytesChunkBuffer::new(num_print);
-    /// chunks.fill(&mut reader).unwrap();
-    ///
-    /// let mut reader = BufReader::new(Cursor::new("a"));
-    /// let num_print = 1;
-    /// let mut chunks = BytesChunkBuffer::new(num_print);
-    /// chunks.fill(&mut reader).unwrap();
-    /// ```
-    pub fn fill(&mut self, reader: &mut impl BufRead) -> UResult<()> {
-        let mut chunk = Box::new(BytesChunk::new());
-
-        // fill chunks with all bytes from reader and reuse already instantiated chunks if possible
-        while (chunk.fill(reader)?).is_some() {
-            self.bytes += chunk.bytes as u64;
-            self.chunks.push_back(chunk);
-
-            let first = &self.chunks[0];
-            if self.bytes - first.bytes as u64 > self.num_print {
-                chunk = self.chunks.pop_front().unwrap();
-                self.bytes -= chunk.bytes as u64;
-            } else {
-                chunk = Box::new(BytesChunk::new());
-            }
-        }
-
-        // quit early if there are no chunks for example in case the pipe was empty
-        if self.chunks.is_empty() {
-            return Ok(());
-        }
-
-        let chunk = self.chunks.pop_front().unwrap();
-
-        // calculate the offset in the first chunk and put the calculated chunk as first element in
-        // the self.chunks collection. The calculated offset must be in the range 0 to BUFFER_SIZE
-        // and is therefore safely convertible to a usize without losses.
-        let offset = self.bytes.saturating_sub(self.num_print) as usize;
-        self.chunks
-            .push_front(Box::new(BytesChunk::from_chunk(&chunk, offset)));
-
-        Ok(())
-    }
-
-    pub fn print(&self, mut writer: impl Write) -> UResult<()> {
-        for chunk in &self.chunks {
-            writer.write_all(chunk.get_buffer())?;
-        }
-        Ok(())
-    }
-
-    pub fn has_data(&self) -> bool {
-        !self.chunks.is_empty()
-    }
-}
-
-/// Works similar to a [`BytesChunk`] but also stores the number of lines encountered in the current
-/// buffer. The size of the buffer is limited to a fixed size number of bytes.
-#[derive(Debug)]
-pub struct LinesChunk {
-    /// Work on top of a [`BytesChunk`]
-    chunk: BytesChunk,
-    /// The number of lines delimited by `delimiter`. The choice of usize is sufficient here,
-    /// because lines max value is the number of bytes contained in this chunk's buffer, and the
-    /// number of bytes max value is [`BUFFER_SIZE`], which is a usize.
-    lines: usize,
-    /// The delimiter to use, to count the lines
-    delimiter: u8,
-}
-
-impl LinesChunk {
-    pub fn new(delimiter: u8) -> Self {
-        Self {
-            chunk: BytesChunk::new(),
-            lines: 0,
-            delimiter,
-        }
-    }
-
-    /// Count the number of lines delimited with [`Self::delimiter`] contained in the buffer.
-    /// Currently [`memchr`] is used because performance is better than using an iterator or for
-    /// loop.
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// let mut chunk = LinesChunk::new(b'\n');
-    /// chunk.buffer[0..12].copy_from_slice("hello\nworld\n".as_bytes());
-    /// chunk.bytes = 12;
-    /// assert_eq!(2, chunk.count_lines());
-    ///
-    /// chunk.buffer[0..14].copy_from_slice("hello\r\nworld\r\n".as_bytes());
-    /// chunk.bytes = 14;
-    /// assert_eq!(2, chunk.count_lines());
-    /// ```
-    fn count_lines(&self) -> usize {
-        memchr::memchr_iter(self.delimiter, self.get_buffer()).count()
-    }
-
-    /// Creates a new [`LinesChunk`] from an existing one with an offset in lines. The new chunk
-    /// contains exactly `chunk.lines - offset` lines. The offset in bytes is calculated and applied
-    /// to the new chunk, so the new chunk contains only the bytes encountered after the offset in
-    /// number of lines and the `delimiter`. If the offset is larger than `chunk.lines` then a new
-    /// empty `LinesChunk` is returned.
-    ///
-    /// # Arguments
-    ///
-    /// * `chunk`: The chunk to create the new chunk from
-    /// * `offset`: The offset in number of lines (not bytes)
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// let mut chunk = LinesChunk::new(b'\n');
-    /// // manually filling the buffer and setting the correct values for bytes and lines
-    /// chunk.buffer[0..12].copy_from_slice("hello\nworld\n".as_bytes());
-    /// chunk.bytes = 12;
-    /// chunk.lines = 2;
-    ///
-    /// let offset = 1; // offset in number of lines
-    /// let new_chunk = LinesChunk::from(&chunk, offset);
-    /// assert_eq!("world\n".as_bytes(), new_chunk.get_buffer());
-    /// assert_eq!(6, new_chunk.bytes);
-    /// assert_eq!(1, new_chunk.lines);
-    /// ```
-    fn from_chunk(chunk: &Self, offset: usize) -> Self {
-        if offset > chunk.lines {
-            return Self::new(chunk.delimiter);
-        }
-
-        let bytes_offset = chunk.calculate_bytes_offset_from(offset);
-        let new_chunk = BytesChunk::from_chunk(&chunk.chunk, bytes_offset);
-
-        Self {
-            chunk: new_chunk,
-            lines: chunk.lines - offset,
-            delimiter: chunk.delimiter,
-        }
-    }
-
-    /// Returns true if this buffer has stored any bytes.
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// let mut chunk = LinesChunk::new(b'\n');
-    /// assert!(!chunk.has_data());
-    ///
-    /// chunk.buffer[0] = 1;
-    /// assert!(!chunk.has_data());
-    ///
-    /// chunk.bytes = 1;
-    /// assert!(chunk.has_data());
-    /// ```
-    pub fn has_data(&self) -> bool {
-        self.chunk.has_data()
-    }
-
-    /// Returns this buffer safely. See [`BytesChunk::get_buffer`]
-    ///
-    /// returns: &[u8] with length `self.bytes`
-    pub fn get_buffer(&self) -> &[u8] {
-        self.chunk.get_buffer()
-    }
-
-    /// Returns this buffer safely with an offset applied. See [`BytesChunk::get_buffer_with`].
-    ///
-    /// returns: &[u8] with length `self.bytes - offset`
-    pub fn get_buffer_with(&self, offset: usize) -> &[u8] {
-        self.chunk.get_buffer_with(offset)
-    }
-
-    /// Return the number of lines the buffer contains. `self.lines` needs to be set before the call
-    /// to this function returns the correct value. If the calculation of lines is needed then
-    /// use `self.count_lines`.
-    pub fn get_lines(&self) -> usize {
-        self.lines
-    }
-
-    /// Fills `self.buffer` with maximal [`BUFFER_SIZE`] number of bytes, draining the reader by
-    /// that number of bytes. This function works like the [`BytesChunk::fill`] function besides
-    /// that this function also counts and stores the number of lines encountered while reading from
-    /// the `filehandle`.
-    pub fn fill(&mut self, filehandle: &mut impl BufRead) -> UResult<Option<usize>> {
-        match self.chunk.fill(filehandle)? {
-            None => {
-                self.lines = 0;
-                Ok(None)
-            }
-            Some(bytes) => {
-                self.lines = self.count_lines();
-                Ok(Some(bytes))
-            }
-        }
-    }
-
-    /// Calculates the offset in bytes within this buffer from the offset in number of lines. The
-    /// resulting offset is 0-based and points to the byte after the delimiter.
-    ///
-    /// # Arguments
-    ///
-    /// * `offset`: the offset in number of lines. If offset is 0 then 0 is returned, if larger than
-    ///             the contained lines then self.bytes is returned.
-    ///
-    /// # Examples
-    ///
-    /// ```rust,ignore
-    /// let mut chunk = LinesChunk::new(b'\n');
-    /// chunk.buffer[0..12].copy_from_slice("hello\nworld\n".as_bytes());
-    /// chunk.bytes = 12;
-    /// chunk.lines = 2; // note that if not setting lines the result might not be what is expected
-    /// let bytes_offset = chunk.calculate_bytes_offset_from(1);
-    /// assert_eq!(6, bytes_offset);
-    /// assert_eq!(
-    ///     "world\n",
-    ///     String::from_utf8_lossy(chunk.get_buffer_with(bytes_offset)));
-    /// ```
-    fn calculate_bytes_offset_from(&self, offset: usize) -> usize {
-        let mut lines_offset = offset;
-        let mut bytes_offset = 0;
-        for byte in self.get_buffer().iter() {
-            if lines_offset == 0 {
-                break;
-            }
-            if byte == &self.delimiter {
-                lines_offset -= 1;
-            }
-            bytes_offset += 1;
-        }
-        bytes_offset
-    }
-
-    /// Print the bytes contained in this buffer calculated with the given offset in number of
-    /// lines.
-    ///
-    /// # Arguments
-    ///
-    /// * `writer`: must implement [`Write`]
-    /// * `offset`: An offset in number of lines.
-    pub fn print_lines(&self, writer: &mut impl Write, offset: usize) -> UResult<()> {
-        self.print_bytes(writer, self.calculate_bytes_offset_from(offset))
-    }
-
-    /// Print the bytes contained in this buffer beginning from the given offset in number of bytes.
-    ///
-    /// # Arguments
-    ///
-    /// * `writer`: must implement [`Write`]
-    /// * `offset`: An offset in number of bytes.
-    pub fn print_bytes(&self, writer: &mut impl Write, offset: usize) -> UResult<()> {
-        writer.write_all(self.get_buffer_with(offset))?;
-        Ok(())
-    }
-}
-
-/// An abstraction layer on top of [`LinesChunk`] mainly to simplify filling only the needed amount
-/// of chunks. See also [`Self::fill`]. Works similar like [`BytesChunkBuffer`], but works on top
-/// of lines delimited by `self.delimiter` instead of bytes.
-pub struct LinesChunkBuffer {
-    /// The delimiter to recognize a line. Any [`u8`] is allowed.
-    delimiter: u8,
-    /// The amount of lines occurring in all currently stored [`LinesChunk`]s. Use u64 here to
-    /// support files > 4GB on 32-bit systems. Note, this differs from [`LinesChunk::lines`] which
-    /// is a usize. The choice of u64 is based on `tail::FilterMode::Lines`.
-    lines: u64,
-    /// The amount of lines to print.
-    num_print: u64,
-    /// Stores the [`LinesChunk`]
-    chunks: VecDeque<Box<LinesChunk>>,
-}
-
-impl LinesChunkBuffer {
-    /// Create a new [`LinesChunkBuffer`]
-    pub fn new(delimiter: u8, num_print: u64) -> Self {
-        Self {
-            delimiter,
-            num_print,
-            lines: 0,
-            chunks: VecDeque::new(),
-        }
-    }
-
-    /// Fills this buffer with chunks and consumes the reader completely. This method ensures that
-    /// there are exactly as many chunks as needed to match `self.num_print` lines, so there are
-    /// in sum exactly `self.num_print` lines stored in all chunks. The method returns an iterator
-    /// over these chunks. If there are no chunks, for example because the piped stdin contained no
-    /// lines, or `num_print = 0` then `iterator.next` will return None.
-    pub fn fill(&mut self, reader: &mut impl BufRead) -> UResult<()> {
-        let mut chunk = Box::new(LinesChunk::new(self.delimiter));
-
-        while (chunk.fill(reader)?).is_some() {
-            self.lines += chunk.lines as u64;
-            self.chunks.push_back(chunk);
-
-            let first = &self.chunks[0];
-            if self.lines - first.lines as u64 > self.num_print {
-                chunk = self.chunks.pop_front().unwrap();
-
-                self.lines -= chunk.lines as u64;
-            } else {
-                chunk = Box::new(LinesChunk::new(self.delimiter));
-            }
-        }
-
-        if self.chunks.is_empty() {
-            // chunks is empty when a file is empty so quitting early here
-            return Ok(());
-        } else {
-            let length = &self.chunks.len();
-            let last = &mut self.chunks[length - 1];
-            if !last.get_buffer().ends_with(&[self.delimiter]) {
-                last.lines += 1;
-                self.lines += 1;
-            }
-        }
-
-        // skip unnecessary chunks and save the first chunk which may hold some lines we have to
-        // print
-        let chunk = loop {
-            // it's safe to call unwrap here because there is at least one chunk and sorting out
-            // more chunks than exist shouldn't be possible.
-            let chunk = self.chunks.pop_front().unwrap();
-
-            // skip is true as long there are enough lines left in the other stored chunks.
-            let skip = self.lines - chunk.lines as u64 > self.num_print;
-            if skip {
-                self.lines -= chunk.lines as u64;
-            } else {
-                break chunk;
-            }
-        };
-
-        // Calculate the number of lines to skip in the current chunk. The calculated value must be
-        // in the range 0 to BUFFER_SIZE and is therefore safely convertible to a usize without
-        // losses.
-        let skip_lines = self.lines.saturating_sub(self.num_print) as usize;
-        let chunk = LinesChunk::from_chunk(&chunk, skip_lines);
-        self.chunks.push_front(Box::new(chunk));
-
-        Ok(())
-    }
-
-    pub fn print(&self, mut writer: impl Write) -> UResult<()> {
-        for chunk in &self.chunks {
-            chunk.print_bytes(&mut writer, 0)?;
-        }
-        Ok(())
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::chunks::{BytesChunk, BUFFER_SIZE};
-
-    #[test]
-    fn test_bytes_chunk_from_when_offset_is_zero() {
-        let mut chunk = BytesChunk::new();
-        chunk.bytes = BUFFER_SIZE;
-        chunk.buffer[1] = 1;
-        let other = BytesChunk::from_chunk(&chunk, 0);
-        assert_eq!(other, chunk);
-
-        chunk.bytes = 2;
-        let other = BytesChunk::from_chunk(&chunk, 0);
-        assert_eq!(other, chunk);
-
-        chunk.bytes = 1;
-        let other = BytesChunk::from_chunk(&chunk, 0);
-        assert_eq!(other.buffer, [0; BUFFER_SIZE]);
-        assert_eq!(other.bytes, chunk.bytes);
-
-        chunk.bytes = BUFFER_SIZE;
-        let other = BytesChunk::from_chunk(&chunk, 2);
-        assert_eq!(other.buffer, [0; BUFFER_SIZE]);
-        assert_eq!(other.bytes, BUFFER_SIZE - 2);
-    }
-
-    #[test]
-    fn test_bytes_chunk_from_when_offset_is_not_zero() {
-        let mut chunk = BytesChunk::new();
-        chunk.bytes = BUFFER_SIZE;
-        chunk.buffer[1] = 1;
-
-        let other = BytesChunk::from_chunk(&chunk, 1);
-        let mut expected_buffer = [0; BUFFER_SIZE];
-        expected_buffer[0] = 1;
-        assert_eq!(other.buffer, expected_buffer);
-        assert_eq!(other.bytes, BUFFER_SIZE - 1);
-
-        let other = BytesChunk::from_chunk(&chunk, 2);
-        assert_eq!(other.buffer, [0; BUFFER_SIZE]);
-        assert_eq!(other.bytes, BUFFER_SIZE - 2);
-    }
-
-    #[test]
-    fn test_bytes_chunk_from_when_offset_is_larger_than_chunk_size_1() {
-        let mut chunk = BytesChunk::new();
-        chunk.bytes = BUFFER_SIZE;
-        let new_chunk = BytesChunk::from_chunk(&chunk, BUFFER_SIZE + 1);
-        assert_eq!(0, new_chunk.bytes);
-    }
-
-    #[test]
-    fn test_bytes_chunk_from_when_offset_is_larger_than_chunk_size_2() {
-        let mut chunk = BytesChunk::new();
-        chunk.bytes = 0;
-        let new_chunk = BytesChunk::from_chunk(&chunk, 1);
-        assert_eq!(0, new_chunk.bytes);
-    }
-
-    #[test]
-    fn test_bytes_chunk_from_when_offset_is_larger_than_chunk_size_3() {
-        let mut chunk = BytesChunk::new();
-        chunk.bytes = 1;
-        let new_chunk = BytesChunk::from_chunk(&chunk, 2);
-        assert_eq!(0, new_chunk.bytes);
-    }
-
-    #[test]
-    fn test_bytes_chunk_from_when_offset_is_equal_to_chunk_size() {
-        let mut chunk = BytesChunk::new();
-        chunk.buffer[0] = 1;
-        chunk.bytes = 1;
-        let new_chunk = BytesChunk::from_chunk(&chunk, 1);
-        assert_eq!(0, new_chunk.bytes);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/follow/files.rs.html b/coreutils/dev/src/uu_tail/follow/files.rs.html deleted file mode 100644 index f7e758d31..000000000 --- a/coreutils/dev/src/uu_tail/follow/files.rs.html +++ /dev/null @@ -1,421 +0,0 @@ -files.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore tailable seekable stdlib (stdlib)
-
-use crate::args::Settings;
-use crate::chunks::BytesChunkBuffer;
-use crate::paths::{HeaderPrinter, PathExtTail};
-use crate::text;
-use std::collections::hash_map::Keys;
-use std::collections::HashMap;
-use std::fs::{File, Metadata};
-use std::io::{stdout, BufRead, BufReader, BufWriter};
-use std::path::{Path, PathBuf};
-use uucore::error::UResult;
-
-/// Data structure to keep a handle on files to follow.
-/// `last` always holds the path/key of the last file that was printed from.
-/// The keys of the HashMap can point to an existing file path (normal case),
-/// or stdin ("-"), or to a non existing path (--retry).
-/// For existing files, all keys in the HashMap are absolute Paths.
-pub struct FileHandling {
-    map: HashMap<PathBuf, PathData>,
-    last: Option<PathBuf>,
-    header_printer: HeaderPrinter,
-}
-
-impl FileHandling {
-    pub fn from(settings: &Settings) -> Self {
-        Self {
-            map: HashMap::with_capacity(settings.inputs.len()),
-            last: None,
-            header_printer: HeaderPrinter::new(settings.verbose, false),
-        }
-    }
-
-    /// Wrapper for HashMap::insert using Path::canonicalize
-    pub fn insert(&mut self, k: &Path, v: PathData, update_last: bool) {
-        let k = Self::canonicalize_path(k);
-        if update_last {
-            self.last = Some(k.to_owned());
-        }
-        let _ = self.map.insert(k, v);
-    }
-
-    /// Wrapper for HashMap::remove using Path::canonicalize
-    pub fn remove(&mut self, k: &Path) -> PathData {
-        self.map.remove(&Self::canonicalize_path(k)).unwrap()
-    }
-
-    /// Wrapper for HashMap::get using Path::canonicalize
-    pub fn get(&self, k: &Path) -> &PathData {
-        self.map.get(&Self::canonicalize_path(k)).unwrap()
-    }
-
-    /// Wrapper for HashMap::get_mut using Path::canonicalize
-    pub fn get_mut(&mut self, k: &Path) -> &mut PathData {
-        self.map.get_mut(&Self::canonicalize_path(k)).unwrap()
-    }
-
-    /// Canonicalize `path` if it is not already an absolute path
-    fn canonicalize_path(path: &Path) -> PathBuf {
-        if path.is_relative() && !path.is_stdin() {
-            if let Ok(p) = path.canonicalize() {
-                return p;
-            }
-        }
-        path.to_owned()
-    }
-
-    pub fn get_mut_metadata(&mut self, path: &Path) -> Option<&Metadata> {
-        self.get_mut(path).metadata.as_ref()
-    }
-
-    pub fn keys(&self) -> Keys<PathBuf, PathData> {
-        self.map.keys()
-    }
-
-    pub fn contains_key(&self, k: &Path) -> bool {
-        self.map.contains_key(k)
-    }
-
-    pub fn get_last(&self) -> Option<&PathBuf> {
-        self.last.as_ref()
-    }
-
-    /// Return true if there is only stdin remaining
-    pub fn only_stdin_remaining(&self) -> bool {
-        self.map.len() == 1 && (self.map.contains_key(Path::new(text::DASH)))
-    }
-
-    /// Return true if there is at least one "tailable" path (or stdin) remaining
-    pub fn files_remaining(&self) -> bool {
-        for path in self.map.keys() {
-            if path.is_tailable() || path.is_stdin() {
-                return true;
-            }
-        }
-        false
-    }
-
-    /// Returns true if there are no files remaining
-    pub fn no_files_remaining(&self, settings: &Settings) -> bool {
-        self.map.is_empty() || !self.files_remaining() && !settings.retry
-    }
-
-    /// Set `reader` to None to indicate that `path` is not an existing file anymore.
-    pub fn reset_reader(&mut self, path: &Path) {
-        self.get_mut(path).reader = None;
-    }
-
-    /// Reopen the file at the monitored `path`
-    pub fn update_reader(&mut self, path: &Path) -> UResult<()> {
-        /*
-        BUG: If it's not necessary to reopen a file, GNU's tail calls seek to offset 0.
-        However we can't call seek here because `BufRead` does not implement `Seek`.
-        As a workaround we always reopen the file even though this might not always
-        be necessary.
-        */
-        self.get_mut(path)
-            .reader
-            .replace(Box::new(BufReader::new(File::open(path)?)));
-        Ok(())
-    }
-
-    /// Reload metadata from `path`, or `metadata`
-    pub fn update_metadata(&mut self, path: &Path, metadata: Option<Metadata>) {
-        self.get_mut(path).metadata = if metadata.is_some() {
-            metadata
-        } else {
-            path.metadata().ok()
-        };
-    }
-
-    /// Read new data from `path` and print it to stdout
-    pub fn tail_file(&mut self, path: &Path, verbose: bool) -> UResult<bool> {
-        let mut chunks = BytesChunkBuffer::new(u64::MAX);
-        if let Some(reader) = self.get_mut(path).reader.as_mut() {
-            chunks.fill(reader)?;
-        }
-        if chunks.has_data() {
-            if self.needs_header(path, verbose) {
-                let display_name = self.get(path).display_name.clone();
-                self.header_printer.print(display_name.as_str());
-            }
-
-            let stdout = stdout();
-            let writer = BufWriter::new(stdout.lock());
-            chunks.print(writer)?;
-
-            self.last.replace(path.to_owned());
-            self.update_metadata(path, None);
-            Ok(true)
-        } else {
-            Ok(false)
-        }
-    }
-
-    /// Decide if printing `path` needs a header based on when it was last printed
-    pub fn needs_header(&self, path: &Path, verbose: bool) -> bool {
-        if verbose {
-            if let Some(ref last) = self.last {
-                return !last.eq(&path);
-            } else {
-                return true;
-            }
-        }
-        false
-    }
-}
-
-/// Data structure to keep a handle on the BufReader, Metadata
-/// and the display_name (header_name) of files that are being followed.
-pub struct PathData {
-    pub reader: Option<Box<dyn BufRead>>,
-    pub metadata: Option<Metadata>,
-    pub display_name: String,
-}
-
-impl PathData {
-    pub fn new(
-        reader: Option<Box<dyn BufRead>>,
-        metadata: Option<Metadata>,
-        display_name: &str,
-    ) -> Self {
-        Self {
-            reader,
-            metadata,
-            display_name: display_name.to_owned(),
-        }
-    }
-    pub fn from_other_with_path(data: Self, path: &Path) -> Self {
-        // Remove old reader
-        let old_reader = data.reader;
-        let reader = if old_reader.is_some() {
-            // Use old reader with the same file descriptor if there is one
-            old_reader
-        } else if let Ok(file) = File::open(path) {
-            // Open new file tail from start
-            Some(Box::new(BufReader::new(file)) as Box<dyn BufRead>)
-        } else {
-            // Probably file was renamed/moved or removed again
-            None
-        };
-
-        Self::new(reader, path.metadata().ok(), data.display_name.as_str())
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/follow/mod.rs.html b/coreutils/dev/src/uu_tail/follow/mod.rs.html deleted file mode 100644 index e79f87a29..000000000 --- a/coreutils/dev/src/uu_tail/follow/mod.rs.html +++ /dev/null @@ -1,19 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-mod files;
-mod watch;
-
-pub use watch::{follow, Observer};
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/follow/watch.rs.html b/coreutils/dev/src/uu_tail/follow/watch.rs.html deleted file mode 100644 index ee5ccb4db..000000000 --- a/coreutils/dev/src/uu_tail/follow/watch.rs.html +++ /dev/null @@ -1,1209 +0,0 @@ -watch.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) tailable untailable stdlib kqueue Uncategorized unwatch
-
-use crate::args::{FollowMode, Settings};
-use crate::follow::files::{FileHandling, PathData};
-use crate::paths::{Input, InputKind, MetadataExtTail, PathExtTail};
-use crate::{platform, text};
-use notify::{RecommendedWatcher, RecursiveMode, Watcher, WatcherKind};
-use std::io::BufRead;
-use std::path::{Path, PathBuf};
-use std::sync::mpsc::{self, channel, Receiver};
-use uucore::display::Quotable;
-use uucore::error::{set_exit_code, UResult, USimpleError};
-use uucore::show_error;
-
-pub struct WatcherRx {
-    watcher: Box<dyn Watcher>,
-    receiver: Receiver<Result<notify::Event, notify::Error>>,
-}
-
-impl WatcherRx {
-    fn new(
-        watcher: Box<dyn Watcher>,
-        receiver: Receiver<Result<notify::Event, notify::Error>>,
-    ) -> Self {
-        Self { watcher, receiver }
-    }
-
-    /// Wrapper for `notify::Watcher::watch` to also add the parent directory of `path` if necessary.
-    fn watch_with_parent(&mut self, path: &Path) -> UResult<()> {
-        let mut path = path.to_owned();
-        #[cfg(target_os = "linux")]
-        if path.is_file() {
-            /*
-            NOTE: Using the parent directory instead of the file is a workaround.
-            This workaround follows the recommendation of the notify crate authors:
-            > On some platforms, if the `path` is renamed or removed while being watched, behavior may
-            > be unexpected. See discussions in [#165] and [#166]. If less surprising behavior is wanted
-            > one may non-recursively watch the _parent_ directory as well and manage related events.
-            NOTE: Adding both: file and parent results in duplicate/wrong events.
-            Tested for notify::InotifyWatcher and for notify::PollWatcher.
-            */
-            if let Some(parent) = path.parent() {
-                if parent.is_dir() {
-                    path = parent.to_owned();
-                } else {
-                    path = PathBuf::from(".");
-                }
-            } else {
-                return Err(USimpleError::new(
-                    1,
-                    format!("cannot watch parent directory of {}", path.display()),
-                ));
-            };
-        }
-        if path.is_relative() {
-            path = path.canonicalize()?;
-        }
-
-        // for syscalls: 2x "inotify_add_watch" ("filename" and ".") and 1x "inotify_rm_watch"
-        self.watch(&path, RecursiveMode::NonRecursive)?;
-        Ok(())
-    }
-
-    fn watch(&mut self, path: &Path, mode: RecursiveMode) -> UResult<()> {
-        self.watcher
-            .watch(path, mode)
-            .map_err(|err| USimpleError::new(1, err.to_string()))
-    }
-
-    fn unwatch(&mut self, path: &Path) -> UResult<()> {
-        self.watcher
-            .unwatch(path)
-            .map_err(|err| USimpleError::new(1, err.to_string()))
-    }
-}
-
-pub struct Observer {
-    /// Whether --retry was given on the command line
-    pub retry: bool,
-
-    /// The [`FollowMode`]
-    pub follow: Option<FollowMode>,
-
-    /// Indicates whether to use the fallback `polling` method instead of the
-    /// platform specific event driven method. Since `use_polling` is subject to
-    /// change during runtime it is moved out of [`Settings`].
-    pub use_polling: bool,
-
-    pub watcher_rx: Option<WatcherRx>,
-    pub orphans: Vec<PathBuf>,
-    pub files: FileHandling,
-
-    pub pid: platform::Pid,
-}
-
-impl Observer {
-    pub fn new(
-        retry: bool,
-        follow: Option<FollowMode>,
-        use_polling: bool,
-        files: FileHandling,
-        pid: platform::Pid,
-    ) -> Self {
-        let pid = if platform::supports_pid_checks(pid) {
-            pid
-        } else {
-            0
-        };
-
-        Self {
-            retry,
-            follow,
-            use_polling,
-            watcher_rx: None,
-            orphans: Vec::new(),
-            files,
-            pid,
-        }
-    }
-
-    pub fn from(settings: &Settings) -> Self {
-        Self::new(
-            settings.retry,
-            settings.follow,
-            settings.use_polling,
-            FileHandling::from(settings),
-            settings.pid,
-        )
-    }
-
-    pub fn add_path(
-        &mut self,
-        path: &Path,
-        display_name: &str,
-        reader: Option<Box<dyn BufRead>>,
-        update_last: bool,
-    ) -> UResult<()> {
-        if self.follow.is_some() {
-            let path = if path.is_relative() {
-                std::env::current_dir()?.join(path)
-            } else {
-                path.to_owned()
-            };
-            let metadata = path.metadata().ok();
-            self.files.insert(
-                &path,
-                PathData::new(reader, metadata, display_name),
-                update_last,
-            );
-        }
-
-        Ok(())
-    }
-
-    pub fn add_stdin(
-        &mut self,
-        display_name: &str,
-        reader: Option<Box<dyn BufRead>>,
-        update_last: bool,
-    ) -> UResult<()> {
-        if self.follow == Some(FollowMode::Descriptor) {
-            return self.add_path(
-                &PathBuf::from(text::DEV_STDIN),
-                display_name,
-                reader,
-                update_last,
-            );
-        }
-
-        Ok(())
-    }
-
-    pub fn add_bad_path(
-        &mut self,
-        path: &Path,
-        display_name: &str,
-        update_last: bool,
-    ) -> UResult<()> {
-        if self.retry && self.follow.is_some() {
-            return self.add_path(path, display_name, None, update_last);
-        }
-
-        Ok(())
-    }
-
-    pub fn start(&mut self, settings: &Settings) -> UResult<()> {
-        if settings.follow.is_none() {
-            return Ok(());
-        }
-
-        let (tx, rx) = channel();
-
-        /*
-        Watcher is implemented per platform using the best implementation available on that
-        platform. In addition to such event driven implementations, a polling implementation
-        is also provided that should work on any platform.
-        Linux / Android: inotify
-        macOS: FSEvents / kqueue
-        Windows: ReadDirectoryChangesWatcher
-        FreeBSD / NetBSD / OpenBSD / DragonflyBSD: kqueue
-        Fallback: polling every n seconds
-
-        NOTE:
-        We force the use of kqueue with: features=["macos_kqueue"].
-        On macOS only `kqueue` is suitable for our use case because `FSEvents`
-        waits for file close util it delivers a modify event. See:
-        https://github.com/notify-rs/notify/issues/240
-        */
-
-        let watcher: Box<dyn Watcher>;
-        let watcher_config = notify::Config::default()
-            .with_poll_interval(settings.sleep_sec)
-            /*
-            NOTE: By enabling compare_contents, performance will be significantly impacted
-            as all files will need to be read and hashed at each `poll_interval`.
-            However, this is necessary to pass: "gnu/tests/tail-2/F-vs-rename.sh"
-            */
-            .with_compare_contents(true);
-        if self.use_polling || RecommendedWatcher::kind() == WatcherKind::PollWatcher {
-            self.use_polling = true; // We have to use polling because there's no supported backend
-            watcher = Box::new(notify::PollWatcher::new(tx, watcher_config).unwrap());
-        } else {
-            let tx_clone = tx.clone();
-            match notify::RecommendedWatcher::new(tx, notify::Config::default()) {
-                Ok(w) => watcher = Box::new(w),
-                Err(e) if e.to_string().starts_with("Too many open files") => {
-                    /*
-                    NOTE: This ErrorKind is `Uncategorized`, but it is not recommended
-                    to match an error against `Uncategorized`
-                    NOTE: Could be tested with decreasing `max_user_instances`, e.g.:
-                    `sudo sysctl fs.inotify.max_user_instances=64`
-                    */
-                    show_error!(
-                        "{} cannot be used, reverting to polling: Too many open files",
-                        text::BACKEND
-                    );
-                    set_exit_code(1);
-                    self.use_polling = true;
-                    watcher = Box::new(notify::PollWatcher::new(tx_clone, watcher_config).unwrap());
-                }
-                Err(e) => return Err(USimpleError::new(1, e.to_string())),
-            };
-        }
-
-        self.watcher_rx = Some(WatcherRx::new(watcher, rx));
-        self.init_files(&settings.inputs)?;
-
-        Ok(())
-    }
-
-    pub fn follow_descriptor(&self) -> bool {
-        self.follow == Some(FollowMode::Descriptor)
-    }
-
-    pub fn follow_name(&self) -> bool {
-        self.follow == Some(FollowMode::Name)
-    }
-
-    pub fn follow_descriptor_retry(&self) -> bool {
-        self.follow_descriptor() && self.retry
-    }
-
-    pub fn follow_name_retry(&self) -> bool {
-        self.follow_name() && self.retry
-    }
-
-    fn init_files(&mut self, inputs: &Vec<Input>) -> UResult<()> {
-        if let Some(watcher_rx) = &mut self.watcher_rx {
-            for input in inputs {
-                match input.kind() {
-                    InputKind::Stdin => continue,
-                    InputKind::File(path) => {
-                        #[cfg(all(unix, not(target_os = "linux")))]
-                        if !path.is_file() {
-                            continue;
-                        }
-                        let mut path = path.to_owned();
-                        if path.is_relative() {
-                            path = std::env::current_dir()?.join(path);
-                        }
-
-                        if path.is_tailable() {
-                            // Add existing regular files to `Watcher` (InotifyWatcher).
-                            watcher_rx.watch_with_parent(&path)?;
-                        } else if !path.is_orphan() {
-                            // If `path` is not a tailable file, add its parent to `Watcher`.
-                            watcher_rx
-                                .watch(path.parent().unwrap(), RecursiveMode::NonRecursive)?;
-                        } else {
-                            // If there is no parent, add `path` to `orphans`.
-                            self.orphans.push(path);
-                        }
-                    }
-                }
-            }
-        }
-        Ok(())
-    }
-
-    #[allow(clippy::cognitive_complexity)]
-    fn handle_event(
-        &mut self,
-        event: &notify::Event,
-        settings: &Settings,
-    ) -> UResult<Vec<PathBuf>> {
-        use notify::event::*;
-
-        let event_path = event.paths.first().unwrap();
-        let mut paths: Vec<PathBuf> = vec![];
-        let display_name = self.files.get(event_path).display_name.clone();
-
-        match event.kind {
-            EventKind::Modify(ModifyKind::Metadata(MetadataKind::Any | MetadataKind::WriteTime))
-
-                // | EventKind::Access(AccessKind::Close(AccessMode::Write))
-                | EventKind::Create(CreateKind::File | CreateKind::Folder | CreateKind::Any)
-                | EventKind::Modify(ModifyKind::Data(DataChange::Any))
-                | EventKind::Modify(ModifyKind::Name(RenameMode::To)) => {
-                    if let Ok(new_md) = event_path.metadata() {
-
-                        let is_tailable = new_md.is_tailable();
-                        let pd = self.files.get(event_path);
-                        if let Some(old_md) = &pd.metadata {
-                            if is_tailable {
-                                // We resume tracking from the start of the file,
-                                // assuming it has been truncated to 0. This mimics GNU's `tail`
-                                // behavior and is the usual truncation operation for log self.files.
-                                if !old_md.is_tailable() {
-                                    show_error!( "{} has become accessible", display_name.quote());
-                                    self.files.update_reader(event_path)?;
-                                } else if pd.reader.is_none() {
-                                    show_error!( "{} has appeared;  following new file", display_name.quote());
-                                    self.files.update_reader(event_path)?;
-                                } else if event.kind == EventKind::Modify(ModifyKind::Name(RenameMode::To))
-                                || (self.use_polling
-                                && !old_md.file_id_eq(&new_md)) {
-                                    show_error!( "{} has been replaced;  following new file", display_name.quote());
-                                    self.files.update_reader(event_path)?;
-                                } else if old_md.got_truncated(&new_md)? {
-                                    show_error!("{}: file truncated", display_name);
-                                    self.files.update_reader(event_path)?;
-                                }
-                                paths.push(event_path.to_owned());
-                            } else if !is_tailable && old_md.is_tailable() {
-                                if pd.reader.is_some() {
-                                    self.files.reset_reader(event_path);
-                                } else {
-                                    show_error!(
-                                        "{} has been replaced with an untailable file",
-                                        display_name.quote()
-                                    );
-                                }
-                            }
-                        } else if is_tailable {
-                                show_error!( "{} has appeared;  following new file", display_name.quote());
-                                self.files.update_reader(event_path)?;
-                                paths.push(event_path.to_owned());
-                            } else if settings.retry {
-                                if self.follow_descriptor() {
-                                    show_error!(
-                                        "{} has been replaced with an untailable file; giving up on this name",
-                                        display_name.quote()
-                                    );
-                                    let _ = self.watcher_rx.as_mut().unwrap().watcher.unwatch(event_path);
-                                    self.files.remove(event_path);
-                                    if self.files.no_files_remaining(settings) {
-                                        return Err(USimpleError::new(1, text::NO_FILES_REMAINING));
-                                    }
-                                } else {
-                                    show_error!(
-                                        "{} has been replaced with an untailable file",
-                                        display_name.quote()
-                                    );
-                                }
-                            }
-                        self.files.update_metadata(event_path, Some(new_md));
-                    }
-                }
-            EventKind::Remove(RemoveKind::File | RemoveKind::Any)
-
-                // | EventKind::Modify(ModifyKind::Name(RenameMode::Any))
-                | EventKind::Modify(ModifyKind::Name(RenameMode::From)) => {
-                    if self.follow_name() {
-                        if settings.retry {
-                            if let Some(old_md) = self.files.get_mut_metadata(event_path) {
-                                if old_md.is_tailable() && self.files.get(event_path).reader.is_some() {
-                                    show_error!(
-                                        "{} {}: {}",
-                                        display_name.quote(),
-                                        text::BECOME_INACCESSIBLE,
-                                        text::NO_SUCH_FILE
-                                    );
-                                }
-                            }
-                            if event_path.is_orphan() && !self.orphans.contains(event_path) {
-                                show_error!("directory containing watched file was removed");
-                                show_error!(
-                                    "{} cannot be used, reverting to polling",
-                                    text::BACKEND
-                                );
-                                self.orphans.push(event_path.to_owned());
-                                let _ = self.watcher_rx.as_mut().unwrap().unwatch(event_path);
-                            }
-                        } else {
-                            show_error!("{}: {}", display_name, text::NO_SUCH_FILE);
-                            if !self.files.files_remaining() && self.use_polling {
-                                // NOTE: GNU's tail exits here for `---disable-inotify`
-                                return Err(USimpleError::new(1, text::NO_FILES_REMAINING));
-                            }
-                        }
-                        self.files.reset_reader(event_path);
-                    } else if self.follow_descriptor_retry() {
-                        // --retry only effective for the initial open
-                        let _ = self.watcher_rx.as_mut().unwrap().unwatch(event_path);
-                        self.files.remove(event_path);
-                    } else if self.use_polling && event.kind == EventKind::Remove(RemoveKind::Any) {
-                        /*
-                        BUG: The watched file was removed. Since we're using Polling, this
-                        could be a rename. We can't tell because `notify::PollWatcher` doesn't
-                        recognize renames properly.
-                        Ideally we want to call seek to offset 0 on the file handle.
-                        But because we only have access to `PathData::reader` as `BufRead`,
-                        we cannot seek to 0 with `BufReader::seek_relative`.
-                        Also because we don't have the new name, we cannot work around this
-                        by simply reopening the file.
-                        */
-                    }
-                }
-            EventKind::Modify(ModifyKind::Name(RenameMode::Both)) => {
-                /*
-                NOTE: For `tail -f a`, keep tracking additions to b after `mv a b`
-                (gnu/tests/tail-2/descriptor-vs-rename.sh)
-                NOTE: The File/BufReader doesn't need to be updated.
-                However, we need to update our `files.map`.
-                This can only be done for inotify, because this EventKind does not
-                trigger for the PollWatcher.
-                BUG: As a result, there's a bug if polling is used:
-                $ tail -f file_a ---disable-inotify
-                $ mv file_a file_b
-                $ echo A >> file_b
-                $ echo A >> file_a
-                The last append to file_a is printed, however this shouldn't be because
-                after the "mv" tail should only follow "file_b".
-                TODO: [2022-05; jhscheer] add test for this bug
-                */
-
-                if self.follow_descriptor() {
-                    let new_path = event.paths.last().unwrap();
-                    paths.push(new_path.to_owned());
-
-                    let new_data = PathData::from_other_with_path(self.files.remove(event_path), new_path);
-                    self.files.insert(
-                        new_path,
-                        new_data,
-                        self.files.get_last().unwrap() == event_path
-                    );
-
-                    // Unwatch old path and watch new path
-                    let _ = self.watcher_rx.as_mut().unwrap().unwatch(event_path);
-                    self.watcher_rx.as_mut().unwrap().watch_with_parent(new_path)?;
-                }
-            }
-            _ => {}
-        }
-        Ok(paths)
-    }
-}
-
-#[allow(clippy::cognitive_complexity)]
-pub fn follow(mut observer: Observer, settings: &Settings) -> UResult<()> {
-    if observer.files.no_files_remaining(settings) && !observer.files.only_stdin_remaining() {
-        return Err(USimpleError::new(1, text::NO_FILES_REMAINING.to_string()));
-    }
-
-    let mut process = platform::ProcessChecker::new(observer.pid);
-
-    let mut _event_counter = 0;
-    let mut _timeout_counter = 0;
-
-    // main follow loop
-    loop {
-        let mut _read_some = false;
-
-        // If `--pid=p`, tail checks whether process p
-        // is alive at least every `--sleep-interval=N` seconds
-        if settings.follow.is_some() && observer.pid != 0 && process.is_dead() {
-            // p is dead, tail will also terminate
-            break;
-        }
-
-        // For `-F` we need to poll if an orphan path becomes available during runtime.
-        // If a path becomes an orphan during runtime, it will be added to orphans.
-        // To be able to differentiate between the cases of test_retry8 and test_retry9,
-        // here paths will not be removed from orphans if the path becomes available.
-        if observer.follow_name_retry() {
-            for new_path in &observer.orphans {
-                if new_path.exists() {
-                    let pd = observer.files.get(new_path);
-                    let md = new_path.metadata().unwrap();
-                    if md.is_tailable() && pd.reader.is_none() {
-                        show_error!(
-                            "{} has appeared;  following new file",
-                            pd.display_name.quote()
-                        );
-                        observer.files.update_metadata(new_path, Some(md));
-                        observer.files.update_reader(new_path)?;
-                        _read_some = observer.files.tail_file(new_path, settings.verbose)?;
-                        observer
-                            .watcher_rx
-                            .as_mut()
-                            .unwrap()
-                            .watch_with_parent(new_path)?;
-                    }
-                }
-            }
-        }
-
-        // With  -f, sleep for approximately N seconds (default 1.0) between iterations;
-        // We wake up if Notify sends an Event or if we wait more than `sleep_sec`.
-        let rx_result = observer
-            .watcher_rx
-            .as_mut()
-            .unwrap()
-            .receiver
-            .recv_timeout(settings.sleep_sec);
-        if rx_result.is_ok() {
-            _event_counter += 1;
-            _timeout_counter = 0;
-        }
-
-        let mut paths = vec![]; // Paths worth checking for new content to print
-        match rx_result {
-            Ok(Ok(event)) => {
-                if let Some(event_path) = event.paths.first() {
-                    if observer.files.contains_key(event_path) {
-                        // Handle Event if it is about a path that we are monitoring
-                        paths = observer.handle_event(&event, settings)?;
-                    }
-                }
-            }
-            Ok(Err(notify::Error {
-                kind: notify::ErrorKind::Io(ref e),
-                paths,
-            })) if e.kind() == std::io::ErrorKind::NotFound => {
-                if let Some(event_path) = paths.first() {
-                    if observer.files.contains_key(event_path) {
-                        let _ = observer
-                            .watcher_rx
-                            .as_mut()
-                            .unwrap()
-                            .watcher
-                            .unwatch(event_path);
-                    }
-                }
-            }
-            Ok(Err(notify::Error {
-                kind: notify::ErrorKind::MaxFilesWatch,
-                ..
-            })) => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("{} resources exhausted", text::BACKEND),
-                ))
-            }
-            Ok(Err(e)) => return Err(USimpleError::new(1, format!("NotifyError: {e}"))),
-            Err(mpsc::RecvTimeoutError::Timeout) => {
-                _timeout_counter += 1;
-            }
-            Err(e) => return Err(USimpleError::new(1, format!("RecvTimeoutError: {e}"))),
-        }
-
-        if observer.use_polling && settings.follow.is_some() {
-            // Consider all files to potentially have new content.
-            // This is a workaround because `Notify::PollWatcher`
-            // does not recognize the "renaming" of files.
-            paths = observer.files.keys().cloned().collect::<Vec<_>>();
-        }
-
-        // main print loop
-        for path in &paths {
-            _read_some = observer.files.tail_file(path, settings.verbose)?;
-        }
-
-        if _timeout_counter == settings.max_unchanged_stats {
-            /*
-            TODO: [2021-10; jhscheer] implement timeout_counter for each file.
-            ‘--max-unchanged-stats=n’
-            When tailing a file by name, if there have been n (default n=5) consecutive iterations
-            for which the file has not changed, then open/fstat the file to determine if that file
-            name is still associated with the same device/inode-number pair as before. When
-            following a log file that is rotated, this is approximately the number of seconds
-            between when tail prints the last pre-rotation lines and when it prints the lines that
-            have accumulated in the new log file. This option is meaningful only when polling
-            (i.e., without inotify) and when following by name.
-            */
-        }
-    }
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/parse.rs.html b/coreutils/dev/src/uu_tail/parse.rs.html deleted file mode 100644 index ce0bddf04..000000000 --- a/coreutils/dev/src/uu_tail/parse.rs.html +++ /dev/null @@ -1,379 +0,0 @@ -parse.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use std::ffi::OsString;
-
-#[derive(PartialEq, Eq, Debug, Copy, Clone)]
-pub struct ObsoleteArgs {
-    pub num: u64,
-    pub plus: bool,
-    pub lines: bool,
-    pub follow: bool,
-}
-
-impl Default for ObsoleteArgs {
-    fn default() -> Self {
-        Self {
-            num: 10,
-            plus: false,
-            lines: true,
-            follow: false,
-        }
-    }
-}
-
-#[derive(PartialEq, Eq, Debug)]
-pub enum ParseError {
-    OutOfRange,
-    Overflow,
-    Context,
-    InvalidEncoding,
-}
-/// Parses obsolete syntax
-/// tail -\[NUM\]\[bcl\]\[f\] and tail +\[NUM\]\[bcl\]\[f\] // spell-checker:disable-line
-pub fn parse_obsolete(src: &OsString) -> Option<Result<ObsoleteArgs, ParseError>> {
-    let mut rest = match src.to_str() {
-        Some(src) => src,
-        None => return Some(Err(ParseError::InvalidEncoding)),
-    };
-    let sign = if let Some(r) = rest.strip_prefix('-') {
-        rest = r;
-        '-'
-    } else if let Some(r) = rest.strip_prefix('+') {
-        rest = r;
-        '+'
-    } else {
-        return None;
-    };
-
-    let end_num = rest
-        .find(|c: char| !c.is_ascii_digit())
-        .unwrap_or(rest.len());
-    let has_num = !rest[..end_num].is_empty();
-    let num: u64 = if has_num {
-        if let Ok(num) = rest[..end_num].parse() {
-            num
-        } else {
-            return Some(Err(ParseError::OutOfRange));
-        }
-    } else {
-        10
-    };
-    rest = &rest[end_num..];
-
-    let mode = if let Some(r) = rest.strip_prefix('l') {
-        rest = r;
-        'l'
-    } else if let Some(r) = rest.strip_prefix('c') {
-        rest = r;
-        'c'
-    } else if let Some(r) = rest.strip_prefix('b') {
-        rest = r;
-        'b'
-    } else {
-        'l'
-    };
-
-    let follow = rest.contains('f');
-    if !rest.chars().all(|f| f == 'f') {
-        // GNU allows an arbitrary amount of following fs, but nothing else
-        if sign == '-' && has_num {
-            return Some(Err(ParseError::Context));
-        }
-        return None;
-    }
-
-    let multiplier = if mode == 'b' { 512 } else { 1 };
-    let num = match num.checked_mul(multiplier) {
-        Some(n) => n,
-        None => return Some(Err(ParseError::Overflow)),
-    };
-
-    Some(Ok(ObsoleteArgs {
-        num,
-        plus: sign == '+',
-        lines: mode == 'l',
-        follow,
-    }))
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    #[test]
-    fn test_parse_numbers_obsolete() {
-        assert_eq!(
-            parse_obsolete(&OsString::from("+2c")),
-            Some(Ok(ObsoleteArgs {
-                num: 2,
-                plus: true,
-                lines: false,
-                follow: false,
-            }))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-5")),
-            Some(Ok(ObsoleteArgs {
-                num: 5,
-                plus: false,
-                lines: true,
-                follow: false,
-            }))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("+100f")),
-            Some(Ok(ObsoleteArgs {
-                num: 100,
-                plus: true,
-                lines: true,
-                follow: true,
-            }))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-2b")),
-            Some(Ok(ObsoleteArgs {
-                num: 1024,
-                plus: false,
-                lines: false,
-                follow: false,
-            }))
-        );
-    }
-    #[test]
-    fn test_parse_errors_obsolete() {
-        assert_eq!(
-            parse_obsolete(&OsString::from("-5n")),
-            Some(Err(ParseError::Context))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-5c5")),
-            Some(Err(ParseError::Context))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-1vzc")),
-            Some(Err(ParseError::Context))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-5m")),
-            Some(Err(ParseError::Context))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-1k")),
-            Some(Err(ParseError::Context))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-1mmk")),
-            Some(Err(ParseError::Context))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-105kzm")),
-            Some(Err(ParseError::Context))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-1vz")),
-            Some(Err(ParseError::Context))
-        );
-        assert_eq!(
-            parse_obsolete(&OsString::from("-1vzqvq")), // spell-checker:disable-line
-            Some(Err(ParseError::Context))
-        );
-    }
-    #[test]
-    fn test_parse_obsolete_no_match() {
-        assert_eq!(parse_obsolete(&OsString::from("-k")), None);
-        assert_eq!(parse_obsolete(&OsString::from("asd")), None);
-        assert_eq!(parse_obsolete(&OsString::from("-cc")), None);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/paths.rs.html b/coreutils/dev/src/uu_tail/paths.rs.html deleted file mode 100644 index 129fb9586..000000000 --- a/coreutils/dev/src/uu_tail/paths.rs.html +++ /dev/null @@ -1,501 +0,0 @@ -paths.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore tailable seekable stdlib (stdlib)
-
-use crate::text;
-use std::ffi::OsStr;
-use std::fs::{File, Metadata};
-use std::io::{Seek, SeekFrom};
-#[cfg(unix)]
-use std::os::unix::fs::{FileTypeExt, MetadataExt};
-use std::path::{Path, PathBuf};
-use uucore::error::UResult;
-
-#[derive(Debug, Clone)]
-pub enum InputKind {
-    File(PathBuf),
-    Stdin,
-}
-
-#[cfg(unix)]
-impl From<&OsStr> for InputKind {
-    fn from(value: &OsStr) -> Self {
-        if value == OsStr::new("-") {
-            Self::Stdin
-        } else {
-            Self::File(PathBuf::from(value))
-        }
-    }
-}
-
-#[cfg(not(unix))]
-impl From<&OsStr> for InputKind {
-    fn from(value: &OsStr) -> Self {
-        if value == OsStr::new(text::DASH) {
-            Self::Stdin
-        } else {
-            Self::File(PathBuf::from(value))
-        }
-    }
-}
-
-#[derive(Debug, Clone)]
-pub struct Input {
-    kind: InputKind,
-    pub display_name: String,
-}
-
-impl Input {
-    pub fn from<T: AsRef<OsStr>>(string: T) -> Self {
-        let string = string.as_ref();
-
-        let kind = string.into();
-        let display_name = match kind {
-            InputKind::File(_) => string.to_string_lossy().to_string(),
-            InputKind::Stdin => text::STDIN_HEADER.to_string(),
-        };
-
-        Self { kind, display_name }
-    }
-
-    pub fn kind(&self) -> &InputKind {
-        &self.kind
-    }
-
-    pub fn is_stdin(&self) -> bool {
-        match self.kind {
-            InputKind::File(_) => false,
-            InputKind::Stdin => true,
-        }
-    }
-
-    pub fn resolve(&self) -> Option<PathBuf> {
-        match &self.kind {
-            InputKind::File(path) if path != &PathBuf::from(text::DEV_STDIN) => {
-                path.canonicalize().ok()
-            }
-            InputKind::File(_) | InputKind::Stdin => {
-                if cfg!(unix) {
-                    match PathBuf::from(text::DEV_STDIN).canonicalize().ok() {
-                        Some(path) if path != PathBuf::from(text::FD0) => Some(path),
-                        Some(_) | None => None,
-                    }
-                } else {
-                    None
-                }
-            }
-        }
-    }
-
-    pub fn is_tailable(&self) -> bool {
-        match &self.kind {
-            InputKind::File(path) => path_is_tailable(path),
-            InputKind::Stdin => self.resolve().map_or(false, |path| path_is_tailable(&path)),
-        }
-    }
-}
-
-impl Default for Input {
-    fn default() -> Self {
-        Self {
-            kind: InputKind::Stdin,
-            display_name: String::from(text::STDIN_HEADER),
-        }
-    }
-}
-
-#[derive(Debug, Default, Clone, Copy)]
-pub struct HeaderPrinter {
-    verbose: bool,
-    first_header: bool,
-}
-
-impl HeaderPrinter {
-    pub fn new(verbose: bool, first_header: bool) -> Self {
-        Self {
-            verbose,
-            first_header,
-        }
-    }
-
-    pub fn print_input(&mut self, input: &Input) {
-        self.print(input.display_name.as_str());
-    }
-
-    pub fn print(&mut self, string: &str) {
-        if self.verbose {
-            println!(
-                "{}==> {} <==",
-                if self.first_header { "" } else { "\n" },
-                string,
-            );
-            self.first_header = false;
-        }
-    }
-}
-pub trait FileExtTail {
-    #[allow(clippy::wrong_self_convention)]
-    fn is_seekable(&mut self, current_offset: u64) -> bool;
-}
-
-impl FileExtTail for File {
-    /// Test if File is seekable.
-    /// Set the current position offset to `current_offset`.
-    fn is_seekable(&mut self, current_offset: u64) -> bool {
-        self.stream_position().is_ok()
-            && self.seek(SeekFrom::End(0)).is_ok()
-            && self.seek(SeekFrom::Start(current_offset)).is_ok()
-    }
-}
-
-pub trait MetadataExtTail {
-    fn is_tailable(&self) -> bool;
-    fn got_truncated(&self, other: &Metadata) -> UResult<bool>;
-    fn get_block_size(&self) -> u64;
-    fn file_id_eq(&self, other: &Metadata) -> bool;
-}
-
-impl MetadataExtTail for Metadata {
-    fn is_tailable(&self) -> bool {
-        let ft = self.file_type();
-        #[cfg(unix)]
-        {
-            ft.is_file() || ft.is_char_device() || ft.is_fifo()
-        }
-        #[cfg(not(unix))]
-        {
-            ft.is_file()
-        }
-    }
-
-    /// Return true if the file was modified and is now shorter
-    fn got_truncated(&self, other: &Metadata) -> UResult<bool> {
-        Ok(other.len() < self.len() && other.modified()? != self.modified()?)
-    }
-
-    fn get_block_size(&self) -> u64 {
-        #[cfg(unix)]
-        {
-            self.blocks()
-        }
-        #[cfg(not(unix))]
-        {
-            self.len()
-        }
-    }
-
-    fn file_id_eq(&self, _other: &Metadata) -> bool {
-        #[cfg(unix)]
-        {
-            self.ino().eq(&_other.ino())
-        }
-        #[cfg(windows)]
-        {
-            // TODO: `file_index` requires unstable library feature `windows_by_handle`
-            // use std::os::windows::prelude::*;
-            // if let Some(self_id) = self.file_index() {
-            //     if let Some(other_id) = other.file_index() {
-            //     // TODO: not sure this is the equivalent of comparing inode numbers
-            //
-            //         return self_id.eq(&other_id);
-            //     }
-            // }
-            false
-        }
-    }
-}
-
-pub trait PathExtTail {
-    fn is_stdin(&self) -> bool;
-    fn is_orphan(&self) -> bool;
-    fn is_tailable(&self) -> bool;
-}
-
-impl PathExtTail for Path {
-    fn is_stdin(&self) -> bool {
-        self.eq(Self::new(text::DASH))
-            || self.eq(Self::new(text::DEV_STDIN))
-            || self.eq(Self::new(text::STDIN_HEADER))
-    }
-
-    /// Return true if `path` does not have an existing parent directory
-    fn is_orphan(&self) -> bool {
-        !matches!(self.parent(), Some(parent) if parent.is_dir())
-    }
-
-    /// Return true if `path` is is a file type that can be tailed
-    fn is_tailable(&self) -> bool {
-        path_is_tailable(self)
-    }
-}
-
-pub fn path_is_tailable(path: &Path) -> bool {
-    path.is_file() || path.exists() && path.metadata().map_or(false, |meta| meta.is_tailable())
-}
-
-#[inline]
-pub fn stdin_is_bad_fd() -> bool {
-    // FIXME : Rust's stdlib is reopening fds as /dev/null
-    // see also: https://github.com/uutils/coreutils/issues/2873
-    // (gnu/tests/tail-2/follow-stdin.sh fails because of this)
-    //#[cfg(unix)]
-    {
-        //platform::stdin_is_bad_fd()
-    }
-    //#[cfg(not(unix))]
-    false
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/platform/mod.rs.html b/coreutils/dev/src/uu_tail/platform/mod.rs.html deleted file mode 100644 index 5415bf4e9..000000000 --- a/coreutils/dev/src/uu_tail/platform/mod.rs.html +++ /dev/null @@ -1,53 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-
/*
- * This file is part of the uutils coreutils package.
- *
- * (c) Alexander Batischev <eual.jp@gmail.com>
- * (c) Thomas Queiroz <thomasqueirozb@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-#[cfg(unix)]
-pub use self::unix::{
-    //stdin_is_bad_fd, stdin_is_pipe_or_fifo, supports_pid_checks, Pid, ProcessChecker,
-    supports_pid_checks,
-    Pid,
-    ProcessChecker,
-};
-
-#[cfg(windows)]
-pub use self::windows::{supports_pid_checks, Pid, ProcessChecker};
-
-#[cfg(unix)]
-mod unix;
-
-#[cfg(windows)]
-mod windows;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/platform/unix.rs.html b/coreutils/dev/src/uu_tail/platform/unix.rs.html deleted file mode 100644 index 4643e3e15..000000000 --- a/coreutils/dev/src/uu_tail/platform/unix.rs.html +++ /dev/null @@ -1,109 +0,0 @@ -unix.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-
/*
- * This file is part of the uutils coreutils package.
- *
- * (c) Alexander Batischev <eual.jp@gmail.com>
- * (c) Thomas Queiroz <thomasqueirozb@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-// spell-checker:ignore (ToDO) stdlib, ISCHR, GETFD
-// spell-checker:ignore (options) EPERM, ENOSYS
-
-use std::io::Error;
-
-pub type Pid = libc::pid_t;
-
-pub struct ProcessChecker {
-    pid: self::Pid,
-}
-
-impl ProcessChecker {
-    pub fn new(process_id: self::Pid) -> Self {
-        Self { pid: process_id }
-    }
-
-    // Borrowing mutably to be aligned with Windows implementation
-    #[allow(clippy::wrong_self_convention)]
-    pub fn is_dead(&mut self) -> bool {
-        unsafe { libc::kill(self.pid, 0) != 0 && get_errno() != libc::EPERM }
-    }
-}
-
-impl Drop for ProcessChecker {
-    fn drop(&mut self) {}
-}
-
-pub fn supports_pid_checks(pid: self::Pid) -> bool {
-    unsafe { !(libc::kill(pid, 0) != 0 && get_errno() == libc::ENOSYS) }
-}
-
-#[inline]
-fn get_errno() -> i32 {
-    Error::last_os_error().raw_os_error().unwrap()
-}
-
-//pub fn stdin_is_bad_fd() -> bool {
-// FIXME: Detect a closed file descriptor, e.g.: `tail <&-`
-// this is never `true`, even with `<&-` because Rust's stdlib is reopening fds as /dev/null
-// see also: https://github.com/uutils/coreutils/issues/2873
-// (gnu/tests/tail-2/follow-stdin.sh fails because of this)
-// unsafe { libc::fcntl(fd, libc::F_GETFD) == -1 && get_errno() == libc::EBADF }
-//false
-//}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/tail.rs.html b/coreutils/dev/src/uu_tail/tail.rs.html deleted file mode 100644 index 446cb4ce8..000000000 --- a/coreutils/dev/src/uu_tail/tail.rs.html +++ /dev/null @@ -1,989 +0,0 @@ -tail.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Morten Olsen Lysgaard <morten@lysgaard.no>
-//  * (c) Alexander Batischev <eual.jp@gmail.com>
-//  * (c) Thomas Queiroz <thomasqueirozb@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) seekable seek'd tail'ing ringbuffer ringbuf unwatch Uncategorized filehandle Signum
-// spell-checker:ignore (libs) kqueue
-// spell-checker:ignore (acronyms)
-// spell-checker:ignore (env/flags)
-// spell-checker:ignore (jargon) tailable untailable stdlib
-// spell-checker:ignore (names)
-// spell-checker:ignore (shell/tools)
-// spell-checker:ignore (misc)
-
-pub mod args;
-pub mod chunks;
-mod follow;
-mod parse;
-mod paths;
-mod platform;
-pub mod text;
-
-pub use args::uu_app;
-use args::{parse_args, FilterMode, Settings, Signum};
-use chunks::ReverseChunks;
-use follow::Observer;
-use paths::{FileExtTail, HeaderPrinter, Input, InputKind, MetadataExtTail};
-use same_file::Handle;
-use std::cmp::Ordering;
-use std::fs::File;
-use std::io::{self, stdin, stdout, BufRead, BufReader, BufWriter, Read, Seek, SeekFrom, Write};
-use std::path::{Path, PathBuf};
-use uucore::display::Quotable;
-use uucore::error::{get_exit_code, set_exit_code, FromIo, UError, UResult, USimpleError};
-use uucore::{show, show_error};
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let settings = parse_args(args)?;
-
-    settings.check_warnings();
-
-    match settings.verify() {
-        args::VerificationResult::CannotFollowStdinByName => {
-            return Err(USimpleError::new(
-                1,
-                format!("cannot follow {} by name", text::DASH.quote()),
-            ))
-        }
-        // Exit early if we do not output anything. Note, that this may break a pipe
-        // when tail is on the receiving side.
-        args::VerificationResult::NoOutput => return Ok(()),
-        args::VerificationResult::Ok => {}
-    }
-
-    uu_tail(&settings)
-}
-
-fn uu_tail(settings: &Settings) -> UResult<()> {
-    let mut printer = HeaderPrinter::new(settings.verbose, true);
-    let mut observer = Observer::from(settings);
-
-    observer.start(settings)?;
-    // Do an initial tail print of each path's content.
-    // Add `path` and `reader` to `files` map if `--follow` is selected.
-    for input in &settings.inputs.clone() {
-        match input.kind() {
-            InputKind::File(path) if cfg!(not(unix)) || path != &PathBuf::from(text::DEV_STDIN) => {
-                tail_file(settings, &mut printer, input, path, &mut observer, 0)?;
-            }
-            // File points to /dev/stdin here
-            InputKind::File(_) | InputKind::Stdin => {
-                tail_stdin(settings, &mut printer, input, &mut observer)?;
-            }
-        }
-    }
-
-    if settings.follow.is_some() {
-        /*
-        POSIX specification regarding tail -f
-        If the input file is a regular file or if the file operand specifies a FIFO, do not
-        terminate after the last line of the input file has been copied, but read and copy
-        further bytes from the input file when they become available. If no file operand is
-        specified and standard input is a pipe or FIFO, the -f option shall be ignored. If
-        the input file is not a FIFO, pipe, or regular file, it is unspecified whether or
-        not the -f option shall be ignored.
-        */
-        if !settings.has_only_stdin() {
-            follow::follow(observer, settings)?;
-        }
-    }
-
-    if get_exit_code() > 0 && paths::stdin_is_bad_fd() {
-        show_error!("-: {}", text::BAD_FD);
-    }
-
-    Ok(())
-}
-
-fn tail_file(
-    settings: &Settings,
-    header_printer: &mut HeaderPrinter,
-    input: &Input,
-    path: &Path,
-    observer: &mut Observer,
-    offset: u64,
-) -> UResult<()> {
-    if !path.exists() {
-        set_exit_code(1);
-        show_error!(
-            "cannot open '{}' for reading: {}",
-            input.display_name,
-            text::NO_SUCH_FILE
-        );
-        observer.add_bad_path(path, input.display_name.as_str(), false)?;
-    } else if path.is_dir() {
-        set_exit_code(1);
-
-        header_printer.print_input(input);
-        let err_msg = "Is a directory".to_string();
-
-        show_error!("error reading '{}': {}", input.display_name, err_msg);
-        if settings.follow.is_some() {
-            let msg = if settings.retry {
-                ""
-            } else {
-                "; giving up on this name"
-            };
-            show_error!(
-                "{}: cannot follow end of this type of file{}",
-                input.display_name,
-                msg
-            );
-        }
-        if !(observer.follow_name_retry()) {
-            // skip directory if not retry
-            return Ok(());
-        }
-        observer.add_bad_path(path, input.display_name.as_str(), false)?;
-    } else if input.is_tailable() {
-        let metadata = path.metadata().ok();
-        match File::open(path) {
-            Ok(mut file) => {
-                header_printer.print_input(input);
-                let mut reader;
-                if !settings.presume_input_pipe
-                    && file.is_seekable(if input.is_stdin() { offset } else { 0 })
-                    && metadata.as_ref().unwrap().get_block_size() > 0
-                {
-                    bounded_tail(&mut file, settings);
-                    reader = BufReader::new(file);
-                } else {
-                    reader = BufReader::new(file);
-                    unbounded_tail(&mut reader, settings)?;
-                }
-                observer.add_path(
-                    path,
-                    input.display_name.as_str(),
-                    Some(Box::new(reader)),
-                    true,
-                )?;
-            }
-            Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => {
-                observer.add_bad_path(path, input.display_name.as_str(), false)?;
-                show!(e.map_err_context(|| {
-                    format!("cannot open '{}' for reading", input.display_name)
-                }));
-            }
-            Err(e) => {
-                observer.add_bad_path(path, input.display_name.as_str(), false)?;
-                return Err(e.map_err_context(|| {
-                    format!("cannot open '{}' for reading", input.display_name)
-                }));
-            }
-        }
-    } else {
-        observer.add_bad_path(path, input.display_name.as_str(), false)?;
-    }
-
-    Ok(())
-}
-
-fn tail_stdin(
-    settings: &Settings,
-    header_printer: &mut HeaderPrinter,
-    input: &Input,
-    observer: &mut Observer,
-) -> UResult<()> {
-    match input.resolve() {
-        // fifo
-        Some(path) => {
-            let mut stdin_offset = 0;
-            if cfg!(unix) {
-                // Save the current seek position/offset of a stdin redirected file.
-                // This is needed to pass "gnu/tests/tail-2/start-middle.sh"
-                if let Ok(mut stdin_handle) = Handle::stdin() {
-                    if let Ok(offset) = stdin_handle.as_file_mut().stream_position() {
-                        stdin_offset = offset;
-                    }
-                }
-            }
-            tail_file(
-                settings,
-                header_printer,
-                input,
-                &path,
-                observer,
-                stdin_offset,
-            )?;
-        }
-        // pipe
-        None => {
-            header_printer.print_input(input);
-            if paths::stdin_is_bad_fd() {
-                set_exit_code(1);
-                show_error!(
-                    "cannot fstat {}: {}",
-                    text::STDIN_HEADER.quote(),
-                    text::BAD_FD
-                );
-                if settings.follow.is_some() {
-                    show_error!(
-                        "error reading {}: {}",
-                        text::STDIN_HEADER.quote(),
-                        text::BAD_FD
-                    );
-                }
-            } else {
-                let mut reader = BufReader::new(stdin());
-                unbounded_tail(&mut reader, settings)?;
-                observer.add_stdin(input.display_name.as_str(), Some(Box::new(reader)), true)?;
-            }
-        }
-    };
-
-    Ok(())
-}
-
-/// Find the index after the given number of instances of a given byte.
-///
-/// This function reads through a given reader until `num_delimiters`
-/// instances of `delimiter` have been seen, returning the index of
-/// the byte immediately following that delimiter. If there are fewer
-/// than `num_delimiters` instances of `delimiter`, this returns the
-/// total number of bytes read from the `reader` until EOF.
-///
-/// # Errors
-///
-/// This function returns an error if there is an error during reading
-/// from `reader`.
-///
-/// # Examples
-///
-/// Basic usage:
-///
-/// ```rust,ignore
-/// use std::io::Cursor;
-///
-/// let mut reader = Cursor::new("a\nb\nc\nd\ne\n");
-/// let i = forwards_thru_file(&mut reader, 2, b'\n').unwrap();
-/// assert_eq!(i, 4);
-/// ```
-///
-/// If `num_delimiters` is zero, then this function always returns
-/// zero:
-///
-/// ```rust,ignore
-/// use std::io::Cursor;
-///
-/// let mut reader = Cursor::new("a\n");
-/// let i = forwards_thru_file(&mut reader, 0, b'\n').unwrap();
-/// assert_eq!(i, 0);
-/// ```
-///
-/// If there are fewer than `num_delimiters` instances of `delimiter`
-/// in the reader, then this function returns the total number of
-/// bytes read:
-///
-/// ```rust,ignore
-/// use std::io::Cursor;
-///
-/// let mut reader = Cursor::new("a\n");
-/// let i = forwards_thru_file(&mut reader, 2, b'\n').unwrap();
-/// assert_eq!(i, 2);
-/// ```
-fn forwards_thru_file<R>(
-    reader: &mut R,
-    num_delimiters: u64,
-    delimiter: u8,
-) -> std::io::Result<usize>
-where
-    R: Read,
-{
-    let mut reader = BufReader::new(reader);
-
-    let mut buf = vec![];
-    let mut total = 0;
-    for _ in 0..num_delimiters {
-        match reader.read_until(delimiter, &mut buf) {
-            Ok(0) => {
-                return Ok(total);
-            }
-            Ok(n) => {
-                total += n;
-                buf.clear();
-                continue;
-            }
-            Err(e) => {
-                return Err(e);
-            }
-        }
-    }
-    Ok(total)
-}
-
-/// Iterate over bytes in the file, in reverse, until we find the
-/// `num_delimiters` instance of `delimiter`. The `file` is left seek'd to the
-/// position just after that delimiter.
-fn backwards_thru_file(file: &mut File, num_delimiters: u64, delimiter: u8) {
-    // This variable counts the number of delimiters found in the file
-    // so far (reading from the end of the file toward the beginning).
-    let mut counter = 0;
-
-    for (block_idx, slice) in ReverseChunks::new(file).enumerate() {
-        // Iterate over each byte in the slice in reverse order.
-        let mut iter = slice.iter().enumerate().rev();
-
-        // Ignore a trailing newline in the last block, if there is one.
-        if block_idx == 0 {
-            if let Some(c) = slice.last() {
-                if *c == delimiter {
-                    iter.next();
-                }
-            }
-        }
-
-        // For each byte, increment the count of the number of
-        // delimiters found. If we have found more than the specified
-        // number of delimiters, terminate the search and seek to the
-        // appropriate location in the file.
-        for (i, ch) in iter {
-            if *ch == delimiter {
-                counter += 1;
-                if counter >= num_delimiters {
-                    // After each iteration of the outer loop, the
-                    // cursor in the file is at the *beginning* of the
-                    // block, so seeking forward by `i + 1` bytes puts
-                    // us right after the found delimiter.
-                    file.seek(SeekFrom::Current((i + 1) as i64)).unwrap();
-                    return;
-                }
-            }
-        }
-    }
-}
-
-/// When tail'ing a file, we do not need to read the whole file from start to
-/// finish just to find the last n lines or bytes. Instead, we can seek to the
-/// end of the file, and then read the file "backwards" in blocks of size
-/// `BLOCK_SIZE` until we find the location of the first line/byte. This ends up
-/// being a nice performance win for very large files.
-fn bounded_tail(file: &mut File, settings: &Settings) {
-    debug_assert!(!settings.presume_input_pipe);
-
-    // Find the position in the file to start printing from.
-    match &settings.mode {
-        FilterMode::Lines(Signum::Negative(count), delimiter) => {
-            backwards_thru_file(file, *count, *delimiter);
-        }
-        FilterMode::Lines(Signum::Positive(count), delimiter) if count > &1 => {
-            let i = forwards_thru_file(file, *count - 1, *delimiter).unwrap();
-            file.seek(SeekFrom::Start(i as u64)).unwrap();
-        }
-        FilterMode::Lines(Signum::MinusZero, _) => {
-            return;
-        }
-        FilterMode::Bytes(Signum::Negative(count)) => {
-            let len = file.seek(SeekFrom::End(0)).unwrap();
-            file.seek(SeekFrom::End(-((*count).min(len) as i64)))
-                .unwrap();
-        }
-        FilterMode::Bytes(Signum::Positive(count)) if count > &1 => {
-            // GNU `tail` seems to index bytes and lines starting at 1, not
-            // at 0. It seems to treat `+0` and `+1` as the same thing.
-            file.seek(SeekFrom::Start(*count - 1)).unwrap();
-        }
-        FilterMode::Bytes(Signum::MinusZero) => {
-            return;
-        }
-        _ => {}
-    }
-
-    // Print the target section of the file.
-    let stdout = stdout();
-    let mut stdout = stdout.lock();
-    std::io::copy(file, &mut stdout).unwrap();
-}
-
-fn unbounded_tail<T: Read>(reader: &mut BufReader<T>, settings: &Settings) -> UResult<()> {
-    let stdout = stdout();
-    let mut writer = BufWriter::new(stdout.lock());
-    match &settings.mode {
-        FilterMode::Lines(Signum::Negative(count), sep) => {
-            let mut chunks = chunks::LinesChunkBuffer::new(*sep, *count);
-            chunks.fill(reader)?;
-            chunks.print(&mut writer)?;
-        }
-        FilterMode::Lines(Signum::PlusZero | Signum::Positive(1), _) => {
-            io::copy(reader, &mut writer)?;
-        }
-        FilterMode::Lines(Signum::Positive(count), sep) => {
-            let mut num_skip = *count - 1;
-            let mut chunk = chunks::LinesChunk::new(*sep);
-            while chunk.fill(reader)?.is_some() {
-                let lines = chunk.get_lines() as u64;
-                if lines < num_skip {
-                    num_skip -= lines;
-                } else {
-                    break;
-                }
-            }
-            if chunk.has_data() {
-                chunk.print_lines(&mut writer, num_skip as usize)?;
-                io::copy(reader, &mut writer)?;
-            }
-        }
-        FilterMode::Bytes(Signum::Negative(count)) => {
-            let mut chunks = chunks::BytesChunkBuffer::new(*count);
-            chunks.fill(reader)?;
-            chunks.print(&mut writer)?;
-        }
-        FilterMode::Bytes(Signum::PlusZero | Signum::Positive(1)) => {
-            io::copy(reader, &mut writer)?;
-        }
-        FilterMode::Bytes(Signum::Positive(count)) => {
-            let mut num_skip = *count - 1;
-            let mut chunk = chunks::BytesChunk::new();
-            loop {
-                if let Some(bytes) = chunk.fill(reader)? {
-                    let bytes: u64 = bytes as u64;
-                    match bytes.cmp(&num_skip) {
-                        Ordering::Less => num_skip -= bytes,
-                        Ordering::Equal => {
-                            break;
-                        }
-                        Ordering::Greater => {
-                            writer.write_all(chunk.get_buffer_with(num_skip as usize))?;
-                            break;
-                        }
-                    }
-                } else {
-                    return Ok(());
-                }
-            }
-
-            io::copy(reader, &mut writer)?;
-        }
-        _ => {}
-    }
-    Ok(())
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::forwards_thru_file;
-    use std::io::Cursor;
-
-    #[test]
-    fn test_forwards_thru_file_zero() {
-        let mut reader = Cursor::new("a\n");
-        let i = forwards_thru_file(&mut reader, 0, b'\n').unwrap();
-        assert_eq!(i, 0);
-    }
-
-    #[test]
-    fn test_forwards_thru_file_basic() {
-        //                   01 23 45 67 89
-        let mut reader = Cursor::new("a\nb\nc\nd\ne\n");
-        let i = forwards_thru_file(&mut reader, 2, b'\n').unwrap();
-        assert_eq!(i, 4);
-    }
-
-    #[test]
-    fn test_forwards_thru_file_past_end() {
-        let mut reader = Cursor::new("x\n");
-        let i = forwards_thru_file(&mut reader, 2, b'\n').unwrap();
-        assert_eq!(i, 2);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tail/text.rs.html b/coreutils/dev/src/uu_tail/text.rs.html deleted file mode 100644 index 9a1c66e1a..000000000 --- a/coreutils/dev/src/uu_tail/text.rs.html +++ /dev/null @@ -1,49 +0,0 @@ -text.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) kqueue
-
-pub const DASH: &str = "-";
-pub const DEV_STDIN: &str = "/dev/stdin";
-pub const STDIN_HEADER: &str = "standard input";
-pub const NO_FILES_REMAINING: &str = "no files remaining";
-pub const NO_SUCH_FILE: &str = "No such file or directory";
-pub const BECOME_INACCESSIBLE: &str = "has become inaccessible";
-pub const BAD_FD: &str = "Bad file descriptor";
-#[cfg(target_os = "linux")]
-pub const BACKEND: &str = "inotify";
-#[cfg(all(unix, not(target_os = "linux")))]
-pub const BACKEND: &str = "kqueue";
-#[cfg(target_os = "windows")]
-pub const BACKEND: &str = "ReadDirectoryChanges";
-pub const FD0: &str = "/dev/fd/0";
-pub const IS_A_DIRECTORY: &str = "Is a directory";
-pub const DEV_TTY: &str = "/dev/tty";
-pub const DEV_PTMX: &str = "/dev/ptmx";
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tee/tee.rs.html b/coreutils/dev/src/uu_tee/tee.rs.html deleted file mode 100644 index c95f7e5ff..000000000 --- a/coreutils/dev/src/uu_tee/tee.rs.html +++ /dev/null @@ -1,725 +0,0 @@ -tee.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Aleksander Bielawski <pabzdzdzwiagief@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use clap::{builder::PossibleValue, crate_version, Arg, ArgAction, Command};
-use std::fs::OpenOptions;
-use std::io::{copy, sink, stdin, stdout, Error, ErrorKind, Read, Result, Write};
-use std::path::PathBuf;
-use uucore::display::Quotable;
-use uucore::error::UResult;
-use uucore::{format_usage, help_about, help_section, help_usage, show_error};
-
-// spell-checker:ignore nopipe
-
-#[cfg(unix)]
-use uucore::signals::{enable_pipe_errors, ignore_interrupts};
-
-const ABOUT: &str = help_about!("tee.md");
-const USAGE: &str = help_usage!("tee.md");
-const AFTER_HELP: &str = help_section!("after help", "tee.md");
-
-mod options {
-    pub const APPEND: &str = "append";
-    pub const IGNORE_INTERRUPTS: &str = "ignore-interrupts";
-    pub const FILE: &str = "file";
-    pub const IGNORE_PIPE_ERRORS: &str = "ignore-pipe-errors";
-    pub const OUTPUT_ERROR: &str = "output-error";
-}
-
-#[allow(dead_code)]
-struct Options {
-    append: bool,
-    ignore_interrupts: bool,
-    files: Vec<String>,
-    output_error: Option<OutputErrorMode>,
-}
-
-#[derive(Clone, Debug)]
-enum OutputErrorMode {
-    Warn,
-    WarnNoPipe,
-    Exit,
-    ExitNoPipe,
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let options = Options {
-        append: matches.get_flag(options::APPEND),
-        ignore_interrupts: matches.get_flag(options::IGNORE_INTERRUPTS),
-        files: matches
-            .get_many::<String>(options::FILE)
-            .map(|v| v.map(ToString::to_string).collect())
-            .unwrap_or_default(),
-        output_error: {
-            if matches.get_flag(options::IGNORE_PIPE_ERRORS) {
-                Some(OutputErrorMode::WarnNoPipe)
-            } else if matches.contains_id(options::OUTPUT_ERROR) {
-                if let Some(v) = matches.get_one::<String>(options::OUTPUT_ERROR) {
-                    match v.as_str() {
-                        "warn" => Some(OutputErrorMode::Warn),
-                        "warn-nopipe" => Some(OutputErrorMode::WarnNoPipe),
-                        "exit" => Some(OutputErrorMode::Exit),
-                        "exit-nopipe" => Some(OutputErrorMode::ExitNoPipe),
-                        _ => unreachable!(),
-                    }
-                } else {
-                    Some(OutputErrorMode::WarnNoPipe)
-                }
-            } else {
-                None
-            }
-        },
-    };
-
-    match tee(&options) {
-        Ok(_) => Ok(()),
-        Err(_) => Err(1.into()),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .after_help(AFTER_HELP)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::APPEND)
-                .long(options::APPEND)
-                .short('a')
-                .help("append to the given FILEs, do not overwrite")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::IGNORE_INTERRUPTS)
-                .long(options::IGNORE_INTERRUPTS)
-                .short('i')
-                .help("ignore interrupt signals (ignored on non-Unix platforms)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::IGNORE_PIPE_ERRORS)
-                .short('p')
-                .help("set write error behavior (ignored on non-Unix platforms)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OUTPUT_ERROR)
-                .long(options::OUTPUT_ERROR)
-                .require_equals(true)
-                .num_args(0..=1)
-                .value_parser([
-                    PossibleValue::new("warn")
-                        .help("produce warnings for errors writing to any output"),
-                    PossibleValue::new("warn-nopipe")
-                        .help("produce warnings for errors that are not pipe errors (ignored on non-unix platforms)"),
-                    PossibleValue::new("exit").help("exit on write errors to any output"),
-                    PossibleValue::new("exit-nopipe")
-                        .help("exit on write errors to any output that are not pipe errors (equivalent to exit on non-unix platforms)"),
-                ])
-                .help("set write error behavior")
-                .conflicts_with(options::IGNORE_PIPE_ERRORS),
-        )
-}
-
-fn tee(options: &Options) -> Result<()> {
-    #[cfg(unix)]
-    {
-        // ErrorKind::Other is raised by MultiWriter when all writers have exited.
-        // This is therefore just a clever way to stop all writers
-
-        if options.ignore_interrupts {
-            ignore_interrupts().map_err(|_| Error::from(ErrorKind::Other))?;
-        }
-        if options.output_error.is_none() {
-            enable_pipe_errors().map_err(|_| Error::from(ErrorKind::Other))?;
-        }
-    }
-    let mut writers: Vec<NamedWriter> = options
-        .files
-        .clone()
-        .into_iter()
-        .map(|file| {
-            Ok(NamedWriter {
-                name: file.clone(),
-                inner: open(file, options.append, options.output_error.as_ref())?,
-            })
-        })
-        .collect::<Result<Vec<NamedWriter>>>()?;
-
-    writers.insert(
-        0,
-        NamedWriter {
-            name: "'standard output'".to_owned(),
-            inner: Box::new(stdout()),
-        },
-    );
-
-    let mut output = MultiWriter::new(writers, options.output_error.clone());
-    let input = &mut NamedReader {
-        inner: Box::new(stdin()) as Box<dyn Read>,
-    };
-
-    let res = match copy(input, &mut output) {
-        // ErrorKind::Other is raised by MultiWriter when all writers
-        // have exited, so that copy will abort. It's equivalent to
-        // success of this part (if there was an error that should
-        // cause a failure from any writer, that error would have been
-        // returned instead).
-        Err(e) if e.kind() != ErrorKind::Other => Err(e),
-        _ => Ok(()),
-    };
-
-    if res.is_err() || output.flush().is_err() || output.error_occurred() {
-        Err(Error::from(ErrorKind::Other))
-    } else {
-        Ok(())
-    }
-}
-
-fn open(
-    name: String,
-    append: bool,
-    output_error: Option<&OutputErrorMode>,
-) -> Result<Box<dyn Write>> {
-    let path = PathBuf::from(name.clone());
-    let inner: Box<dyn Write> = {
-        let mut options = OpenOptions::new();
-        let mode = if append {
-            options.append(true)
-        } else {
-            options.truncate(true)
-        };
-        match mode.write(true).create(true).open(path.as_path()) {
-            Ok(file) => Box::new(file),
-            Err(f) => {
-                show_error!("{}: {}", name.maybe_quote(), f);
-                match output_error {
-                    Some(OutputErrorMode::Exit | OutputErrorMode::ExitNoPipe) => return Err(f),
-                    _ => Box::new(sink()),
-                }
-            }
-        }
-    };
-    Ok(Box::new(NamedWriter { inner, name }) as Box<dyn Write>)
-}
-
-struct MultiWriter {
-    writers: Vec<NamedWriter>,
-    output_error_mode: Option<OutputErrorMode>,
-    ignored_errors: usize,
-}
-
-impl MultiWriter {
-    fn new(writers: Vec<NamedWriter>, output_error_mode: Option<OutputErrorMode>) -> Self {
-        Self {
-            writers,
-            output_error_mode,
-            ignored_errors: 0,
-        }
-    }
-
-    fn error_occurred(&self) -> bool {
-        self.ignored_errors != 0
-    }
-}
-
-fn process_error(
-    mode: Option<&OutputErrorMode>,
-    f: Error,
-    writer: &NamedWriter,
-    ignored_errors: &mut usize,
-) -> Result<()> {
-    match mode {
-        Some(OutputErrorMode::Warn) => {
-            show_error!("{}: {}", writer.name.maybe_quote(), f);
-            *ignored_errors += 1;
-            Ok(())
-        }
-        Some(OutputErrorMode::WarnNoPipe) | None => {
-            if f.kind() != ErrorKind::BrokenPipe {
-                show_error!("{}: {}", writer.name.maybe_quote(), f);
-                *ignored_errors += 1;
-            }
-            Ok(())
-        }
-        Some(OutputErrorMode::Exit) => {
-            show_error!("{}: {}", writer.name.maybe_quote(), f);
-            Err(f)
-        }
-        Some(OutputErrorMode::ExitNoPipe) => {
-            if f.kind() == ErrorKind::BrokenPipe {
-                Ok(())
-            } else {
-                show_error!("{}: {}", writer.name.maybe_quote(), f);
-                Err(f)
-            }
-        }
-    }
-}
-
-impl Write for MultiWriter {
-    fn write(&mut self, buf: &[u8]) -> Result<usize> {
-        let mut aborted = None;
-        let mode = self.output_error_mode.clone();
-        let mut errors = 0;
-        self.writers.retain_mut(|writer| {
-            let result = writer.write_all(buf);
-            match result {
-                Err(f) => {
-                    if let Err(e) = process_error(mode.as_ref(), f, writer, &mut errors) {
-                        if aborted.is_none() {
-                            aborted = Some(e);
-                        }
-                    }
-                    false
-                }
-                _ => true,
-            }
-        });
-        self.ignored_errors += errors;
-        if let Some(e) = aborted {
-            Err(e)
-        } else if self.writers.is_empty() {
-            // This error kind will never be raised by the standard
-            // library, so we can use it for early termination of
-            // `copy`
-            Err(Error::from(ErrorKind::Other))
-        } else {
-            Ok(buf.len())
-        }
-    }
-
-    fn flush(&mut self) -> Result<()> {
-        let mut aborted = None;
-        let mode = self.output_error_mode.clone();
-        let mut errors = 0;
-        self.writers.retain_mut(|writer| {
-            let result = writer.flush();
-            match result {
-                Err(f) => {
-                    if let Err(e) = process_error(mode.as_ref(), f, writer, &mut errors) {
-                        if aborted.is_none() {
-                            aborted = Some(e);
-                        }
-                    }
-                    false
-                }
-                _ => true,
-            }
-        });
-        self.ignored_errors += errors;
-        if let Some(e) = aborted {
-            Err(e)
-        } else {
-            Ok(())
-        }
-    }
-}
-
-struct NamedWriter {
-    inner: Box<dyn Write>,
-    pub name: String,
-}
-
-impl Write for NamedWriter {
-    fn write(&mut self, buf: &[u8]) -> Result<usize> {
-        self.inner.write(buf)
-    }
-
-    fn flush(&mut self) -> Result<()> {
-        self.inner.flush()
-    }
-}
-
-struct NamedReader {
-    inner: Box<dyn Read>,
-}
-
-impl Read for NamedReader {
-    fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
-        match self.inner.read(buf) {
-            Err(f) => {
-                show_error!("stdin: {}", f);
-                Err(f)
-            }
-            okay => okay,
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_test/error.rs.html b/coreutils/dev/src/uu_test/error.rs.html deleted file mode 100644 index b1315b1b2..000000000 --- a/coreutils/dev/src/uu_test/error.rs.html +++ /dev/null @@ -1,75 +0,0 @@ -error.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-
/// Represents an error encountered while parsing a test expression
-#[derive(Debug)]
-pub enum ParseError {
-    ExpectedValue,
-    Expected(String),
-    ExtraArgument(String),
-    MissingArgument(String),
-    UnknownOperator(String),
-    InvalidInteger(String),
-}
-
-/// A Result type for parsing test expressions
-pub type ParseResult<T> = Result<T, ParseError>;
-
-/// Implement Display trait for ParseError to make it easier to print useful errors.
-impl std::fmt::Display for ParseError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::Expected(s) => write!(f, "expected {s}"),
-            Self::ExpectedValue => write!(f, "expected value"),
-            Self::MissingArgument(s) => write!(f, "missing argument after {s}"),
-            Self::ExtraArgument(s) => write!(f, "extra argument {s}"),
-            Self::UnknownOperator(s) => write!(f, "unknown operator {s}"),
-            Self::InvalidInteger(s) => write!(f, "invalid integer {s}"),
-        }
-    }
-}
-
-/// Implement UError trait for ParseError to make it easier to return useful error codes from main().
-impl uucore::error::UError for ParseError {
-    fn code(&self) -> i32 {
-        2
-    }
-}
-
-/// Implement standard Error trait for UError
-impl std::error::Error for ParseError {}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_test/parser.rs.html b/coreutils/dev/src/uu_test/parser.rs.html deleted file mode 100644 index b7bc4ca20..000000000 --- a/coreutils/dev/src/uu_test/parser.rs.html +++ /dev/null @@ -1,885 +0,0 @@ -parser.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-
// This file is part of the uutils coreutils package.
-//
-// (c) Daniel Rocco <drocco@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (grammar) BOOLOP STRLEN FILETEST FILEOP INTOP STRINGOP ; (vars) LParen StrlenOp
-
-use std::ffi::{OsStr, OsString};
-use std::iter::Peekable;
-
-use super::error::{ParseError, ParseResult};
-
-use uucore::display::Quotable;
-
-/// Represents one of the binary comparison operators for strings, integers, or files
-#[derive(Debug, PartialEq, Eq)]
-pub enum Operator {
-    String(OsString),
-    Int(OsString),
-    File(OsString),
-}
-
-/// Represents one of the unary test operators for strings or files
-#[derive(Debug, PartialEq, Eq)]
-pub enum UnaryOperator {
-    StrlenOp(OsString),
-    FiletestOp(OsString),
-}
-
-/// Represents a parsed token from a test expression
-#[derive(Debug, PartialEq, Eq)]
-pub enum Symbol {
-    LParen,
-    Bang,
-    BoolOp(OsString),
-    Literal(OsString),
-    Op(Operator),
-    UnaryOp(UnaryOperator),
-    None,
-}
-
-impl Symbol {
-    /// Create a new Symbol from an OsString.
-    ///
-    /// Returns Symbol::None in place of None
-    fn new(token: Option<OsString>) -> Self {
-        match token {
-            Some(s) => match s.to_str() {
-                Some(t) => match t {
-                    "(" => Self::LParen,
-                    "!" => Self::Bang,
-                    "-a" | "-o" => Self::BoolOp(s),
-                    "=" | "==" | "!=" => Self::Op(Operator::String(s)),
-                    "-eq" | "-ge" | "-gt" | "-le" | "-lt" | "-ne" => Self::Op(Operator::Int(s)),
-                    "-ef" | "-nt" | "-ot" => Self::Op(Operator::File(s)),
-                    "-n" | "-z" => Self::UnaryOp(UnaryOperator::StrlenOp(s)),
-                    "-b" | "-c" | "-d" | "-e" | "-f" | "-g" | "-G" | "-h" | "-k" | "-L" | "-N"
-                    | "-O" | "-p" | "-r" | "-s" | "-S" | "-t" | "-u" | "-w" | "-x" => {
-                        Self::UnaryOp(UnaryOperator::FiletestOp(s))
-                    }
-                    _ => Self::Literal(s),
-                },
-                None => Self::Literal(s),
-            },
-            None => Self::None,
-        }
-    }
-
-    /// Convert this Symbol into a Symbol::Literal, useful for cases where
-    /// test treats an operator as a string operand (test has no reserved
-    /// words).
-    ///
-    /// # Panics
-    ///
-    /// Panics if `self` is Symbol::None
-    fn into_literal(self) -> Self {
-        Self::Literal(match self {
-            Self::LParen => OsString::from("("),
-            Self::Bang => OsString::from("!"),
-            Self::BoolOp(s)
-            | Self::Literal(s)
-            | Self::Op(Operator::String(s))
-            | Self::Op(Operator::Int(s))
-            | Self::Op(Operator::File(s))
-            | Self::UnaryOp(UnaryOperator::StrlenOp(s))
-            | Self::UnaryOp(UnaryOperator::FiletestOp(s)) => s,
-            Self::None => panic!(),
-        })
-    }
-}
-
-/// Implement Display trait for Symbol to make it easier to print useful errors.
-/// We will try to match the format in which the symbol appears in the input.
-impl std::fmt::Display for Symbol {
-    /// Format a Symbol for printing
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        let s = match &self {
-            Self::LParen => OsStr::new("("),
-            Self::Bang => OsStr::new("!"),
-            Self::BoolOp(s)
-            | Self::Literal(s)
-            | Self::Op(Operator::String(s))
-            | Self::Op(Operator::Int(s))
-            | Self::Op(Operator::File(s))
-            | Self::UnaryOp(UnaryOperator::StrlenOp(s))
-            | Self::UnaryOp(UnaryOperator::FiletestOp(s)) => OsStr::new(s),
-            Self::None => OsStr::new("None"),
-        };
-        write!(f, "{}", s.quote())
-    }
-}
-
-/// Recursive descent parser for test, which converts a list of OsStrings
-/// (typically command line arguments) into a stack of Symbols in postfix
-/// order.
-///
-/// Grammar:
-///
-///   EXPR → TERM | EXPR BOOLOP EXPR
-///   TERM → ( EXPR )
-///   TERM → ! EXPR
-///   TERM → UOP str
-///   UOP → STRLEN | FILETEST
-///   TERM → str OP str
-///   TERM → str | 𝜖
-///   OP → STRINGOP | INTOP | FILEOP
-///   STRINGOP → = | == | !=
-///   INTOP → -eq | -ge | -gt | -le | -lt | -ne
-///   FILEOP → -ef | -nt | -ot
-///   STRLEN → -n | -z
-///   FILETEST → -b | -c | -d | -e | -f | -g | -G | -h | -k | -L | -N | -O | -p |
-///               -r | -s | -S | -t | -u | -w | -x
-///   BOOLOP → -a | -o
-///
-#[derive(Debug)]
-struct Parser {
-    tokens: Peekable<std::vec::IntoIter<OsString>>,
-    pub stack: Vec<Symbol>,
-}
-
-impl Parser {
-    /// Construct a new Parser from a `Vec<OsString>` of tokens.
-    fn new(tokens: Vec<OsString>) -> Self {
-        Self {
-            tokens: tokens.into_iter().peekable(),
-            stack: vec![],
-        }
-    }
-
-    /// Fetch the next token from the input stream as a Symbol.
-    fn next_token(&mut self) -> Symbol {
-        Symbol::new(self.tokens.next())
-    }
-
-    /// Consume the next token & verify that it matches the provided value.
-    fn expect(&mut self, value: &str) -> ParseResult<()> {
-        match self.next_token() {
-            Symbol::Literal(s) if s == value => Ok(()),
-            _ => Err(ParseError::Expected(value.quote().to_string())),
-        }
-    }
-
-    /// Peek at the next token from the input stream, returning it as a Symbol.
-    /// The stream is unchanged and will return the same Symbol on subsequent
-    /// calls to `next()` or `peek()`.
-    fn peek(&mut self) -> Symbol {
-        Symbol::new(self.tokens.peek().map(|s| s.to_os_string()))
-    }
-
-    /// Test if the next token in the stream is a BOOLOP (-a or -o), without
-    /// removing the token from the stream.
-    fn peek_is_boolop(&mut self) -> bool {
-        matches!(self.peek(), Symbol::BoolOp(_))
-    }
-
-    /// Parse an expression.
-    ///
-    ///   EXPR → TERM | EXPR BOOLOP EXPR
-    fn expr(&mut self) -> ParseResult<()> {
-        if !self.peek_is_boolop() {
-            self.term()?;
-        }
-        self.maybe_boolop()?;
-        Ok(())
-    }
-
-    /// Parse a term token and possible subsequent symbols: "(", "!", UOP,
-    /// literal, or None.
-    fn term(&mut self) -> ParseResult<()> {
-        let symbol = self.next_token();
-
-        match symbol {
-            Symbol::LParen => self.lparen()?,
-            Symbol::Bang => self.bang()?,
-            Symbol::UnaryOp(_) => self.uop(symbol),
-            Symbol::None => self.stack.push(symbol),
-            literal => self.literal(literal)?,
-        }
-        Ok(())
-    }
-
-    /// Parse a (possibly) parenthesized expression.
-    ///
-    /// test has no reserved keywords, so "(" will be interpreted as a literal
-    /// in certain cases:
-    ///
-    /// * when found at the end of the token stream
-    /// * when followed by a binary operator that is not _itself_ interpreted
-    ///   as a literal
-    ///
-    fn lparen(&mut self) -> ParseResult<()> {
-        // Look ahead up to 3 tokens to determine if the lparen is being used
-        // as a grouping operator or should be treated as a literal string
-        let peek3: Vec<Symbol> = self
-            .tokens
-            .clone()
-            .take(3)
-            .map(|token| Symbol::new(Some(token)))
-            .collect();
-
-        match peek3.as_slice() {
-            // case 1: lparen is a literal when followed by nothing
-            [] => {
-                self.literal(Symbol::LParen.into_literal())?;
-                Ok(())
-            }
-
-            // case 2: error if end of stream is `( <any_token>`
-            [symbol] => Err(ParseError::MissingArgument(format!("{symbol}"))),
-
-            // case 3: `( uop <any_token> )` → parenthesized unary operation;
-            //         this case ensures we don’t get confused by `( -f ) )`
-            //         or `( -f ( )`, for example
-            [Symbol::UnaryOp(_), _, Symbol::Literal(s)] if s == ")" => {
-                let symbol = self.next_token();
-                self.uop(symbol);
-                self.expect(")")?;
-                Ok(())
-            }
-
-            // case 4: binary comparison of literal lparen, e.g. `( != )`
-            [Symbol::Op(_), Symbol::Literal(s)] | [Symbol::Op(_), Symbol::Literal(s), _]
-                if s == ")" =>
-            {
-                self.literal(Symbol::LParen.into_literal())?;
-                Ok(())
-            }
-
-            // case 5: after handling the prior cases, any single token inside
-            //         parentheses is a literal, e.g. `( -f )`
-            [_, Symbol::Literal(s)] | [_, Symbol::Literal(s), _] if s == ")" => {
-                let symbol = self.next_token();
-                self.literal(symbol)?;
-                self.expect(")")?;
-                Ok(())
-            }
-
-            // case 6: two binary ops in a row, treat the first op as a literal
-            [Symbol::Op(_), Symbol::Op(_), _] => {
-                let symbol = self.next_token();
-                self.literal(symbol)?;
-                self.expect(")")?;
-                Ok(())
-            }
-
-            // case 7: if earlier cases didn’t match, `( op <any_token>…`
-            //         indicates binary comparison of literal lparen with
-            //         anything _except_ ")" (case 4)
-            [Symbol::Op(_), _] | [Symbol::Op(_), _, _] => {
-                self.literal(Symbol::LParen.into_literal())?;
-                Ok(())
-            }
-
-            // Otherwise, lparen indicates the start of a parenthesized
-            // expression
-            _ => {
-                self.expr()?;
-                self.expect(")")?;
-                Ok(())
-            }
-        }
-    }
-
-    /// Parse a (possibly) negated expression.
-    ///
-    /// Example cases:
-    ///
-    /// * `! =`: negate the result of the implicit string length test of `=`
-    /// * `! = foo`: compare the literal strings `!` and `foo`
-    /// * `! = = str`: negate comparison of literal `=` and `str`
-    /// * `!`: bang followed by nothing is literal
-    /// * `! EXPR`: negate the result of the expression
-    ///
-    /// Combined Boolean & negation:
-    ///
-    /// * `! ( EXPR ) [BOOLOP EXPR]`: negate the parenthesized expression only
-    /// * `! UOP str BOOLOP EXPR`: negate the unary subexpression
-    /// * `! str BOOLOP str`: negate the entire Boolean expression
-    /// * `! str BOOLOP EXPR BOOLOP EXPR`: negate the value of the first `str` term
-    ///
-    fn bang(&mut self) -> ParseResult<()> {
-        match self.peek() {
-            Symbol::Op(_) | Symbol::BoolOp(_) => {
-                // we need to peek ahead one more token to disambiguate the first
-                // three cases listed above
-                let peek2 = Symbol::new(self.tokens.clone().nth(1));
-
-                match peek2 {
-                    // case 1: `! <OP as literal>`
-                    // case 3: `! = OP str`
-                    Symbol::Op(_) | Symbol::None => {
-                        // op is literal
-                        let op = self.next_token().into_literal();
-                        self.literal(op)?;
-                        self.stack.push(Symbol::Bang);
-                    }
-                    // case 2: `<! as literal> OP str [BOOLOP EXPR]`.
-                    _ => {
-                        // bang is literal; parsing continues with op
-                        self.literal(Symbol::Bang.into_literal())?;
-                        self.maybe_boolop()?;
-                    }
-                }
-            }
-
-            // bang followed by nothing is literal
-            Symbol::None => self.stack.push(Symbol::Bang.into_literal()),
-
-            _ => {
-                // peek ahead up to 4 tokens to determine if we need to negate
-                // the entire expression or just the first term
-                let peek4: Vec<Symbol> = self
-                    .tokens
-                    .clone()
-                    .take(4)
-                    .map(|token| Symbol::new(Some(token)))
-                    .collect();
-
-                match peek4.as_slice() {
-                    // we peeked ahead 4 but there were only 3 tokens left
-                    [Symbol::Literal(_), Symbol::BoolOp(_), Symbol::Literal(_)] => {
-                        self.expr()?;
-                        self.stack.push(Symbol::Bang);
-                    }
-                    _ => {
-                        self.term()?;
-                        self.stack.push(Symbol::Bang);
-                    }
-                }
-            }
-        }
-        Ok(())
-    }
-
-    /// Peek at the next token and parse it as a BOOLOP or string literal,
-    /// as appropriate.
-    fn maybe_boolop(&mut self) -> ParseResult<()> {
-        if self.peek_is_boolop() {
-            let symbol = self.next_token();
-
-            // BoolOp by itself interpreted as Literal
-            if let Symbol::None = self.peek() {
-                self.literal(symbol.into_literal())?;
-            } else {
-                self.boolop(symbol)?;
-                self.maybe_boolop()?;
-            }
-        }
-        Ok(())
-    }
-
-    /// Parse a Boolean expression.
-    ///
-    /// Logical and (-a) has higher precedence than or (-o), so in an
-    /// expression like `foo -o '' -a ''`, the and subexpression is evaluated
-    /// first.
-    fn boolop(&mut self, op: Symbol) -> ParseResult<()> {
-        if op == Symbol::BoolOp(OsString::from("-a")) {
-            self.term()?;
-        } else {
-            self.expr()?;
-        }
-        self.stack.push(op);
-        Ok(())
-    }
-
-    /// Parse a (possible) unary argument test (string length or file
-    /// attribute check).
-    ///
-    /// If a UOP is followed by nothing it is interpreted as a literal string.
-    fn uop(&mut self, op: Symbol) {
-        match self.next_token() {
-            Symbol::None => self.stack.push(op.into_literal()),
-            symbol => {
-                self.stack.push(symbol.into_literal());
-                self.stack.push(op);
-            }
-        }
-    }
-
-    /// Parse a string literal, optionally followed by a comparison operator
-    /// and a second string literal.
-    fn literal(&mut self, token: Symbol) -> ParseResult<()> {
-        self.stack.push(token.into_literal());
-
-        // EXPR → str OP str
-        if let Symbol::Op(_) = self.peek() {
-            let op = self.next_token();
-
-            match self.next_token() {
-                Symbol::None => {
-                    return Err(ParseError::MissingArgument(format!("{op}")));
-                }
-                token => self.stack.push(token.into_literal()),
-            }
-
-            self.stack.push(op);
-        }
-        Ok(())
-    }
-
-    /// Parser entry point: parse the token stream `self.tokens`, storing the
-    /// resulting `Symbol` stack in `self.stack`.
-    fn parse(&mut self) -> ParseResult<()> {
-        self.expr()?;
-
-        match self.tokens.next() {
-            Some(token) => Err(ParseError::ExtraArgument(token.quote().to_string())),
-            None => Ok(()),
-        }
-    }
-}
-
-/// Parse the token stream `args`, returning a `Symbol` stack representing the
-/// operations to perform in postfix order.
-pub fn parse(args: Vec<OsString>) -> ParseResult<Vec<Symbol>> {
-    let mut p = Parser::new(args);
-    p.parse()?;
-    Ok(p.stack)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_test/test.rs.html b/coreutils/dev/src/uu_test/test.rs.html deleted file mode 100644 index dafc62119..000000000 --- a/coreutils/dev/src/uu_test/test.rs.html +++ /dev/null @@ -1,803 +0,0 @@ -test.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-
// This file is part of the uutils coreutils package.
-//
-// (c) mahkoh (ju.orth [at] gmail [dot] com)
-// (c) Daniel Rocco <drocco@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (vars) egid euid FiletestOp StrlenOp
-
-pub(crate) mod error;
-mod parser;
-
-use clap::{crate_version, Command};
-use error::{ParseError, ParseResult};
-use parser::{parse, Operator, Symbol, UnaryOperator};
-use std::ffi::{OsStr, OsString};
-use std::fs;
-#[cfg(unix)]
-use std::os::unix::fs::MetadataExt;
-use uucore::display::Quotable;
-use uucore::error::{UResult, USimpleError};
-use uucore::{format_usage, help_about, help_section};
-
-const ABOUT: &str = help_about!("test.md");
-
-// The help_usage method replaces util name (the first word) with {}.
-// And, The format_usage method replaces {} with execution_phrase ( e.g. test or [ ).
-// However, This test command has two util names.
-// So, we use test or [ instead of {} so that the usage string is correct.
-const USAGE: &str = "\
-test EXPRESSION
-test
-[ EXPRESSION ]
-[ ]
-[ OPTION";
-
-// We use after_help so that this comes after the usage string (it would come before if we used about)
-const AFTER_HELP: &str = help_section!("after help", "test.md");
-
-pub fn uu_app() -> Command {
-    // Disable printing of -h and -v as valid alternatives for --help and --version,
-    // since we don't recognize -h and -v as help/version flags.
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .after_help(AFTER_HELP)
-}
-
-#[uucore::main]
-pub fn uumain(mut args: impl uucore::Args) -> UResult<()> {
-    let program = args.next().unwrap_or_else(|| OsString::from("test"));
-    let binary_name = uucore::util_name();
-    let mut args: Vec<_> = args.collect();
-
-    if binary_name.ends_with('[') {
-        // If invoked as [ we should recognize --help and --version (but not -h or -v)
-        if args.len() == 1 && (args[0] == "--help" || args[0] == "--version") {
-            uu_app().get_matches_from(std::iter::once(program).chain(args.into_iter()));
-            return Ok(());
-        }
-        // If invoked via name '[', matching ']' must be in the last arg
-        let last = args.pop();
-        if last.as_deref() != Some(OsStr::new("]")) {
-            return Err(USimpleError::new(2, "missing ']'"));
-        }
-    }
-
-    let result = parse(args).map(|mut stack| eval(&mut stack))??;
-
-    if result {
-        Ok(())
-    } else {
-        Err(1.into())
-    }
-}
-
-/// Evaluate a stack of Symbols, returning the result of the evaluation or
-/// an error message if evaluation failed.
-fn eval(stack: &mut Vec<Symbol>) -> ParseResult<bool> {
-    macro_rules! pop_literal {
-        () => {
-            match stack.pop() {
-                Some(Symbol::Literal(s)) => s,
-                _ => panic!(),
-            }
-        };
-    }
-
-    let s = stack.pop();
-
-    match s {
-        Some(Symbol::Bang) => {
-            let result = eval(stack)?;
-
-            Ok(!result)
-        }
-        Some(Symbol::Op(Operator::String(op))) => {
-            let b = stack.pop();
-            let a = stack.pop();
-            Ok(if op == "!=" { a != b } else { a == b })
-        }
-        Some(Symbol::Op(Operator::Int(op))) => {
-            let b = pop_literal!();
-            let a = pop_literal!();
-
-            Ok(integers(&a, &b, &op)?)
-        }
-        Some(Symbol::Op(Operator::File(op))) => {
-            let b = pop_literal!();
-            let a = pop_literal!();
-            Ok(files(&a, &b, &op)?)
-        }
-        Some(Symbol::UnaryOp(UnaryOperator::StrlenOp(op))) => {
-            let s = match stack.pop() {
-                Some(Symbol::Literal(s)) => s,
-                Some(Symbol::None) => OsString::from(""),
-                None => {
-                    return Ok(true);
-                }
-                _ => {
-                    return Err(ParseError::MissingArgument(op.quote().to_string()));
-                }
-            };
-
-            Ok(if op == "-z" {
-                s.is_empty()
-            } else {
-                !s.is_empty()
-            })
-        }
-        Some(Symbol::UnaryOp(UnaryOperator::FiletestOp(op))) => {
-            let op = op.to_str().unwrap();
-
-            let f = pop_literal!();
-
-            Ok(match op {
-                "-b" => path(&f, &PathCondition::BlockSpecial),
-                "-c" => path(&f, &PathCondition::CharacterSpecial),
-                "-d" => path(&f, &PathCondition::Directory),
-                "-e" => path(&f, &PathCondition::Exists),
-                "-f" => path(&f, &PathCondition::Regular),
-                "-g" => path(&f, &PathCondition::GroupIdFlag),
-                "-G" => path(&f, &PathCondition::GroupOwns),
-                "-h" => path(&f, &PathCondition::SymLink),
-                "-k" => path(&f, &PathCondition::Sticky),
-                "-L" => path(&f, &PathCondition::SymLink),
-                "-N" => path(&f, &PathCondition::ExistsModifiedLastRead),
-                "-O" => path(&f, &PathCondition::UserOwns),
-                "-p" => path(&f, &PathCondition::Fifo),
-                "-r" => path(&f, &PathCondition::Readable),
-                "-S" => path(&f, &PathCondition::Socket),
-                "-s" => path(&f, &PathCondition::NonEmpty),
-                "-t" => isatty(&f)?,
-                "-u" => path(&f, &PathCondition::UserIdFlag),
-                "-w" => path(&f, &PathCondition::Writable),
-                "-x" => path(&f, &PathCondition::Executable),
-                _ => panic!(),
-            })
-        }
-        Some(Symbol::Literal(s)) => Ok(!s.is_empty()),
-        Some(Symbol::None) | None => Ok(false),
-        Some(Symbol::BoolOp(op)) => {
-            let b = eval(stack)?;
-            let a = eval(stack)?;
-
-            Ok(if op == "-a" { a && b } else { a || b })
-        }
-        _ => Err(ParseError::ExpectedValue),
-    }
-}
-
-/// Operations to compare integers
-/// `a` is the left hand side
-/// `b` is the left hand side
-/// `op` the operation (ex: -eq, -lt, etc)
-fn integers(a: &OsStr, b: &OsStr, op: &OsStr) -> ParseResult<bool> {
-    // Parse the two inputs
-    let a: i128 = a
-        .to_str()
-        .and_then(|s| s.parse().ok())
-        .ok_or_else(|| ParseError::InvalidInteger(a.quote().to_string()))?;
-
-    let b: i128 = b
-        .to_str()
-        .and_then(|s| s.parse().ok())
-        .ok_or_else(|| ParseError::InvalidInteger(b.quote().to_string()))?;
-
-    // Do the maths
-    Ok(match op.to_str() {
-        Some("-eq") => a == b,
-        Some("-ne") => a != b,
-        Some("-gt") => a > b,
-        Some("-ge") => a >= b,
-        Some("-lt") => a < b,
-        Some("-le") => a <= b,
-        _ => return Err(ParseError::UnknownOperator(op.quote().to_string())),
-    })
-}
-
-/// Operations to compare files metadata
-/// `a` is the left hand side
-/// `b` is the left hand side
-/// `op` the operation (ex: -ef, -nt, etc)
-fn files(a: &OsStr, b: &OsStr, op: &OsStr) -> ParseResult<bool> {
-    // Don't manage the error. GNU doesn't show error when doing
-    // test foo -nt bar
-    let f_a = match fs::metadata(a) {
-        Ok(f) => f,
-        Err(_) => return Ok(false),
-    };
-    let f_b = match fs::metadata(b) {
-        Ok(f) => f,
-        Err(_) => return Ok(false),
-    };
-
-    Ok(match op.to_str() {
-        #[cfg(unix)]
-        Some("-ef") => f_a.ino() == f_b.ino() && f_a.dev() == f_b.dev(),
-        #[cfg(not(unix))]
-        Some("-ef") => unimplemented!(),
-        Some("-nt") => f_a.modified().unwrap() > f_b.modified().unwrap(),
-        Some("-ot") => f_a.created().unwrap() > f_b.created().unwrap(),
-        _ => return Err(ParseError::UnknownOperator(op.quote().to_string())),
-    })
-}
-
-fn isatty(fd: &OsStr) -> ParseResult<bool> {
-    fd.to_str()
-        .and_then(|s| s.parse().ok())
-        .ok_or_else(|| ParseError::InvalidInteger(fd.quote().to_string()))
-        .map(|i| {
-            #[cfg(not(target_os = "redox"))]
-            unsafe {
-                libc::isatty(i) == 1
-            }
-            #[cfg(target_os = "redox")]
-            syscall::dup(i, b"termios").map(syscall::close).is_ok()
-        })
-}
-
-#[derive(Eq, PartialEq)]
-enum PathCondition {
-    BlockSpecial,
-    CharacterSpecial,
-    Directory,
-    Exists,
-    ExistsModifiedLastRead,
-    Regular,
-    GroupIdFlag,
-    GroupOwns,
-    SymLink,
-    Sticky,
-    UserOwns,
-    Fifo,
-    Readable,
-    Socket,
-    NonEmpty,
-    UserIdFlag,
-    Writable,
-    Executable,
-}
-
-#[cfg(not(windows))]
-fn path(path: &OsStr, condition: &PathCondition) -> bool {
-    use std::fs::Metadata;
-    use std::os::unix::fs::FileTypeExt;
-
-    const S_ISUID: u32 = 0o4000;
-    const S_ISGID: u32 = 0o2000;
-    const S_ISVTX: u32 = 0o1000;
-
-    enum Permission {
-        Read = 0o4,
-        Write = 0o2,
-        Execute = 0o1,
-    }
-
-    let geteuid = || {
-        #[cfg(not(target_os = "redox"))]
-        let euid = unsafe { libc::geteuid() };
-        #[cfg(target_os = "redox")]
-        let euid = syscall::geteuid().unwrap() as u32;
-
-        euid
-    };
-
-    let getegid = || {
-        #[cfg(not(target_os = "redox"))]
-        let egid = unsafe { libc::getegid() };
-        #[cfg(target_os = "redox")]
-        let egid = syscall::getegid().unwrap() as u32;
-
-        egid
-    };
-
-    let perm = |metadata: Metadata, p: Permission| {
-        if geteuid() == metadata.uid() {
-            metadata.mode() & ((p as u32) << 6) != 0
-        } else if getegid() == metadata.gid() {
-            metadata.mode() & ((p as u32) << 3) != 0
-        } else {
-            metadata.mode() & (p as u32) != 0
-        }
-    };
-
-    let metadata = if condition == &PathCondition::SymLink {
-        fs::symlink_metadata(path)
-    } else {
-        fs::metadata(path)
-    };
-
-    let metadata = match metadata {
-        Ok(metadata) => metadata,
-        Err(_) => {
-            return false;
-        }
-    };
-
-    let file_type = metadata.file_type();
-
-    match condition {
-        PathCondition::BlockSpecial => file_type.is_block_device(),
-        PathCondition::CharacterSpecial => file_type.is_char_device(),
-        PathCondition::Directory => file_type.is_dir(),
-        PathCondition::Exists => true,
-        PathCondition::ExistsModifiedLastRead => {
-            metadata.accessed().unwrap() < metadata.modified().unwrap()
-        }
-        PathCondition::Regular => file_type.is_file(),
-        PathCondition::GroupIdFlag => metadata.mode() & S_ISGID != 0,
-        PathCondition::GroupOwns => metadata.gid() == getegid(),
-        PathCondition::SymLink => metadata.file_type().is_symlink(),
-        PathCondition::Sticky => metadata.mode() & S_ISVTX != 0,
-        PathCondition::UserOwns => metadata.uid() == geteuid(),
-        PathCondition::Fifo => file_type.is_fifo(),
-        PathCondition::Readable => perm(metadata, Permission::Read),
-        PathCondition::Socket => file_type.is_socket(),
-        PathCondition::NonEmpty => metadata.size() > 0,
-        PathCondition::UserIdFlag => metadata.mode() & S_ISUID != 0,
-        PathCondition::Writable => perm(metadata, Permission::Write),
-        PathCondition::Executable => perm(metadata, Permission::Execute),
-    }
-}
-
-#[cfg(windows)]
-fn path(path: &OsStr, condition: &PathCondition) -> bool {
-    use std::fs::metadata;
-
-    let stat = match metadata(path) {
-        Ok(s) => s,
-        _ => return false,
-    };
-
-    match condition {
-        PathCondition::BlockSpecial => false,
-        PathCondition::CharacterSpecial => false,
-        PathCondition::Directory => stat.is_dir(),
-        PathCondition::Exists => true,
-        PathCondition::ExistsModifiedLastRead => unimplemented!(),
-        PathCondition::Regular => stat.is_file(),
-        PathCondition::GroupIdFlag => false,
-        PathCondition::GroupOwns => unimplemented!(),
-        PathCondition::SymLink => false,
-        PathCondition::Sticky => false,
-        PathCondition::UserOwns => unimplemented!(),
-        PathCondition::Fifo => false,
-        PathCondition::Readable => false, // TODO
-        PathCondition::Socket => false,
-        PathCondition::NonEmpty => stat.len() > 0,
-        PathCondition::UserIdFlag => false,
-        PathCondition::Writable => false,   // TODO
-        PathCondition::Executable => false, // TODO
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::integers;
-    use std::ffi::OsStr;
-
-    #[test]
-    fn test_integer_op() {
-        let a = OsStr::new("18446744073709551616");
-        let b = OsStr::new("0");
-        assert!(!integers(a, b, OsStr::new("-lt")).unwrap());
-        let a = OsStr::new("18446744073709551616");
-        let b = OsStr::new("0");
-        assert!(integers(a, b, OsStr::new("-gt")).unwrap());
-        let a = OsStr::new("-1");
-        let b = OsStr::new("0");
-        assert!(integers(a, b, OsStr::new("-lt")).unwrap());
-        let a = OsStr::new("42");
-        let b = OsStr::new("42");
-        assert!(integers(a, b, OsStr::new("-eq")).unwrap());
-        let a = OsStr::new("42");
-        let b = OsStr::new("42");
-        assert!(!integers(a, b, OsStr::new("-ne")).unwrap());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_timeout/status.rs.html b/coreutils/dev/src/uu_timeout/status.rs.html deleted file mode 100644 index ea37eb6b6..000000000 --- a/coreutils/dev/src/uu_timeout/status.rs.html +++ /dev/null @@ -1,103 +0,0 @@ -status.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-//! Exit status codes produced by `timeout`.
-use std::convert::From;
-use uucore::error::UError;
-
-/// Enumerates the exit statuses produced by `timeout`.
-///
-/// Use [`Into::into`] (or [`From::from`]) to convert an enumeration
-/// member into a numeric status code. You can also convert into a
-/// [`UError`].
-///
-/// # Examples
-///
-/// Convert into an [`i32`]:
-///
-/// ```rust,ignore
-/// assert_eq!(i32::from(ExitStatus::CommandTimedOut), 124);
-/// ```
-pub(crate) enum ExitStatus {
-    /// When the child process times out and `--preserve-status` is not specified.
-    CommandTimedOut,
-
-    /// When `timeout` itself fails.
-    TimeoutFailed,
-
-    /// When a signal is sent to the child process or `timeout` itself.
-    SignalSent(usize),
-
-    /// When there is a failure while waiting for the child process to terminate.
-    WaitingFailed,
-}
-
-impl From<ExitStatus> for i32 {
-    fn from(exit_status: ExitStatus) -> Self {
-        match exit_status {
-            ExitStatus::CommandTimedOut => 124,
-            ExitStatus::TimeoutFailed => 125,
-            ExitStatus::SignalSent(s) => 128 + s as Self,
-            ExitStatus::WaitingFailed => 124,
-        }
-    }
-}
-
-impl From<ExitStatus> for Box<dyn UError> {
-    fn from(exit_status: ExitStatus) -> Self {
-        Box::from(i32::from(exit_status))
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_timeout/timeout.rs.html b/coreutils/dev/src/uu_timeout/timeout.rs.html deleted file mode 100644 index e8d5949a2..000000000 --- a/coreutils/dev/src/uu_timeout/timeout.rs.html +++ /dev/null @@ -1,761 +0,0 @@ -timeout.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) tstr sigstr cmdname setpgid sigchld getpid
-mod status;
-
-use crate::status::ExitStatus;
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::io::ErrorKind;
-use std::os::unix::process::ExitStatusExt;
-use std::process::{self, Child, Stdio};
-use std::time::Duration;
-use uucore::display::Quotable;
-use uucore::error::{UClapError, UResult, USimpleError, UUsageError};
-use uucore::process::ChildExt;
-
-#[cfg(unix)]
-use uucore::signals::enable_pipe_errors;
-
-use uucore::{
-    format_usage, help_about, help_usage, show_error,
-    signals::{signal_by_name_or_value, signal_name_by_value},
-};
-
-const ABOUT: &str = help_about!("timeout.md");
-const USAGE: &str = help_usage!("timeout.md");
-
-pub mod options {
-    pub static FOREGROUND: &str = "foreground";
-    pub static KILL_AFTER: &str = "kill-after";
-    pub static SIGNAL: &str = "signal";
-    pub static PRESERVE_STATUS: &str = "preserve-status";
-    pub static VERBOSE: &str = "verbose";
-
-    // Positional args.
-    pub static DURATION: &str = "duration";
-    pub static COMMAND: &str = "command";
-}
-
-struct Config {
-    foreground: bool,
-    kill_after: Option<Duration>,
-    signal: usize,
-    duration: Duration,
-    preserve_status: bool,
-    verbose: bool,
-
-    command: Vec<String>,
-}
-
-impl Config {
-    fn from(options: &clap::ArgMatches) -> UResult<Self> {
-        let signal = match options.get_one::<String>(options::SIGNAL) {
-            Some(signal_) => {
-                let signal_result = signal_by_name_or_value(signal_);
-                match signal_result {
-                    None => {
-                        return Err(UUsageError::new(
-                            ExitStatus::TimeoutFailed.into(),
-                            format!("{}: invalid signal", signal_.quote()),
-                        ))
-                    }
-                    Some(signal_value) => signal_value,
-                }
-            }
-            _ => uucore::signals::signal_by_name_or_value("TERM").unwrap(),
-        };
-
-        let kill_after = match options.get_one::<String>(options::KILL_AFTER) {
-            None => None,
-            Some(kill_after) => match uucore::parse_time::from_str(kill_after) {
-                Ok(k) => Some(k),
-                Err(err) => return Err(UUsageError::new(ExitStatus::TimeoutFailed.into(), err)),
-            },
-        };
-
-        let duration = match uucore::parse_time::from_str(
-            options.get_one::<String>(options::DURATION).unwrap(),
-        ) {
-            Ok(duration) => duration,
-            Err(err) => return Err(UUsageError::new(ExitStatus::TimeoutFailed.into(), err)),
-        };
-
-        let preserve_status: bool = options.get_flag(options::PRESERVE_STATUS);
-        let foreground = options.get_flag(options::FOREGROUND);
-        let verbose = options.get_flag(options::VERBOSE);
-
-        let command = options
-            .get_many::<String>(options::COMMAND)
-            .unwrap()
-            .map(String::from)
-            .collect::<Vec<_>>();
-
-        Ok(Self {
-            foreground,
-            kill_after,
-            signal,
-            duration,
-            preserve_status,
-            verbose,
-            command,
-        })
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args).with_exit_code(125)?;
-
-    let config = Config::from(&matches)?;
-    timeout(
-        &config.command,
-        config.duration,
-        config.signal,
-        config.kill_after,
-        config.foreground,
-        config.preserve_status,
-        config.verbose,
-    )
-}
-
-pub fn uu_app() -> Command {
-    Command::new("timeout")
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .arg(
-            Arg::new(options::FOREGROUND)
-                .long(options::FOREGROUND)
-                .help(
-                    "when not running timeout directly from a shell prompt, allow \
-                COMMAND to read from the TTY and get TTY signals; in this mode, \
-                children of COMMAND will not be timed out",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::KILL_AFTER)
-                .long(options::KILL_AFTER)
-                .short('k')
-                .help(
-                    "also send a KILL signal if COMMAND is still running this long \
-                after the initial signal was sent",
-                ),
-        )
-        .arg(
-            Arg::new(options::PRESERVE_STATUS)
-                .long(options::PRESERVE_STATUS)
-                .help("exit with the same status as COMMAND, even when the command times out")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SIGNAL)
-                .short('s')
-                .long(options::SIGNAL)
-                .help(
-                    "specify the signal to be sent on timeout; SIGNAL may be a name like \
-                'HUP' or a number; see 'kill -l' for a list of signals",
-                )
-                .value_name("SIGNAL"),
-        )
-        .arg(
-            Arg::new(options::VERBOSE)
-                .short('v')
-                .long(options::VERBOSE)
-                .help("diagnose to stderr any signal sent upon timeout")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(Arg::new(options::DURATION).required(true))
-        .arg(
-            Arg::new(options::COMMAND)
-                .required(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::CommandName),
-        )
-        .trailing_var_arg(true)
-        .infer_long_args(true)
-}
-
-/// Remove pre-existing SIGCHLD handlers that would make waiting for the child's exit code fail.
-fn unblock_sigchld() {
-    unsafe {
-        nix::sys::signal::signal(
-            nix::sys::signal::Signal::SIGCHLD,
-            nix::sys::signal::SigHandler::SigDfl,
-        )
-        .unwrap();
-    }
-}
-
-/// Report that a signal is being sent if the verbose flag is set.
-fn report_if_verbose(signal: usize, cmd: &str, verbose: bool) {
-    if verbose {
-        let s = signal_name_by_value(signal).unwrap();
-        show_error!("sending signal {} to command {}", s, cmd.quote());
-    }
-}
-
-fn send_signal(process: &mut Child, signal: usize, foreground: bool) {
-    // NOTE: GNU timeout doesn't check for errors of signal.
-    // The subprocess might have exited just after the timeout.
-    // Sending a signal now would return "No such process", but we should still try to kill the children.
-    _ = process.send_signal(signal);
-    if !foreground {
-        _ = process.send_signal_group(signal);
-        let kill_signal = signal_by_name_or_value("KILL").unwrap();
-        let continued_signal = signal_by_name_or_value("CONT").unwrap();
-        if signal != kill_signal && signal != continued_signal {
-            _ = process.send_signal(continued_signal);
-            _ = process.send_signal_group(continued_signal);
-        }
-    }
-}
-
-/// Wait for a child process and send a kill signal if it does not terminate.
-///
-/// This function waits for the child `process` for the time period
-/// given by `duration`. If the child process does not terminate
-/// within that time, we send the `SIGKILL` signal to it. If `verbose`
-/// is `true`, then a message is printed to `stderr` when that
-/// happens.
-///
-/// If the child process terminates within the given time period and
-/// `preserve_status` is `true`, then the status code of the child
-/// process is returned. If the child process terminates within the
-/// given time period and `preserve_status` is `false`, then 124 is
-/// returned. If the child does not terminate within the time period,
-/// then 137 is returned. Finally, if there is an error while waiting
-/// for the child process to terminate, then 124 is returned.
-///
-/// # Errors
-///
-/// If there is a problem sending the `SIGKILL` signal or waiting for
-/// the process after that signal is sent.
-fn wait_or_kill_process(
-    process: &mut Child,
-    cmd: &str,
-    duration: Duration,
-    preserve_status: bool,
-    foreground: bool,
-    verbose: bool,
-) -> std::io::Result<i32> {
-    match process.wait_or_timeout(duration) {
-        Ok(Some(status)) => {
-            if preserve_status {
-                Ok(status.code().unwrap_or_else(|| status.signal().unwrap()))
-            } else {
-                Ok(ExitStatus::TimeoutFailed.into())
-            }
-        }
-        Ok(None) => {
-            let signal = signal_by_name_or_value("KILL").unwrap();
-            report_if_verbose(signal, cmd, verbose);
-            send_signal(process, signal, foreground);
-            process.wait()?;
-            Ok(ExitStatus::SignalSent(signal).into())
-        }
-        Err(_) => Ok(ExitStatus::WaitingFailed.into()),
-    }
-}
-
-#[cfg(unix)]
-fn preserve_signal_info(signal: libc::c_int) -> libc::c_int {
-    // This is needed because timeout is expected to preserve the exit
-    // status of its child. It is not the case that utilities have a
-    // single simple exit code, that's an illusion some shells
-    // provide.  Instead exit status is really two numbers:
-    //
-    //  - An exit code if the program ran to completion
-    //
-    //  - A signal number if the program was terminated by a signal
-    //
-    // The easiest way to preserve the latter seems to be to kill
-    // ourselves with whatever signal our child exited with, which is
-    // what the following is intended to accomplish.
-    unsafe {
-        libc::kill(libc::getpid(), signal);
-    }
-    signal
-}
-
-#[cfg(not(unix))]
-fn preserve_signal_info(signal: libc::c_int) -> libc::c_int {
-    // Do nothing
-    signal
-}
-
-/// TODO: Improve exit codes, and make them consistent with the GNU Coreutils exit codes.
-
-fn timeout(
-    cmd: &[String],
-    duration: Duration,
-    signal: usize,
-    kill_after: Option<Duration>,
-    foreground: bool,
-    preserve_status: bool,
-    verbose: bool,
-) -> UResult<()> {
-    if !foreground {
-        unsafe { libc::setpgid(0, 0) };
-    }
-    #[cfg(unix)]
-    enable_pipe_errors()?;
-
-    let process = &mut process::Command::new(&cmd[0])
-        .args(&cmd[1..])
-        .stdin(Stdio::inherit())
-        .stdout(Stdio::inherit())
-        .stderr(Stdio::inherit())
-        .spawn()
-        .map_err(|err| {
-            let status_code = if err.kind() == ErrorKind::NotFound {
-                // FIXME: not sure which to use
-                127
-            } else {
-                // FIXME: this may not be 100% correct...
-                126
-            };
-            USimpleError::new(status_code, format!("failed to execute process: {err}"))
-        })?;
-    unblock_sigchld();
-    // Wait for the child process for the specified time period.
-    //
-    // If the process exits within the specified time period (the
-    // `Ok(Some(_))` arm), then return the appropriate status code.
-    //
-    // If the process does not exit within that time (the `Ok(None)`
-    // arm) and `kill_after` is specified, then try sending `SIGKILL`.
-    //
-    // TODO The structure of this block is extremely similar to the
-    // structure of `wait_or_kill_process()`. They can probably be
-    // refactored into some common function.
-    match process.wait_or_timeout(duration) {
-        Ok(Some(status)) => Err(status
-            .code()
-            .unwrap_or_else(|| preserve_signal_info(status.signal().unwrap()))
-            .into()),
-        Ok(None) => {
-            report_if_verbose(signal, &cmd[0], verbose);
-            send_signal(process, signal, foreground);
-            match kill_after {
-                None => {
-                    if preserve_status {
-                        Err(ExitStatus::SignalSent(signal).into())
-                    } else {
-                        Err(ExitStatus::CommandTimedOut.into())
-                    }
-                }
-                Some(kill_after) => {
-                    match wait_or_kill_process(
-                        process,
-                        &cmd[0],
-                        kill_after,
-                        preserve_status,
-                        foreground,
-                        verbose,
-                    ) {
-                        Ok(status) => Err(status.into()),
-                        Err(e) => Err(USimpleError::new(
-                            ExitStatus::TimeoutFailed.into(),
-                            format!("{e}"),
-                        )),
-                    }
-                }
-            }
-        }
-        Err(_) => {
-            // We're going to return ERR_EXIT_STATUS regardless of
-            // whether `send_signal()` succeeds or fails
-            send_signal(process, signal, foreground);
-            Err(ExitStatus::TimeoutFailed.into())
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_touch/touch.rs.html b/coreutils/dev/src/uu_touch/touch.rs.html deleted file mode 100644 index 9aaa0c157..000000000 --- a/coreutils/dev/src/uu_touch/touch.rs.html +++ /dev/null @@ -1,1059 +0,0 @@ -touch.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-
// This file is part of the uutils coreutils package.
-//
-// (c) Nick Platt <platt.nicholas@gmail.com>
-// (c) Jian Zeng <anonymousknight96 AT gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) filetime datetime lpszfilepath mktime DATETIME subsecond datelike timelike
-// spell-checker:ignore (FORMATS) MMDDhhmm YYYYMMDDHHMM YYMMDDHHMM YYYYMMDDHHMMS
-
-use chrono::{DateTime, Datelike, Duration, Local, NaiveDate, NaiveTime, TimeZone, Timelike, Utc};
-use clap::builder::ValueParser;
-use clap::{crate_version, Arg, ArgAction, ArgGroup, Command};
-use filetime::{set_file_times, set_symlink_file_times, FileTime};
-use std::ffi::OsString;
-use std::fs::{self, File};
-use std::path::{Path, PathBuf};
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UError, UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage, show};
-
-const ABOUT: &str = help_about!("touch.md");
-const USAGE: &str = help_usage!("touch.md");
-
-pub mod options {
-    // Both SOURCES and sources are needed as we need to be able to refer to the ArgGroup.
-    pub static SOURCES: &str = "sources";
-    pub mod sources {
-        pub static DATE: &str = "date";
-        pub static REFERENCE: &str = "reference";
-        pub static TIMESTAMP: &str = "timestamp";
-    }
-    pub static HELP: &str = "help";
-    pub static ACCESS: &str = "access";
-    pub static MODIFICATION: &str = "modification";
-    pub static NO_CREATE: &str = "no-create";
-    pub static NO_DEREF: &str = "no-dereference";
-    pub static TIME: &str = "time";
-}
-
-static ARG_FILES: &str = "files";
-
-mod format {
-    pub(crate) const POSIX_LOCALE: &str = "%a %b %e %H:%M:%S %Y";
-    pub(crate) const ISO_8601: &str = "%Y-%m-%d";
-    // "%Y%m%d%H%M.%S" 15 chars
-    pub(crate) const YYYYMMDDHHMM_DOT_SS: &str = "%Y%m%d%H%M.%S";
-    // "%Y-%m-%d %H:%M:%S.%SS" 12 chars
-    pub(crate) const YYYYMMDDHHMMSS: &str = "%Y-%m-%d %H:%M:%S.%f";
-    // "%Y-%m-%d %H:%M:%S" 12 chars
-    pub(crate) const YYYYMMDDHHMMS: &str = "%Y-%m-%d %H:%M:%S";
-    // "%Y-%m-%d %H:%M" 12 chars
-    // Used for example in tests/touch/no-rights.sh
-    pub(crate) const YYYY_MM_DD_HH_MM: &str = "%Y-%m-%d %H:%M";
-    // "%Y%m%d%H%M" 12 chars
-    pub(crate) const YYYYMMDDHHMM: &str = "%Y%m%d%H%M";
-    // "%Y-%m-%d %H:%M +offset"
-    // Used for example in tests/touch/relative.sh
-    pub(crate) const YYYYMMDDHHMM_OFFSET: &str = "%Y-%m-%d %H:%M %z";
-}
-
-/// Convert a DateTime with a TZ offset into a FileTime
-///
-/// The DateTime is converted into a unix timestamp from which the FileTime is
-/// constructed.
-fn datetime_to_filetime<T: TimeZone>(dt: &DateTime<T>) -> FileTime {
-    FileTime::from_unix_time(dt.timestamp(), dt.timestamp_subsec_nanos())
-}
-
-#[uucore::main]
-#[allow(clippy::cognitive_complexity)]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let files = matches.get_many::<OsString>(ARG_FILES).ok_or_else(|| {
-        USimpleError::new(
-            1,
-            format!(
-                "missing file operand\nTry '{} --help' for more information.",
-                uucore::execution_phrase()
-            ),
-        )
-    })?;
-    let (mut atime, mut mtime) = match (
-        matches.get_one::<OsString>(options::sources::REFERENCE),
-        matches.get_one::<String>(options::sources::DATE),
-    ) {
-        (Some(reference), Some(date)) => {
-            let (atime, mtime) = stat(Path::new(reference), !matches.get_flag(options::NO_DEREF))?;
-            if let Ok(offset) = parse_datetime::from_str(date) {
-                let seconds = offset.num_seconds();
-                let nanos = offset.num_nanoseconds().unwrap_or(0) % 1_000_000_000;
-
-                let ref_atime_secs = atime.unix_seconds();
-                let ref_atime_nanos = atime.nanoseconds();
-                let atime = FileTime::from_unix_time(
-                    ref_atime_secs + seconds,
-                    ref_atime_nanos + nanos as u32,
-                );
-
-                let ref_mtime_secs = mtime.unix_seconds();
-                let ref_mtime_nanos = mtime.nanoseconds();
-                let mtime = FileTime::from_unix_time(
-                    ref_mtime_secs + seconds,
-                    ref_mtime_nanos + nanos as u32,
-                );
-
-                (atime, mtime)
-            } else {
-                let timestamp = parse_date(date)?;
-                (timestamp, timestamp)
-            }
-        }
-        (Some(reference), None) => {
-            stat(Path::new(reference), !matches.get_flag(options::NO_DEREF))?
-        }
-        (None, Some(date)) => {
-            let timestamp = parse_date(date)?;
-            (timestamp, timestamp)
-        }
-        (None, None) => {
-            let timestamp = if let Some(ts) = matches.get_one::<String>(options::sources::TIMESTAMP)
-            {
-                parse_timestamp(ts)?
-            } else {
-                datetime_to_filetime(&Local::now())
-            };
-            (timestamp, timestamp)
-        }
-    };
-
-    for filename in files {
-        // FIXME: find a way to avoid having to clone the path
-        let pathbuf = if filename == "-" {
-            pathbuf_from_stdout()?
-        } else {
-            PathBuf::from(filename)
-        };
-
-        let path = pathbuf.as_path();
-
-        let metadata_result = if matches.get_flag(options::NO_DEREF) {
-            path.symlink_metadata()
-        } else {
-            path.metadata()
-        };
-
-        if let Err(e) = metadata_result {
-            if e.kind() != std::io::ErrorKind::NotFound {
-                return Err(e.map_err_context(|| format!("setting times of {}", filename.quote())));
-            }
-
-            if matches.get_flag(options::NO_CREATE) {
-                continue;
-            }
-
-            if matches.get_flag(options::NO_DEREF) {
-                show!(USimpleError::new(
-                    1,
-                    format!(
-                        "setting times of {}: No such file or directory",
-                        filename.quote()
-                    )
-                ));
-                continue;
-            }
-
-            if let Err(e) = File::create(path) {
-                show!(e.map_err_context(|| format!("cannot touch {}", path.quote())));
-                continue;
-            };
-
-            // Minor optimization: if no reference time was specified, we're done.
-            if !matches.contains_id(options::SOURCES) {
-                continue;
-            }
-        }
-
-        // If changing "only" atime or mtime, grab the existing value of the other.
-        // Note that "-a" and "-m" may be passed together; this is not an xor.
-        if matches.get_flag(options::ACCESS)
-            || matches.get_flag(options::MODIFICATION)
-            || matches.contains_id(options::TIME)
-        {
-            let st = stat(path, !matches.get_flag(options::NO_DEREF))?;
-            let time = matches
-                .get_one::<String>(options::TIME)
-                .map(|s| s.as_str())
-                .unwrap_or("");
-
-            if !(matches.get_flag(options::ACCESS)
-                || time.contains(&"access".to_owned())
-                || time.contains(&"atime".to_owned())
-                || time.contains(&"use".to_owned()))
-            {
-                atime = st.0;
-            }
-
-            if !(matches.get_flag(options::MODIFICATION)
-                || time.contains(&"modify".to_owned())
-                || time.contains(&"mtime".to_owned()))
-            {
-                mtime = st.1;
-            }
-        }
-
-        // sets the file access and modification times for a file or a symbolic link.
-        // The filename, access time (atime), and modification time (mtime) are provided as inputs.
-
-        // If the filename is not "-", indicating a special case for touch -h -,
-        // the code checks if the NO_DEREF flag is set, which means the user wants to
-        // set the times for a symbolic link itself, rather than the file it points to.
-        if filename == "-" {
-            filetime::set_file_times(path, atime, mtime)
-        } else if matches.get_flag(options::NO_DEREF) {
-            set_symlink_file_times(path, atime, mtime)
-        } else {
-            set_file_times(path, atime, mtime)
-        }
-        .map_err_context(|| format!("setting times of {}", path.quote()))?;
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .disable_help_flag(true)
-        .arg(
-            Arg::new(options::HELP)
-                .long(options::HELP)
-                .help("Print help information.")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new(options::ACCESS)
-                .short('a')
-                .help("change only the access time")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::sources::TIMESTAMP)
-                .short('t')
-                .help("use [[CC]YY]MMDDhhmm[.ss] instead of the current time")
-                .value_name("STAMP"),
-        )
-        .arg(
-            Arg::new(options::sources::DATE)
-                .short('d')
-                .long(options::sources::DATE)
-                .allow_hyphen_values(true)
-                .help("parse argument and use it instead of current time")
-                .value_name("STRING")
-                .conflicts_with(options::sources::TIMESTAMP),
-        )
-        .arg(
-            Arg::new(options::MODIFICATION)
-                .short('m')
-                .help("change only the modification time")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NO_CREATE)
-                .short('c')
-                .long(options::NO_CREATE)
-                .help("do not create any files")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NO_DEREF)
-                .short('h')
-                .long(options::NO_DEREF)
-                .help(
-                    "affect each symbolic link instead of any referenced file \
-                     (only for systems that can change the timestamps of a symlink)",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::sources::REFERENCE)
-                .short('r')
-                .long(options::sources::REFERENCE)
-                .help("use this file's times instead of the current time")
-                .value_name("FILE")
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::AnyPath)
-                .conflicts_with(options::sources::TIMESTAMP),
-        )
-        .arg(
-            Arg::new(options::TIME)
-                .long(options::TIME)
-                .help(
-                    "change only the specified time: \"access\", \"atime\", or \
-                     \"use\" are equivalent to -a; \"modify\" or \"mtime\" are \
-                     equivalent to -m",
-                )
-                .value_name("WORD")
-                .value_parser(["access", "atime", "use", "modify", "mtime"]),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .num_args(1..)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-        .group(
-            ArgGroup::new(options::SOURCES)
-                .args([
-                    options::sources::TIMESTAMP,
-                    options::sources::DATE,
-                    options::sources::REFERENCE,
-                ])
-                .multiple(true),
-        )
-}
-
-// Get metadata of the provided path
-// If `follow` is `true`, the function will try to follow symlinks
-// If `follow` is `false` or the symlink is broken, the function will return metadata of the symlink itself
-fn stat(path: &Path, follow: bool) -> UResult<(FileTime, FileTime)> {
-    let metadata = match fs::metadata(path) {
-        Ok(metadata) => metadata,
-        Err(e) if e.kind() == std::io::ErrorKind::NotFound && !follow => fs::symlink_metadata(path)
-            .map_err_context(|| format!("failed to get attributes of {}", path.quote()))?,
-        Err(e) => return Err(e.into()),
-    };
-
-    Ok((
-        FileTime::from_last_access_time(&metadata),
-        FileTime::from_last_modification_time(&metadata),
-    ))
-}
-
-fn parse_date(s: &str) -> UResult<FileTime> {
-    // This isn't actually compatible with GNU touch, but there doesn't seem to
-    // be any simple specification for what format this parameter allows and I'm
-    // not about to implement GNU parse_datetime.
-    // http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/parse-datetime.y
-
-    // TODO: match on char count?
-
-    // "The preferred date and time representation for the current locale."
-    // "(In the POSIX locale this is equivalent to %a %b %e %H:%M:%S %Y.)"
-    // time 0.1.43 parsed this as 'a b e T Y'
-    // which is equivalent to the POSIX locale: %a %b %e %H:%M:%S %Y
-    // Tue Dec  3 ...
-    // ("%c", POSIX_LOCALE_FORMAT),
-    //
-    if let Ok(parsed) = Local.datetime_from_str(s, format::POSIX_LOCALE) {
-        return Ok(datetime_to_filetime(&parsed));
-    }
-
-    // Also support other formats found in the GNU tests like
-    // in tests/misc/stat-nanoseconds.sh
-    // or tests/touch/no-rights.sh
-    for fmt in [
-        format::YYYYMMDDHHMMS,
-        format::YYYYMMDDHHMMSS,
-        format::YYYY_MM_DD_HH_MM,
-        format::YYYYMMDDHHMM_OFFSET,
-    ] {
-        if let Ok(parsed) = Utc.datetime_from_str(s, fmt) {
-            return Ok(datetime_to_filetime(&parsed));
-        }
-    }
-
-    // "Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99)"
-    // ("%F", ISO_8601_FORMAT),
-    if let Ok(parsed_date) = NaiveDate::parse_from_str(s, format::ISO_8601) {
-        let parsed = Local
-            .from_local_datetime(&parsed_date.and_time(NaiveTime::MIN))
-            .unwrap();
-        return Ok(datetime_to_filetime(&parsed));
-    }
-
-    // "@%s" is "The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). (TZ) (Calculated from mktime(tm).)"
-    if s.bytes().next() == Some(b'@') {
-        if let Ok(ts) = &s[1..].parse::<i64>() {
-            return Ok(FileTime::from_unix_time(*ts, 0));
-        }
-    }
-
-    if let Ok(duration) = parse_datetime::from_str(s) {
-        let dt = Local::now() + duration;
-        return Ok(datetime_to_filetime(&dt));
-    }
-
-    Err(USimpleError::new(1, format!("Unable to parse date: {s}")))
-}
-
-fn parse_timestamp(s: &str) -> UResult<FileTime> {
-    use format::*;
-
-    let current_year = || Local::now().year();
-
-    let (format, ts) = match s.chars().count() {
-        15 => (YYYYMMDDHHMM_DOT_SS, s.to_owned()),
-        12 => (YYYYMMDDHHMM, s.to_owned()),
-        // If we don't add "20", we have insufficient information to parse
-        13 => (YYYYMMDDHHMM_DOT_SS, format!("20{}", s)),
-        10 => (YYYYMMDDHHMM, format!("20{}", s)),
-        11 => (YYYYMMDDHHMM_DOT_SS, format!("{}{}", current_year(), s)),
-        8 => (YYYYMMDDHHMM, format!("{}{}", current_year(), s)),
-        _ => {
-            return Err(USimpleError::new(
-                1,
-                format!("invalid date format {}", s.quote()),
-            ))
-        }
-    };
-
-    let mut local = chrono::Local
-        .datetime_from_str(&ts, format)
-        .map_err(|_| USimpleError::new(1, format!("invalid date ts format {}", ts.quote())))?;
-
-    // Chrono caps seconds at 59, but 60 is valid. It might be a leap second
-    // or wrap to the next minute. But that doesn't really matter, because we
-    // only care about the timestamp anyway.
-    // Tested in gnu/tests/touch/60-seconds
-    if local.second() == 59 && ts.ends_with(".60") {
-        local += Duration::seconds(1);
-    }
-
-    // Due to daylight saving time switch, local time can jump from 1:59 AM to
-    // 3:00 AM, in which case any time between 2:00 AM and 2:59 AM is not
-    // valid. If we are within this jump, chrono takes the offset from before
-    // the jump. If we then jump forward an hour, we get the new corrected
-    // offset. Jumping back will then now correctly take the jump into account.
-    let local2 = local + Duration::hours(1) - Duration::hours(1);
-    if local.hour() != local2.hour() {
-        return Err(USimpleError::new(
-            1,
-            format!("invalid date format {}", s.quote()),
-        ));
-    }
-
-    Ok(datetime_to_filetime(&local))
-}
-
-// TODO: this may be a good candidate to put in fsext.rs
-/// Returns a PathBuf to stdout.
-///
-/// On Windows, uses GetFinalPathNameByHandleW to attempt to get the path
-/// from the stdout handle.
-fn pathbuf_from_stdout() -> UResult<PathBuf> {
-    #[cfg(all(unix, not(target_os = "android")))]
-    {
-        Ok(PathBuf::from("/dev/stdout"))
-    }
-    #[cfg(target_os = "android")]
-    {
-        Ok(PathBuf::from("/proc/self/fd/1"))
-    }
-    #[cfg(windows)]
-    {
-        use std::os::windows::prelude::AsRawHandle;
-        use windows_sys::Win32::Foundation::{
-            GetLastError, ERROR_INVALID_PARAMETER, ERROR_NOT_ENOUGH_MEMORY, ERROR_PATH_NOT_FOUND,
-            HANDLE, MAX_PATH,
-        };
-        use windows_sys::Win32::Storage::FileSystem::{
-            GetFinalPathNameByHandleW, FILE_NAME_OPENED,
-        };
-
-        let handle = std::io::stdout().lock().as_raw_handle() as HANDLE;
-        let mut file_path_buffer: [u16; MAX_PATH as usize] = [0; MAX_PATH as usize];
-
-        // https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlea#examples
-        // SAFETY: We transmute the handle to be able to cast *mut c_void into a
-        // HANDLE (i32) so rustc will let us call GetFinalPathNameByHandleW. The
-        // reference example code for GetFinalPathNameByHandleW implies that
-        // it is safe for us to leave lpszfilepath uninitialized, so long as
-        // the buffer size is correct. We know the buffer size (MAX_PATH) at
-        // compile time. MAX_PATH is a small number (260) so we can cast it
-        // to a u32.
-        let ret = unsafe {
-            GetFinalPathNameByHandleW(
-                handle,
-                file_path_buffer.as_mut_ptr(),
-                file_path_buffer.len() as u32,
-                FILE_NAME_OPENED,
-            )
-        };
-
-        let buffer_size = match ret {
-            ERROR_PATH_NOT_FOUND | ERROR_NOT_ENOUGH_MEMORY | ERROR_INVALID_PARAMETER => {
-                return Err(USimpleError::new(
-                    1,
-                    format!("GetFinalPathNameByHandleW failed with code {ret}"),
-                ))
-            }
-            e if e == 0 => {
-                return Err(USimpleError::new(
-                    1,
-                    format!(
-                        "GetFinalPathNameByHandleW failed with code {}",
-                        // SAFETY: GetLastError is thread-safe and has no documented memory unsafety.
-                        unsafe { GetLastError() }
-                    ),
-                ));
-            }
-            e => e as usize,
-        };
-
-        // Don't include the null terminator
-        Ok(String::from_utf16(&file_path_buffer[0..buffer_size])
-            .map_err(|e| USimpleError::new(1, e.to_string()))?
-            .into())
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    #[cfg(windows)]
-    #[test]
-    fn test_get_pathbuf_from_stdout_fails_if_stdout_is_not_a_file() {
-        // We can trigger an error by not setting stdout to anything (will
-        // fail with code 1)
-        assert!(super::pathbuf_from_stdout()
-            .expect_err("pathbuf_from_stdout should have failed")
-            .to_string()
-            .contains("GetFinalPathNameByHandleW failed with code 1"));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tr/convert.rs.html b/coreutils/dev/src/uu_tr/convert.rs.html deleted file mode 100644 index f6468af74..000000000 --- a/coreutils/dev/src/uu_tr/convert.rs.html +++ /dev/null @@ -1,73 +0,0 @@ -convert.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (strings) anychar combinator
-
-use nom::{
-    branch::alt,
-    bytes::complete::tag,
-    character::complete::{anychar, one_of},
-    combinator::{map_opt, recognize},
-    multi::{many0, many_m_n},
-    sequence::preceded,
-    IResult,
-};
-
-fn parse_octal(input: &str) -> IResult<&str, char> {
-    map_opt(
-        preceded(tag("\\"), recognize(many_m_n(1, 3, one_of("01234567")))),
-        |out: &str| {
-            u32::from_str_radix(out, 8)
-                .map(std::char::from_u32)
-                .ok()
-                .flatten()
-        },
-    )(input)
-}
-
-pub fn reduce_octal_to_char(input: &str) -> String {
-    many0(alt((parse_octal, anychar)))(input)
-        .map(|(_, r)| r)
-        .unwrap()
-        .into_iter()
-        .collect()
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tr/operation.rs.html b/coreutils/dev/src/uu_tr/operation.rs.html deleted file mode 100644 index 52f3e4a32..000000000 --- a/coreutils/dev/src/uu_tr/operation.rs.html +++ /dev/null @@ -1,1107 +0,0 @@ -operation.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (strings) anychar combinator Alnum Punct Xdigit alnum punct xdigit cntrl
-
-use nom::{
-    branch::alt,
-    bytes::complete::tag,
-    character::complete::{anychar, digit1},
-    combinator::{map, peek, value},
-    multi::many0,
-    sequence::{delimited, preceded, separated_pair},
-    IResult,
-};
-use std::{
-    collections::{HashMap, HashSet},
-    error::Error,
-    fmt::{Debug, Display},
-    io::{BufRead, Write},
-};
-use uucore::error::UError;
-
-use crate::unicode_table;
-
-#[derive(Debug, Clone)]
-pub enum BadSequence {
-    MissingCharClassName,
-    MissingEquivalentClassChar,
-    MultipleCharRepeatInSet2,
-    CharRepeatInSet1,
-    InvalidRepeatCount(String),
-    EmptySet2WhenNotTruncatingSet1,
-}
-
-impl Display for BadSequence {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::MissingCharClassName => write!(f, "missing character class name '[::]'"),
-            Self::MissingEquivalentClassChar => {
-                write!(f, "missing equivalence class character '[==]'")
-            }
-            Self::MultipleCharRepeatInSet2 => {
-                write!(f, "only one [c*] repeat construct may appear in string2")
-            }
-            Self::CharRepeatInSet1 => {
-                write!(f, "the [c*] repeat construct may not appear in string1")
-            }
-            Self::InvalidRepeatCount(count) => {
-                write!(f, "invalid repeat count '{count}' in [c*n] construct")
-            }
-            Self::EmptySet2WhenNotTruncatingSet1 => {
-                write!(f, "when not truncating set1, string2 must be non-empty")
-            }
-        }
-    }
-}
-
-impl Error for BadSequence {}
-impl UError for BadSequence {}
-
-#[derive(Debug, Clone, Copy)]
-pub enum Sequence {
-    Char(char),
-    CharRange(u32, u32),
-    CharStar(char),
-    CharRepeat(char, usize),
-    Alnum,
-    Alpha,
-    Blank,
-    Control,
-    Digit,
-    Graph,
-    Lower,
-    Print,
-    Punct,
-    Space,
-    Upper,
-    Xdigit,
-}
-
-impl Sequence {
-    pub fn flatten(&self) -> Box<dyn Iterator<Item = char>> {
-        match self {
-            Self::Char(c) => Box::new(std::iter::once(*c)),
-            Self::CharRange(l, r) => Box::new((*l..=*r).flat_map(std::char::from_u32)),
-            Self::CharStar(c) => Box::new(std::iter::repeat(*c)),
-            Self::CharRepeat(c, n) => Box::new(std::iter::repeat(*c).take(*n)),
-            Self::Alnum => Box::new(('0'..='9').chain('A'..='Z').chain('a'..='z')),
-            Self::Alpha => Box::new(('A'..='Z').chain('a'..='z')),
-            Self::Blank => Box::new(unicode_table::BLANK.iter().cloned()),
-            Self::Control => Box::new(
-                (0..=31)
-                    .chain(std::iter::once(127))
-                    .flat_map(std::char::from_u32),
-            ),
-            Self::Digit => Box::new('0'..='9'),
-            Self::Graph => Box::new(
-                (48..=57) // digit
-                    .chain(65..=90) // uppercase
-                    .chain(97..=122) // lowercase
-                    // punctuations
-                    .chain(33..=47)
-                    .chain(58..=64)
-                    .chain(91..=96)
-                    .chain(123..=126)
-                    .chain(std::iter::once(32)) // space
-                    .flat_map(std::char::from_u32),
-            ),
-            Self::Lower => Box::new('a'..='z'),
-            Self::Print => Box::new(
-                (48..=57) // digit
-                    .chain(65..=90) // uppercase
-                    .chain(97..=122) // lowercase
-                    // punctuations
-                    .chain(33..=47)
-                    .chain(58..=64)
-                    .chain(91..=96)
-                    .chain(123..=126)
-                    .flat_map(std::char::from_u32),
-            ),
-            Self::Punct => Box::new(
-                (33..=47)
-                    .chain(58..=64)
-                    .chain(91..=96)
-                    .chain(123..=126)
-                    .flat_map(std::char::from_u32),
-            ),
-            Self::Space => Box::new(unicode_table::SPACES.iter().cloned()),
-            Self::Upper => Box::new('A'..='Z'),
-            Self::Xdigit => Box::new(('0'..='9').chain('A'..='F').chain('a'..='f')),
-        }
-    }
-
-    // Hide all the nasty sh*t in here
-    // TODO: Make the 2 set lazily generate the character mapping as necessary.
-    pub fn solve_set_characters(
-        set1_str: &str,
-        set2_str: &str,
-        truncate_set1_flag: bool,
-    ) -> Result<(Vec<char>, Vec<char>), BadSequence> {
-        let set1 = Self::from_str(set1_str)?;
-        let set2 = Self::from_str(set2_str)?;
-
-        let is_char_star = |s: &&Self| -> bool { matches!(s, Self::CharStar(_)) };
-        let set1_star_count = set1.iter().filter(is_char_star).count();
-        if set1_star_count == 0 {
-            let set2_star_count = set2.iter().filter(is_char_star).count();
-            if set2_star_count < 2 {
-                let char_star = set2.iter().find_map(|s| match s {
-                    Self::CharStar(c) => Some(c),
-                    _ => None,
-                });
-                let mut partition = set2.as_slice().split(|s| matches!(s, Self::CharStar(_)));
-                let set1_len = set1.iter().flat_map(Self::flatten).count();
-                let set2_len = set2
-                    .iter()
-                    .filter_map(|s| match s {
-                        Self::CharStar(_) => None,
-                        r => Some(r),
-                    })
-                    .flat_map(Self::flatten)
-                    .count();
-                let star_compensate_len = set1_len.saturating_sub(set2_len);
-                let (left, right) = (partition.next(), partition.next());
-                let set2_solved: Vec<char> = match (left, right) {
-                    (None, None) => match char_star {
-                        Some(c) => std::iter::repeat(*c).take(star_compensate_len).collect(),
-                        None => std::iter::empty().collect(),
-                    },
-                    (None, Some(set2_b)) => {
-                        if let Some(c) = char_star {
-                            std::iter::repeat(*c)
-                                .take(star_compensate_len)
-                                .chain(set2_b.iter().flat_map(Self::flatten))
-                                .collect()
-                        } else {
-                            set2_b.iter().flat_map(Self::flatten).collect()
-                        }
-                    }
-                    (Some(set2_a), None) => match char_star {
-                        Some(c) => set2_a
-                            .iter()
-                            .flat_map(Self::flatten)
-                            .chain(std::iter::repeat(*c).take(star_compensate_len))
-                            .collect(),
-                        None => set2_a.iter().flat_map(Self::flatten).collect(),
-                    },
-                    (Some(set2_a), Some(set2_b)) => match char_star {
-                        Some(c) => set2_a
-                            .iter()
-                            .flat_map(Self::flatten)
-                            .chain(std::iter::repeat(*c).take(star_compensate_len))
-                            .chain(set2_b.iter().flat_map(Self::flatten))
-                            .collect(),
-                        None => set2_a
-                            .iter()
-                            .chain(set2_b.iter())
-                            .flat_map(Self::flatten)
-                            .collect(),
-                    },
-                };
-                let mut set1_solved: Vec<char> = set1.iter().flat_map(Self::flatten).collect();
-                if truncate_set1_flag {
-                    set1_solved.truncate(set2_solved.len());
-                }
-                Ok((set1_solved, set2_solved))
-            } else {
-                Err(BadSequence::MultipleCharRepeatInSet2)
-            }
-        } else {
-            Err(BadSequence::CharRepeatInSet1)
-        }
-    }
-}
-
-impl Sequence {
-    pub fn from_str(input: &str) -> Result<Vec<Self>, BadSequence> {
-        many0(alt((
-            Self::parse_char_range,
-            Self::parse_char_star,
-            Self::parse_char_repeat,
-            Self::parse_class,
-            Self::parse_char_equal,
-            // NOTE: This must be the last one
-            map(Self::parse_backslash_or_char, |s| Ok(Self::Char(s))),
-        )))(input)
-        .map(|(_, r)| r)
-        .unwrap()
-        .into_iter()
-        .collect::<Result<Vec<_>, _>>()
-    }
-
-    fn parse_backslash(input: &str) -> IResult<&str, char> {
-        preceded(tag("\\"), anychar)(input).map(|(l, a)| {
-            let c = match a {
-                'a' => unicode_table::BEL,
-                'b' => unicode_table::BS,
-                'f' => unicode_table::FF,
-                'n' => unicode_table::LF,
-                'r' => unicode_table::CR,
-                't' => unicode_table::HT,
-                'v' => unicode_table::VT,
-                x => x,
-            };
-            (l, c)
-        })
-    }
-
-    fn parse_backslash_or_char(input: &str) -> IResult<&str, char> {
-        alt((Self::parse_backslash, anychar))(input)
-    }
-
-    fn parse_char_range(input: &str) -> IResult<&str, Result<Self, BadSequence>> {
-        separated_pair(
-            Self::parse_backslash_or_char,
-            tag("-"),
-            Self::parse_backslash_or_char,
-        )(input)
-        .map(|(l, (a, b))| {
-            (l, {
-                let (start, end) = (u32::from(a), u32::from(b));
-                Ok(Self::CharRange(start, end))
-            })
-        })
-    }
-
-    fn parse_char_star(input: &str) -> IResult<&str, Result<Self, BadSequence>> {
-        delimited(tag("["), Self::parse_backslash_or_char, tag("*]"))(input)
-            .map(|(l, a)| (l, Ok(Self::CharStar(a))))
-    }
-
-    fn parse_char_repeat(input: &str) -> IResult<&str, Result<Self, BadSequence>> {
-        delimited(
-            tag("["),
-            separated_pair(Self::parse_backslash_or_char, tag("*"), digit1),
-            tag("]"),
-        )(input)
-        .map(|(l, (c, cnt_str))| {
-            let result = if cnt_str.starts_with('0') {
-                match usize::from_str_radix(cnt_str, 8) {
-                    Ok(0) => Ok(Self::CharStar(c)),
-                    Ok(count) => Ok(Self::CharRepeat(c, count)),
-                    Err(_) => Err(BadSequence::InvalidRepeatCount(cnt_str.to_string())),
-                }
-            } else {
-                match cnt_str.parse::<usize>() {
-                    Ok(0) => Ok(Self::CharStar(c)),
-                    Ok(count) => Ok(Self::CharRepeat(c, count)),
-                    Err(_) => Err(BadSequence::InvalidRepeatCount(cnt_str.to_string())),
-                }
-            };
-            (l, result)
-        })
-    }
-
-    fn parse_class(input: &str) -> IResult<&str, Result<Self, BadSequence>> {
-        delimited(
-            tag("[:"),
-            alt((
-                map(
-                    alt((
-                        value(Self::Alnum, tag("alnum")),
-                        value(Self::Alpha, tag("alpha")),
-                        value(Self::Blank, tag("blank")),
-                        value(Self::Control, tag("cntrl")),
-                        value(Self::Digit, tag("digit")),
-                        value(Self::Graph, tag("graph")),
-                        value(Self::Lower, tag("lower")),
-                        value(Self::Print, tag("print")),
-                        value(Self::Punct, tag("punct")),
-                        value(Self::Space, tag("space")),
-                        value(Self::Upper, tag("upper")),
-                        value(Self::Xdigit, tag("xdigit")),
-                    )),
-                    Ok,
-                ),
-                value(Err(BadSequence::MissingCharClassName), tag("")),
-            )),
-            tag(":]"),
-        )(input)
-    }
-
-    fn parse_char_equal(input: &str) -> IResult<&str, Result<Self, BadSequence>> {
-        delimited(
-            tag("[="),
-            alt((
-                value(
-                    Err(BadSequence::MissingEquivalentClassChar),
-                    peek(tag("=]")),
-                ),
-                map(Self::parse_backslash_or_char, |c| Ok(Self::Char(c))),
-            )),
-            tag("=]"),
-        )(input)
-    }
-}
-
-pub trait SymbolTranslator {
-    fn translate(&mut self, current: char) -> Option<char>;
-}
-
-#[derive(Debug)]
-pub struct DeleteOperation {
-    set: Vec<char>,
-    complement_flag: bool,
-}
-
-impl DeleteOperation {
-    pub fn new(set: Vec<char>, complement_flag: bool) -> Self {
-        Self {
-            set,
-            complement_flag,
-        }
-    }
-}
-
-impl SymbolTranslator for DeleteOperation {
-    fn translate(&mut self, current: char) -> Option<char> {
-        let found = self.set.iter().any(|sequence| sequence.eq(&current));
-        if self.complement_flag == found {
-            Some(current)
-        } else {
-            None
-        }
-    }
-}
-
-pub struct TranslateOperationComplement {
-    iter: u32,
-    set2_iter: usize,
-    set1: Vec<char>,
-    set2: Vec<char>,
-    translation_map: HashMap<char, char>,
-}
-
-impl TranslateOperationComplement {
-    fn new(set1: Vec<char>, set2: Vec<char>) -> Self {
-        Self {
-            iter: 0,
-            set2_iter: 0,
-            set1,
-            set2,
-            translation_map: HashMap::new(),
-        }
-    }
-}
-
-#[derive(Debug)]
-pub struct TranslateOperationStandard {
-    translation_map: HashMap<char, char>,
-}
-
-impl TranslateOperationStandard {
-    fn new(set1: Vec<char>, set2: Vec<char>) -> Result<Self, BadSequence> {
-        if let Some(fallback) = set2.last().copied() {
-            Ok(Self {
-                translation_map: set1
-                    .into_iter()
-                    .zip(set2.into_iter().chain(std::iter::repeat(fallback)))
-                    .collect::<HashMap<_, _>>(),
-            })
-        } else if set1.is_empty() && set2.is_empty() {
-            Ok(Self {
-                translation_map: HashMap::new(),
-            })
-        } else {
-            Err(BadSequence::EmptySet2WhenNotTruncatingSet1)
-        }
-    }
-}
-
-pub enum TranslateOperation {
-    Standard(TranslateOperationStandard),
-    Complement(TranslateOperationComplement),
-}
-
-impl TranslateOperation {
-    fn next_complement_char(iter: u32, ignore_list: &[char]) -> (u32, char) {
-        (iter..)
-            .filter_map(std::char::from_u32)
-            .filter(|c| !ignore_list.iter().any(|s| s.eq(c)))
-            .map(|c| (u32::from(c) + 1, c))
-            .next()
-            .expect("exhausted all possible characters")
-    }
-}
-
-impl TranslateOperation {
-    pub fn new(set1: Vec<char>, set2: Vec<char>, complement: bool) -> Result<Self, BadSequence> {
-        if complement {
-            Ok(Self::Complement(TranslateOperationComplement::new(
-                set1, set2,
-            )))
-        } else {
-            Ok(Self::Standard(TranslateOperationStandard::new(set1, set2)?))
-        }
-    }
-}
-
-impl SymbolTranslator for TranslateOperation {
-    fn translate(&mut self, current: char) -> Option<char> {
-        match self {
-            Self::Standard(TranslateOperationStandard { translation_map }) => Some(
-                translation_map
-                    .iter()
-                    .find_map(|(l, r)| if l.eq(&current) { Some(*r) } else { None })
-                    .unwrap_or(current),
-            ),
-            Self::Complement(TranslateOperationComplement {
-                iter,
-                set2_iter,
-                set1,
-                set2,
-                translation_map,
-            }) => {
-                // First, try to see if current char is already mapped
-                // If so, return the mapped char
-                // Else, pop from set2
-                // If we popped something, map the next complement character to this value
-                // If set2 is empty, we just map the current char directly to fallback --- to avoid looping unnecessarily
-                if let Some(c) = set1.iter().find(|c| c.eq(&&current)) {
-                    Some(*c)
-                } else {
-                    while translation_map.get(&current).is_none() {
-                        if let Some(value) = set2.get(*set2_iter) {
-                            let (next_iter, next_key) = Self::next_complement_char(*iter, &*set1);
-                            *iter = next_iter;
-                            *set2_iter = set2_iter.saturating_add(1);
-                            translation_map.insert(next_key, *value);
-                        } else {
-                            translation_map.insert(current, *set2.last().unwrap());
-                        }
-                    }
-                    Some(*translation_map.get(&current).unwrap())
-                }
-            }
-        }
-    }
-}
-
-#[derive(Debug, Clone)]
-pub struct SqueezeOperation {
-    set1: HashSet<char>,
-    complement: bool,
-    previous: Option<char>,
-}
-
-impl SqueezeOperation {
-    pub fn new(set1: Vec<char>, complement: bool) -> Self {
-        Self {
-            set1: set1.into_iter().collect(),
-            complement,
-            previous: None,
-        }
-    }
-}
-
-impl SymbolTranslator for SqueezeOperation {
-    fn translate(&mut self, current: char) -> Option<char> {
-        if self.complement {
-            let next = if self.set1.contains(&current) {
-                Some(current)
-            } else {
-                match self.previous {
-                    Some(v) => {
-                        if v.eq(&current) {
-                            None
-                        } else {
-                            Some(current)
-                        }
-                    }
-                    None => Some(current),
-                }
-            };
-            self.previous = Some(current);
-            next
-        } else {
-            let next = if self.set1.contains(&current) {
-                match self.previous {
-                    Some(v) if v == current => None,
-                    _ => Some(current),
-                }
-            } else {
-                Some(current)
-            };
-            self.previous = Some(current);
-            next
-        }
-    }
-}
-
-pub fn translate_input<T, R, W>(input: &mut R, output: &mut W, mut translator: T)
-where
-    T: SymbolTranslator,
-    R: BufRead,
-    W: Write,
-{
-    let mut buf = String::new();
-    let mut output_buf = String::new();
-    while let Ok(length) = input.read_line(&mut buf) {
-        if length == 0 {
-            break;
-        } else {
-            let filtered = buf.chars().filter_map(|c| translator.translate(c));
-            output_buf.extend(filtered);
-            output.write_all(output_buf.as_bytes()).unwrap();
-        }
-        buf.clear();
-        output_buf.clear();
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tr/tr.rs.html b/coreutils/dev/src/uu_tr/tr.rs.html deleted file mode 100644 index 1428b68b0..000000000 --- a/coreutils/dev/src/uu_tr/tr.rs.html +++ /dev/null @@ -1,339 +0,0 @@ -tr.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) allocs bset dflag cflag sflag tflag
-
-mod convert;
-mod operation;
-mod unicode_table;
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use nom::AsBytes;
-use operation::{translate_input, Sequence, SqueezeOperation, TranslateOperation};
-use std::io::{stdin, stdout, BufReader, BufWriter};
-use uucore::{format_usage, help_about, help_section, help_usage, show};
-
-use crate::operation::DeleteOperation;
-use uucore::display::Quotable;
-use uucore::error::{UResult, USimpleError, UUsageError};
-
-const ABOUT: &str = help_about!("tr.md");
-const AFTER_HELP: &str = help_section!("after help", "tr.md");
-const USAGE: &str = help_usage!("tr.md");
-
-mod options {
-    pub const COMPLEMENT: &str = "complement";
-    pub const DELETE: &str = "delete";
-    pub const SQUEEZE: &str = "squeeze-repeats";
-    pub const TRUNCATE_SET1: &str = "truncate-set1";
-    pub const SETS: &str = "sets";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().after_help(AFTER_HELP).try_get_matches_from(args)?;
-
-    let delete_flag = matches.get_flag(options::DELETE);
-    let complement_flag = matches.get_flag(options::COMPLEMENT);
-    let squeeze_flag = matches.get_flag(options::SQUEEZE);
-    let truncate_set1_flag = matches.get_flag(options::TRUNCATE_SET1);
-
-    let sets = matches
-        .get_many::<String>(options::SETS)
-        .map(|v| {
-            v.map(ToString::to_string)
-                .map(|input| convert::reduce_octal_to_char(&input))
-                .collect::<Vec<_>>()
-        })
-        .unwrap_or_default();
-    let sets_len = sets.len();
-
-    if sets.is_empty() {
-        return Err(UUsageError::new(1, "missing operand"));
-    }
-
-    if !(delete_flag || squeeze_flag) && sets_len < 2 {
-        return Err(UUsageError::new(
-            1,
-            format!("missing operand after {}", sets[0].quote()),
-        ));
-    }
-
-    if let Some(first) = sets.get(0) {
-        if first.ends_with('\\') {
-            show!(USimpleError::new(
-                0,
-                "warning: an unescaped backslash at end of string is not portable"
-            ));
-        }
-    }
-
-    let stdin = stdin();
-    let mut locked_stdin = stdin.lock();
-    let stdout = stdout();
-    let locked_stdout = stdout.lock();
-    let mut buffered_stdout = BufWriter::new(locked_stdout);
-
-    let mut sets_iter = sets.iter().map(|c| c.as_str());
-    let (set1, set2) = Sequence::solve_set_characters(
-        sets_iter.next().unwrap_or_default(),
-        sets_iter.next().unwrap_or_default(),
-        truncate_set1_flag,
-    )?;
-
-    if delete_flag {
-        if squeeze_flag {
-            let mut delete_buffer = vec![];
-            {
-                let mut delete_writer = BufWriter::new(&mut delete_buffer);
-                let delete_op = DeleteOperation::new(set1, complement_flag);
-                translate_input(&mut locked_stdin, &mut delete_writer, delete_op);
-            }
-            {
-                let mut squeeze_reader = BufReader::new(delete_buffer.as_bytes());
-                let op = SqueezeOperation::new(set2, complement_flag);
-                translate_input(&mut squeeze_reader, &mut buffered_stdout, op);
-            }
-        } else {
-            let op = DeleteOperation::new(set1, complement_flag);
-            translate_input(&mut locked_stdin, &mut buffered_stdout, op);
-        }
-    } else if squeeze_flag {
-        if sets_len < 2 {
-            let op = SqueezeOperation::new(set1, complement_flag);
-            translate_input(&mut locked_stdin, &mut buffered_stdout, op);
-        } else {
-            let mut translate_buffer = vec![];
-            {
-                let mut writer = BufWriter::new(&mut translate_buffer);
-                let op = TranslateOperation::new(set1, set2.clone(), complement_flag)?;
-                translate_input(&mut locked_stdin, &mut writer, op);
-            }
-            {
-                let mut reader = BufReader::new(translate_buffer.as_bytes());
-                let squeeze_op = SqueezeOperation::new(set2, false);
-                translate_input(&mut reader, &mut buffered_stdout, squeeze_op);
-            }
-        }
-    } else {
-        let op = TranslateOperation::new(set1, set2, complement_flag)?;
-        translate_input(&mut locked_stdin, &mut buffered_stdout, op);
-    }
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::COMPLEMENT)
-                .visible_short_alias('C')
-                .short('c')
-                .long(options::COMPLEMENT)
-                .help("use the complement of SET1")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DELETE)
-                .short('d')
-                .long(options::DELETE)
-                .help("delete characters in SET1, do not translate")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SQUEEZE)
-                .long(options::SQUEEZE)
-                .short('s')
-                .help(
-                    "replace each sequence of a repeated character that is \
-                     listed in the last specified SET, with a single occurrence \
-                     of that character",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::TRUNCATE_SET1)
-                .long(options::TRUNCATE_SET1)
-                .short('t')
-                .help("first truncate SET1 to length of SET2")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(Arg::new(options::SETS).num_args(1..=2))
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tr/unicode_table.rs.html b/coreutils/dev/src/uu_tr/unicode_table.rs.html deleted file mode 100644 index b421b42bd..000000000 --- a/coreutils/dev/src/uu_tr/unicode_table.rs.html +++ /dev/null @@ -1,31 +0,0 @@ -unicode_table.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-pub static BEL: char = '\u{0007}';
-pub static BS: char = '\u{0008}';
-pub static HT: char = '\u{0009}';
-pub static LF: char = '\u{000A}';
-pub static VT: char = '\u{000B}';
-pub static FF: char = '\u{000C}';
-pub static CR: char = '\u{000D}';
-pub static SPACE: char = '\u{0020}';
-pub static SPACES: &[char] = &[HT, LF, VT, FF, CR, SPACE];
-pub static BLANK: &[char] = &[SPACE, HT];
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_true/true.rs.html b/coreutils/dev/src/uu_true/true.rs.html deleted file mode 100644 index fd74c21fd..000000000 --- a/coreutils/dev/src/uu_true/true.rs.html +++ /dev/null @@ -1,129 +0,0 @@ -true.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Jordi Boggiano <j.boggiano@seld.be>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-use clap::{Arg, ArgAction, Command};
-use std::{ffi::OsString, io::Write};
-use uucore::error::{set_exit_code, UResult};
-use uucore::help_about;
-
-const ABOUT: &str = help_about!("true.md");
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let mut command = uu_app();
-
-    let args: Vec<OsString> = args.collect();
-    if args.len() > 2 {
-        return Ok(());
-    }
-
-    if let Err(e) = command.try_get_matches_from_mut(args) {
-        let error = match e.kind() {
-            clap::error::ErrorKind::DisplayHelp => command.print_help(),
-            clap::error::ErrorKind::DisplayVersion => {
-                writeln!(std::io::stdout(), "{}", command.render_version())
-            }
-            _ => Ok(()),
-        };
-
-        if let Err(print_fail) = error {
-            // Try to display this error.
-            let _ = writeln!(std::io::stderr(), "{}: {}", uucore::util_name(), print_fail);
-            // Mirror GNU options. When failing to print warnings or version flags, then we exit
-            // with FAIL. This avoids allocation some error information which may result in yet
-            // other types of failure.
-            set_exit_code(1);
-        }
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(clap::crate_version!())
-        .about(ABOUT)
-        // We provide our own help and version options, to ensure maximum compatibility with GNU.
-        .disable_help_flag(true)
-        .disable_version_flag(true)
-        .arg(
-            Arg::new("help")
-                .long("help")
-                .help("Print help information")
-                .action(ArgAction::Help),
-        )
-        .arg(
-            Arg::new("version")
-                .long("version")
-                .help("Print version information")
-                .action(ArgAction::Version),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_truncate/truncate.rs.html b/coreutils/dev/src/uu_truncate/truncate.rs.html deleted file mode 100644 index 4484e033b..000000000 --- a/coreutils/dev/src/uu_truncate/truncate.rs.html +++ /dev/null @@ -1,895 +0,0 @@ -truncate.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Alex Lyon <arcterus@mail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) RFILE refsize rfilename fsize tsize
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::fs::{metadata, OpenOptions};
-use std::io::ErrorKind;
-#[cfg(unix)]
-use std::os::unix::fs::FileTypeExt;
-use std::path::Path;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
-use uucore::parse_size::{parse_size, ParseSizeError};
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-#[derive(Debug, Eq, PartialEq)]
-enum TruncateMode {
-    Absolute(u64),
-    Extend(u64),
-    Reduce(u64),
-    AtMost(u64),
-    AtLeast(u64),
-    RoundDown(u64),
-    RoundUp(u64),
-}
-
-impl TruncateMode {
-    /// Compute a target size in bytes for this truncate mode.
-    ///
-    /// `fsize` is the size of the reference file, in bytes.
-    ///
-    /// If the mode is [`TruncateMode::Reduce`] and the value to
-    /// reduce by is greater than `fsize`, then this function returns
-    /// 0 (since it cannot return a negative number).
-    ///
-    /// # Examples
-    ///
-    /// Extending a file of 10 bytes by 5 bytes:
-    ///
-    /// ```rust,ignore
-    /// let mode = TruncateMode::Extend(5);
-    /// let fsize = 10;
-    /// assert_eq!(mode.to_size(fsize), 15);
-    /// ```
-    ///
-    /// Reducing a file by more than its size results in 0:
-    ///
-    /// ```rust,ignore
-    /// let mode = TruncateMode::Reduce(5);
-    /// let fsize = 3;
-    /// assert_eq!(mode.to_size(fsize), 0);
-    /// ```
-    fn to_size(&self, fsize: u64) -> u64 {
-        match self {
-            Self::Absolute(size) => *size,
-            Self::Extend(size) => fsize + size,
-            Self::Reduce(size) => {
-                if *size > fsize {
-                    0
-                } else {
-                    fsize - size
-                }
-            }
-            Self::AtMost(size) => fsize.min(*size),
-            Self::AtLeast(size) => fsize.max(*size),
-            Self::RoundDown(size) => fsize - fsize % size,
-            Self::RoundUp(size) => fsize + fsize % size,
-        }
-    }
-}
-
-const ABOUT: &str = help_about!("truncate.md");
-const AFTER_HELP: &str = help_section!("after help", "truncate.md");
-const USAGE: &str = help_usage!("truncate.md");
-
-pub mod options {
-    pub static IO_BLOCKS: &str = "io-blocks";
-    pub static NO_CREATE: &str = "no-create";
-    pub static REFERENCE: &str = "reference";
-    pub static SIZE: &str = "size";
-    pub static ARG_FILES: &str = "files";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app()
-        .after_help(AFTER_HELP)
-        .try_get_matches_from(args)
-        .map_err(|e| {
-            e.print().expect("Error writing clap::Error");
-            match e.kind() {
-                clap::error::ErrorKind::DisplayHelp | clap::error::ErrorKind::DisplayVersion => 0,
-                _ => 1,
-            }
-        })?;
-
-    let files: Vec<String> = matches
-        .get_many::<String>(options::ARG_FILES)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    if files.is_empty() {
-        return Err(UUsageError::new(1, "missing file operand"));
-    } else {
-        let io_blocks = matches.get_flag(options::IO_BLOCKS);
-        let no_create = matches.get_flag(options::NO_CREATE);
-        let reference = matches
-            .get_one::<String>(options::REFERENCE)
-            .map(String::from);
-        let size = matches.get_one::<String>(options::SIZE).map(String::from);
-        truncate(no_create, io_blocks, reference, size, &files)
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::IO_BLOCKS)
-                .short('o')
-                .long(options::IO_BLOCKS)
-                .help(
-                    "treat SIZE as the number of I/O blocks of the file rather than bytes \
-            (NOT IMPLEMENTED)",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NO_CREATE)
-                .short('c')
-                .long(options::NO_CREATE)
-                .help("do not create files that do not exist")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::REFERENCE)
-                .short('r')
-                .long(options::REFERENCE)
-                .required_unless_present(options::SIZE)
-                .help("base the size of each file on the size of RFILE")
-                .value_name("RFILE")
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::SIZE)
-                .short('s')
-                .long(options::SIZE)
-                .required_unless_present(options::REFERENCE)
-                .help(
-                    "set or adjust the size of each file according to SIZE, which is in \
-            bytes unless --io-blocks is specified",
-                )
-                .value_name("SIZE"),
-        )
-        .arg(
-            Arg::new(options::ARG_FILES)
-                .value_name("FILE")
-                .action(ArgAction::Append)
-                .required(true)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-/// Truncate the named file to the specified size.
-///
-/// If `create` is true, then the file will be created if it does not
-/// already exist. If `size` is larger than the number of bytes in the
-/// file, then the file will be padded with zeros. If `size` is smaller
-/// than the number of bytes in the file, then the file will be
-/// truncated and any bytes beyond `size` will be lost.
-///
-/// # Errors
-///
-/// If the file could not be opened, or there was a problem setting the
-/// size of the file.
-fn file_truncate(filename: &str, create: bool, size: u64) -> std::io::Result<()> {
-    let path = Path::new(filename);
-    let f = OpenOptions::new().write(true).create(create).open(path)?;
-    f.set_len(size)
-}
-
-/// Truncate files to a size relative to a given file.
-///
-/// `rfilename` is the name of the reference file.
-///
-/// `size_string` gives the size relative to the reference file to which
-/// to set the target files. For example, "+3K" means "set each file to
-/// be three kilobytes larger than the size of the reference file".
-///
-/// If `create` is true, then each file will be created if it does not
-/// already exist.
-///
-/// # Errors
-///
-/// If any file could not be opened, or there was a problem setting
-/// the size of at least one file.
-///
-/// If at least one file is a named pipe (also known as a fifo).
-fn truncate_reference_and_size(
-    rfilename: &str,
-    size_string: &str,
-    filenames: &[String],
-    create: bool,
-) -> UResult<()> {
-    let mode = match parse_mode_and_size(size_string) {
-        Err(e) => return Err(USimpleError::new(1, format!("Invalid number: {e}"))),
-        Ok(TruncateMode::Absolute(_)) => {
-            return Err(USimpleError::new(
-                1,
-                String::from("you must specify a relative '--size' with '--reference'"),
-            ))
-        }
-        Ok(m) => m,
-    };
-    if let TruncateMode::RoundDown(0) | TruncateMode::RoundUp(0) = mode {
-        return Err(USimpleError::new(1, "division by zero"));
-    }
-    let metadata = metadata(rfilename).map_err(|e| match e.kind() {
-        ErrorKind::NotFound => USimpleError::new(
-            1,
-            format!(
-                "cannot stat {}: No such file or directory",
-                rfilename.quote()
-            ),
-        ),
-        _ => e.map_err_context(String::new),
-    })?;
-    let fsize = metadata.len();
-    let tsize = mode.to_size(fsize);
-    for filename in filenames {
-        #[cfg(unix)]
-        if std::fs::metadata(filename)?.file_type().is_fifo() {
-            return Err(USimpleError::new(
-                1,
-                format!(
-                    "cannot open {} for writing: No such device or address",
-                    filename.quote()
-                ),
-            ));
-        }
-
-        file_truncate(filename, create, tsize)
-            .map_err_context(|| format!("cannot open {} for writing", filename.quote()))?;
-    }
-    Ok(())
-}
-
-/// Truncate files to match the size of a given reference file.
-///
-/// `rfilename` is the name of the reference file.
-///
-/// If `create` is true, then each file will be created if it does not
-/// already exist.
-///
-/// # Errors
-///
-/// If any file could not be opened, or there was a problem setting
-/// the size of at least one file.
-///
-/// If at least one file is a named pipe (also known as a fifo).
-fn truncate_reference_file_only(
-    rfilename: &str,
-    filenames: &[String],
-    create: bool,
-) -> UResult<()> {
-    let metadata = metadata(rfilename).map_err(|e| match e.kind() {
-        ErrorKind::NotFound => USimpleError::new(
-            1,
-            format!(
-                "cannot stat {}: No such file or directory",
-                rfilename.quote()
-            ),
-        ),
-        _ => e.map_err_context(String::new),
-    })?;
-    let tsize = metadata.len();
-    for filename in filenames {
-        #[cfg(unix)]
-        if std::fs::metadata(filename)?.file_type().is_fifo() {
-            return Err(USimpleError::new(
-                1,
-                format!(
-                    "cannot open {} for writing: No such device or address",
-                    filename.quote()
-                ),
-            ));
-        }
-        file_truncate(filename, create, tsize)
-            .map_err_context(|| format!("cannot open {} for writing", filename.quote()))?;
-    }
-    Ok(())
-}
-
-/// Truncate files to a specified size.
-///
-/// `size_string` gives either an absolute size or a relative size. A
-/// relative size adjusts the size of each file relative to its current
-/// size. For example, "3K" means "set each file to be three kilobytes"
-/// whereas "+3K" means "set each file to be three kilobytes larger than
-/// its current size".
-///
-/// If `create` is true, then each file will be created if it does not
-/// already exist.
-///
-/// # Errors
-///
-/// If any file could not be opened, or there was a problem setting
-/// the size of at least one file.
-///
-/// If at least one file is a named pipe (also known as a fifo).
-fn truncate_size_only(size_string: &str, filenames: &[String], create: bool) -> UResult<()> {
-    let mode = parse_mode_and_size(size_string)
-        .map_err(|e| USimpleError::new(1, format!("Invalid number: {e}")))?;
-    if let TruncateMode::RoundDown(0) | TruncateMode::RoundUp(0) = mode {
-        return Err(USimpleError::new(1, "division by zero"));
-    }
-    for filename in filenames {
-        let fsize = match metadata(filename) {
-            Ok(m) => {
-                #[cfg(unix)]
-                if m.file_type().is_fifo() {
-                    return Err(USimpleError::new(
-                        1,
-                        format!(
-                            "cannot open {} for writing: No such device or address",
-                            filename.quote()
-                        ),
-                    ));
-                }
-                m.len()
-            }
-            Err(_) => 0,
-        };
-        let tsize = mode.to_size(fsize);
-        match file_truncate(filename, create, tsize) {
-            Ok(_) => continue,
-            Err(e) if e.kind() == ErrorKind::NotFound && !create => continue,
-            Err(e) => {
-                return Err(
-                    e.map_err_context(|| format!("cannot open {} for writing", filename.quote()))
-                )
-            }
-        }
-    }
-    Ok(())
-}
-
-fn truncate(
-    no_create: bool,
-    _: bool,
-    reference: Option<String>,
-    size: Option<String>,
-    filenames: &[String],
-) -> UResult<()> {
-    let create = !no_create;
-    // There are four possibilities
-    // - reference file given and size given,
-    // - reference file given but no size given,
-    // - no reference file given but size given,
-    // - no reference file given and no size given,
-    match (reference, size) {
-        (Some(rfilename), Some(size_string)) => {
-            truncate_reference_and_size(&rfilename, &size_string, filenames, create)
-        }
-        (Some(rfilename), None) => truncate_reference_file_only(&rfilename, filenames, create),
-        (None, Some(size_string)) => truncate_size_only(&size_string, filenames, create),
-        (None, None) => unreachable!(), // this case cannot happen anymore because it's handled by clap
-    }
-}
-
-/// Decide whether a character is one of the size modifiers, like '+' or '<'.
-fn is_modifier(c: char) -> bool {
-    c == '+' || c == '-' || c == '<' || c == '>' || c == '/' || c == '%'
-}
-
-/// Parse a size string with optional modifier symbol as its first character.
-///
-/// A size string is as described in [`parse_size`]. The first character
-/// of `size_string` might be a modifier symbol, like `'+'` or
-/// `'<'`. The first element of the pair returned by this function
-/// indicates which modifier symbol was present, or
-/// [`TruncateMode::Absolute`] if none.
-///
-/// # Panics
-///
-/// If `size_string` is empty, or if no number could be parsed from the
-/// given string (for example, if the string were `"abc"`).
-///
-/// # Examples
-///
-/// ```rust,ignore
-/// assert_eq!(parse_mode_and_size("+123"), (TruncateMode::Extend, 123));
-/// ```
-fn parse_mode_and_size(size_string: &str) -> Result<TruncateMode, ParseSizeError> {
-    // Trim any whitespace.
-    let mut size_string = size_string.trim();
-
-    // Get the modifier character from the size string, if any. For
-    // example, if the argument is "+123", then the modifier is '+'.
-    if let Some(c) = size_string.chars().next() {
-        if is_modifier(c) {
-            size_string = &size_string[1..];
-        }
-        parse_size(size_string).map(match c {
-            '+' => TruncateMode::Extend,
-            '-' => TruncateMode::Reduce,
-            '<' => TruncateMode::AtMost,
-            '>' => TruncateMode::AtLeast,
-            '/' => TruncateMode::RoundDown,
-            '%' => TruncateMode::RoundUp,
-            _ => TruncateMode::Absolute,
-        })
-    } else {
-        Err(ParseSizeError::ParseFailure(size_string.to_string()))
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::parse_mode_and_size;
-    use crate::TruncateMode;
-
-    #[test]
-    fn test_parse_mode_and_size() {
-        assert_eq!(parse_mode_and_size("10"), Ok(TruncateMode::Absolute(10)));
-        assert_eq!(parse_mode_and_size("+10"), Ok(TruncateMode::Extend(10)));
-        assert_eq!(parse_mode_and_size("-10"), Ok(TruncateMode::Reduce(10)));
-        assert_eq!(parse_mode_and_size("<10"), Ok(TruncateMode::AtMost(10)));
-        assert_eq!(parse_mode_and_size(">10"), Ok(TruncateMode::AtLeast(10)));
-        assert_eq!(parse_mode_and_size("/10"), Ok(TruncateMode::RoundDown(10)));
-        assert_eq!(parse_mode_and_size("%10"), Ok(TruncateMode::RoundUp(10)));
-    }
-
-    #[test]
-    fn test_to_size() {
-        assert_eq!(TruncateMode::Extend(5).to_size(10), 15);
-        assert_eq!(TruncateMode::Reduce(5).to_size(10), 5);
-        assert_eq!(TruncateMode::Reduce(5).to_size(3), 0);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tsort/tsort.rs.html b/coreutils/dev/src/uu_tsort/tsort.rs.html deleted file mode 100644 index 22b05e96b..000000000 --- a/coreutils/dev/src/uu_tsort/tsort.rs.html +++ /dev/null @@ -1,353 +0,0 @@ -tsort.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Ben Eggers <ben.eggers36@gmail.com>
-//  * (c) Akira Hayakawa <ruby.wktk@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-use clap::{crate_version, Arg, Command};
-use std::collections::{BTreeMap, BTreeSet};
-use std::fs::File;
-use std::io::{stdin, BufRead, BufReader, Read};
-use std::path::Path;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError};
-use uucore::{format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("tsort.md");
-const USAGE: &str = help_usage!("tsort.md");
-
-mod options {
-    pub const FILE: &str = "file";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_lossy();
-
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let input = matches
-        .get_one::<String>(options::FILE)
-        .expect("Value is required by clap");
-
-    let mut stdin_buf;
-    let mut file_buf;
-    let mut reader = BufReader::new(if input == "-" {
-        stdin_buf = stdin();
-        &mut stdin_buf as &mut dyn Read
-    } else {
-        file_buf = File::open(Path::new(&input)).map_err_context(|| input.to_string())?;
-        &mut file_buf as &mut dyn Read
-    });
-
-    let mut g = Graph::new();
-    loop {
-        let mut line = String::new();
-        match reader.read_line(&mut line) {
-            Ok(_) => {
-                let tokens: Vec<String> = line.split_whitespace().map(|s| s.to_owned()).collect();
-                if tokens.is_empty() {
-                    break;
-                }
-                for ab in tokens.chunks(2) {
-                    match ab.len() {
-                        2 => g.add_edge(&ab[0], &ab[1]),
-                        _ => {
-                            return Err(USimpleError::new(
-                                1,
-                                format!(
-                                    "{}: input contains an odd number of tokens",
-                                    input.maybe_quote()
-                                ),
-                            ))
-                        }
-                    }
-                }
-            }
-            _ => break,
-        }
-    }
-
-    g.run_tsort();
-
-    if !g.is_acyclic() {
-        return Err(USimpleError::new(
-            1,
-            format!("{input}, input contains a loop:"),
-        ));
-    }
-
-    for x in &g.result {
-        println!("{x}");
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::FILE)
-                .default_value("-")
-                .hide(true)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-// We use String as a representation of node here
-// but using integer may improve performance.
-#[derive(Default)]
-struct Graph {
-    in_edges: BTreeMap<String, BTreeSet<String>>,
-    out_edges: BTreeMap<String, Vec<String>>,
-    result: Vec<String>,
-}
-
-impl Graph {
-    fn new() -> Self {
-        Self::default()
-    }
-
-    fn has_node(&self, n: &str) -> bool {
-        self.in_edges.contains_key(n)
-    }
-
-    fn has_edge(&self, from: &str, to: &str) -> bool {
-        self.in_edges[to].contains(from)
-    }
-
-    fn init_node(&mut self, n: &str) {
-        self.in_edges.insert(n.to_string(), BTreeSet::new());
-        self.out_edges.insert(n.to_string(), vec![]);
-    }
-
-    fn add_edge(&mut self, from: &str, to: &str) {
-        if !self.has_node(to) {
-            self.init_node(to);
-        }
-
-        if !self.has_node(from) {
-            self.init_node(from);
-        }
-
-        if from != to && !self.has_edge(from, to) {
-            self.in_edges.get_mut(to).unwrap().insert(from.to_string());
-            self.out_edges.get_mut(from).unwrap().push(to.to_string());
-        }
-    }
-
-    // Kahn's algorithm
-    // O(|V|+|E|)
-    fn run_tsort(&mut self) {
-        let mut start_nodes = vec![];
-        for (n, edges) in &self.in_edges {
-            if edges.is_empty() {
-                start_nodes.push(n.clone());
-            }
-        }
-
-        while !start_nodes.is_empty() {
-            let n = start_nodes.remove(0);
-
-            self.result.push(n.clone());
-
-            let n_out_edges = self.out_edges.get_mut(&n).unwrap();
-            for m in n_out_edges.iter() {
-                let m_in_edges = self.in_edges.get_mut(m).unwrap();
-                m_in_edges.remove(&n);
-
-                // If m doesn't have other in-coming edges add it to start_nodes
-                if m_in_edges.is_empty() {
-                    start_nodes.push(m.clone());
-                }
-            }
-            n_out_edges.clear();
-        }
-    }
-
-    fn is_acyclic(&self) -> bool {
-        self.out_edges.values().all(|edge| edge.is_empty())
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_tty/tty.rs.html b/coreutils/dev/src/uu_tty/tty.rs.html deleted file mode 100644 index f128daa38..000000000 --- a/coreutils/dev/src/uu_tty/tty.rs.html +++ /dev/null @@ -1,155 +0,0 @@ -tty.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Jordi Boggiano <j.boggiano@seld.be>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-//  *
-//  * Synced with http://lingrok.org/xref/coreutils/src/tty.c
-
-// spell-checker:ignore (ToDO) ttyname filedesc
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use is_terminal::IsTerminal;
-use std::io::Write;
-use std::os::unix::io::AsRawFd;
-use uucore::error::{set_exit_code, UResult};
-use uucore::{format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("tty.md");
-const USAGE: &str = help_usage!("tty.md");
-
-mod options {
-    pub const SILENT: &str = "silent";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().get_matches_from(args);
-
-    let silent = matches.get_flag(options::SILENT);
-
-    // If silent, we don't need the name, only whether or not stdin is a tty.
-    if silent {
-        return if std::io::stdin().is_terminal() {
-            Ok(())
-        } else {
-            Err(1.into())
-        };
-    };
-
-    let mut stdout = std::io::stdout();
-
-    // Get the ttyname via nix
-    let name = nix::unistd::ttyname(std::io::stdin().as_raw_fd());
-
-    let write_result = match name {
-        Ok(name) => writeln!(stdout, "{}", name.display()),
-        Err(_) => {
-            set_exit_code(1);
-            writeln!(stdout, "not a tty")
-        }
-    };
-
-    if write_result.is_err() || stdout.flush().is_err() {
-        // Don't return to prevent a panic later when another flush is attempted
-        // because the `uucore_procs::main` macro inserts a flush after execution for every utility.
-        std::process::exit(3);
-    };
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::SILENT)
-                .long(options::SILENT)
-                .visible_alias("quiet")
-                .short('s')
-                .help("print nothing, only return an exit status")
-                .action(ArgAction::SetTrue),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_uname/uname.rs.html b/coreutils/dev/src/uu_uname/uname.rs.html deleted file mode 100644 index e43d08845..000000000 --- a/coreutils/dev/src/uu_uname/uname.rs.html +++ /dev/null @@ -1,377 +0,0 @@ -uname.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-
// This file is part of the uutils coreutils package.
-//
-// (c) Joao Oliveira <joaoxsouls@gmail.com>
-// (c) Jian Zeng <anonymousknight96 AT gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// last synced with: uname (GNU coreutils) 8.21
-
-// spell-checker:ignore (API) nodename osname sysname (options) mnrsv mnrsvo
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use platform_info::*;
-use uucore::{
-    error::{UResult, USimpleError},
-    format_usage, help_about, help_usage,
-};
-
-const ABOUT: &str = help_about!("uname.md");
-const USAGE: &str = help_usage!("uname.md");
-
-pub mod options {
-    pub static ALL: &str = "all";
-    pub static KERNEL_NAME: &str = "kernel-name";
-    pub static NODENAME: &str = "nodename";
-    pub static KERNEL_VERSION: &str = "kernel-version";
-    pub static KERNEL_RELEASE: &str = "kernel-release";
-    pub static MACHINE: &str = "machine";
-    pub static PROCESSOR: &str = "processor";
-    pub static HARDWARE_PLATFORM: &str = "hardware-platform";
-    pub static OS: &str = "operating-system";
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let uname = PlatformInfo::new().map_err(|_e| USimpleError::new(1, "cannot get system name"))?;
-
-    let mut output = String::new();
-
-    let all = matches.get_flag(options::ALL);
-    let kernel_name = matches.get_flag(options::KERNEL_NAME);
-    let nodename = matches.get_flag(options::NODENAME);
-    let kernel_release = matches.get_flag(options::KERNEL_RELEASE);
-    let kernel_version = matches.get_flag(options::KERNEL_VERSION);
-    let machine = matches.get_flag(options::MACHINE);
-    let processor = matches.get_flag(options::PROCESSOR);
-    let hardware_platform = matches.get_flag(options::HARDWARE_PLATFORM);
-    let os = matches.get_flag(options::OS);
-
-    let none = !(all
-        || kernel_name
-        || nodename
-        || kernel_release
-        || kernel_version
-        || machine
-        || os
-        || processor
-        || hardware_platform);
-
-    if kernel_name || all || none {
-        output.push_str(&uname.sysname().to_string_lossy());
-        output.push(' ');
-    }
-
-    if nodename || all {
-        output.push_str(&uname.nodename().to_string_lossy());
-        output.push(' ');
-    }
-
-    if kernel_release || all {
-        output.push_str(&uname.release().to_string_lossy());
-        output.push(' ');
-    }
-
-    if kernel_version || all {
-        output.push_str(&uname.version().to_string_lossy());
-        output.push(' ');
-    }
-
-    if machine || all {
-        output.push_str(&uname.machine().to_string_lossy());
-        output.push(' ');
-    }
-
-    if os || all {
-        output.push_str(&uname.osname().to_string_lossy());
-        output.push(' ');
-    }
-
-    // This option is unsupported on modern Linux systems
-    // See: https://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html
-    if processor {
-        output.push_str("unknown");
-        output.push(' ');
-    }
-
-    // This option is unsupported on modern Linux systems
-    // See: https://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html
-    if hardware_platform {
-        output.push_str("unknown");
-        output.push(' ');
-    }
-
-    println!("{}", output.trim_end());
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::ALL)
-                .short('a')
-                .long(options::ALL)
-                .help("Behave as though all of the options -mnrsvo were specified.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::KERNEL_NAME)
-                .short('s')
-                .long(options::KERNEL_NAME)
-                .alias("sysname") // Obsolescent option in GNU uname
-                .help("print the kernel name.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::NODENAME)
-                .short('n')
-                .long(options::NODENAME)
-                .help(
-                    "print the nodename (the nodename may be a name that the system \
-                is known by to a communications network).",
-                )
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::KERNEL_RELEASE)
-                .short('r')
-                .long(options::KERNEL_RELEASE)
-                .alias("release") // Obsolescent option in GNU uname
-                .help("print the operating system release.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::KERNEL_VERSION)
-                .short('v')
-                .long(options::KERNEL_VERSION)
-                .help("print the operating system version.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::MACHINE)
-                .short('m')
-                .long(options::MACHINE)
-                .help("print the machine hardware name.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::OS)
-                .short('o')
-                .long(options::OS)
-                .help("print the operating system name.")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PROCESSOR)
-                .short('p')
-                .long(options::PROCESSOR)
-                .help("print the processor type (non-portable)")
-                .action(ArgAction::SetTrue)
-                .hide(true),
-        )
-        .arg(
-            Arg::new(options::HARDWARE_PLATFORM)
-                .short('i')
-                .long(options::HARDWARE_PLATFORM)
-                .help("print the hardware platform (non-portable)")
-                .action(ArgAction::SetTrue)
-                .hide(true),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_unexpand/unexpand.rs.html b/coreutils/dev/src/uu_unexpand/unexpand.rs.html deleted file mode 100644 index a4b454008..000000000 --- a/coreutils/dev/src/uu_unexpand/unexpand.rs.html +++ /dev/null @@ -1,869 +0,0 @@ -unexpand.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Virgile Andreani <virgile.andreani@anbuco.fr>
-//  * (c) kwantam <kwantam@gmail.com>
-//  *     * 2015-04-28 ~ updated to work with both UTF-8 and non-UTF-8 encodings
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) nums aflag uflag scol prevtab amode ctype cwidth nbytes lastcol pctype Preprocess
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::error::Error;
-use std::fmt;
-use std::fs::File;
-use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Stdout, Write};
-use std::num::IntErrorKind;
-use std::str::from_utf8;
-use unicode_width::UnicodeWidthChar;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UError, UResult};
-use uucore::{crash, crash_if_err, format_usage, help_about, help_usage};
-
-const USAGE: &str = help_usage!("unexpand.md");
-const ABOUT: &str = help_about!("unexpand.md");
-
-const DEFAULT_TABSTOP: usize = 8;
-
-#[derive(Debug)]
-enum ParseError {
-    InvalidCharacter(String),
-    TabSizeCannotBeZero,
-    TabSizeTooLarge,
-    TabSizesMustBeAscending,
-}
-
-impl Error for ParseError {}
-impl UError for ParseError {}
-
-impl fmt::Display for ParseError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match self {
-            Self::InvalidCharacter(s) => {
-                write!(f, "tab size contains invalid character(s): {}", s.quote())
-            }
-            Self::TabSizeCannotBeZero => write!(f, "tab size cannot be 0"),
-            Self::TabSizeTooLarge => write!(f, "tab stop value is too large"),
-            Self::TabSizesMustBeAscending => write!(f, "tab sizes must be ascending"),
-        }
-    }
-}
-
-fn tabstops_parse(s: &str) -> Result<Vec<usize>, ParseError> {
-    let words = s.split(',');
-
-    let mut nums = Vec::new();
-
-    for word in words {
-        match word.parse::<usize>() {
-            Ok(num) => nums.push(num),
-            Err(e) => match e.kind() {
-                IntErrorKind::PosOverflow => return Err(ParseError::TabSizeTooLarge),
-                _ => {
-                    return Err(ParseError::InvalidCharacter(
-                        word.trim_start_matches(char::is_numeric).to_string(),
-                    ))
-                }
-            },
-        }
-    }
-
-    if nums.iter().any(|&n| n == 0) {
-        return Err(ParseError::TabSizeCannotBeZero);
-    }
-
-    if let (false, _) = nums
-        .iter()
-        .fold((true, 0), |(acc, last), &n| (acc && last < n, n))
-    {
-        return Err(ParseError::TabSizesMustBeAscending);
-    }
-
-    Ok(nums)
-}
-
-mod options {
-    pub const FILE: &str = "file";
-    pub const ALL: &str = "all";
-    pub const FIRST_ONLY: &str = "first-only";
-    pub const TABS: &str = "tabs";
-    pub const NO_UTF8: &str = "no-utf8";
-}
-
-struct Options {
-    files: Vec<String>,
-    tabstops: Vec<usize>,
-    aflag: bool,
-    uflag: bool,
-}
-
-impl Options {
-    fn new(matches: &clap::ArgMatches) -> Result<Self, ParseError> {
-        let tabstops = match matches.get_many::<String>(options::TABS) {
-            None => vec![DEFAULT_TABSTOP],
-            Some(s) => tabstops_parse(&s.map(|s| s.as_str()).collect::<Vec<_>>().join(","))?,
-        };
-
-        let aflag = (matches.get_flag(options::ALL) || matches.contains_id(options::TABS))
-            && !matches.get_flag(options::FIRST_ONLY);
-        let uflag = !matches.get_flag(options::NO_UTF8);
-
-        let files = match matches.get_one::<String>(options::FILE) {
-            Some(v) => vec![v.to_string()],
-            None => vec!["-".to_owned()],
-        };
-
-        Ok(Self {
-            files,
-            tabstops,
-            aflag,
-            uflag,
-        })
-    }
-}
-
-/// Decide whether the character is either a digit or a comma.
-fn is_digit_or_comma(c: char) -> bool {
-    c.is_ascii_digit() || c == ','
-}
-
-/// Preprocess command line arguments and expand shortcuts. For example, "-7" is expanded to
-/// "--tabs=7 --first-only" and "-1,3" to "--tabs=1 --tabs=3 --first-only". However, if "-a" or
-/// "--all" is provided, "--first-only" is omitted.
-fn expand_shortcuts(args: &[String]) -> Vec<String> {
-    let mut processed_args = Vec::with_capacity(args.len());
-    let mut is_all_arg_provided = false;
-    let mut has_shortcuts = false;
-
-    for arg in args {
-        if arg.starts_with('-') && arg[1..].chars().all(is_digit_or_comma) {
-            arg[1..]
-                .split(',')
-                .filter(|s| !s.is_empty())
-                .for_each(|s| processed_args.push(format!("--tabs={s}")));
-            has_shortcuts = true;
-        } else {
-            processed_args.push(arg.to_string());
-
-            if arg == "--all" || arg == "-a" {
-                is_all_arg_provided = true;
-            }
-        }
-    }
-
-    if has_shortcuts && !is_all_arg_provided {
-        processed_args.push("--first-only".into());
-    }
-
-    processed_args
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app().try_get_matches_from(expand_shortcuts(&args))?;
-
-    unexpand(&Options::new(&matches)?).map_err_context(String::new)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .override_usage(format_usage(USAGE))
-        .about(ABOUT)
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::FILE)
-                .hide(true)
-                .action(ArgAction::Append)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::ALL)
-                .short('a')
-                .long(options::ALL)
-                .help("convert all blanks, instead of just initial blanks")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FIRST_ONLY)
-                .long(options::FIRST_ONLY)
-                .help("convert only leading sequences of blanks (overrides -a)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::TABS)
-                .short('t')
-                .long(options::TABS)
-                .help(
-                    "use comma separated LIST of tab positions or have tabs N characters \
-                apart instead of 8 (enables -a)",
-                )
-                .action(ArgAction::Append)
-                .value_name("N, LIST"),
-        )
-        .arg(
-            Arg::new(options::NO_UTF8)
-                .short('U')
-                .long(options::NO_UTF8)
-                .help("interpret input file as 8-bit ASCII rather than UTF-8")
-                .action(ArgAction::SetTrue),
-        )
-}
-
-fn open(path: &str) -> BufReader<Box<dyn Read + 'static>> {
-    let file_buf;
-    if path == "-" {
-        BufReader::new(Box::new(stdin()) as Box<dyn Read>)
-    } else {
-        file_buf = match File::open(path) {
-            Ok(a) => a,
-            Err(e) => crash!(1, "{}: {}", path.maybe_quote(), e),
-        };
-        BufReader::new(Box::new(file_buf) as Box<dyn Read>)
-    }
-}
-
-fn next_tabstop(tabstops: &[usize], col: usize) -> Option<usize> {
-    if tabstops.len() == 1 {
-        Some(tabstops[0] - col % tabstops[0])
-    } else {
-        // find next larger tab
-        // if there isn't one in the list, tab becomes a single space
-        tabstops.iter().find(|&&t| t > col).map(|t| t - col)
-    }
-}
-
-fn write_tabs(
-    output: &mut BufWriter<Stdout>,
-    tabstops: &[usize],
-    mut scol: usize,
-    col: usize,
-    prevtab: bool,
-    init: bool,
-    amode: bool,
-) {
-    // This conditional establishes the following:
-    // We never turn a single space before a non-blank into
-    // a tab, unless it's at the start of the line.
-    let ai = init || amode;
-    if (ai && !prevtab && col > scol + 1) || (col > scol && (init || ai && prevtab)) {
-        while let Some(nts) = next_tabstop(tabstops, scol) {
-            if col < scol + nts {
-                break;
-            }
-
-            crash_if_err!(1, output.write_all(b"\t"));
-            scol += nts;
-        }
-    }
-
-    while col > scol {
-        crash_if_err!(1, output.write_all(b" "));
-        scol += 1;
-    }
-}
-
-#[derive(PartialEq, Eq, Debug)]
-enum CharType {
-    Backspace,
-    Space,
-    Tab,
-    Other,
-}
-
-fn next_char_info(uflag: bool, buf: &[u8], byte: usize) -> (CharType, usize, usize) {
-    let (ctype, cwidth, nbytes) = if uflag {
-        let nbytes = char::from(buf[byte]).len_utf8();
-
-        if byte + nbytes > buf.len() {
-            // make sure we don't overrun the buffer because of invalid UTF-8
-            (CharType::Other, 1, 1)
-        } else if let Ok(t) = from_utf8(&buf[byte..byte + nbytes]) {
-            // Now that we think it's UTF-8, figure out what kind of char it is
-            match t.chars().next() {
-                Some(' ') => (CharType::Space, 0, 1),
-                Some('\t') => (CharType::Tab, 0, 1),
-                Some('\x08') => (CharType::Backspace, 0, 1),
-                Some(c) => (
-                    CharType::Other,
-                    UnicodeWidthChar::width(c).unwrap_or(0),
-                    nbytes,
-                ),
-                None => {
-                    // invalid char snuck past the utf8_validation_iterator somehow???
-                    (CharType::Other, 1, 1)
-                }
-            }
-        } else {
-            // otherwise, it's not valid
-            (CharType::Other, 1, 1) // implicit assumption: non-UTF8 char has display width 1
-        }
-    } else {
-        (
-            match buf[byte] {
-                // always take exactly 1 byte in strict ASCII mode
-                0x20 => CharType::Space,
-                0x09 => CharType::Tab,
-                0x08 => CharType::Backspace,
-                _ => CharType::Other,
-            },
-            1,
-            1,
-        )
-    };
-
-    (ctype, cwidth, nbytes)
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn unexpand(options: &Options) -> std::io::Result<()> {
-    let mut output = BufWriter::new(stdout());
-    let ts = &options.tabstops[..];
-    let mut buf = Vec::new();
-    let lastcol = if ts.len() > 1 { *ts.last().unwrap() } else { 0 };
-
-    for file in &options.files {
-        let mut fh = open(file);
-
-        while match fh.read_until(b'\n', &mut buf) {
-            Ok(s) => s > 0,
-            Err(_) => !buf.is_empty(),
-        } {
-            let mut byte = 0; // offset into the buffer
-            let mut col = 0; // the current column
-            let mut scol = 0; // the start col for the current span, i.e., the already-printed width
-            let mut init = true; // are we at the start of the line?
-            let mut pctype = CharType::Other;
-
-            while byte < buf.len() {
-                // when we have a finite number of columns, never convert past the last column
-                if lastcol > 0 && col >= lastcol {
-                    write_tabs(
-                        &mut output,
-                        ts,
-                        scol,
-                        col,
-                        pctype == CharType::Tab,
-                        init,
-                        true,
-                    );
-                    output.write_all(&buf[byte..])?;
-                    scol = col;
-                    break;
-                }
-
-                // figure out how big the next char is, if it's UTF-8
-                let (ctype, cwidth, nbytes) = next_char_info(options.uflag, &buf, byte);
-
-                // now figure out how many columns this char takes up, and maybe print it
-                let tabs_buffered = init || options.aflag;
-                match ctype {
-                    CharType::Space | CharType::Tab => {
-                        // compute next col, but only write space or tab chars if not buffering
-                        col += if ctype == CharType::Space {
-                            1
-                        } else {
-                            next_tabstop(ts, col).unwrap_or(1)
-                        };
-
-                        if !tabs_buffered {
-                            output.write_all(&buf[byte..byte + nbytes])?;
-                            scol = col; // now printed up to this column
-                        }
-                    }
-                    CharType::Other | CharType::Backspace => {
-                        // always
-                        write_tabs(
-                            &mut output,
-                            ts,
-                            scol,
-                            col,
-                            pctype == CharType::Tab,
-                            init,
-                            options.aflag,
-                        );
-                        init = false; // no longer at the start of a line
-                        col = if ctype == CharType::Other {
-                            // use computed width
-                            col + cwidth
-                        } else if col > 0 {
-                            // Backspace case, but only if col > 0
-                            col - 1
-                        } else {
-                            0
-                        };
-                        output.write_all(&buf[byte..byte + nbytes])?;
-                        scol = col; // we've now printed up to this column
-                    }
-                }
-
-                byte += nbytes; // move on to next char
-                pctype = ctype; // save the previous type
-            }
-
-            // write out anything remaining
-            write_tabs(
-                &mut output,
-                ts,
-                scol,
-                col,
-                pctype == CharType::Tab,
-                init,
-                true,
-            );
-            output.flush()?;
-            buf.truncate(0); // clear out the buffer
-        }
-    }
-    output.flush()
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::is_digit_or_comma;
-
-    #[test]
-    fn test_is_digit_or_comma() {
-        assert!(is_digit_or_comma('1'));
-        assert!(is_digit_or_comma(','));
-        assert!(!is_digit_or_comma('a'));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_uniq/uniq.rs.html b/coreutils/dev/src/uu_uniq/uniq.rs.html deleted file mode 100644 index de75fe88d..000000000 --- a/coreutils/dev/src/uu_uniq/uniq.rs.html +++ /dev/null @@ -1,857 +0,0 @@ -uniq.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Chirag B Jadwani <chirag.jadwani@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command};
-use std::ffi::{OsStr, OsString};
-use std::fs::File;
-use std::io::{self, stdin, stdout, BufRead, BufReader, BufWriter, Write};
-use std::str::FromStr;
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
-use uucore::{format_usage, help_about, help_section, help_usage};
-
-const ABOUT: &str = help_about!("uniq.md");
-const USAGE: &str = help_usage!("uniq.md");
-const AFTER_HELP: &str = help_section!("after help", "uniq.md");
-
-pub mod options {
-    pub static ALL_REPEATED: &str = "all-repeated";
-    pub static CHECK_CHARS: &str = "check-chars";
-    pub static COUNT: &str = "count";
-    pub static IGNORE_CASE: &str = "ignore-case";
-    pub static REPEATED: &str = "repeated";
-    pub static SKIP_FIELDS: &str = "skip-fields";
-    pub static SKIP_CHARS: &str = "skip-chars";
-    pub static UNIQUE: &str = "unique";
-    pub static ZERO_TERMINATED: &str = "zero-terminated";
-    pub static GROUP: &str = "group";
-}
-
-static ARG_FILES: &str = "files";
-
-#[derive(PartialEq, Clone, Copy)]
-enum Delimiters {
-    Append,
-    Prepend,
-    Separate,
-    Both,
-    None,
-}
-
-struct Uniq {
-    repeats_only: bool,
-    uniques_only: bool,
-    all_repeated: bool,
-    delimiters: Delimiters,
-    show_counts: bool,
-    skip_fields: Option<usize>,
-    slice_start: Option<usize>,
-    slice_stop: Option<usize>,
-    ignore_case: bool,
-    zero_terminated: bool,
-}
-
-macro_rules! write_line_terminator {
-    ($writer:expr, $line_terminator:expr) => {
-        $writer
-            .write_all(&[$line_terminator])
-            .map_err_context(|| "Could not write line terminator".to_string())
-    };
-}
-
-impl Uniq {
-    pub fn print_uniq(&self, reader: impl BufRead, mut writer: impl Write) -> UResult<()> {
-        let mut first_line_printed = false;
-        let mut group_count = 1;
-        let line_terminator = self.get_line_terminator();
-        let mut lines = reader.split(line_terminator).map(get_line_string);
-        let mut line = match lines.next() {
-            Some(l) => l?,
-            None => return Ok(()),
-        };
-
-        let writer = &mut writer;
-
-        // compare current `line` with consecutive lines (`next_line`) of the input
-        // and if needed, print `line` based on the command line options provided
-        for next_line in lines {
-            let next_line = next_line?;
-            if self.cmp_keys(&line, &next_line) {
-                if (group_count == 1 && !self.repeats_only)
-                    || (group_count > 1 && !self.uniques_only)
-                {
-                    self.print_line(writer, &line, group_count, first_line_printed)?;
-                    first_line_printed = true;
-                }
-                line = next_line;
-                group_count = 1;
-            } else {
-                if self.all_repeated {
-                    self.print_line(writer, &line, group_count, first_line_printed)?;
-                    first_line_printed = true;
-                    line = next_line;
-                }
-                group_count += 1;
-            }
-        }
-        if (group_count == 1 && !self.repeats_only) || (group_count > 1 && !self.uniques_only) {
-            self.print_line(writer, &line, group_count, first_line_printed)?;
-            first_line_printed = true;
-        }
-        if (self.delimiters == Delimiters::Append || self.delimiters == Delimiters::Both)
-            && first_line_printed
-        {
-            write_line_terminator!(writer, line_terminator)?;
-        }
-        Ok(())
-    }
-
-    fn skip_fields<'a>(&self, line: &'a str) -> &'a str {
-        if let Some(skip_fields) = self.skip_fields {
-            let mut i = 0;
-            let mut char_indices = line.char_indices();
-            for _ in 0..skip_fields {
-                if char_indices.all(|(_, c)| c.is_whitespace()) {
-                    return "";
-                }
-                match char_indices.find(|(_, c)| c.is_whitespace()) {
-                    None => return "",
-                    Some((next_field_i, _)) => i = next_field_i,
-                }
-            }
-            &line[i..]
-        } else {
-            line
-        }
-    }
-
-    fn get_line_terminator(&self) -> u8 {
-        if self.zero_terminated {
-            0
-        } else {
-            b'\n'
-        }
-    }
-
-    fn cmp_keys(&self, first: &str, second: &str) -> bool {
-        self.cmp_key(first, |first_iter| {
-            self.cmp_key(second, |second_iter| first_iter.ne(second_iter))
-        })
-    }
-
-    fn cmp_key<F>(&self, line: &str, mut closure: F) -> bool
-    where
-        F: FnMut(&mut dyn Iterator<Item = char>) -> bool,
-    {
-        let fields_to_check = self.skip_fields(line);
-        let len = fields_to_check.len();
-        let slice_start = self.slice_start.unwrap_or(0);
-        let slice_stop = self.slice_stop.unwrap_or(len);
-        if len > 0 {
-            // fast path: avoid doing any work if there is no need to skip or map to lower-case
-            if !self.ignore_case && slice_start == 0 && slice_stop == len {
-                return closure(&mut fields_to_check.chars());
-            }
-
-            // fast path: avoid skipping
-            if self.ignore_case && slice_start == 0 && slice_stop == len {
-                return closure(&mut fields_to_check.chars().flat_map(|c| c.to_uppercase()));
-            }
-
-            // fast path: we can avoid mapping chars to upper-case, if we don't want to ignore the case
-            if !self.ignore_case {
-                return closure(&mut fields_to_check.chars().skip(slice_start).take(slice_stop));
-            }
-
-            closure(
-                &mut fields_to_check
-                    .chars()
-                    .skip(slice_start)
-                    .take(slice_stop)
-                    .flat_map(|c| c.to_uppercase()),
-            )
-        } else {
-            closure(&mut fields_to_check.chars())
-        }
-    }
-
-    fn should_print_delimiter(&self, group_count: usize, first_line_printed: bool) -> bool {
-        // if no delimiter option is selected then no other checks needed
-        self.delimiters != Delimiters::None
-            // print delimiter only before the first line of a group, not between lines of a group
-            && group_count == 1
-            // if at least one line has been output before current group then print delimiter
-            && (first_line_printed
-                // or if we need to prepend delimiter then print it even at the start of the output
-                || self.delimiters == Delimiters::Prepend
-                // the 'both' delimit mode should prepend and append delimiters
-                || self.delimiters == Delimiters::Both)
-    }
-
-    fn print_line(
-        &self,
-        writer: &mut impl Write,
-        line: &str,
-        count: usize,
-        first_line_printed: bool,
-    ) -> UResult<()> {
-        let line_terminator = self.get_line_terminator();
-
-        if self.should_print_delimiter(count, first_line_printed) {
-            write_line_terminator!(writer, line_terminator)?;
-        }
-
-        if self.show_counts {
-            write!(writer, "{count:7} {line}")
-        } else {
-            writer.write_all(line.as_bytes())
-        }
-        .map_err_context(|| "Failed to write line".to_string())?;
-
-        write_line_terminator!(writer, line_terminator)
-    }
-}
-
-fn get_line_string(io_line: io::Result<Vec<u8>>) -> UResult<String> {
-    let line_bytes = io_line.map_err_context(|| "failed to split lines".to_string())?;
-    String::from_utf8(line_bytes)
-        .map_err(|e| USimpleError::new(1, format!("failed to convert line to utf8: {e}")))
-}
-
-fn opt_parsed<T: FromStr>(opt_name: &str, matches: &ArgMatches) -> UResult<Option<T>> {
-    Ok(match matches.get_one::<String>(opt_name) {
-        Some(arg_str) => Some(arg_str.parse().map_err(|_| {
-            USimpleError::new(
-                1,
-                format!(
-                    "Invalid argument for {}: {}",
-                    opt_name,
-                    arg_str.maybe_quote()
-                ),
-            )
-        })?),
-        None => None,
-    })
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().after_help(AFTER_HELP).try_get_matches_from(args)?;
-
-    let files = matches.get_many::<OsString>(ARG_FILES);
-
-    let (in_file_name, out_file_name) = files
-        .map(|fi| fi.map(AsRef::as_ref))
-        .map(|mut fi| (fi.next(), fi.next()))
-        .unwrap_or_default();
-
-    let uniq = Uniq {
-        repeats_only: matches.get_flag(options::REPEATED)
-            || matches.contains_id(options::ALL_REPEATED),
-        uniques_only: matches.get_flag(options::UNIQUE),
-        all_repeated: matches.contains_id(options::ALL_REPEATED)
-            || matches.contains_id(options::GROUP),
-        delimiters: get_delimiter(&matches),
-        show_counts: matches.get_flag(options::COUNT),
-        skip_fields: opt_parsed(options::SKIP_FIELDS, &matches)?,
-        slice_start: opt_parsed(options::SKIP_CHARS, &matches)?,
-        slice_stop: opt_parsed(options::CHECK_CHARS, &matches)?,
-        ignore_case: matches.get_flag(options::IGNORE_CASE),
-        zero_terminated: matches.get_flag(options::ZERO_TERMINATED),
-    };
-
-    if uniq.show_counts && uniq.all_repeated {
-        return Err(UUsageError::new(
-            1,
-            "printing all duplicated lines and repeat counts is meaningless",
-        ));
-    }
-
-    uniq.print_uniq(
-        open_input_file(in_file_name)?,
-        open_output_file(out_file_name)?,
-    )
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::ALL_REPEATED)
-                .short('D')
-                .long(options::ALL_REPEATED)
-                .value_parser([
-                    "none",
-                    "prepend",
-                    "separate"
-                ])
-                .help("print all duplicate lines. Delimiting is done with blank lines. [default: none]")
-                .value_name("delimit-method")
-                .num_args(0..=1)
-                .default_missing_value("none")
-                .require_equals(true),
-        )
-        .arg(
-            Arg::new(options::GROUP)
-                .long(options::GROUP)
-                .value_parser([
-                    "separate",
-                    "prepend",
-                    "append",
-                    "both",
-                ])
-                .help("show all items, separating groups with an empty line. [default: separate]")
-                .value_name("group-method")
-                .num_args(0..=1)
-                .default_missing_value("separate")
-                .require_equals(true)
-                .conflicts_with_all([
-                    options::REPEATED,
-                    options::ALL_REPEATED,
-                    options::UNIQUE,
-                ]),
-        )
-        .arg(
-            Arg::new(options::CHECK_CHARS)
-                .short('w')
-                .long(options::CHECK_CHARS)
-                .help("compare no more than N characters in lines")
-                .value_name("N"),
-        )
-        .arg(
-            Arg::new(options::COUNT)
-                .short('c')
-                .long(options::COUNT)
-                .help("prefix lines by the number of occurrences")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::IGNORE_CASE)
-                .short('i')
-                .long(options::IGNORE_CASE)
-                .help("ignore differences in case when comparing")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::REPEATED)
-                .short('d')
-                .long(options::REPEATED)
-                .help("only print duplicate lines")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SKIP_CHARS)
-                .short('s')
-                .long(options::SKIP_CHARS)
-                .help("avoid comparing the first N characters")
-                .value_name("N"),
-        )
-        .arg(
-            Arg::new(options::SKIP_FIELDS)
-                .short('f')
-                .long(options::SKIP_FIELDS)
-                .help("avoid comparing the first N fields")
-                .value_name("N"),
-        )
-        .arg(
-            Arg::new(options::UNIQUE)
-                .short('u')
-                .long(options::UNIQUE)
-                .help("only print unique lines")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ZERO_TERMINATED)
-                .short('z')
-                .long(options::ZERO_TERMINATED)
-                .help("end lines with 0 byte, not newline")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .value_parser(ValueParser::os_string())
-                .num_args(0..=2)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-fn get_delimiter(matches: &ArgMatches) -> Delimiters {
-    let value = matches
-        .get_one::<String>(options::ALL_REPEATED)
-        .or_else(|| matches.get_one::<String>(options::GROUP));
-    if let Some(delimiter_arg) = value {
-        match delimiter_arg.as_ref() {
-            "append" => Delimiters::Append,
-            "prepend" => Delimiters::Prepend,
-            "separate" => Delimiters::Separate,
-            "both" => Delimiters::Both,
-            "none" => Delimiters::None,
-            _ => unreachable!("Should have been caught by possible values in clap"),
-        }
-    } else if matches.contains_id(options::GROUP) {
-        Delimiters::Separate
-    } else {
-        Delimiters::None
-    }
-}
-
-// None or "-" means stdin.
-fn open_input_file(in_file_name: Option<&OsStr>) -> UResult<Box<dyn BufRead>> {
-    Ok(match in_file_name {
-        Some(path) if path != "-" => {
-            let in_file = File::open(path)
-                .map_err_context(|| format!("Could not open {}", path.maybe_quote()))?;
-            Box::new(BufReader::new(in_file))
-        }
-        _ => Box::new(stdin().lock()),
-    })
-}
-
-// None or "-" means stdout.
-fn open_output_file(out_file_name: Option<&OsStr>) -> UResult<Box<dyn Write>> {
-    Ok(match out_file_name {
-        Some(path) if path != "-" => {
-            let out_file = File::create(path)
-                .map_err_context(|| format!("Could not open {}", path.maybe_quote()))?;
-            Box::new(BufWriter::new(out_file))
-        }
-        _ => Box::new(stdout().lock()),
-    })
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_unlink/unlink.rs.html b/coreutils/dev/src/uu_unlink/unlink.rs.html deleted file mode 100644 index e583b6fba..000000000 --- a/coreutils/dev/src/uu_unlink/unlink.rs.html +++ /dev/null @@ -1,95 +0,0 @@ -unlink.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Colin Warren <me@zv.ms>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-/* last synced with: unlink (GNU coreutils) 8.21 */
-
-use std::ffi::OsString;
-use std::fs::remove_file;
-use std::path::Path;
-
-use clap::builder::ValueParser;
-use clap::{crate_version, Arg, Command};
-
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult};
-use uucore::{format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("unlink.md");
-const USAGE: &str = help_usage!("unlink.md");
-static OPT_PATH: &str = "FILE";
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let path: &Path = matches.get_one::<OsString>(OPT_PATH).unwrap().as_ref();
-
-    remove_file(path).map_err_context(|| format!("cannot unlink {}", path.quote()))
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(OPT_PATH)
-                .required(true)
-                .hide(true)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::AnyPath),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_uptime/uptime.rs.html b/coreutils/dev/src/uu_uptime/uptime.rs.html deleted file mode 100644 index acd6ea566..000000000 --- a/coreutils/dev/src/uu_uptime/uptime.rs.html +++ /dev/null @@ -1,371 +0,0 @@ -uptime.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Jordi Boggiano <j.boggiano@seld.be>
-//  * (c) Jian Zeng <anonymousknight86@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) getloadavg upsecs updays nusers loadavg boottime uphours upmins
-
-use chrono::{Local, TimeZone, Utc};
-use clap::{crate_version, Arg, ArgAction, Command};
-
-use uucore::libc::time_t;
-use uucore::{format_usage, help_about, help_usage};
-
-use uucore::error::{UResult, USimpleError};
-
-const ABOUT: &str = help_about!("uptime.md");
-const USAGE: &str = help_usage!("uptime.md");
-pub mod options {
-    pub static SINCE: &str = "since";
-}
-
-#[cfg(unix)]
-use uucore::libc::getloadavg;
-
-#[cfg(windows)]
-extern "C" {
-    fn GetTickCount() -> uucore::libc::uint32_t;
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let (boot_time, user_count) = process_utmpx();
-    let uptime = get_uptime(boot_time);
-    if uptime < 0 {
-        Err(USimpleError::new(1, "could not retrieve system uptime"))
-    } else {
-        if matches.get_flag(options::SINCE) {
-            let initial_date = Local
-                .timestamp_opt(Utc::now().timestamp() - uptime, 0)
-                .unwrap();
-            println!("{}", initial_date.format("%Y-%m-%d %H:%M:%S"));
-            return Ok(());
-        }
-
-        print_time();
-        let upsecs = uptime;
-        print_uptime(upsecs);
-        print_nusers(user_count);
-        print_loadavg();
-
-        Ok(())
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::SINCE)
-                .short('s')
-                .long(options::SINCE)
-                .help("system up since")
-                .action(ArgAction::SetTrue),
-        )
-}
-
-#[cfg(unix)]
-fn print_loadavg() {
-    use uucore::libc::c_double;
-
-    let mut avg: [c_double; 3] = [0.0; 3];
-    let loads: i32 = unsafe { getloadavg(avg.as_mut_ptr(), 3) };
-
-    if loads == -1 {
-        println!();
-    } else {
-        print!("load average: ");
-        for n in 0..loads {
-            print!(
-                "{:.2}{}",
-                avg[n as usize],
-                if n == loads - 1 { "\n" } else { ", " }
-            );
-        }
-    }
-}
-
-#[cfg(windows)]
-fn print_loadavg() {
-    // XXX: currently this is a noop as Windows does not seem to have anything comparable to
-    //      getloadavg()
-}
-
-#[cfg(unix)]
-fn process_utmpx() -> (Option<time_t>, usize) {
-    use uucore::utmpx::*;
-
-    let mut nusers = 0;
-    let mut boot_time = None;
-
-    for line in Utmpx::iter_all_records() {
-        match line.record_type() {
-            USER_PROCESS => nusers += 1,
-            BOOT_TIME => {
-                let dt = line.login_time();
-                if dt.unix_timestamp() > 0 {
-                    boot_time = Some(dt.unix_timestamp() as time_t);
-                }
-            }
-            _ => continue,
-        }
-    }
-    (boot_time, nusers)
-}
-
-#[cfg(windows)]
-fn process_utmpx() -> (Option<time_t>, usize) {
-    (None, 0) // TODO: change 0 to number of users
-}
-
-fn print_nusers(nusers: usize) {
-    match nusers.cmp(&1) {
-        std::cmp::Ordering::Equal => print!("1 user,  "),
-        std::cmp::Ordering::Greater => print!("{nusers} users,  "),
-        _ => {}
-    };
-}
-
-fn print_time() {
-    let local_time = Local::now().time();
-
-    print!(" {} ", local_time.format("%H:%M:%S"));
-}
-
-#[cfg(unix)]
-fn get_uptime(boot_time: Option<time_t>) -> i64 {
-    use std::fs::File;
-    use std::io::Read;
-
-    let mut proc_uptime_s = String::new();
-
-    let proc_uptime = File::open("/proc/uptime")
-        .ok()
-        .and_then(|mut f| f.read_to_string(&mut proc_uptime_s).ok())
-        .and_then(|_| proc_uptime_s.split_whitespace().next())
-        .and_then(|s| s.split('.').next().unwrap_or("0").parse().ok());
-
-    proc_uptime.unwrap_or_else(|| match boot_time {
-        Some(t) => {
-            let now = Local::now().timestamp();
-            #[cfg(target_pointer_width = "64")]
-            let boottime: i64 = t;
-            #[cfg(not(target_pointer_width = "64"))]
-            let boottime: i64 = t.into();
-            now - boottime
-        }
-        None => -1,
-    })
-}
-
-#[cfg(windows)]
-fn get_uptime(_boot_time: Option<time_t>) -> i64 {
-    unsafe { GetTickCount() as i64 }
-}
-
-fn print_uptime(upsecs: i64) {
-    let updays = upsecs / 86400;
-    let uphours = (upsecs - (updays * 86400)) / 3600;
-    let upmins = (upsecs - (updays * 86400) - (uphours * 3600)) / 60;
-    match updays.cmp(&1) {
-        std::cmp::Ordering::Equal => print!("up {updays:1} day, {uphours:2}:{upmins:02},  "),
-        std::cmp::Ordering::Greater => {
-            print!("up {updays:1} days, {uphours:2}:{upmins:02},  ");
-        }
-        _ => print!("up  {uphours:2}:{upmins:02}, "),
-    };
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_users/users.rs.html b/coreutils/dev/src/uu_users/users.rs.html deleted file mode 100644 index b6a6e8fec..000000000 --- a/coreutils/dev/src/uu_users/users.rs.html +++ /dev/null @@ -1,151 +0,0 @@ -users.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) KokaKiwi <kokakiwi@kokakiwi.net>
-//  * (c) Jian Zeng <anonymousknight86@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (paths) wtmp
-
-use std::ffi::OsString;
-use std::path::Path;
-
-use clap::builder::ValueParser;
-use clap::{crate_version, Arg, Command};
-use uucore::error::UResult;
-use uucore::utmpx::{self, Utmpx};
-use uucore::{format_usage, help_about, help_usage};
-
-const ABOUT: &str = help_about!("users.md");
-const USAGE: &str = help_usage!("users.md");
-
-static ARG_FILES: &str = "files";
-
-fn get_long_usage() -> String {
-    format!(
-        "Output who is currently logged in according to FILE.
-If FILE is not specified, use {}.  /var/log/wtmp as FILE is common.",
-        utmpx::DEFAULT_FILE
-    )
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app()
-        .after_help(get_long_usage())
-        .try_get_matches_from(args)?;
-
-    let files: Vec<&Path> = matches
-        .get_many::<OsString>(ARG_FILES)
-        .map(|v| v.map(AsRef::as_ref).collect())
-        .unwrap_or_default();
-
-    let filename = if files.is_empty() {
-        utmpx::DEFAULT_FILE.as_ref()
-    } else {
-        files[0]
-    };
-
-    let mut users = Utmpx::iter_all_records_from(filename)
-        .filter(Utmpx::is_user_process)
-        .map(|ut| ut.user())
-        .collect::<Vec<_>>();
-
-    if !users.is_empty() {
-        users.sort();
-        println!("{}", users.join(" "));
-    }
-
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(ARG_FILES)
-                .num_args(1)
-                .value_hint(clap::ValueHint::FilePath)
-                .value_parser(ValueParser::os_string()),
-        )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_vdir/vdir.rs.html b/coreutils/dev/src/uu_vdir/vdir.rs.html deleted file mode 100644 index 214e3e22f..000000000 --- a/coreutils/dev/src/uu_vdir/vdir.rs.html +++ /dev/null @@ -1,139 +0,0 @@ -vdir.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-
// * This file is part of the uutils coreutils package.
-// *
-// * (c) gmnsii <gmnsii@protonmail.com>
-// *
-// * For the full copyright and license information, please view the LICENSE file
-// * that was distributed with this source code.
-
-use clap::Command;
-use std::ffi::OsString;
-use std::path::Path;
-use uu_ls::{options, Config, Format};
-use uucore::error::UResult;
-use uucore::quoting_style::{Quotes, QuotingStyle};
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let command = uu_app();
-    let matches = command.get_matches_from(args);
-
-    let mut default_quoting_style = false;
-    let mut default_format_style = false;
-
-    // We check if any options on formatting or quoting style have been given.
-    // If not, we will use dir default formatting and quoting style options
-
-    if !matches.contains_id(options::QUOTING_STYLE)
-        && !matches.get_flag(options::quoting::C)
-        && !matches.get_flag(options::quoting::ESCAPE)
-        && !matches.get_flag(options::quoting::LITERAL)
-    {
-        default_quoting_style = true;
-    }
-    if !matches.contains_id(options::FORMAT)
-        && !matches.get_flag(options::format::ACROSS)
-        && !matches.get_flag(options::format::COLUMNS)
-        && !matches.get_flag(options::format::COMMAS)
-        && !matches.get_flag(options::format::LONG)
-        && !matches.get_flag(options::format::LONG_NO_GROUP)
-        && !matches.get_flag(options::format::LONG_NO_OWNER)
-        && !matches.get_flag(options::format::LONG_NUMERIC_UID_GID)
-        && !matches.get_flag(options::format::ONE_LINE)
-    {
-        default_format_style = true;
-    }
-
-    let mut config = Config::from(&matches)?;
-
-    if default_quoting_style {
-        config.quoting_style = QuotingStyle::C {
-            quotes: Quotes::None,
-        };
-    }
-    if default_format_style {
-        config.format = Format::Long;
-    }
-
-    let locs = matches
-        .get_many::<OsString>(options::PATHS)
-        .map(|v| v.map(Path::new).collect())
-        .unwrap_or_else(|| vec![Path::new(".")]);
-    uu_ls::list(locs, &config)
-}
-
-// To avoid code duplication, we reuse ls uu_app function which has the same
-// arguments. However, coreutils won't compile if one of the utils is missing
-// an uu_app function, so we need this dummy one.
-pub fn uu_app() -> Command {
-    uu_ls::uu_app()
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_wc/count_fast.rs.html b/coreutils/dev/src/uu_wc/count_fast.rs.html deleted file mode 100644 index 789eac695..000000000 --- a/coreutils/dev/src/uu_wc/count_fast.rs.html +++ /dev/null @@ -1,327 +0,0 @@ -count_fast.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-
use crate::word_count::WordCount;
-
-use super::WordCountable;
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use std::fs::OpenOptions;
-use std::io::{self, ErrorKind, Read};
-
-#[cfg(unix)]
-use libc::S_IFREG;
-#[cfg(unix)]
-use nix::sys::stat;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use std::os::unix::io::AsRawFd;
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use libc::S_IFIFO;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use uucore::pipes::{pipe, splice, splice_exact};
-
-const BUF_SIZE: usize = 16 * 1024;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-const SPLICE_SIZE: usize = 128 * 1024;
-
-/// This is a Linux-specific function to count the number of bytes using the
-/// `splice` system call, which is faster than using `read`.
-///
-/// On error it returns the number of bytes it did manage to read, since the
-/// caller will fall back to a simpler method.
-#[inline]
-#[cfg(any(target_os = "linux", target_os = "android"))]
-fn count_bytes_using_splice(fd: &impl AsRawFd) -> Result<usize, usize> {
-    let null_file = OpenOptions::new()
-        .write(true)
-        .open("/dev/null")
-        .map_err(|_| 0_usize)?;
-    let null_rdev = stat::fstat(null_file.as_raw_fd())
-        .map_err(|_| 0_usize)?
-        .st_rdev as libc::dev_t;
-    if unsafe { (libc::major(null_rdev), libc::minor(null_rdev)) } != (1, 3) {
-        // This is not a proper /dev/null, writing to it is probably bad
-        // Bit of an edge case, but it has been known to happen
-        return Err(0);
-    }
-    let (pipe_rd, pipe_wr) = pipe().map_err(|_| 0_usize)?;
-
-    let mut byte_count = 0;
-    loop {
-        match splice(fd, &pipe_wr, SPLICE_SIZE) {
-            Ok(0) => break,
-            Ok(res) => {
-                byte_count += res;
-                // Silent the warning as we want to the error message
-                #[allow(clippy::question_mark)]
-                if splice_exact(&pipe_rd, &null_file, res).is_err() {
-                    return Err(byte_count);
-                }
-            }
-            Err(_) => return Err(byte_count),
-        };
-    }
-
-    Ok(byte_count)
-}
-
-/// In the special case where we only need to count the number of bytes. There
-/// are several optimizations we can do:
-///   1. On Unix,  we can simply `stat` the file if it is regular.
-///   2. On Linux -- if the above did not work -- we can use splice to count
-///      the number of bytes if the file is a FIFO.
-///   3. Otherwise, we just read normally, but without the overhead of counting
-///      other things such as lines and words.
-#[inline]
-pub(crate) fn count_bytes_fast<T: WordCountable>(handle: &mut T) -> (usize, Option<io::Error>) {
-    let mut byte_count = 0;
-
-    #[cfg(unix)]
-    {
-        let fd = handle.as_raw_fd();
-        if let Ok(stat) = stat::fstat(fd) {
-            // If the file is regular, then the `st_size` should hold
-            // the file's size in bytes.
-            // If stat.st_size = 0 then
-            //  - either the size is 0
-            //  - or the size is unknown.
-            // The second case happens for files in pseudo-filesystems. For
-            // example with /proc/version and /sys/kernel/profiling. So,
-            // if it is 0 we don't report that and instead do a full read.
-            if (stat.st_mode as libc::mode_t & S_IFREG) != 0 && stat.st_size > 0 {
-                return (stat.st_size as usize, None);
-            }
-            #[cfg(any(target_os = "linux", target_os = "android"))]
-            {
-                // Else, if we're on Linux and our file is a FIFO pipe
-                // (or stdin), we use splice to count the number of bytes.
-                if (stat.st_mode as libc::mode_t & S_IFIFO) != 0 {
-                    match count_bytes_using_splice(handle) {
-                        Ok(n) => return (n, None),
-                        Err(n) => byte_count = n,
-                    }
-                }
-            }
-        }
-    }
-
-    // Fall back on `read`, but without the overhead of counting words and lines.
-    let mut buf = [0_u8; BUF_SIZE];
-    loop {
-        match handle.read(&mut buf) {
-            Ok(0) => return (byte_count, None),
-            Ok(n) => {
-                byte_count += n;
-            }
-            Err(ref e) if e.kind() == ErrorKind::Interrupted => continue,
-            Err(e) => return (byte_count, Some(e)),
-        }
-    }
-}
-
-/// Returns a WordCount that counts the number of bytes, lines, and/or the number of Unicode characters encoded in UTF-8 read via a Reader.
-///
-/// This corresponds to the `-c`, `-l` and `-m` command line flags to wc.
-///
-/// # Arguments
-///
-/// * `R` - A Reader from which the UTF-8 stream will be read.
-pub(crate) fn count_bytes_chars_and_lines_fast<
-    R: Read,
-    const COUNT_BYTES: bool,
-    const COUNT_CHARS: bool,
-    const COUNT_LINES: bool,
->(
-    handle: &mut R,
-) -> (WordCount, Option<io::Error>) {
-    /// Mask of the value bits of a continuation byte
-    const CONT_MASK: u8 = 0b0011_1111u8;
-    /// Value of the tag bits (tag mask is !CONT_MASK) of a continuation byte
-    const TAG_CONT_U8: u8 = 0b1000_0000u8;
-
-    let mut total = WordCount::default();
-    let mut buf = [0; BUF_SIZE];
-    loop {
-        match handle.read(&mut buf) {
-            Ok(0) => return (total, None),
-            Ok(n) => {
-                if COUNT_BYTES {
-                    total.bytes += n;
-                }
-                if COUNT_CHARS {
-                    total.chars += buf[..n]
-                        .iter()
-                        .filter(|&&byte| (byte & !CONT_MASK) != TAG_CONT_U8)
-                        .count();
-                }
-                if COUNT_LINES {
-                    total.lines += bytecount::count(&buf[..n], b'\n');
-                }
-            }
-            Err(ref e) if e.kind() == ErrorKind::Interrupted => continue,
-            Err(e) => return (total, Some(e)),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_wc/countable.rs.html b/coreutils/dev/src/uu_wc/countable.rs.html deleted file mode 100644 index f0ca10d1c..000000000 --- a/coreutils/dev/src/uu_wc/countable.rs.html +++ /dev/null @@ -1,77 +0,0 @@ -countable.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-
//! Traits and implementations for iterating over lines in a file-like object.
-//!
-//! This module provides a [`WordCountable`] trait and implementations
-//! for some common file-like objects. Use the [`WordCountable::buffered`]
-//! method to get an iterator over lines of a file-like object.
-use std::fs::File;
-use std::io::{BufRead, BufReader, Read, StdinLock};
-
-#[cfg(unix)]
-use std::os::unix::io::AsRawFd;
-
-#[cfg(unix)]
-pub trait WordCountable: AsRawFd + Read {
-    type Buffered: BufRead;
-    fn buffered(self) -> Self::Buffered;
-}
-
-#[cfg(not(unix))]
-pub trait WordCountable: Read {
-    type Buffered: BufRead;
-    fn buffered(self) -> Self::Buffered;
-}
-
-impl WordCountable for StdinLock<'_> {
-    type Buffered = Self;
-
-    fn buffered(self) -> Self::Buffered {
-        self
-    }
-}
-
-impl WordCountable for File {
-    type Buffered = BufReader<Self>;
-
-    fn buffered(self) -> Self::Buffered {
-        BufReader::new(self)
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_wc/utf8/mod.rs.html b/coreutils/dev/src/uu_wc/utf8/mod.rs.html deleted file mode 100644 index fe1abe89f..000000000 --- a/coreutils/dev/src/uu_wc/utf8/mod.rs.html +++ /dev/null @@ -1,187 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-
// spell-checker:ignore Sapin
-mod read;
-
-pub use read::{BufReadDecoder, BufReadDecoderError};
-
-use std::cmp;
-use std::str;
-
-///
-/// Incremental, zero-copy UTF-8 decoding with error handling
-///
-/// The original implementation was written by Simon Sapin in the utf-8 crate <https://crates.io/crates/utf-8>.
-/// uu_wc used to depend on that crate.
-/// The author archived the repository <https://github.com/SimonSapin/rust-utf8>.
-/// They suggested incorporating the source directly into uu_wc <https://github.com/uutils/coreutils/issues/4289>.
-///
-
-#[derive(Debug, Copy, Clone)]
-pub struct Incomplete {
-    pub buffer: [u8; 4],
-    pub buffer_len: u8,
-}
-
-impl Incomplete {
-    pub fn empty() -> Self {
-        Self {
-            buffer: [0, 0, 0, 0],
-            buffer_len: 0,
-        }
-    }
-
-    pub fn is_empty(&self) -> bool {
-        self.buffer_len == 0
-    }
-
-    pub fn new(bytes: &[u8]) -> Self {
-        let mut buffer = [0, 0, 0, 0];
-        let len = bytes.len();
-        buffer[..len].copy_from_slice(bytes);
-        Self {
-            buffer,
-            buffer_len: len as u8,
-        }
-    }
-
-    fn take_buffer(&mut self) -> &[u8] {
-        let len = self.buffer_len as usize;
-        self.buffer_len = 0;
-        &self.buffer[..len]
-    }
-
-    /// (consumed_from_input, None): not enough input
-    /// (consumed_from_input, Some(Err(()))): error bytes in buffer
-    /// (consumed_from_input, Some(Ok(()))): UTF-8 string in buffer
-    fn try_complete_offsets(&mut self, input: &[u8]) -> (usize, Option<Result<(), ()>>) {
-        let initial_buffer_len = self.buffer_len as usize;
-        let copied_from_input;
-        {
-            let unwritten = &mut self.buffer[initial_buffer_len..];
-            copied_from_input = cmp::min(unwritten.len(), input.len());
-            unwritten[..copied_from_input].copy_from_slice(&input[..copied_from_input]);
-        }
-        let spliced = &self.buffer[..initial_buffer_len + copied_from_input];
-        match str::from_utf8(spliced) {
-            Ok(_) => {
-                self.buffer_len = spliced.len() as u8;
-                (copied_from_input, Some(Ok(())))
-            }
-            Err(error) => {
-                let valid_up_to = error.valid_up_to();
-                if valid_up_to > 0 {
-                    let consumed = valid_up_to.checked_sub(initial_buffer_len).unwrap();
-                    self.buffer_len = valid_up_to as u8;
-                    (consumed, Some(Ok(())))
-                } else {
-                    match error.error_len() {
-                        Some(invalid_sequence_length) => {
-                            let consumed = invalid_sequence_length
-                                .checked_sub(initial_buffer_len)
-                                .unwrap();
-                            self.buffer_len = invalid_sequence_length as u8;
-                            (consumed, Some(Err(())))
-                        }
-                        None => {
-                            self.buffer_len = spliced.len() as u8;
-                            (copied_from_input, None)
-                        }
-                    }
-                }
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_wc/utf8/read.rs.html b/coreutils/dev/src/uu_wc/utf8/read.rs.html deleted file mode 100644 index 0161931aa..000000000 --- a/coreutils/dev/src/uu_wc/utf8/read.rs.html +++ /dev/null @@ -1,277 +0,0 @@ -read.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-
// spell-checker:ignore bytestream
-use super::*;
-use std::error::Error;
-use std::fmt;
-use std::io::{self, BufRead};
-use std::str;
-
-/// Wraps a `std::io::BufRead` buffered byte stream and decode it as UTF-8.
-pub struct BufReadDecoder<B: BufRead> {
-    buf_read: B,
-    bytes_consumed: usize,
-    incomplete: Incomplete,
-}
-
-#[derive(Debug)]
-pub enum BufReadDecoderError<'a> {
-    /// Represents one UTF-8 error in the byte stream.
-    ///
-    /// In lossy decoding, each such error should be replaced with U+FFFD.
-    /// (See `BufReadDecoder::next_lossy` and `BufReadDecoderError::lossy`.)
-    InvalidByteSequence(&'a [u8]),
-
-    /// An I/O error from the underlying byte stream
-    Io(io::Error),
-}
-
-impl<'a> fmt::Display for BufReadDecoderError<'a> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match *self {
-            BufReadDecoderError::InvalidByteSequence(bytes) => {
-                write!(f, "invalid byte sequence: {bytes:02x?}")
-            }
-            BufReadDecoderError::Io(ref err) => write!(f, "underlying bytestream error: {err}"),
-        }
-    }
-}
-
-impl<'a> Error for BufReadDecoderError<'a> {
-    fn source(&self) -> Option<&(dyn Error + 'static)> {
-        match *self {
-            BufReadDecoderError::InvalidByteSequence(_) => None,
-            BufReadDecoderError::Io(ref err) => Some(err),
-        }
-    }
-}
-
-impl<B: BufRead> BufReadDecoder<B> {
-    pub fn new(buf_read: B) -> Self {
-        Self {
-            buf_read,
-            bytes_consumed: 0,
-            incomplete: Incomplete::empty(),
-        }
-    }
-
-    /// Decode and consume the next chunk of UTF-8 input.
-    ///
-    /// This method is intended to be called repeatedly until it returns `None`,
-    /// which represents EOF from the underlying byte stream.
-    /// This is similar to `Iterator::next`,
-    /// except that decoded chunks borrow the decoder (~iterator)
-    /// so they need to be handled or copied before the next chunk can start decoding.
-    #[allow(clippy::cognitive_complexity)]
-    pub fn next_strict(&mut self) -> Option<Result<&str, BufReadDecoderError>> {
-        enum BytesSource {
-            BufRead(usize),
-            Incomplete,
-        }
-        macro_rules! try_io {
-            ($io_result: expr) => {
-                match $io_result {
-                    Ok(value) => value,
-                    Err(error) => return Some(Err(BufReadDecoderError::Io(error))),
-                }
-            };
-        }
-        let (source, result) = loop {
-            if self.bytes_consumed > 0 {
-                self.buf_read.consume(self.bytes_consumed);
-                self.bytes_consumed = 0;
-            }
-            let buf = try_io!(self.buf_read.fill_buf());
-
-            // Force loop iteration to go through an explicit `continue`
-            enum Unreachable {}
-            let _: Unreachable = if self.incomplete.is_empty() {
-                if buf.is_empty() {
-                    return None; // EOF
-                }
-                match str::from_utf8(buf) {
-                    Ok(_) => break (BytesSource::BufRead(buf.len()), Ok(())),
-                    Err(error) => {
-                        let valid_up_to = error.valid_up_to();
-                        if valid_up_to > 0 {
-                            break (BytesSource::BufRead(valid_up_to), Ok(()));
-                        }
-                        match error.error_len() {
-                            Some(invalid_sequence_length) => {
-                                break (BytesSource::BufRead(invalid_sequence_length), Err(()))
-                            }
-                            None => {
-                                self.bytes_consumed = buf.len();
-                                self.incomplete = Incomplete::new(buf);
-                                // need more input bytes
-                                continue;
-                            }
-                        }
-                    }
-                }
-            } else {
-                if buf.is_empty() {
-                    break (BytesSource::Incomplete, Err(())); // EOF with incomplete code point
-                }
-                let (consumed, opt_result) = self.incomplete.try_complete_offsets(buf);
-                self.bytes_consumed = consumed;
-                match opt_result {
-                    None => {
-                        // need more input bytes
-                        continue;
-                    }
-                    Some(result) => break (BytesSource::Incomplete, result),
-                }
-            };
-        };
-        let bytes = match source {
-            BytesSource::BufRead(byte_count) => {
-                self.bytes_consumed = byte_count;
-                let buf = try_io!(self.buf_read.fill_buf());
-                &buf[..byte_count]
-            }
-            BytesSource::Incomplete => self.incomplete.take_buffer(),
-        };
-        match result {
-            Ok(()) => Some(Ok(unsafe { str::from_utf8_unchecked(bytes) })),
-            Err(()) => Some(Err(BufReadDecoderError::InvalidByteSequence(bytes))),
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_wc/wc.rs.html b/coreutils/dev/src/uu_wc/wc.rs.html deleted file mode 100644 index 2760253f4..000000000 --- a/coreutils/dev/src/uu_wc/wc.rs.html +++ /dev/null @@ -1,1775 +0,0 @@ -wc.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Boden Garman <bpgarman@gmail.com>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// cSpell:ignore ilog wc wc's
-
-mod count_fast;
-mod countable;
-mod utf8;
-mod word_count;
-
-use std::{
-    borrow::{Borrow, Cow},
-    cmp::max,
-    ffi::OsString,
-    fs::{self, File},
-    io::{self, Write},
-    iter,
-    path::{Path, PathBuf},
-};
-
-use clap::{builder::ValueParser, crate_version, Arg, ArgAction, ArgMatches, Command};
-use thiserror::Error;
-use unicode_width::UnicodeWidthChar;
-use utf8::{BufReadDecoder, BufReadDecoderError};
-
-use uucore::{
-    error::{FromIo, UError, UResult},
-    format_usage, help_about, help_usage,
-    quoting_style::{escape_name, QuotingStyle},
-    show,
-};
-
-use crate::{
-    count_fast::{count_bytes_chars_and_lines_fast, count_bytes_fast},
-    countable::WordCountable,
-    word_count::WordCount,
-};
-
-/// The minimum character width for formatting counts when reading from stdin.
-const MINIMUM_WIDTH: usize = 7;
-
-struct Settings<'a> {
-    show_bytes: bool,
-    show_chars: bool,
-    show_lines: bool,
-    show_words: bool,
-    show_max_line_length: bool,
-    files0_from: Option<Input<'a>>,
-    total_when: TotalWhen,
-}
-
-impl Default for Settings<'_> {
-    fn default() -> Self {
-        // Defaults if none of -c, -m, -l, -w, nor -L are specified.
-        Self {
-            show_bytes: true,
-            show_chars: false,
-            show_lines: true,
-            show_words: true,
-            show_max_line_length: false,
-            files0_from: None,
-            total_when: TotalWhen::default(),
-        }
-    }
-}
-
-impl<'a> Settings<'a> {
-    fn new(matches: &'a ArgMatches) -> Self {
-        let files0_from = matches
-            .get_one::<OsString>(options::FILES0_FROM)
-            .map(Into::into);
-
-        let total_when = matches
-            .get_one::<String>(options::TOTAL)
-            .map(Into::into)
-            .unwrap_or_default();
-
-        let settings = Self {
-            show_bytes: matches.get_flag(options::BYTES),
-            show_chars: matches.get_flag(options::CHAR),
-            show_lines: matches.get_flag(options::LINES),
-            show_words: matches.get_flag(options::WORDS),
-            show_max_line_length: matches.get_flag(options::MAX_LINE_LENGTH),
-            files0_from,
-            total_when,
-        };
-
-        if settings.number_enabled() > 0 {
-            settings
-        } else {
-            Self {
-                files0_from: settings.files0_from,
-                total_when,
-                ..Default::default()
-            }
-        }
-    }
-
-    fn number_enabled(&self) -> u32 {
-        [
-            self.show_bytes,
-            self.show_chars,
-            self.show_lines,
-            self.show_max_line_length,
-            self.show_words,
-        ]
-        .into_iter()
-        .map(Into::<u32>::into)
-        .sum()
-    }
-}
-
-const ABOUT: &str = help_about!("wc.md");
-const USAGE: &str = help_usage!("wc.md");
-
-mod options {
-    pub static BYTES: &str = "bytes";
-    pub static CHAR: &str = "chars";
-    pub static FILES0_FROM: &str = "files0-from";
-    pub static LINES: &str = "lines";
-    pub static MAX_LINE_LENGTH: &str = "max-line-length";
-    pub static TOTAL: &str = "total";
-    pub static WORDS: &str = "words";
-}
-static ARG_FILES: &str = "files";
-static STDIN_REPR: &str = "-";
-
-static QS_ESCAPE: &QuotingStyle = &QuotingStyle::Shell {
-    escape: true,
-    always_quote: false,
-    show_control: false,
-};
-static QS_QUOTE_ESCAPE: &QuotingStyle = &QuotingStyle::Shell {
-    escape: true,
-    always_quote: true,
-    show_control: false,
-};
-
-/// Supported inputs.
-#[derive(Debug)]
-enum Inputs<'a> {
-    /// Default Standard input, i.e. no arguments.
-    Stdin,
-    /// Files; "-" means stdin, possibly multiple times!
-    Paths(Vec<Input<'a>>),
-    /// --files0-from; "-" means stdin.
-    Files0From(Input<'a>),
-}
-
-impl<'a> Inputs<'a> {
-    fn new(matches: &'a ArgMatches) -> UResult<Self> {
-        let arg_files = matches.get_many::<OsString>(ARG_FILES);
-        let files0_from = matches.get_one::<OsString>(options::FILES0_FROM);
-
-        match (arg_files, files0_from) {
-            (None, None) => Ok(Self::Stdin),
-            (Some(files), None) => Ok(Self::Paths(files.map(Into::into).collect())),
-            (None, Some(path)) => {
-                // If path is a file, and the file isn't too large, we'll load it ahead
-                // of time. Every path within the file will have its length checked to
-                // hopefully better align the output columns.
-                let input = Input::from(path);
-                match input.try_as_files0()? {
-                    Some(paths) => Ok(Self::Paths(paths)),
-                    None => Ok(Self::Files0From(input)),
-                }
-            }
-            (Some(_), Some(_)) => Err(WcError::FilesDisabled.into()),
-        }
-    }
-
-    // Creates an iterator which yields values borrowed from the command line arguments.
-    // Returns an error if the file specified in --files0-from cannot be opened.
-    fn try_iter(
-        &'a self,
-        settings: &'a Settings<'a>,
-    ) -> UResult<impl Iterator<Item = InputIterItem<'a>>> {
-        let base: Box<dyn Iterator<Item = _>> = match self {
-            Self::Stdin => Box::new(iter::once(Ok(Input::Stdin(StdinKind::Implicit)))),
-            Self::Paths(inputs) => Box::new(inputs.iter().map(|i| Ok(i.as_borrowed()))),
-            Self::Files0From(input) => match input {
-                Input::Path(path) => Box::new(files0_iter_file(path)?),
-                Input::Stdin(_) => Box::new(files0_iter_stdin()),
-            },
-        };
-
-        // The 1-based index of each yielded item must be tracked for error reporting.
-        let mut with_idx = base.enumerate().map(|(i, v)| (i + 1, v));
-        let files0_from_path = settings.files0_from.as_ref().map(|p| p.as_borrowed());
-
-        let iter = iter::from_fn(move || {
-            let (idx, next) = with_idx.next()?;
-            match next {
-                // filter zero length file names...
-                Ok(Input::Path(p)) if p.as_os_str().is_empty() => Some(Err({
-                    let maybe_ctx = files0_from_path.as_ref().map(|p| (p, idx));
-                    WcError::zero_len(maybe_ctx).into()
-                })),
-                _ => Some(next),
-            }
-        });
-        Ok(iter)
-    }
-}
-
-#[derive(Clone, Copy, Debug)]
-enum StdinKind {
-    /// Specified on command-line with "-" (STDIN_REPR)
-    Explicit,
-    /// Implied by the lack of any arguments
-    Implicit,
-}
-
-/// Represents a single input, either to be counted or processed for other files names via
-/// --files0-from.
-#[derive(Debug)]
-enum Input<'a> {
-    Path(Cow<'a, Path>),
-    Stdin(StdinKind),
-}
-
-impl From<PathBuf> for Input<'_> {
-    fn from(p: PathBuf) -> Self {
-        if p.as_os_str() == STDIN_REPR {
-            Self::Stdin(StdinKind::Explicit)
-        } else {
-            Self::Path(Cow::Owned(p))
-        }
-    }
-}
-
-impl<'a, T: AsRef<Path> + ?Sized> From<&'a T> for Input<'a> {
-    fn from(p: &'a T) -> Self {
-        let p = p.as_ref();
-        if p.as_os_str() == STDIN_REPR {
-            Self::Stdin(StdinKind::Explicit)
-        } else {
-            Self::Path(Cow::Borrowed(p))
-        }
-    }
-}
-
-impl<'a> Input<'a> {
-    /// Translates Path(Cow::Owned(_)) to Path(Cow::Borrowed(_)).
-    fn as_borrowed(&'a self) -> Self {
-        match self {
-            Self::Path(p) => Self::Path(Cow::Borrowed(p.borrow())),
-            Self::Stdin(k) => Self::Stdin(*k),
-        }
-    }
-
-    /// Converts input to title that appears in stats.
-    fn to_title(&self) -> Option<Cow<str>> {
-        match self {
-            Self::Path(path) => Some(match path.to_str() {
-                Some(s) if !s.contains('\n') => Cow::Borrowed(s),
-                _ => Cow::Owned(escape_name(path.as_os_str(), QS_ESCAPE)),
-            }),
-            Self::Stdin(StdinKind::Explicit) => Some(Cow::Borrowed(STDIN_REPR)),
-            Self::Stdin(StdinKind::Implicit) => None,
-        }
-    }
-
-    /// Converts input into the form that appears in errors.
-    fn path_display(&self) -> String {
-        match self {
-            Self::Path(path) => escape_name(path.as_os_str(), QS_ESCAPE),
-            Self::Stdin(_) => String::from("standard input"),
-        }
-    }
-
-    /// When given --files0-from, we may be given a path or stdin. Either may be a stream or
-    /// a regular file. If given a file less than 10 MiB, it will be consumed and turned into
-    /// a Vec of Input::Paths which can be scanned to determine the widths of the columns that
-    /// will ultimately be printed.
-    fn try_as_files0(&self) -> UResult<Option<Vec<Input<'static>>>> {
-        match self {
-            Self::Path(path) => match fs::metadata(path) {
-                Ok(meta) if meta.is_file() && meta.len() <= (10 << 20) => Ok(Some(
-                    files0_iter_file(path)?.collect::<Result<Vec<_>, _>>()?,
-                )),
-                _ => Ok(None),
-            },
-            Self::Stdin(_) if is_stdin_small_file() => {
-                Ok(Some(files0_iter_stdin().collect::<Result<Vec<_>, _>>()?))
-            }
-            Self::Stdin(_) => Ok(None),
-        }
-    }
-}
-
-#[cfg(unix)]
-fn is_stdin_small_file() -> bool {
-    use std::os::unix::io::{AsRawFd, FromRawFd};
-    // Safety: we'll rely on Rust to give us a valid RawFd for stdin with which we can attempt to
-    // open a File, but only for the sake of fetching .metadata().  ManuallyDrop will ensure we
-    // don't do anything else to the FD if anything unexpected happens.
-    let f = std::mem::ManuallyDrop::new(unsafe { File::from_raw_fd(io::stdin().as_raw_fd()) });
-    matches!(f.metadata(), Ok(meta) if meta.is_file() && meta.len() <= (10 << 20))
-}
-
-#[cfg(not(unix))]
-// Windows presents a piped stdin as a "normal file" with a length equal to however many bytes
-// have been buffered at the time it's checked. To be safe, we must never assume it's a file.
-fn is_stdin_small_file() -> bool {
-    false
-}
-
-/// When to show the "total" line
-#[derive(Clone, Copy, Default, PartialEq)]
-enum TotalWhen {
-    #[default]
-    Auto,
-    Always,
-    Only,
-    Never,
-}
-
-impl<T: AsRef<str>> From<T> for TotalWhen {
-    fn from(s: T) -> Self {
-        match s.as_ref() {
-            "auto" => Self::Auto,
-            "always" => Self::Always,
-            "only" => Self::Only,
-            "never" => Self::Never,
-            _ => unreachable!("Should have been caught by clap"),
-        }
-    }
-}
-
-impl TotalWhen {
-    fn is_total_row_visible(&self, num_inputs: usize) -> bool {
-        match self {
-            Self::Auto => num_inputs > 1,
-            Self::Always | Self::Only => true,
-            Self::Never => false,
-        }
-    }
-}
-
-#[derive(Debug, Error)]
-enum WcError {
-    #[error("file operands cannot be combined with --files0-from")]
-    FilesDisabled,
-    #[error("when reading file names from stdin, no file name of '-' allowed")]
-    StdinReprNotAllowed,
-    #[error("invalid zero-length file name")]
-    ZeroLengthFileName,
-    #[error("{path}:{idx}: invalid zero-length file name")]
-    ZeroLengthFileNameCtx { path: Cow<'static, str>, idx: usize },
-}
-
-impl WcError {
-    fn zero_len(ctx: Option<(&Input, usize)>) -> Self {
-        match ctx {
-            Some((input, idx)) => {
-                let path = match input {
-                    Input::Stdin(_) => STDIN_REPR.into(),
-                    Input::Path(path) => escape_name(path.as_os_str(), QS_ESCAPE).into(),
-                };
-                Self::ZeroLengthFileNameCtx { path, idx }
-            }
-            None => Self::ZeroLengthFileName,
-        }
-    }
-}
-
-impl UError for WcError {
-    fn usage(&self) -> bool {
-        matches!(self, Self::FilesDisabled)
-    }
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let settings = Settings::new(&matches);
-    let inputs = Inputs::new(&matches)?;
-
-    wc(&inputs, &settings)
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::BYTES)
-                .short('c')
-                .long(options::BYTES)
-                .help("print the byte counts")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::CHAR)
-                .short('m')
-                .long(options::CHAR)
-                .help("print the character counts")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILES0_FROM)
-                .long(options::FILES0_FROM)
-                .value_name("F")
-                .help(concat!(
-                    "read input from the files specified by\n",
-                    "  NUL-terminated names in file F;\n",
-                    "  If F is - then read names from standard input"
-                ))
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::FilePath),
-        )
-        .arg(
-            Arg::new(options::LINES)
-                .short('l')
-                .long(options::LINES)
-                .help("print the newline counts")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::MAX_LINE_LENGTH)
-                .short('L')
-                .long(options::MAX_LINE_LENGTH)
-                .help("print the length of the longest line")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::TOTAL)
-                .long(options::TOTAL)
-                .value_parser(["auto", "always", "only", "never"])
-                .value_name("WHEN")
-                .hide_possible_values(true)
-                .help(concat!(
-                    "when to print a line with total counts;\n",
-                    "  WHEN can be: auto, always, only, never"
-                )),
-        )
-        .arg(
-            Arg::new(options::WORDS)
-                .short('w')
-                .long(options::WORDS)
-                .help("print the word counts")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(ARG_FILES)
-                .action(ArgAction::Append)
-                .value_parser(ValueParser::os_string())
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-fn word_count_from_reader<T: WordCountable>(
-    mut reader: T,
-    settings: &Settings,
-) -> (WordCount, Option<io::Error>) {
-    match (
-        settings.show_bytes,
-        settings.show_chars,
-        settings.show_lines,
-        settings.show_max_line_length,
-        settings.show_words,
-    ) {
-        // Specialize scanning loop to improve the performance.
-        (false, false, false, false, false) => unreachable!(),
-
-        // show_bytes
-        (true, false, false, false, false) => {
-            // Fast path when only show_bytes is true.
-            let (bytes, error) = count_bytes_fast(&mut reader);
-            (
-                WordCount {
-                    bytes,
-                    ..WordCount::default()
-                },
-                error,
-            )
-        }
-
-        // Fast paths that can be computed without Unicode decoding.
-        // show_lines
-        (false, false, true, false, false) => {
-            count_bytes_chars_and_lines_fast::<_, false, false, true>(&mut reader)
-        }
-        // show_chars
-        (false, true, false, false, false) => {
-            count_bytes_chars_and_lines_fast::<_, false, true, false>(&mut reader)
-        }
-        // show_chars, show_lines
-        (false, true, true, false, false) => {
-            count_bytes_chars_and_lines_fast::<_, false, true, true>(&mut reader)
-        }
-        // show_bytes, show_lines
-        (true, false, true, false, false) => {
-            count_bytes_chars_and_lines_fast::<_, true, false, true>(&mut reader)
-        }
-        // show_bytes, show_chars
-        (true, true, false, false, false) => {
-            count_bytes_chars_and_lines_fast::<_, true, true, false>(&mut reader)
-        }
-        // show_bytes, show_chars, show_lines
-        (true, true, true, false, false) => {
-            count_bytes_chars_and_lines_fast::<_, true, true, true>(&mut reader)
-        }
-        // show_words
-        (_, false, false, false, true) => {
-            word_count_from_reader_specialized::<_, false, false, false, true>(reader)
-        }
-        // show_max_line_length
-        (_, false, false, true, false) => {
-            word_count_from_reader_specialized::<_, false, false, true, false>(reader)
-        }
-        // show_max_line_length, show_words
-        (_, false, false, true, true) => {
-            word_count_from_reader_specialized::<_, false, false, true, true>(reader)
-        }
-        // show_chars, show_words
-        (_, false, true, false, true) => {
-            word_count_from_reader_specialized::<_, false, true, false, true>(reader)
-        }
-        // show_chars, show_lines
-        (_, false, true, true, false) => {
-            word_count_from_reader_specialized::<_, false, true, true, false>(reader)
-        }
-        // show_lines, show_max_line_length, show_words
-        (_, false, true, true, true) => {
-            word_count_from_reader_specialized::<_, false, true, true, true>(reader)
-        }
-        // show_chars, show_words
-        (_, true, false, false, true) => {
-            word_count_from_reader_specialized::<_, true, false, false, true>(reader)
-        }
-        // show_chars, show_max_line_length
-        (_, true, false, true, false) => {
-            word_count_from_reader_specialized::<_, true, false, true, false>(reader)
-        }
-        // show_chars, show_max_line_length, show_words
-        (_, true, false, true, true) => {
-            word_count_from_reader_specialized::<_, true, false, true, true>(reader)
-        }
-        // show_chars, show_lines, show_words
-        (_, true, true, false, true) => {
-            word_count_from_reader_specialized::<_, true, true, false, true>(reader)
-        }
-        // show_chars, show_lines, show_max_line_length
-        (_, true, true, true, false) => {
-            word_count_from_reader_specialized::<_, true, true, true, false>(reader)
-        }
-        // show_chars, show_lines, show_max_line_length, show_words
-        (_, true, true, true, true) => {
-            word_count_from_reader_specialized::<_, true, true, true, true>(reader)
-        }
-    }
-}
-
-#[allow(clippy::cognitive_complexity)]
-fn word_count_from_reader_specialized<
-    T: WordCountable,
-    const SHOW_CHARS: bool,
-    const SHOW_LINES: bool,
-    const SHOW_MAX_LINE_LENGTH: bool,
-    const SHOW_WORDS: bool,
->(
-    reader: T,
-) -> (WordCount, Option<io::Error>) {
-    let mut total = WordCount::default();
-    let mut reader = BufReadDecoder::new(reader.buffered());
-    let mut in_word = false;
-    let mut current_len = 0;
-
-    while let Some(chunk) = reader.next_strict() {
-        match chunk {
-            Ok(text) => {
-                for ch in text.chars() {
-                    if SHOW_WORDS {
-                        if ch.is_whitespace() {
-                            in_word = false;
-                        } else if ch.is_ascii_control() {
-                            // These count as characters but do not affect the word state
-                        } else if !in_word {
-                            in_word = true;
-                            total.words += 1;
-                        }
-                    }
-                    if SHOW_MAX_LINE_LENGTH {
-                        match ch {
-                            '\n' | '\r' | '\x0c' => {
-                                total.max_line_length = max(current_len, total.max_line_length);
-                                current_len = 0;
-                            }
-                            '\t' => {
-                                current_len -= current_len % 8;
-                                current_len += 8;
-                            }
-                            _ => {
-                                current_len += ch.width().unwrap_or(0);
-                            }
-                        }
-                    }
-                    if SHOW_LINES && ch == '\n' {
-                        total.lines += 1;
-                    }
-                    if SHOW_CHARS {
-                        total.chars += 1;
-                    }
-                }
-                total.bytes += text.len();
-            }
-            Err(BufReadDecoderError::InvalidByteSequence(bytes)) => {
-                // GNU wc treats invalid data as neither word nor char nor whitespace,
-                // so no other counters are affected
-                total.bytes += bytes.len();
-            }
-            Err(BufReadDecoderError::Io(e)) => {
-                return (total, Some(e));
-            }
-        }
-    }
-
-    total.max_line_length = max(current_len, total.max_line_length);
-
-    (total, None)
-}
-
-enum CountResult {
-    /// Nothing went wrong.
-    Success(WordCount),
-    /// Managed to open but failed to read.
-    Interrupted(WordCount, io::Error),
-    /// Didn't even manage to open.
-    Failure(io::Error),
-}
-
-/// If we fail opening a file, we only show the error. If we fail reading the
-/// file, we show a count for what we managed to read.
-///
-/// Therefore, the reading implementations always return a total and sometimes
-/// return an error: (WordCount, Option<io::Error>).
-fn word_count_from_input(input: &Input<'_>, settings: &Settings) -> CountResult {
-    let (total, maybe_err) = match input {
-        Input::Stdin(_) => word_count_from_reader(io::stdin().lock(), settings),
-        Input::Path(path) => match File::open(path) {
-            Ok(f) => word_count_from_reader(f, settings),
-            Err(err) => return CountResult::Failure(err),
-        },
-    };
-    match maybe_err {
-        None => CountResult::Success(total),
-        Some(err) => CountResult::Interrupted(total, err),
-    }
-}
-
-/// Compute the number of digits needed to represent all counts in all inputs.
-///
-/// For [`Inputs::Stdin`], [`MINIMUM_WIDTH`] is returned, unless there is only one counter number
-/// to be printed, in which case 1 is returned.
-///
-/// For [`Inputs::Files0From`], [`MINIMUM_WIDTH`] is returned.
-///
-/// An [`Inputs::Paths`] may include zero or more "-" entries, each of which represents reading
-/// from `stdin`. The presence of any such entry causes this function to return a width that is at
-/// least [`MINIMUM_WIDTH`].
-///
-/// If an [`Inputs::Paths`] contains only one path and only one number needs to be printed then
-/// this function is optimized to return 1 without making any calls to get file metadata.
-///
-/// If file metadata could not be read from any of the [`Input::Path`] input, that input does not
-/// affect number width computation.  Otherwise, the file sizes from the files' metadata are summed
-/// and the number of digits in that total size is returned.
-fn compute_number_width(inputs: &Inputs, settings: &Settings) -> usize {
-    match inputs {
-        Inputs::Stdin if settings.number_enabled() == 1 => 1,
-        Inputs::Stdin => MINIMUM_WIDTH,
-        Inputs::Files0From(_) => 1,
-        Inputs::Paths(inputs) => {
-            if settings.number_enabled() == 1 && inputs.len() == 1 {
-                return 1;
-            }
-
-            let mut minimum_width = 1;
-            let mut total: u64 = 0;
-            for input in inputs.iter() {
-                match input {
-                    Input::Stdin(_) => minimum_width = MINIMUM_WIDTH,
-                    Input::Path(path) => {
-                        if let Ok(meta) = fs::metadata(path) {
-                            if meta.is_file() {
-                                total += meta.len();
-                            } else {
-                                minimum_width = MINIMUM_WIDTH;
-                            }
-                        }
-                    }
-                }
-            }
-
-            if total == 0 {
-                minimum_width
-            } else {
-                let total_width = (1 + ilog10_u64(total))
-                    .try_into()
-                    .expect("ilog of a u64 should fit into a usize");
-                max(total_width, minimum_width)
-            }
-        }
-    }
-}
-
-type InputIterItem<'a> = Result<Input<'a>, Box<dyn UError>>;
-
-/// To be used with `--files0-from=-`, this applies a filter on the results of files0_iter to
-/// translate '-' into the appropriate error.
-fn files0_iter_stdin<'a>() -> impl Iterator<Item = InputIterItem<'a>> {
-    files0_iter(io::stdin().lock(), STDIN_REPR.into()).map(|i| match i {
-        Ok(Input::Stdin(_)) => Err(WcError::StdinReprNotAllowed.into()),
-        _ => i,
-    })
-}
-
-fn files0_iter_file<'a>(path: &Path) -> UResult<impl Iterator<Item = InputIterItem<'a>>> {
-    match File::open(path) {
-        Ok(f) => Ok(files0_iter(f, path.into())),
-        Err(e) => Err(e.map_err_context(|| {
-            format!(
-                "cannot open {} for reading",
-                escape_name(path.as_os_str(), QS_QUOTE_ESCAPE)
-            )
-        })),
-    }
-}
-
-fn files0_iter<'a>(
-    r: impl io::Read + 'static,
-    err_path: OsString,
-) -> impl Iterator<Item = InputIterItem<'a>> {
-    use std::io::BufRead;
-    let mut i = Some(
-        io::BufReader::new(r)
-            .split(b'\0')
-            .map(move |res| match res {
-                Ok(p) if p == STDIN_REPR.as_bytes() => Ok(Input::Stdin(StdinKind::Explicit)),
-                Ok(p) => {
-                    // On Unix systems, OsStrings are just strings of bytes, not necessarily UTF-8.
-                    #[cfg(unix)]
-                    {
-                        use std::os::unix::ffi::OsStringExt;
-                        Ok(Input::Path(PathBuf::from(OsString::from_vec(p)).into()))
-                    }
-
-                    // ...Windows does not, we must go through Strings.
-                    #[cfg(not(unix))]
-                    {
-                        let s = String::from_utf8(p)
-                            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
-                        Ok(Input::Path(PathBuf::from(s).into()))
-                    }
-                }
-                Err(e) => Err(e.map_err_context(|| {
-                    format!("{}: read error", escape_name(&err_path, QS_ESCAPE))
-                }) as Box<dyn UError>),
-            }),
-    );
-    // Loop until there is an error; yield that error and then nothing else.
-    std::iter::from_fn(move || {
-        let next = i.as_mut().and_then(Iterator::next);
-        if matches!(next, Some(Err(_)) | None) {
-            i = None;
-        }
-        next
-    })
-}
-
-fn wc(inputs: &Inputs, settings: &Settings) -> UResult<()> {
-    let mut total_word_count = WordCount::default();
-    let mut num_inputs: usize = 0;
-
-    let (number_width, are_stats_visible) = match settings.total_when {
-        TotalWhen::Only => (1, false),
-        _ => (compute_number_width(inputs, settings), true),
-    };
-
-    for maybe_input in inputs.try_iter(settings)? {
-        num_inputs += 1;
-
-        let input = match maybe_input {
-            Ok(input) => input,
-            Err(err) => {
-                show!(err);
-                continue;
-            }
-        };
-
-        let word_count = match word_count_from_input(&input, settings) {
-            CountResult::Success(word_count) => word_count,
-            CountResult::Interrupted(word_count, err) => {
-                show!(err.map_err_context(|| input.path_display()));
-                word_count
-            }
-            CountResult::Failure(err) => {
-                show!(err.map_err_context(|| input.path_display()));
-                continue;
-            }
-        };
-        total_word_count += word_count;
-        if are_stats_visible {
-            let maybe_title = input.to_title();
-            let maybe_title_str = maybe_title.as_deref();
-            if let Err(err) = print_stats(settings, &word_count, maybe_title_str, number_width) {
-                let title = maybe_title_str.unwrap_or("<stdin>");
-                show!(err.map_err_context(|| format!("failed to print result for {title}")));
-            }
-        }
-    }
-
-    if settings.total_when.is_total_row_visible(num_inputs) {
-        let title = are_stats_visible.then_some("total");
-        if let Err(err) = print_stats(settings, &total_word_count, title, number_width) {
-            show!(err.map_err_context(|| "failed to print total".into()));
-        }
-    }
-
-    // Although this appears to be returning `Ok`, the exit code may have been set to a non-zero
-    // value by a call to `record_error!()` above.
-    Ok(())
-}
-
-fn print_stats(
-    settings: &Settings,
-    result: &WordCount,
-    title: Option<&str>,
-    number_width: usize,
-) -> io::Result<()> {
-    let mut stdout = io::stdout().lock();
-
-    let maybe_cols = [
-        (settings.show_lines, result.lines),
-        (settings.show_words, result.words),
-        (settings.show_chars, result.chars),
-        (settings.show_bytes, result.bytes),
-        (settings.show_max_line_length, result.max_line_length),
-    ];
-
-    let mut space = "";
-    for (_, num) in maybe_cols.iter().filter(|(show, _)| *show) {
-        write!(stdout, "{space}{num:number_width$}")?;
-        space = " ";
-    }
-
-    if let Some(title) = title {
-        writeln!(stdout, "{space}{title}")
-    } else {
-        writeln!(stdout)
-    }
-}
-
-// TODO: remove and just use usize::ilog10 once the MSRV is >= 1.67.
-fn ilog10_u64(mut u: u64) -> u32 {
-    if u == 0 {
-        panic!("cannot compute log of 0")
-    }
-    let mut log = 0;
-    if u >= 10_000_000_000 {
-        log += 10;
-        u /= 10_000_000_000;
-    }
-    if u >= 100_000 {
-        log += 5;
-        u /= 100_000;
-    }
-    // Rust's standard library in versions >= 1.67 does something even more clever than this, but
-    // this should work just fine for the time being.
-    log + match u {
-        1..=9 => 0,
-        10..=99 => 1,
-        100..=999 => 2,
-        1000..=9999 => 3,
-        10000..=99999 => 4,
-        _ => unreachable!(),
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_wc/word_count.rs.html b/coreutils/dev/src/uu_wc/word_count.rs.html deleted file mode 100644 index 1f8d89b9a..000000000 --- a/coreutils/dev/src/uu_wc/word_count.rs.html +++ /dev/null @@ -1,63 +0,0 @@ -word_count.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-
use std::cmp::max;
-use std::ops::{Add, AddAssign};
-
-#[derive(Debug, Default, Copy, Clone)]
-pub struct WordCount {
-    pub bytes: usize,
-    pub chars: usize,
-    pub lines: usize,
-    pub words: usize,
-    pub max_line_length: usize,
-}
-
-impl Add for WordCount {
-    type Output = Self;
-
-    fn add(self, other: Self) -> Self {
-        Self {
-            bytes: self.bytes + other.bytes,
-            chars: self.chars + other.chars,
-            lines: self.lines + other.lines,
-            words: self.words + other.words,
-            max_line_length: max(self.max_line_length, other.max_line_length),
-        }
-    }
-}
-
-impl AddAssign for WordCount {
-    fn add_assign(&mut self, other: Self) {
-        *self = *self + other;
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_who/who.rs.html b/coreutils/dev/src/uu_who/who.rs.html deleted file mode 100644 index 54df9d95a..000000000 --- a/coreutils/dev/src/uu_who/who.rs.html +++ /dev/null @@ -1,1141 +0,0 @@ -who.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) ttyname hostnames runlevel mesg wtmp statted boottime deadprocs initspawn clockchange curr runlvline pidstr exitstr hoststr
-
-use uucore::display::Quotable;
-use uucore::error::{FromIo, UResult};
-use uucore::libc::{ttyname, STDIN_FILENO, S_IWGRP};
-use uucore::utmpx::{self, time, Utmpx};
-
-use clap::{crate_version, Arg, ArgAction, Command};
-use std::borrow::Cow;
-use std::ffi::CStr;
-use std::fmt::Write;
-use std::os::unix::fs::MetadataExt;
-use std::path::PathBuf;
-use uucore::{format_usage, help_about, help_usage};
-
-mod options {
-    pub const ALL: &str = "all";
-    pub const BOOT: &str = "boot";
-    pub const DEAD: &str = "dead";
-    pub const HEADING: &str = "heading";
-    pub const LOGIN: &str = "login";
-    pub const LOOKUP: &str = "lookup";
-    pub const ONLY_HOSTNAME_USER: &str = "only_hostname_user";
-    pub const PROCESS: &str = "process";
-    pub const COUNT: &str = "count";
-    pub const RUNLEVEL: &str = "runlevel";
-    pub const SHORT: &str = "short";
-    pub const TIME: &str = "time";
-    pub const USERS: &str = "users";
-    pub const MESG: &str = "mesg"; // aliases: --message, --writable
-    pub const FILE: &str = "FILE"; // if length=1: FILE, if length=2: ARG1 ARG2
-}
-
-const ABOUT: &str = help_about!("who.md");
-const USAGE: &str = help_usage!("who.md");
-
-#[cfg(target_os = "linux")]
-static RUNLEVEL_HELP: &str = "print current runlevel";
-#[cfg(not(target_os = "linux"))]
-static RUNLEVEL_HELP: &str = "print current runlevel (This is meaningless on non Linux)";
-
-fn get_long_usage() -> String {
-    format!(
-        "If FILE is not specified, use {}.  /var/log/wtmp as FILE is common.\n\
-         If ARG1 ARG2 given, -m presumed: 'am i' or 'mom likes' are usual.",
-        utmpx::DEFAULT_FILE,
-    )
-}
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let args = args.collect_ignore();
-
-    let matches = uu_app()
-        .after_help(get_long_usage())
-        .try_get_matches_from(args)?;
-
-    let files: Vec<String> = matches
-        .get_many::<String>(options::FILE)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    // If true, attempt to canonicalize hostnames via a DNS lookup.
-    let do_lookup = matches.get_flag(options::LOOKUP);
-
-    // If true, display only a list of usernames and count of
-    // the users logged on.
-    // Ignored for 'who am i'.
-    let short_list = matches.get_flag(options::COUNT);
-
-    let all = matches.get_flag(options::ALL);
-
-    // If true, display a line at the top describing each field.
-    let include_heading = matches.get_flag(options::HEADING);
-
-    // If true, display a '+' for each user if mesg y, a '-' if mesg n,
-    // or a '?' if their tty cannot be statted.
-    let include_mesg = all || matches.get_flag(options::MESG);
-
-    // If true, display the last boot time.
-    let need_boottime = all || matches.get_flag(options::BOOT);
-
-    // If true, display dead processes.
-    let need_deadprocs = all || matches.get_flag(options::DEAD);
-
-    // If true, display processes waiting for user login.
-    let need_login = all || matches.get_flag(options::LOGIN);
-
-    // If true, display processes started by init.
-    let need_initspawn = all || matches.get_flag(options::PROCESS);
-
-    // If true, display the last clock change.
-    let need_clockchange = all || matches.get_flag(options::TIME);
-
-    // If true, display the current runlevel.
-    let need_runlevel = all || matches.get_flag(options::RUNLEVEL);
-
-    let use_defaults = !(all
-        || need_boottime
-        || need_deadprocs
-        || need_login
-        || need_initspawn
-        || need_runlevel
-        || need_clockchange
-        || matches.get_flag(options::USERS));
-
-    // If true, display user processes.
-    let need_users = all || matches.get_flag(options::USERS) || use_defaults;
-
-    // If true, display the hours:minutes since each user has touched
-    // the keyboard, or "." if within the last minute, or "old" if
-    // not within the last day.
-    let include_idle = need_deadprocs || need_login || need_runlevel || need_users;
-
-    // If true, display process termination & exit status.
-    let include_exit = need_deadprocs;
-
-    // If true, display only name, line, and time fields.
-    let short_output = !include_exit && use_defaults;
-
-    // If true, display info only for the controlling tty.
-    let my_line_only = matches.get_flag(options::ONLY_HOSTNAME_USER) || files.len() == 2;
-
-    let mut who = Who {
-        do_lookup,
-        short_list,
-        short_output,
-        include_idle,
-        include_heading,
-        include_mesg,
-        include_exit,
-        need_boottime,
-        need_deadprocs,
-        need_login,
-        need_initspawn,
-        need_clockchange,
-        need_runlevel,
-        need_users,
-        my_line_only,
-        args: files,
-    };
-
-    who.exec()
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-        .arg(
-            Arg::new(options::ALL)
-                .long(options::ALL)
-                .short('a')
-                .help("same as -b -d --login -p -r -t -T -u")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::BOOT)
-                .long(options::BOOT)
-                .short('b')
-                .help("time of last system boot")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::DEAD)
-                .long(options::DEAD)
-                .short('d')
-                .help("print dead processes")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::HEADING)
-                .long(options::HEADING)
-                .short('H')
-                .help("print line of column headings")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::LOGIN)
-                .long(options::LOGIN)
-                .short('l')
-                .help("print system login processes")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::LOOKUP)
-                .long(options::LOOKUP)
-                .help("attempt to canonicalize hostnames via DNS")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::ONLY_HOSTNAME_USER)
-                .short('m')
-                .help("only hostname and user associated with stdin")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::PROCESS)
-                .long(options::PROCESS)
-                .short('p')
-                .help("print active processes spawned by init")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::COUNT)
-                .long(options::COUNT)
-                .short('q')
-                .help("all login names and number of users logged on")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::RUNLEVEL)
-                .long(options::RUNLEVEL)
-                .short('r')
-                .help(RUNLEVEL_HELP)
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::SHORT)
-                .long(options::SHORT)
-                .short('s')
-                .help("print only name, line, and time (default)")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::TIME)
-                .long(options::TIME)
-                .short('t')
-                .help("print last system clock change")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::USERS)
-                .long(options::USERS)
-                .short('u')
-                .help("list users logged in")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::MESG)
-                .long(options::MESG)
-                .short('T')
-                .visible_short_alias('w')
-                .visible_aliases(["message", "writable"])
-                .help("add user's message status as +, - or ?")
-                .action(ArgAction::SetTrue),
-        )
-        .arg(
-            Arg::new(options::FILE)
-                .num_args(1..=2)
-                .value_hint(clap::ValueHint::FilePath),
-        )
-}
-
-struct Who {
-    do_lookup: bool,
-    short_list: bool,
-    short_output: bool,
-    include_idle: bool,
-    include_heading: bool,
-    include_mesg: bool,
-    include_exit: bool,
-    need_boottime: bool,
-    need_deadprocs: bool,
-    need_login: bool,
-    need_initspawn: bool,
-    need_clockchange: bool,
-    need_runlevel: bool,
-    need_users: bool,
-    my_line_only: bool,
-    args: Vec<String>,
-}
-
-fn idle_string<'a>(when: i64, boottime: i64) -> Cow<'a, str> {
-    thread_local! {
-        static NOW: time::OffsetDateTime = time::OffsetDateTime::now_local().unwrap();
-    }
-    NOW.with(|n| {
-        let now = n.unix_timestamp();
-        if boottime < when && now - 24 * 3600 < when && when <= now {
-            let seconds_idle = now - when;
-            if seconds_idle < 60 {
-                "  .  ".into()
-            } else {
-                format!(
-                    "{:02}:{:02}",
-                    seconds_idle / 3600,
-                    (seconds_idle % 3600) / 60
-                )
-                .into()
-            }
-        } else {
-            " old ".into()
-        }
-    })
-}
-
-fn time_string(ut: &Utmpx) -> String {
-    // "%b %e %H:%M"
-    let time_format: Vec<time::format_description::FormatItem> =
-        time::format_description::parse("[month repr:short] [day padding:space] [hour]:[minute]")
-            .unwrap();
-    ut.login_time().format(&time_format).unwrap() // LC_ALL=C
-}
-
-#[inline]
-fn current_tty() -> String {
-    unsafe {
-        let res = ttyname(STDIN_FILENO);
-        if res.is_null() {
-            String::new()
-        } else {
-            CStr::from_ptr(res as *const _)
-                .to_string_lossy()
-                .trim_start_matches("/dev/")
-                .to_owned()
-        }
-    }
-}
-
-impl Who {
-    fn exec(&mut self) -> UResult<()> {
-        let run_level_chk = |_record: i16| {
-            #[cfg(not(target_os = "linux"))]
-            return false;
-
-            #[cfg(target_os = "linux")]
-            return _record == utmpx::RUN_LVL;
-        };
-
-        let f = if self.args.len() == 1 {
-            self.args[0].as_ref()
-        } else {
-            utmpx::DEFAULT_FILE
-        };
-        if self.short_list {
-            let users = Utmpx::iter_all_records_from(f)
-                .filter(Utmpx::is_user_process)
-                .map(|ut| ut.user())
-                .collect::<Vec<_>>();
-            println!("{}", users.join(" "));
-            println!("# users={}", users.len());
-        } else {
-            let records = Utmpx::iter_all_records_from(f);
-
-            if self.include_heading {
-                self.print_heading();
-            }
-            let cur_tty = if self.my_line_only {
-                current_tty()
-            } else {
-                String::new()
-            };
-
-            for ut in records {
-                if !self.my_line_only || cur_tty == ut.tty_device() {
-                    if self.need_users && ut.is_user_process() {
-                        self.print_user(&ut)?;
-                    } else if self.need_runlevel && run_level_chk(ut.record_type()) {
-                        if cfg!(target_os = "linux") {
-                            self.print_runlevel(&ut);
-                        }
-                    } else if self.need_boottime && ut.record_type() == utmpx::BOOT_TIME {
-                        self.print_boottime(&ut);
-                    } else if self.need_clockchange && ut.record_type() == utmpx::NEW_TIME {
-                        self.print_clockchange(&ut);
-                    } else if self.need_initspawn && ut.record_type() == utmpx::INIT_PROCESS {
-                        self.print_initspawn(&ut);
-                    } else if self.need_login && ut.record_type() == utmpx::LOGIN_PROCESS {
-                        self.print_login(&ut);
-                    } else if self.need_deadprocs && ut.record_type() == utmpx::DEAD_PROCESS {
-                        self.print_deadprocs(&ut);
-                    }
-                }
-
-                if ut.record_type() == utmpx::BOOT_TIME {}
-            }
-        }
-        Ok(())
-    }
-
-    #[inline]
-    fn print_runlevel(&self, ut: &Utmpx) {
-        let last = (ut.pid() / 256) as u8 as char;
-        let curr = (ut.pid() % 256) as u8 as char;
-        let runlvline = format!("run-level {curr}");
-        let comment = format!("last={}", if last == 'N' { 'S' } else { 'N' });
-
-        self.print_line(
-            "",
-            ' ',
-            &runlvline,
-            &time_string(ut),
-            "",
-            "",
-            if last.is_control() { "" } else { &comment },
-            "",
-        );
-    }
-
-    #[inline]
-    fn print_clockchange(&self, ut: &Utmpx) {
-        self.print_line("", ' ', "clock change", &time_string(ut), "", "", "", "");
-    }
-
-    #[inline]
-    fn print_login(&self, ut: &Utmpx) {
-        let comment = format!("id={}", ut.terminal_suffix());
-        let pidstr = format!("{}", ut.pid());
-        self.print_line(
-            "LOGIN",
-            ' ',
-            &ut.tty_device(),
-            &time_string(ut),
-            "",
-            &pidstr,
-            &comment,
-            "",
-        );
-    }
-
-    #[inline]
-    fn print_deadprocs(&self, ut: &Utmpx) {
-        let comment = format!("id={}", ut.terminal_suffix());
-        let pidstr = format!("{}", ut.pid());
-        let e = ut.exit_status();
-        let exitstr = format!("term={} exit={}", e.0, e.1);
-        self.print_line(
-            "",
-            ' ',
-            &ut.tty_device(),
-            &time_string(ut),
-            "",
-            &pidstr,
-            &comment,
-            &exitstr,
-        );
-    }
-
-    #[inline]
-    fn print_initspawn(&self, ut: &Utmpx) {
-        let comment = format!("id={}", ut.terminal_suffix());
-        let pidstr = format!("{}", ut.pid());
-        self.print_line(
-            "",
-            ' ',
-            &ut.tty_device(),
-            &time_string(ut),
-            "",
-            &pidstr,
-            &comment,
-            "",
-        );
-    }
-
-    #[inline]
-    fn print_boottime(&self, ut: &Utmpx) {
-        self.print_line("", ' ', "system boot", &time_string(ut), "", "", "", "");
-    }
-
-    fn print_user(&self, ut: &Utmpx) -> UResult<()> {
-        let mut p = PathBuf::from("/dev");
-        p.push(ut.tty_device().as_str());
-        let mesg;
-        let last_change;
-        match p.metadata() {
-            Ok(meta) => {
-                #[cfg(all(
-                    not(target_os = "android"),
-                    not(target_os = "freebsd"),
-                    not(target_vendor = "apple")
-                ))]
-                let iwgrp = S_IWGRP;
-                #[cfg(any(target_os = "android", target_os = "freebsd", target_vendor = "apple"))]
-                let iwgrp = S_IWGRP as u32;
-                mesg = if meta.mode() & iwgrp == 0 { '-' } else { '+' };
-                last_change = meta.atime();
-            }
-            _ => {
-                mesg = '?';
-                last_change = 0;
-            }
-        }
-
-        let idle = if last_change == 0 {
-            "  ?".into()
-        } else {
-            idle_string(last_change, 0)
-        };
-
-        let s = if self.do_lookup {
-            ut.canon_host().map_err_context(|| {
-                let host = ut.host();
-                format!(
-                    "failed to canonicalize {}",
-                    host.split(':').next().unwrap_or(&host).quote()
-                )
-            })?
-        } else {
-            ut.host()
-        };
-        let hoststr = if s.is_empty() { s } else { format!("({s})") };
-
-        self.print_line(
-            ut.user().as_ref(),
-            mesg,
-            ut.tty_device().as_ref(),
-            time_string(ut).as_str(),
-            idle.as_ref(),
-            format!("{}", ut.pid()).as_str(),
-            hoststr.as_str(),
-            "",
-        );
-
-        Ok(())
-    }
-
-    #[allow(clippy::too_many_arguments)]
-    fn print_line(
-        &self,
-        user: &str,
-        state: char,
-        line: &str,
-        time: &str,
-        idle: &str,
-        pid: &str,
-        comment: &str,
-        exit: &str,
-    ) {
-        let mut buf = String::with_capacity(64);
-        let msg = vec![' ', state].into_iter().collect::<String>();
-
-        write!(buf, "{user:<8}").unwrap();
-        if self.include_mesg {
-            buf.push_str(&msg);
-        }
-        write!(buf, " {line:<12}").unwrap();
-        // "%b %e %H:%M" (LC_ALL=C)
-        let time_size = 3 + 2 + 2 + 1 + 2;
-        write!(buf, " {time:<time_size$}").unwrap();
-
-        if !self.short_output {
-            if self.include_idle {
-                write!(buf, " {idle:<6}").unwrap();
-            }
-            write!(buf, " {pid:>10}").unwrap();
-        }
-        write!(buf, " {comment:<8}").unwrap();
-        if self.include_exit {
-            write!(buf, " {exit:<12}").unwrap();
-        }
-        println!("{}", buf.trim_end());
-    }
-
-    #[inline]
-    fn print_heading(&self) {
-        self.print_line(
-            "NAME", ' ', "LINE", "TIME", "IDLE", "PID", "COMMENT", "EXIT",
-        );
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_whoami/platform/mod.rs.html b/coreutils/dev/src/uu_whoami/platform/mod.rs.html deleted file mode 100644 index 87374e2bb..000000000 --- a/coreutils/dev/src/uu_whoami/platform/mod.rs.html +++ /dev/null @@ -1,45 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-
/*
- * This file is part of the uutils coreutils package.
- *
- * (c) Jordi Boggiano <j.boggiano@seld.be>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-// spell-checker:ignore (ToDO) getusername
-
-#[cfg(unix)]
-pub use self::unix::get_username;
-
-#[cfg(windows)]
-pub use self::windows::get_username;
-
-#[cfg(unix)]
-mod unix;
-
-#[cfg(windows)]
-mod windows;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_whoami/platform/unix.rs.html b/coreutils/dev/src/uu_whoami/platform/unix.rs.html deleted file mode 100644 index 4c08f2f88..000000000 --- a/coreutils/dev/src/uu_whoami/platform/unix.rs.html +++ /dev/null @@ -1,43 +0,0 @@ -unix.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-
/*
- * This file is part of the uutils coreutils package.
- *
- * (c) Jordi Boggiano <j.boggiano@seld.be>
- * (c) Jian Zeng <anonymousknight96 AT gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-use std::ffi::OsString;
-use std::io;
-
-use uucore::entries::uid2usr;
-
-pub fn get_username() -> io::Result<OsString> {
-    // SAFETY: getuid() does nothing with memory and is always successful.
-    let uid = unsafe { libc::geteuid() };
-    // uid2usr should arguably return an OsString but currently doesn't
-    uid2usr(uid).map(Into::into)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_whoami/whoami.rs.html b/coreutils/dev/src/uu_whoami/whoami.rs.html deleted file mode 100644 index 008889617..000000000 --- a/coreutils/dev/src/uu_whoami/whoami.rs.html +++ /dev/null @@ -1,71 +0,0 @@ -whoami.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Jordi Boggiano <j.boggiano@seld.be>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-/* last synced with: whoami (GNU coreutils) 8.21 */
-
-use clap::{crate_version, Command};
-
-use uucore::display::println_verbatim;
-use uucore::error::{FromIo, UResult};
-use uucore::{format_usage, help_about, help_usage};
-
-mod platform;
-
-const ABOUT: &str = help_about!("whoami.md");
-const USAGE: &str = help_usage!("whoami.md");
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    uu_app().try_get_matches_from(args)?;
-    let username = platform::get_username().map_err_context(|| "failed to get username".into())?;
-    println_verbatim(username).map_err_context(|| "failed to print username".into())?;
-    Ok(())
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .infer_long_args(true)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_yes/splice.rs.html b/coreutils/dev/src/uu_yes/splice.rs.html deleted file mode 100644 index 4724b3bad..000000000 --- a/coreutils/dev/src/uu_yes/splice.rs.html +++ /dev/null @@ -1,135 +0,0 @@ -splice.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-
//! On Linux we can use vmsplice() to write data more efficiently.
-//!
-//! This does not always work. We're not allowed to splice to some targets,
-//! and on some systems (notably WSL 1) it isn't supported at all.
-//!
-//! If we get an error code that suggests splicing isn't supported then we
-//! tell that to the caller so it can fall back to a robust naïve method. If
-//! we get another kind of error we bubble it up as normal.
-//!
-//! vmsplice() can only splice into a pipe, so if the output is not a pipe
-//! we make our own and use splice() to bridge the gap from the pipe to the
-//! output.
-//!
-//! We assume that an "unsupported" error will only ever happen before any
-//! data was successfully written to the output. That way we don't have to
-//! make any effort to rescue data from the pipe if splice() fails, we can
-//! just fall back and start over from the beginning.
-
-use std::{io, os::unix::io::AsRawFd};
-
-use nix::{errno::Errno, libc::S_IFIFO, sys::stat::fstat};
-
-use uucore::pipes::{pipe, splice_exact, vmsplice};
-
-pub(crate) fn splice_data(bytes: &[u8], out: &impl AsRawFd) -> Result<()> {
-    let is_pipe = fstat(out.as_raw_fd())?.st_mode as nix::libc::mode_t & S_IFIFO != 0;
-
-    if is_pipe {
-        loop {
-            let mut bytes = bytes;
-            while !bytes.is_empty() {
-                let len = vmsplice(out, bytes).map_err(maybe_unsupported)?;
-                bytes = &bytes[len..];
-            }
-        }
-    } else {
-        let (read, write) = pipe()?;
-        loop {
-            let mut bytes = bytes;
-            while !bytes.is_empty() {
-                let len = vmsplice(&write, bytes).map_err(maybe_unsupported)?;
-                splice_exact(&read, out, len).map_err(maybe_unsupported)?;
-                bytes = &bytes[len..];
-            }
-        }
-    }
-}
-
-pub(crate) enum Error {
-    Unsupported,
-    Io(io::Error),
-}
-
-type Result<T> = std::result::Result<T, Error>;
-
-impl From<nix::Error> for Error {
-    fn from(error: nix::Error) -> Self {
-        Self::Io(io::Error::from_raw_os_error(error as i32))
-    }
-}
-
-fn maybe_unsupported(error: nix::Error) -> Error {
-    match error {
-        Errno::EINVAL | Errno::ENOSYS | Errno::EBADF => Error::Unsupported,
-        _ => error.into(),
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uu_yes/yes.rs.html b/coreutils/dev/src/uu_yes/yes.rs.html deleted file mode 100644 index 663a20606..000000000 --- a/coreutils/dev/src/uu_yes/yes.rs.html +++ /dev/null @@ -1,405 +0,0 @@ -yes.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * (c) Jordi Boggiano <j.boggiano@seld.be>
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-/* last synced with: yes (GNU coreutils) 8.13 */
-
-// cSpell:ignore strs
-
-use clap::{builder::ValueParser, crate_version, Arg, ArgAction, Command};
-use std::error::Error;
-use std::ffi::OsString;
-use std::io::{self, Write};
-use uucore::error::{UResult, USimpleError};
-#[cfg(unix)]
-use uucore::signals::enable_pipe_errors;
-use uucore::{format_usage, help_about, help_usage};
-#[cfg(any(target_os = "linux", target_os = "android"))]
-mod splice;
-
-const ABOUT: &str = help_about!("yes.md");
-const USAGE: &str = help_usage!("yes.md");
-
-// it's possible that using a smaller or larger buffer might provide better performance on some
-// systems, but honestly this is good enough
-const BUF_SIZE: usize = 16 * 1024;
-
-#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    let matches = uu_app().try_get_matches_from(args)?;
-
-    let mut buffer = Vec::with_capacity(BUF_SIZE);
-    args_into_buffer(&mut buffer, matches.get_many::<OsString>("STRING")).unwrap();
-    prepare_buffer(&mut buffer);
-
-    match exec(&buffer) {
-        Ok(()) => Ok(()),
-        Err(err) if err.kind() == io::ErrorKind::BrokenPipe => Ok(()),
-        Err(err) => Err(USimpleError::new(1, format!("standard output: {err}"))),
-    }
-}
-
-pub fn uu_app() -> Command {
-    Command::new(uucore::util_name())
-        .version(crate_version!())
-        .about(ABOUT)
-        .override_usage(format_usage(USAGE))
-        .arg(
-            Arg::new("STRING")
-                .value_parser(ValueParser::os_string())
-                .action(ArgAction::Append),
-        )
-        .infer_long_args(true)
-}
-
-// Copies words from `i` into `buf`, separated by spaces.
-fn args_into_buffer<'a>(
-    buf: &mut Vec<u8>,
-    i: Option<impl Iterator<Item = &'a OsString>>,
-) -> Result<(), Box<dyn Error>> {
-    // TODO: this should be replaced with let/else once available in the MSRV.
-    let i = if let Some(i) = i {
-        i
-    } else {
-        buf.extend_from_slice(b"y\n");
-        return Ok(());
-    };
-
-    // On Unix (and wasi), OsStrs are just &[u8]'s underneath...
-    #[cfg(any(unix, target_os = "wasi"))]
-    {
-        #[cfg(unix)]
-        use std::os::unix::ffi::OsStrExt;
-        #[cfg(target_os = "wasi")]
-        use std::os::wasi::ffi::OsStrExt;
-
-        for part in itertools::intersperse(i.map(|a| a.as_bytes()), b" ") {
-            buf.extend_from_slice(part);
-        }
-    }
-
-    // But, on Windows, we must hop through a String.
-    #[cfg(not(any(unix, target_os = "wasi")))]
-    {
-        for part in itertools::intersperse(i.map(|a| a.to_str()), Some(" ")) {
-            let bytes = match part {
-                Some(part) => part.as_bytes(),
-                None => return Err("arguments contain invalid UTF-8".into()),
-            };
-            buf.extend_from_slice(bytes);
-        }
-    }
-
-    buf.push(b'\n');
-
-    Ok(())
-}
-
-// Assumes buf holds a single output line forged from the command line arguments, copies it
-// repeatedly until the buffer holds as many copies as it can under BUF_SIZE.
-fn prepare_buffer(buf: &mut Vec<u8>) {
-    if buf.len() * 2 > BUF_SIZE {
-        return;
-    }
-
-    assert!(!buf.is_empty());
-
-    let line_len = buf.len();
-    let target_size = line_len * (BUF_SIZE / line_len);
-
-    while buf.len() < target_size {
-        let to_copy = std::cmp::min(target_size - buf.len(), buf.len());
-        debug_assert_eq!(to_copy % line_len, 0);
-        buf.extend_from_within(..to_copy);
-    }
-}
-
-pub fn exec(bytes: &[u8]) -> io::Result<()> {
-    let stdout = io::stdout();
-    let mut stdout = stdout.lock();
-    #[cfg(unix)]
-    enable_pipe_errors()?;
-
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    {
-        match splice::splice_data(bytes, &stdout) {
-            Ok(_) => return Ok(()),
-            Err(splice::Error::Io(err)) => return Err(err),
-            Err(splice::Error::Unsupported) => (),
-        }
-    }
-
-    loop {
-        stdout.write_all(bytes)?;
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    fn test_prepare_buffer() {
-        let tests = [
-            (150, 16350),
-            (1000, 16000),
-            (4093, 16372),
-            (4099, 12297),
-            (4111, 12333),
-            (2, 16384),
-            (3, 16383),
-            (4, 16384),
-            (5, 16380),
-            (8192, 16384),
-            (8191, 16382),
-            (8193, 8193),
-            (10000, 10000),
-            (15000, 15000),
-            (25000, 25000),
-        ];
-
-        for (line, final_len) in tests {
-            let mut v = std::iter::repeat(b'a').take(line).collect::<Vec<_>>();
-            prepare_buffer(&mut v);
-            assert_eq!(v.len(), final_len);
-        }
-    }
-
-    #[test]
-    fn test_args_into_buf() {
-        {
-            let mut v = Vec::with_capacity(BUF_SIZE);
-            args_into_buffer(&mut v, None::<std::slice::Iter<OsString>>).unwrap();
-            assert_eq!(String::from_utf8(v).unwrap(), "y\n");
-        }
-
-        {
-            let mut v = Vec::with_capacity(BUF_SIZE);
-            args_into_buffer(&mut v, Some([OsString::from("foo")].iter())).unwrap();
-            assert_eq!(String::from_utf8(v).unwrap(), "foo\n");
-        }
-
-        {
-            let mut v = Vec::with_capacity(BUF_SIZE);
-            args_into_buffer(
-                &mut v,
-                Some(
-                    [
-                        OsString::from("foo"),
-                        OsString::from("bar    baz"),
-                        OsString::from("qux"),
-                    ]
-                    .iter(),
-                ),
-            )
-            .unwrap();
-            assert_eq!(String::from_utf8(v).unwrap(), "foo bar    baz qux\n");
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features.rs.html b/coreutils/dev/src/uucore/features.rs.html deleted file mode 100644 index 0339fb4db..000000000 --- a/coreutils/dev/src/uucore/features.rs.html +++ /dev/null @@ -1,97 +0,0 @@ -features.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-
// features ~ feature-gated modules (core/bundler file)
-
-#[cfg(feature = "encoding")]
-pub mod encoding;
-#[cfg(feature = "fs")]
-pub mod fs;
-#[cfg(feature = "fsext")]
-pub mod fsext;
-#[cfg(feature = "lines")]
-pub mod lines;
-#[cfg(feature = "memo")]
-pub mod memo;
-#[cfg(feature = "ringbuffer")]
-pub mod ringbuffer;
-#[cfg(feature = "sum")]
-pub mod sum;
-#[cfg(feature = "memo")]
-mod tokenize;
-
-// * (platform-specific) feature-gated modules
-// ** non-windows (i.e. Unix + Fuchsia)
-#[cfg(all(not(windows), feature = "mode"))]
-pub mod mode;
-
-// ** unix-only
-#[cfg(all(unix, feature = "entries"))]
-pub mod entries;
-#[cfg(all(unix, feature = "perms"))]
-pub mod perms;
-#[cfg(all(unix, feature = "pipes"))]
-pub mod pipes;
-#[cfg(all(unix, feature = "process"))]
-pub mod process;
-
-#[cfg(all(unix, not(target_os = "fuchsia"), feature = "signals"))]
-pub mod signals;
-#[cfg(all(
-    unix,
-    not(target_os = "android"),
-    not(target_os = "fuchsia"),
-    not(target_os = "redox"),
-    not(target_env = "musl"),
-    feature = "utmpx"
-))]
-pub mod utmpx;
-// ** windows-only
-#[cfg(all(windows, feature = "wide"))]
-pub mod wide;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/encoding.rs.html b/coreutils/dev/src/uucore/features/encoding.rs.html deleted file mode 100644 index 91da8aeba..000000000 --- a/coreutils/dev/src/uucore/features/encoding.rs.html +++ /dev/null @@ -1,359 +0,0 @@ -encoding.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (strings) ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUV
-// spell-checker:ignore (encodings) lsbf msbf hexupper
-
-use data_encoding::{self, BASE32, BASE64};
-
-use std::io::{self, Read, Write};
-
-use data_encoding::{Encoding, BASE32HEX, BASE64URL, HEXUPPER};
-use data_encoding_macro::new_encoding;
-#[cfg(feature = "thiserror")]
-use thiserror::Error;
-
-#[derive(Debug, Error)]
-pub enum DecodeError {
-    #[error("{}", _0)]
-    Decode(#[from] data_encoding::DecodeError),
-    #[error("{}", _0)]
-    DecodeZ85(#[from] z85::DecodeError),
-    #[error("{}", _0)]
-    Io(#[from] io::Error),
-}
-
-pub enum EncodeError {
-    Z85InputLenNotMultipleOf4,
-}
-
-pub type DecodeResult = Result<Vec<u8>, DecodeError>;
-
-#[derive(Clone, Copy)]
-pub enum Format {
-    Base64,
-    Base64Url,
-    Base32,
-    Base32Hex,
-    Base16,
-    Base2Lsbf,
-    Base2Msbf,
-    Z85,
-}
-use self::Format::*;
-
-const BASE2LSBF: Encoding = new_encoding! {
-    symbols: "01",
-    bit_order: LeastSignificantFirst,
-};
-const BASE2MSBF: Encoding = new_encoding! {
-    symbols: "01",
-    bit_order: MostSignificantFirst,
-};
-
-pub fn encode(f: Format, input: &[u8]) -> Result<String, EncodeError> {
-    Ok(match f {
-        Base32 => BASE32.encode(input),
-        Base64 => BASE64.encode(input),
-        Base64Url => BASE64URL.encode(input),
-        Base32Hex => BASE32HEX.encode(input),
-        Base16 => HEXUPPER.encode(input),
-        Base2Lsbf => BASE2LSBF.encode(input),
-        Base2Msbf => BASE2MSBF.encode(input),
-        Z85 => {
-            // According to the spec we should not accept inputs whose len is not a multiple of 4.
-            // However, the z85 crate implements a padded encoding and accepts such inputs. We have to manually check for them.
-            if input.len() % 4 == 0 {
-                z85::encode(input)
-            } else {
-                return Err(EncodeError::Z85InputLenNotMultipleOf4);
-            }
-        }
-    })
-}
-
-pub fn decode(f: Format, input: &[u8]) -> DecodeResult {
-    Ok(match f {
-        Base32 => BASE32.decode(input)?,
-        Base64 => BASE64.decode(input)?,
-        Base64Url => BASE64URL.decode(input)?,
-        Base32Hex => BASE32HEX.decode(input)?,
-        Base16 => HEXUPPER.decode(input)?,
-        Base2Lsbf => BASE2LSBF.decode(input)?,
-        Base2Msbf => BASE2MSBF.decode(input)?,
-        Z85 => {
-            // The z85 crate implements a padded encoding by using a leading '#' which is otherwise not allowed.
-            // We manually check for a leading '#' and return an error ourselves.
-            if input.starts_with(&[b'#']) {
-                return Err(z85::DecodeError::InvalidByte(0, b'#').into());
-            } else {
-                z85::decode(input)?
-            }
-        }
-    })
-}
-
-pub struct Data<R: Read> {
-    line_wrap: usize,
-    ignore_garbage: bool,
-    input: R,
-    format: Format,
-    alphabet: &'static [u8],
-}
-
-impl<R: Read> Data<R> {
-    pub fn new(input: R, format: Format) -> Self {
-        Self {
-            line_wrap: 76,
-            ignore_garbage: false,
-            input,
-            format,
-            alphabet: match format {
-                Base32 => b"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",
-                Base64 => b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789=+/",
-                Base64Url => b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789=_-",
-                Base32Hex => b"0123456789ABCDEFGHIJKLMNOPQRSTUV=",
-                Base16 => b"0123456789ABCDEF",
-                Base2Lsbf => b"01",
-                Base2Msbf => b"01",
-                Z85 => b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#",
-            },
-        }
-    }
-
-    #[must_use]
-    pub fn line_wrap(mut self, wrap: usize) -> Self {
-        self.line_wrap = wrap;
-        self
-    }
-
-    #[must_use]
-    pub fn ignore_garbage(mut self, ignore: bool) -> Self {
-        self.ignore_garbage = ignore;
-        self
-    }
-
-    pub fn decode(&mut self) -> DecodeResult {
-        let mut buf = vec![];
-        self.input.read_to_end(&mut buf)?;
-        if self.ignore_garbage {
-            buf.retain(|c| self.alphabet.contains(c));
-        } else {
-            buf.retain(|&c| c != b'\r' && c != b'\n');
-        };
-        decode(self.format, &buf)
-    }
-
-    pub fn encode(&mut self) -> Result<String, EncodeError> {
-        let mut buf: Vec<u8> = vec![];
-        self.input.read_to_end(&mut buf).unwrap();
-        encode(self.format, buf.as_slice())
-    }
-}
-
-// NOTE: this will likely be phased out at some point
-pub fn wrap_print<R: Read>(data: &Data<R>, res: &str) {
-    let stdout = io::stdout();
-    wrap_write(stdout.lock(), data.line_wrap, res).unwrap();
-}
-
-pub fn wrap_write<W: Write>(mut writer: W, line_wrap: usize, res: &str) -> io::Result<()> {
-    use std::cmp::min;
-
-    if line_wrap == 0 {
-        return write!(writer, "{res}");
-    }
-
-    let mut start = 0;
-    while start < res.len() {
-        let end = min(start + line_wrap, res.len());
-        writeln!(writer, "{}", &res[start..end])?;
-        start = end;
-    }
-
-    Ok(())
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/entries.rs.html b/coreutils/dev/src/uucore/features/entries.rs.html deleted file mode 100644 index a974ad094..000000000 --- a/coreutils/dev/src/uucore/features/entries.rs.html +++ /dev/null @@ -1,779 +0,0 @@ -entries.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (vars) Passwd cstr fnam gecos ngroups egid
-
-//! Get password/group file entry
-//!
-//! # Examples:
-//!
-//! ```
-//! use uucore::entries::{self, Locate};
-//!
-//! let root_group = if cfg!(any(target_os = "linux", target_os = "android")) {
-//!     "root"
-//! } else {
-//!     "wheel"
-//! };
-//!
-//! assert_eq!("root", entries::uid2usr(0).unwrap());
-//! assert_eq!(0, entries::usr2uid("root").unwrap());
-//! assert!(entries::gid2grp(0).is_ok());
-//! assert!(entries::grp2gid(root_group).is_ok());
-//!
-//! assert!(entries::Passwd::locate(0).is_ok());
-//! assert!(entries::Passwd::locate("0").is_ok());
-//! assert!(entries::Passwd::locate("root").is_ok());
-//!
-//! assert!(entries::Group::locate(0).is_ok());
-//! assert!(entries::Group::locate("0").is_ok());
-//! assert!(entries::Group::locate(root_group).is_ok());
-//! ```
-
-#[cfg(any(target_os = "freebsd", target_vendor = "apple"))]
-use libc::time_t;
-use libc::{c_char, c_int, gid_t, uid_t};
-#[cfg(not(target_os = "redox"))]
-use libc::{getgrgid, getgrnam, getgroups};
-use libc::{getpwnam, getpwuid, group, passwd};
-
-use std::ffi::{CStr, CString};
-use std::io::Error as IOError;
-use std::io::ErrorKind;
-use std::io::Result as IOResult;
-use std::ptr;
-use std::sync::Mutex;
-
-use once_cell::sync::Lazy;
-
-extern "C" {
-    /// From: `<https://man7.org/linux/man-pages/man3/getgrouplist.3.html>`
-    /// > The getgrouplist() function scans the group database to obtain
-    /// > the list of groups that user belongs to.
-    fn getgrouplist(
-        name: *const c_char,
-        gid: gid_t,
-        groups: *mut gid_t,
-        ngroups: *mut c_int,
-    ) -> c_int;
-}
-
-/// From: `<https://man7.org/linux/man-pages/man2/getgroups.2.html>`
-/// > getgroups() returns the supplementary group IDs of the calling
-/// > process in list.
-/// > If size is zero, list is not modified, but the total number of
-/// > supplementary group IDs for the process is returned.  This allows
-/// > the caller to determine the size of a dynamically allocated list
-/// > to be used in a further call to getgroups().
-#[cfg(not(target_os = "redox"))]
-pub fn get_groups() -> IOResult<Vec<gid_t>> {
-    let mut groups = Vec::new();
-    loop {
-        let ngroups = match unsafe { getgroups(0, ptr::null_mut()) } {
-            -1 => return Err(IOError::last_os_error()),
-            // Not just optimization; 0 would mess up the next call
-            0 => return Ok(Vec::new()),
-            n => n,
-        };
-
-        // This is a small buffer, so we can afford to zero-initialize it and
-        // use safe Vec operations
-        groups.resize(ngroups.try_into().unwrap(), 0);
-        let res = unsafe { getgroups(ngroups, groups.as_mut_ptr()) };
-        if res == -1 {
-            let err = IOError::last_os_error();
-            if err.raw_os_error() == Some(libc::EINVAL) {
-                // Number of groups changed, retry
-                continue;
-            } else {
-                return Err(err);
-            }
-        } else {
-            groups.truncate(ngroups.try_into().unwrap());
-            return Ok(groups);
-        }
-    }
-}
-
-/// The list of group IDs returned from GNU's `groups` and GNU's `id --groups`
-/// starts with the effective group ID (egid).
-/// This is a wrapper for `get_groups()` to mimic this behavior.
-///
-/// If `arg_id` is `None` (default), `get_groups_gnu` moves the effective
-/// group id (egid) to the first entry in the returned Vector.
-/// If `arg_id` is `Some(x)`, `get_groups_gnu` moves the id with value `x`
-/// to the first entry in the returned Vector. This might be necessary
-/// for `id --groups --real` if `gid` and `egid` are not equal.
-///
-/// From: `<https://www.man7.org/linux/man-pages/man3/getgroups.3p.html>`
-/// > As implied by the definition of supplementary groups, the
-/// > effective group ID may appear in the array returned by
-/// > getgroups() or it may be returned only by getegid().  Duplication
-/// > may exist, but the application needs to call getegid() to be sure
-/// > of getting all of the information. Various implementation
-/// > variations and administrative sequences cause the set of groups
-/// > appearing in the result of getgroups() to vary in order and as to
-/// > whether the effective group ID is included, even when the set of
-/// > groups is the same (in the mathematical sense of ``set''). (The
-/// > history of a process and its parents could affect the details of
-/// > the result.)
-#[cfg(all(unix, not(target_os = "redox"), feature = "process"))]
-pub fn get_groups_gnu(arg_id: Option<u32>) -> IOResult<Vec<gid_t>> {
-    let groups = get_groups()?;
-    let egid = arg_id.unwrap_or_else(crate::features::process::getegid);
-    Ok(sort_groups(groups, egid))
-}
-
-#[cfg(all(unix, feature = "process"))]
-fn sort_groups(mut groups: Vec<gid_t>, egid: gid_t) -> Vec<gid_t> {
-    if let Some(index) = groups.iter().position(|&x| x == egid) {
-        groups[..=index].rotate_right(1);
-    } else {
-        groups.insert(0, egid);
-    }
-    groups
-}
-
-#[derive(Clone, Debug)]
-pub struct Passwd {
-    /// AKA passwd.pw_name
-    pub name: String,
-    /// AKA passwd.pw_uid
-    pub uid: uid_t,
-    /// AKA passwd.pw_gid
-    pub gid: gid_t,
-    /// AKA passwd.pw_gecos
-    pub user_info: Option<String>,
-    /// AKA passwd.pw_shell
-    pub user_shell: Option<String>,
-    /// AKA passwd.pw_dir
-    pub user_dir: Option<String>,
-    /// AKA passwd.pw_passwd
-    pub user_passwd: Option<String>,
-    /// AKA passwd.pw_class
-    #[cfg(any(target_os = "freebsd", target_vendor = "apple"))]
-    pub user_access_class: Option<String>,
-    /// AKA passwd.pw_change
-    #[cfg(any(target_os = "freebsd", target_vendor = "apple"))]
-    pub passwd_change_time: time_t,
-    /// AKA passwd.pw_expire
-    #[cfg(any(target_os = "freebsd", target_vendor = "apple"))]
-    pub expiration: time_t,
-}
-
-/// SAFETY: ptr must point to a valid C string.
-/// Returns None if ptr is null.
-unsafe fn cstr2string(ptr: *const c_char) -> Option<String> {
-    if ptr.is_null() {
-        None
-    } else {
-        Some(CStr::from_ptr(ptr).to_string_lossy().into_owned())
-    }
-}
-
-impl Passwd {
-    /// SAFETY: All the pointed-to strings must be valid and not change while
-    /// the function runs. That means PW_LOCK must be held.
-    unsafe fn from_raw(raw: passwd) -> Self {
-        Self {
-            name: cstr2string(raw.pw_name).expect("passwd without name"),
-            uid: raw.pw_uid,
-            gid: raw.pw_gid,
-            #[cfg(not(all(
-                target_os = "android",
-                any(target_arch = "x86", target_arch = "arm")
-            )))]
-            user_info: cstr2string(raw.pw_gecos),
-            #[cfg(all(target_os = "android", any(target_arch = "x86", target_arch = "arm")))]
-            user_info: None,
-            user_shell: cstr2string(raw.pw_shell),
-            user_dir: cstr2string(raw.pw_dir),
-            user_passwd: cstr2string(raw.pw_passwd),
-            #[cfg(any(target_os = "freebsd", target_vendor = "apple"))]
-            user_access_class: cstr2string(raw.pw_class),
-            #[cfg(any(target_os = "freebsd", target_vendor = "apple"))]
-            passwd_change_time: raw.pw_change,
-            #[cfg(any(target_os = "freebsd", target_vendor = "apple"))]
-            expiration: raw.pw_expire,
-        }
-    }
-
-    /// This is a wrapper function for `libc::getgrouplist`.
-    ///
-    /// From: `<https://man7.org/linux/man-pages/man3/getgrouplist.3.html>`
-    /// > If the number of groups of which user is a member is less than or
-    /// > equal to *ngroups, then the value *ngroups is returned.
-    /// > If the user is a member of more than *ngroups groups, then
-    /// > getgrouplist() returns -1.  In this case, the value returned in
-    /// > *ngroups can be used to resize the buffer passed to a further
-    /// > call getgrouplist().
-    ///
-    /// However, on macOS/darwin (and maybe others?) `getgrouplist` does
-    /// not update `ngroups` if `ngroups` is too small. Therefore, if not
-    /// updated by `getgrouplist`, `ngroups` needs to be increased in a
-    /// loop until `getgrouplist` stops returning -1.
-    pub fn belongs_to(&self) -> Vec<gid_t> {
-        let mut ngroups: c_int = 8;
-        let mut ngroups_old: c_int;
-        let mut groups = vec![0; ngroups.try_into().unwrap()];
-        let name = CString::new(self.name.clone()).unwrap();
-        loop {
-            ngroups_old = ngroups;
-            if unsafe { getgrouplist(name.as_ptr(), self.gid, groups.as_mut_ptr(), &mut ngroups) }
-                == -1
-            {
-                if ngroups == ngroups_old {
-                    ngroups *= 2;
-                }
-                groups.resize(ngroups.try_into().unwrap(), 0);
-            } else {
-                break;
-            }
-        }
-        let ngroups = ngroups.try_into().unwrap();
-        assert!(ngroups <= groups.len());
-        groups.truncate(ngroups);
-        groups
-    }
-}
-
-#[derive(Clone, Debug)]
-pub struct Group {
-    /// AKA group.gr_name
-    pub name: String,
-    /// AKA group.gr_gid
-    pub gid: gid_t,
-}
-
-impl Group {
-    /// SAFETY: gr_name must be valid and not change while
-    /// the function runs. That means PW_LOCK must be held.
-    unsafe fn from_raw(raw: group) -> Self {
-        Self {
-            name: cstr2string(raw.gr_name).expect("group without name"),
-            gid: raw.gr_gid,
-        }
-    }
-}
-
-/// Fetch desired entry.
-pub trait Locate<K> {
-    fn locate(key: K) -> IOResult<Self>
-    where
-        Self: ::std::marker::Sized;
-}
-
-// These functions are not thread-safe:
-// > The return value may point to a static area, and may be
-// > overwritten by subsequent calls to getpwent(3), getpwnam(),
-// > or getpwuid().
-// This applies not just to the struct but also the strings it points
-// to, so we must copy all the data we want before releasing the lock.
-// (Technically we must also ensure that the raw functions aren't being called
-// anywhere else in the program.)
-static PW_LOCK: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
-
-macro_rules! f {
-    ($fnam:ident, $fid:ident, $t:ident, $st:ident) => {
-        impl Locate<$t> for $st {
-            fn locate(k: $t) -> IOResult<Self> {
-                let _guard = PW_LOCK.lock();
-                // SAFETY: We're holding PW_LOCK.
-                unsafe {
-                    let data = $fid(k);
-                    if !data.is_null() {
-                        Ok($st::from_raw(ptr::read(data as *const _)))
-                    } else {
-                        // FIXME: Resource limits, signals and I/O failure may
-                        // cause this too. See getpwnam(3).
-                        // errno must be set to zero before the call. We can
-                        // use libc::__errno_location() on some platforms.
-                        // The same applies for the two cases below.
-                        Err(IOError::new(
-                            ErrorKind::NotFound,
-                            format!("No such id: {}", k),
-                        ))
-                    }
-                }
-            }
-        }
-
-        impl<'a> Locate<&'a str> for $st {
-            fn locate(k: &'a str) -> IOResult<Self> {
-                let _guard = PW_LOCK.lock();
-                if let Ok(id) = k.parse::<$t>() {
-                    // SAFETY: We're holding PW_LOCK.
-                    unsafe {
-                        let data = $fid(id);
-                        if !data.is_null() {
-                            Ok($st::from_raw(ptr::read(data as *const _)))
-                        } else {
-                            Err(IOError::new(
-                                ErrorKind::NotFound,
-                                format!("No such id: {}", id),
-                            ))
-                        }
-                    }
-                } else {
-                    // SAFETY: We're holding PW_LOCK.
-                    unsafe {
-                        let cstring = CString::new(k).unwrap();
-                        let data = $fnam(cstring.as_ptr());
-                        if !data.is_null() {
-                            Ok($st::from_raw(ptr::read(data as *const _)))
-                        } else {
-                            Err(IOError::new(
-                                ErrorKind::NotFound,
-                                format!("Not found: {}", k),
-                            ))
-                        }
-                    }
-                }
-            }
-        }
-    };
-}
-
-f!(getpwnam, getpwuid, uid_t, Passwd);
-#[cfg(not(target_os = "redox"))]
-f!(getgrnam, getgrgid, gid_t, Group);
-
-#[inline]
-pub fn uid2usr(id: uid_t) -> IOResult<String> {
-    Passwd::locate(id).map(|p| p.name)
-}
-
-#[cfg(not(target_os = "redox"))]
-#[inline]
-pub fn gid2grp(id: gid_t) -> IOResult<String> {
-    Group::locate(id).map(|p| p.name)
-}
-
-#[inline]
-pub fn usr2uid(name: &str) -> IOResult<uid_t> {
-    Passwd::locate(name).map(|p| p.uid)
-}
-
-#[cfg(not(target_os = "redox"))]
-#[inline]
-pub fn grp2gid(name: &str) -> IOResult<gid_t> {
-    Group::locate(name).map(|p| p.gid)
-}
-
-#[cfg(test)]
-mod test {
-    use super::*;
-
-    #[test]
-    fn test_sort_groups() {
-        assert_eq!(sort_groups(vec![1, 2, 3], 4), vec![4, 1, 2, 3]);
-        assert_eq!(sort_groups(vec![1, 2, 3], 3), vec![3, 1, 2]);
-        assert_eq!(sort_groups(vec![1, 2, 3], 2), vec![2, 1, 3]);
-        assert_eq!(sort_groups(vec![1, 2, 3], 1), vec![1, 2, 3]);
-        assert_eq!(sort_groups(vec![1, 2, 3], 0), vec![0, 1, 2, 3]);
-    }
-
-    #[test]
-    fn test_entries_get_groups_gnu() {
-        if let Ok(mut groups) = get_groups() {
-            if let Some(last) = groups.pop() {
-                groups.insert(0, last);
-                assert_eq!(get_groups_gnu(Some(last)).unwrap(), groups);
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/fs.rs.html b/coreutils/dev/src/uucore/features/fs.rs.html deleted file mode 100644 index c49e22721..000000000 --- a/coreutils/dev/src/uucore/features/fs.rs.html +++ /dev/null @@ -1,1757 +0,0 @@ -fs.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-
// This file is part of the uutils coreutils package.
-//
-// (c) Joseph Crail <jbcrail@gmail.com>
-// (c) Jian Zeng <anonymousknight96 AT gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-//! Set of functions to manage files and symlinks
-
-// spell-checker:ignore backport
-
-#[cfg(unix)]
-use libc::{
-    mode_t, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK, S_IFMT, S_IFREG, S_IFSOCK, S_IRGRP,
-    S_IROTH, S_IRUSR, S_ISGID, S_ISUID, S_ISVTX, S_IWGRP, S_IWOTH, S_IWUSR, S_IXGRP, S_IXOTH,
-    S_IXUSR,
-};
-use std::borrow::Cow;
-use std::collections::HashSet;
-use std::collections::VecDeque;
-use std::env;
-use std::ffi::{OsStr, OsString};
-use std::fs;
-use std::fs::read_dir;
-use std::hash::Hash;
-use std::io::{Error, ErrorKind, Result as IOResult};
-#[cfg(unix)]
-use std::os::unix::{fs::MetadataExt, io::AsRawFd};
-use std::path::{Component, Path, PathBuf, MAIN_SEPARATOR};
-#[cfg(target_os = "windows")]
-use winapi_util::AsHandleRef;
-
-/// Used to check if the `mode` has its `perm` bit set.
-///
-/// This macro expands to `mode & perm != 0`.
-#[cfg(unix)]
-#[macro_export]
-macro_rules! has {
-    ($mode:expr, $perm:expr) => {
-        $mode & $perm != 0
-    };
-}
-
-/// Information to uniquely identify a file
-pub struct FileInformation(
-    #[cfg(unix)] nix::sys::stat::FileStat,
-    #[cfg(windows)] winapi_util::file::Information,
-);
-
-impl FileInformation {
-    /// Get information from a currently open file
-    #[cfg(unix)]
-    pub fn from_file(file: &impl AsRawFd) -> IOResult<Self> {
-        let stat = nix::sys::stat::fstat(file.as_raw_fd())?;
-        Ok(Self(stat))
-    }
-
-    /// Get information from a currently open file
-    #[cfg(target_os = "windows")]
-    pub fn from_file(file: &impl AsHandleRef) -> IOResult<Self> {
-        let info = winapi_util::file::information(file.as_handle_ref())?;
-        Ok(Self(info))
-    }
-
-    /// Get information for a given path.
-    ///
-    /// If `path` points to a symlink and `dereference` is true, information about
-    /// the link's target will be returned.
-    pub fn from_path(path: impl AsRef<Path>, dereference: bool) -> IOResult<Self> {
-        #[cfg(unix)]
-        {
-            let stat = if dereference {
-                nix::sys::stat::stat(path.as_ref())
-            } else {
-                nix::sys::stat::lstat(path.as_ref())
-            };
-            Ok(Self(stat?))
-        }
-        #[cfg(target_os = "windows")]
-        {
-            use std::fs::OpenOptions;
-            use std::os::windows::prelude::*;
-            let mut open_options = OpenOptions::new();
-            let mut custom_flags = 0;
-            if !dereference {
-                custom_flags |=
-                    windows_sys::Win32::Storage::FileSystem::FILE_FLAG_OPEN_REPARSE_POINT;
-            }
-            custom_flags |= windows_sys::Win32::Storage::FileSystem::FILE_FLAG_BACKUP_SEMANTICS;
-            open_options.custom_flags(custom_flags);
-            let file = open_options.read(true).open(path.as_ref())?;
-            Self::from_file(&file)
-        }
-    }
-
-    pub fn file_size(&self) -> u64 {
-        #[cfg(unix)]
-        {
-            assert!(self.0.st_size >= 0, "File size is negative");
-            self.0.st_size.try_into().unwrap()
-        }
-        #[cfg(target_os = "windows")]
-        {
-            self.0.file_size()
-        }
-    }
-
-    #[cfg(windows)]
-    pub fn file_index(&self) -> u64 {
-        self.0.file_index()
-    }
-
-    pub fn number_of_links(&self) -> u64 {
-        #[cfg(all(
-            unix,
-            not(target_vendor = "apple"),
-            not(target_os = "android"),
-            not(target_os = "freebsd"),
-            not(target_arch = "aarch64"),
-            not(target_arch = "riscv64"),
-            target_pointer_width = "64"
-        ))]
-        return self.0.st_nlink;
-        #[cfg(all(
-            unix,
-            any(
-                target_vendor = "apple",
-                target_os = "android",
-                target_os = "freebsd",
-                target_arch = "aarch64",
-                target_arch = "riscv64",
-                not(target_pointer_width = "64")
-            )
-        ))]
-        return self.0.st_nlink.into();
-        #[cfg(windows)]
-        return self.0.number_of_links();
-    }
-
-    #[cfg(unix)]
-    pub fn inode(&self) -> u64 {
-        #[cfg(all(not(target_os = "freebsd"), target_pointer_width = "64"))]
-        return self.0.st_ino;
-        #[cfg(any(target_os = "freebsd", not(target_pointer_width = "64")))]
-        return self.0.st_ino.into();
-    }
-}
-
-#[cfg(unix)]
-impl PartialEq for FileInformation {
-    fn eq(&self, other: &Self) -> bool {
-        self.0.st_dev == other.0.st_dev && self.0.st_ino == other.0.st_ino
-    }
-}
-
-#[cfg(target_os = "windows")]
-impl PartialEq for FileInformation {
-    fn eq(&self, other: &Self) -> bool {
-        self.0.volume_serial_number() == other.0.volume_serial_number()
-            && self.0.file_index() == other.0.file_index()
-    }
-}
-
-impl Eq for FileInformation {}
-
-impl Hash for FileInformation {
-    fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
-        #[cfg(unix)]
-        {
-            self.0.st_dev.hash(state);
-            self.0.st_ino.hash(state);
-        }
-        #[cfg(target_os = "windows")]
-        {
-            self.0.volume_serial_number().hash(state);
-            self.0.file_index().hash(state);
-        }
-    }
-}
-
-/// resolve a relative path
-pub fn resolve_relative_path(path: &Path) -> Cow<Path> {
-    if path.components().all(|e| e != Component::ParentDir) {
-        return path.into();
-    }
-    let root = Component::RootDir.as_os_str();
-    let mut result = env::current_dir().unwrap_or_else(|_| PathBuf::from(root));
-    for comp in path.components() {
-        match comp {
-            Component::ParentDir => {
-                if let Ok(p) = result.read_link() {
-                    result = p;
-                }
-                result.pop();
-            }
-            Component::CurDir => (),
-            Component::RootDir | Component::Normal(_) | Component::Prefix(_) => {
-                result.push(comp.as_os_str());
-            }
-        }
-    }
-    result.into()
-}
-
-/// Controls how symbolic links should be handled when canonicalizing a path.
-#[derive(Clone, Copy, Debug, Eq, PartialEq)]
-pub enum MissingHandling {
-    /// Return an error if any part of the path is missing.
-    Normal,
-
-    /// Resolve symbolic links, ignoring errors on the final component.
-    Existing,
-
-    /// Resolve symbolic links, ignoring errors on the non-final components.
-    Missing,
-}
-
-/// Controls when symbolic links are resolved
-#[derive(Clone, Copy, Debug, Eq, PartialEq)]
-pub enum ResolveMode {
-    /// Do not resolve any symbolic links.
-    None,
-
-    /// Resolve symlinks as encountered when processing the path
-    Physical,
-
-    /// Resolve '..' elements before symlinks
-    Logical,
-}
-
-/// Normalize a path by removing relative information
-/// For example, convert 'bar/../foo/bar.txt' => 'foo/bar.txt'
-/// copied from `<https://github.com/rust-lang/cargo/blob/2e4cfc2b7d43328b207879228a2ca7d427d188bb/src/cargo/util/paths.rs#L65-L90>`
-/// both projects are MIT `<https://github.com/rust-lang/cargo/blob/master/LICENSE-MIT>`
-/// for std impl progress see rfc `<https://github.com/rust-lang/rfcs/issues/2208>`
-/// replace this once that lands
-pub fn normalize_path(path: &Path) -> PathBuf {
-    let mut components = path.components().peekable();
-    let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() {
-        components.next();
-        PathBuf::from(c.as_os_str())
-    } else {
-        PathBuf::new()
-    };
-
-    for component in components {
-        match component {
-            Component::Prefix(..) => unreachable!(),
-            Component::RootDir => {
-                ret.push(component.as_os_str());
-            }
-            Component::CurDir => {}
-            Component::ParentDir => {
-                ret.pop();
-            }
-            Component::Normal(c) => {
-                ret.push(c);
-            }
-        }
-    }
-    ret
-}
-
-fn resolve_symlink<P: AsRef<Path>>(path: P) -> IOResult<Option<PathBuf>> {
-    let result = if fs::symlink_metadata(&path)?.file_type().is_symlink() {
-        Some(fs::read_link(&path)?)
-    } else {
-        None
-    };
-    Ok(result)
-}
-
-enum OwningComponent {
-    Prefix(OsString),
-    RootDir,
-    CurDir,
-    ParentDir,
-    Normal(OsString),
-}
-
-impl OwningComponent {
-    fn as_os_str(&self) -> &OsStr {
-        match self {
-            Self::Prefix(s) => s.as_os_str(),
-            Self::RootDir => Component::RootDir.as_os_str(),
-            Self::CurDir => Component::CurDir.as_os_str(),
-            Self::ParentDir => Component::ParentDir.as_os_str(),
-            Self::Normal(s) => s.as_os_str(),
-        }
-    }
-}
-
-impl<'a> From<Component<'a>> for OwningComponent {
-    fn from(comp: Component<'a>) -> Self {
-        match comp {
-            Component::Prefix(_) => Self::Prefix(comp.as_os_str().to_os_string()),
-            Component::RootDir => Self::RootDir,
-            Component::CurDir => Self::CurDir,
-            Component::ParentDir => Self::ParentDir,
-            Component::Normal(s) => Self::Normal(s.to_os_string()),
-        }
-    }
-}
-
-/// Return the canonical, absolute form of a path.
-///
-/// This function is a generalization of [`std::fs::canonicalize`] that
-/// allows controlling how symbolic links are resolved and how to deal
-/// with missing components. It returns the canonical, absolute form of
-/// a path.
-/// The `miss_mode` parameter controls how missing path elements are handled
-///
-/// * [`MissingHandling::Normal`] makes this function behave like
-///   [`std::fs::canonicalize`], resolving symbolic links and returning
-///   an error if the path does not exist.
-/// * [`MissingHandling::Missing`] makes this function ignore non-final
-///   components of the path that could not be resolved.
-/// * [`MissingHandling::Existing`] makes this function return an error
-///   if the final component of the path does not exist.
-///
-/// The `res_mode` parameter controls how symbolic links are
-/// resolved:
-///
-/// * [`ResolveMode::None`] makes this function not try to resolve
-///   any symbolic links.
-/// * [`ResolveMode::Physical`] makes this function resolve symlinks as they
-///   are encountered
-/// * [`ResolveMode::Logical`] makes this function resolve '..' components
-///   before symlinks
-///
-#[allow(clippy::cognitive_complexity)]
-pub fn canonicalize<P: AsRef<Path>>(
-    original: P,
-    miss_mode: MissingHandling,
-    res_mode: ResolveMode,
-) -> IOResult<PathBuf> {
-    const SYMLINKS_TO_LOOK_FOR_LOOPS: i32 = 20;
-    let original = original.as_ref();
-    let has_to_be_directory =
-        (miss_mode == MissingHandling::Normal || miss_mode == MissingHandling::Existing) && {
-            let path_str = original.to_string_lossy();
-            path_str.ends_with(MAIN_SEPARATOR) || path_str.ends_with('/')
-        };
-    let original = if original.is_absolute() {
-        original.to_path_buf()
-    } else {
-        let current_dir = env::current_dir()?;
-        dunce::canonicalize(current_dir)?.join(original)
-    };
-    let path = if res_mode == ResolveMode::Logical {
-        normalize_path(&original)
-    } else {
-        original
-    };
-    let mut parts: VecDeque<OwningComponent> = path.components().map(|part| part.into()).collect();
-    let mut result = PathBuf::new();
-    let mut followed_symlinks = 0;
-    let mut visited_files = HashSet::new();
-    while let Some(part) = parts.pop_front() {
-        match part {
-            OwningComponent::Prefix(s) => {
-                result.push(s);
-                continue;
-            }
-            OwningComponent::RootDir | OwningComponent::Normal(..) => {
-                result.push(part.as_os_str());
-            }
-            OwningComponent::CurDir => {}
-            OwningComponent::ParentDir => {
-                result.pop();
-            }
-        }
-        if res_mode == ResolveMode::None {
-            continue;
-        }
-        match resolve_symlink(&result) {
-            Ok(Some(link_path)) => {
-                for link_part in link_path.components().rev() {
-                    parts.push_front(link_part.into());
-                }
-                if followed_symlinks < SYMLINKS_TO_LOOK_FOR_LOOPS {
-                    followed_symlinks += 1;
-                } else {
-                    let file_info =
-                        FileInformation::from_path(result.parent().unwrap(), false).unwrap();
-                    let mut path_to_follow = PathBuf::new();
-                    for part in &parts {
-                        path_to_follow.push(part.as_os_str());
-                    }
-                    if !visited_files.insert((file_info, path_to_follow)) {
-                        return Err(Error::new(
-                            ErrorKind::InvalidInput,
-                            "Too many levels of symbolic links",
-                        )); // TODO use ErrorKind::FilesystemLoop when stable
-                    }
-                }
-                result.pop();
-            }
-            Err(e) => {
-                if miss_mode == MissingHandling::Existing
-                    || (miss_mode == MissingHandling::Normal && !parts.is_empty())
-                {
-                    return Err(e);
-                }
-            }
-            _ => {}
-        }
-    }
-    // raise Not a directory if required
-    match miss_mode {
-        MissingHandling::Existing => {
-            if has_to_be_directory {
-                read_dir(&result)?;
-            }
-        }
-        MissingHandling::Normal => {
-            if result.exists() {
-                if has_to_be_directory {
-                    read_dir(&result)?;
-                }
-            } else if let Some(parent) = result.parent() {
-                read_dir(parent)?;
-            }
-        }
-        MissingHandling::Missing => {}
-    }
-    Ok(result)
-}
-
-#[cfg(not(unix))]
-pub fn display_permissions(metadata: &fs::Metadata, display_file_type: bool) -> String {
-    let write = if metadata.permissions().readonly() {
-        '-'
-    } else {
-        'w'
-    };
-
-    if display_file_type {
-        let file_type = if metadata.is_symlink() {
-            'l'
-        } else if metadata.is_dir() {
-            'd'
-        } else {
-            '-'
-        };
-
-        format!("{file_type}r{write}xr{write}xr{write}x")
-    } else {
-        format!("r{write}xr{write}xr{write}x")
-    }
-}
-
-#[cfg(unix)]
-/// Display the permissions of a file
-/// On non unix like system, just show '----------'
-pub fn display_permissions(metadata: &fs::Metadata, display_file_type: bool) -> String {
-    let mode: mode_t = metadata.mode() as mode_t;
-    display_permissions_unix(mode, display_file_type)
-}
-
-// The logic below is more readable written this way.
-#[allow(clippy::if_not_else)]
-#[allow(clippy::cognitive_complexity)]
-#[cfg(unix)]
-/// Display the permissions of a file on a unix like system
-pub fn display_permissions_unix(mode: mode_t, display_file_type: bool) -> String {
-    let mut result;
-    if display_file_type {
-        result = String::with_capacity(10);
-        result.push(match mode & S_IFMT {
-            S_IFDIR => 'd',
-            S_IFCHR => 'c',
-            S_IFBLK => 'b',
-            S_IFREG => '-',
-            S_IFIFO => 'p',
-            S_IFLNK => 'l',
-            S_IFSOCK => 's',
-            // TODO: Other file types
-            _ => '?',
-        });
-    } else {
-        result = String::with_capacity(9);
-    }
-
-    result.push(if has!(mode, S_IRUSR) { 'r' } else { '-' });
-    result.push(if has!(mode, S_IWUSR) { 'w' } else { '-' });
-    result.push(if has!(mode, S_ISUID as mode_t) {
-        if has!(mode, S_IXUSR) {
-            's'
-        } else {
-            'S'
-        }
-    } else if has!(mode, S_IXUSR) {
-        'x'
-    } else {
-        '-'
-    });
-
-    result.push(if has!(mode, S_IRGRP) { 'r' } else { '-' });
-    result.push(if has!(mode, S_IWGRP) { 'w' } else { '-' });
-    result.push(if has!(mode, S_ISGID as mode_t) {
-        if has!(mode, S_IXGRP) {
-            's'
-        } else {
-            'S'
-        }
-    } else if has!(mode, S_IXGRP) {
-        'x'
-    } else {
-        '-'
-    });
-
-    result.push(if has!(mode, S_IROTH) { 'r' } else { '-' });
-    result.push(if has!(mode, S_IWOTH) { 'w' } else { '-' });
-    result.push(if has!(mode, S_ISVTX as mode_t) {
-        if has!(mode, S_IXOTH) {
-            't'
-        } else {
-            'T'
-        }
-    } else if has!(mode, S_IXOTH) {
-        'x'
-    } else {
-        '-'
-    });
-
-    result
-}
-
-/// For some programs like install or mkdir, dir/. can be provided
-/// Special case to match GNU's behavior:
-/// install -d foo/. should work and just create foo/
-/// std::fs::create_dir("foo/."); fails in pure Rust
-pub fn dir_strip_dot_for_creation(path: &Path) -> PathBuf {
-    if path.to_string_lossy().ends_with("/.") {
-        // Do a simple dance to strip the "/."
-        Path::new(&path).components().collect::<PathBuf>()
-    } else {
-        path.to_path_buf()
-    }
-}
-
-/// Checks if `p1` and `p2` are the same file.
-/// If error happens when trying to get files' metadata, returns false
-pub fn paths_refer_to_same_file<P: AsRef<Path>>(p1: P, p2: P, dereference: bool) -> bool {
-    infos_refer_to_same_file(
-        FileInformation::from_path(p1, dereference),
-        FileInformation::from_path(p2, dereference),
-    )
-}
-
-/// Checks if `p1` and `p2` are the same file information.
-/// If error happens when trying to get files' metadata, returns false
-pub fn infos_refer_to_same_file(
-    info1: IOResult<FileInformation>,
-    info2: IOResult<FileInformation>,
-) -> bool {
-    if let Ok(info1) = info1 {
-        if let Ok(info2) = info2 {
-            return info1 == info2;
-        }
-    }
-    false
-}
-
-/// Converts absolute `path` to be relative to absolute `to` path.
-pub fn make_path_relative_to<P1: AsRef<Path>, P2: AsRef<Path>>(path: P1, to: P2) -> PathBuf {
-    let path = path.as_ref();
-    let to = to.as_ref();
-    let common_prefix_size = path
-        .components()
-        .zip(to.components())
-        .take_while(|(first, second)| first == second)
-        .count();
-    let path_suffix = path
-        .components()
-        .skip(common_prefix_size)
-        .map(|x| x.as_os_str());
-    let mut components: Vec<_> = to
-        .components()
-        .skip(common_prefix_size)
-        .map(|_| Component::ParentDir.as_os_str())
-        .chain(path_suffix)
-        .collect();
-    if components.is_empty() {
-        components.push(Component::CurDir.as_os_str());
-    }
-    components.iter().collect()
-}
-
-/// Checks if there is a symlink loop in the given path.
-///
-/// A symlink loop is a chain of symlinks where the last symlink points back to one of the previous symlinks in the chain.
-///
-/// # Arguments
-///
-/// * `path` - A reference to a `Path` representing the starting path to check for symlink loops.
-///
-/// # Returns
-///
-/// * `bool` - Returns `true` if a symlink loop is detected, `false` otherwise.
-pub fn is_symlink_loop(path: &Path) -> bool {
-    let mut visited_symlinks = HashSet::new();
-    let mut current_path = path.to_path_buf();
-
-    while let (Ok(metadata), Ok(link)) = (
-        current_path.symlink_metadata(),
-        fs::read_link(&current_path),
-    ) {
-        if !metadata.file_type().is_symlink() {
-            return false;
-        }
-        if !visited_symlinks.insert(current_path.clone()) {
-            return true;
-        }
-        current_path = link;
-    }
-
-    false
-}
-
-#[cfg(not(unix))]
-// Hard link comparison is not supported on non-Unix platforms
-pub fn are_hardlinks_to_same_file(_source: &Path, _target: &Path) -> bool {
-    false
-}
-
-/// Checks if two paths are hard links to the same file.
-///
-/// # Arguments
-///
-/// * `source` - A reference to a `Path` representing the source path.
-/// * `target` - A reference to a `Path` representing the target path.
-///
-/// # Returns
-///
-/// * `bool` - Returns `true` if the paths are hard links to the same file, and `false` otherwise.
-#[cfg(unix)]
-pub fn are_hardlinks_to_same_file(source: &Path, target: &Path) -> bool {
-    let source_metadata = match fs::symlink_metadata(source) {
-        Ok(metadata) => metadata,
-        Err(_) => return false,
-    };
-
-    let target_metadata = match fs::symlink_metadata(target) {
-        Ok(metadata) => metadata,
-        Err(_) => return false,
-    };
-
-    source_metadata.ino() == target_metadata.ino() && source_metadata.dev() == target_metadata.dev()
-}
-
-#[cfg(not(unix))]
-pub fn are_hardlinks_or_one_way_symlink_to_same_file(_source: &Path, _target: &Path) -> bool {
-    false
-}
-
-/// Checks if either two paths are hard links to the same file or if the source path is a symbolic link which when fully resolved points to target path
-///
-/// # Arguments
-///
-/// * `source` - A reference to a `Path` representing the source path.
-/// * `target` - A reference to a `Path` representing the target path.
-///
-/// # Returns
-///
-/// * `bool` - Returns `true` if either of above conditions are true, and `false` otherwise.
-#[cfg(unix)]
-pub fn are_hardlinks_or_one_way_symlink_to_same_file(source: &Path, target: &Path) -> bool {
-    let source_metadata = match fs::metadata(source) {
-        Ok(metadata) => metadata,
-        Err(_) => return false,
-    };
-
-    let target_metadata = match fs::symlink_metadata(target) {
-        Ok(metadata) => metadata,
-        Err(_) => return false,
-    };
-
-    source_metadata.ino() == target_metadata.ino() && source_metadata.dev() == target_metadata.dev()
-}
-
-#[cfg(test)]
-mod tests {
-    // Note this useful idiom: importing names from outer (for mod tests) scope.
-    use super::*;
-    #[cfg(unix)]
-    use std::io::Write;
-    #[cfg(unix)]
-    use std::os::unix;
-    #[cfg(unix)]
-    use tempfile::{tempdir, NamedTempFile};
-
-    struct NormalizePathTestCase<'a> {
-        path: &'a str,
-        test: &'a str,
-    }
-
-    const NORMALIZE_PATH_TESTS: [NormalizePathTestCase; 8] = [
-        NormalizePathTestCase {
-            path: "./foo/bar.txt",
-            test: "foo/bar.txt",
-        },
-        NormalizePathTestCase {
-            path: "bar/../foo/bar.txt",
-            test: "foo/bar.txt",
-        },
-        NormalizePathTestCase {
-            path: "foo///bar.txt",
-            test: "foo/bar.txt",
-        },
-        NormalizePathTestCase {
-            path: "foo///bar",
-            test: "foo/bar",
-        },
-        NormalizePathTestCase {
-            path: "foo//./bar",
-            test: "foo/bar",
-        },
-        NormalizePathTestCase {
-            path: "/foo//./bar",
-            test: "/foo/bar",
-        },
-        NormalizePathTestCase {
-            path: r"C:/you/later/",
-            test: "C:/you/later",
-        },
-        NormalizePathTestCase {
-            path: "\\networkShare/a//foo//./bar",
-            test: "\\networkShare/a/foo/bar",
-        },
-    ];
-
-    #[test]
-    fn test_normalize_path() {
-        for test in &NORMALIZE_PATH_TESTS {
-            let path = Path::new(test.path);
-            let normalized = normalize_path(path);
-            assert_eq!(
-                test.test
-                    .replace('/', std::path::MAIN_SEPARATOR.to_string().as_str()),
-                normalized.to_str().expect("Path is not valid utf-8!")
-            );
-        }
-    }
-
-    #[cfg(unix)]
-    #[test]
-    fn test_display_permissions() {
-        // spell-checker:ignore (perms) brwsr drwxr rwxr
-        assert_eq!(
-            "drwxr-xr-x",
-            display_permissions_unix(S_IFDIR | 0o755, true)
-        );
-        assert_eq!(
-            "rwxr-xr-x",
-            display_permissions_unix(S_IFDIR | 0o755, false)
-        );
-        assert_eq!(
-            "-rw-r--r--",
-            display_permissions_unix(S_IFREG | 0o644, true)
-        );
-        assert_eq!(
-            "srw-r-----",
-            display_permissions_unix(S_IFSOCK | 0o640, true)
-        );
-        assert_eq!(
-            "lrw-r-xr-x",
-            display_permissions_unix(S_IFLNK | 0o655, true)
-        );
-        assert_eq!("?rw-r-xr-x", display_permissions_unix(0o655, true));
-
-        assert_eq!(
-            "brwSr-xr-x",
-            display_permissions_unix(S_IFBLK | S_ISUID as mode_t | 0o655, true)
-        );
-        assert_eq!(
-            "brwsr-xr-x",
-            display_permissions_unix(S_IFBLK | S_ISUID as mode_t | 0o755, true)
-        );
-
-        assert_eq!(
-            "prw---sr--",
-            display_permissions_unix(S_IFIFO | S_ISGID as mode_t | 0o614, true)
-        );
-        assert_eq!(
-            "prw---Sr--",
-            display_permissions_unix(S_IFIFO | S_ISGID as mode_t | 0o604, true)
-        );
-
-        assert_eq!(
-            "c---r-xr-t",
-            display_permissions_unix(S_IFCHR | S_ISVTX as mode_t | 0o055, true)
-        );
-        assert_eq!(
-            "c---r-xr-T",
-            display_permissions_unix(S_IFCHR | S_ISVTX as mode_t | 0o054, true)
-        );
-    }
-
-    #[cfg(unix)]
-    #[test]
-    fn test_is_symlink_loop_no_loop() {
-        let temp_dir = tempdir().unwrap();
-        let file_path = temp_dir.path().join("file.txt");
-        let symlink_path = temp_dir.path().join("symlink");
-
-        fs::write(&file_path, "test content").unwrap();
-        unix::fs::symlink(&file_path, &symlink_path).unwrap();
-
-        assert!(!is_symlink_loop(&symlink_path));
-    }
-
-    #[cfg(unix)]
-    #[test]
-    fn test_is_symlink_loop_direct_loop() {
-        let temp_dir = tempdir().unwrap();
-        let symlink_path = temp_dir.path().join("loop");
-
-        unix::fs::symlink(&symlink_path, &symlink_path).unwrap();
-
-        assert!(is_symlink_loop(&symlink_path));
-    }
-
-    #[cfg(unix)]
-    #[test]
-    fn test_is_symlink_loop_indirect_loop() {
-        let temp_dir = tempdir().unwrap();
-        let symlink1_path = temp_dir.path().join("symlink1");
-        let symlink2_path = temp_dir.path().join("symlink2");
-
-        unix::fs::symlink(&symlink1_path, &symlink2_path).unwrap();
-        unix::fs::symlink(&symlink2_path, &symlink1_path).unwrap();
-
-        assert!(is_symlink_loop(&symlink1_path));
-    }
-
-    #[cfg(unix)]
-    #[test]
-    fn test_are_hardlinks_to_same_file_same_file() {
-        let mut temp_file = NamedTempFile::new().unwrap();
-        writeln!(temp_file, "Test content").unwrap();
-
-        let path1 = temp_file.path();
-        let path2 = temp_file.path();
-
-        assert_eq!(are_hardlinks_to_same_file(&path1, &path2), true);
-    }
-
-    #[cfg(unix)]
-    #[test]
-    fn test_are_hardlinks_to_same_file_different_files() {
-        let mut temp_file1 = NamedTempFile::new().unwrap();
-        writeln!(temp_file1, "Test content 1").unwrap();
-
-        let mut temp_file2 = NamedTempFile::new().unwrap();
-        writeln!(temp_file2, "Test content 2").unwrap();
-
-        let path1 = temp_file1.path();
-        let path2 = temp_file2.path();
-
-        assert_eq!(are_hardlinks_to_same_file(&path1, &path2), false);
-    }
-
-    #[cfg(unix)]
-    #[test]
-    fn test_are_hardlinks_to_same_file_hard_link() {
-        let mut temp_file = NamedTempFile::new().unwrap();
-        writeln!(temp_file, "Test content").unwrap();
-        let path1 = temp_file.path();
-
-        let path2 = temp_file.path().with_extension("hardlink");
-        fs::hard_link(&path1, &path2).unwrap();
-
-        assert_eq!(are_hardlinks_to_same_file(&path1, &path2), true);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/fsext.rs.html b/coreutils/dev/src/uucore/features/fsext.rs.html deleted file mode 100644 index 1cd8414dd..000000000 --- a/coreutils/dev/src/uucore/features/fsext.rs.html +++ /dev/null @@ -1,2139 +0,0 @@ -fsext.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-// (c) Fangxu Hu <framlog@gmail.com>
-// (c) Sylvestre Ledru <sylvestre@debian.org>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-//! Set of functions to manage file systems
-
-// spell-checker:ignore DATETIME subsecond (arch) bitrig ; (fs) cifs smbfs
-
-use time::macros::format_description;
-use time::UtcOffset;
-
-pub use crate::*; // import macros from `../../macros.rs`
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-const LINUX_MTAB: &str = "/etc/mtab";
-#[cfg(any(target_os = "linux", target_os = "android"))]
-const LINUX_MOUNTINFO: &str = "/proc/self/mountinfo";
-static MOUNT_OPT_BIND: &str = "bind";
-#[cfg(windows)]
-const MAX_PATH: usize = 266;
-#[cfg(not(unix))]
-static EXIT_ERR: i32 = 1;
-
-#[cfg(windows)]
-use std::ffi::OsStr;
-#[cfg(windows)]
-use std::os::windows::ffi::OsStrExt;
-#[cfg(windows)]
-use windows_sys::Win32::Foundation::{ERROR_NO_MORE_FILES, INVALID_HANDLE_VALUE};
-#[cfg(windows)]
-use windows_sys::Win32::Storage::FileSystem::{
-    FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, GetDiskFreeSpaceW, GetDriveTypeW,
-    GetVolumeInformationW, GetVolumePathNamesForVolumeNameW, QueryDosDeviceW,
-};
-#[cfg(windows)]
-use windows_sys::Win32::System::WindowsProgramming::DRIVE_REMOTE;
-
-// Warning: the pointer has to be used *immediately* or the Vec
-// it points to will be dropped!
-#[cfg(windows)]
-macro_rules! String2LPWSTR {
-    ($str: expr) => {
-        OsStr::new(&$str)
-            .encode_wide()
-            .chain(Some(0))
-            .collect::<Vec<u16>>()
-            .as_ptr()
-    };
-}
-
-#[cfg(windows)]
-#[allow(non_snake_case)]
-fn LPWSTR2String(buf: &[u16]) -> String {
-    let len = buf.iter().position(|&n| n == 0).unwrap();
-    String::from_utf16(&buf[..len]).unwrap()
-}
-
-#[cfg(unix)]
-use libc::{
-    mode_t, strerror, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK, S_IFMT, S_IFREG, S_IFSOCK,
-};
-use std::borrow::Cow;
-use std::convert::{AsRef, From};
-#[cfg(any(
-    target_vendor = "apple",
-    target_os = "freebsd",
-    target_os = "netbsd",
-    target_os = "openbsd",
-    target_os = "linux",
-    target_os = "android",
-))]
-use std::ffi::CStr;
-#[cfg(not(windows))]
-use std::ffi::CString;
-use std::io::Error as IOError;
-#[cfg(unix)]
-use std::mem;
-#[cfg(not(unix))]
-use std::path::Path;
-use std::time::UNIX_EPOCH;
-
-#[cfg(any(
-    target_os = "linux",
-    target_os = "android",
-    target_vendor = "apple",
-    target_os = "freebsd",
-    target_os = "openbsd"
-))]
-pub use libc::statfs as StatFs;
-#[cfg(any(
-    target_os = "netbsd",
-    target_os = "bitrig",
-    target_os = "dragonfly",
-    target_os = "illumos",
-    target_os = "solaris",
-    target_os = "redox"
-))]
-pub use libc::statvfs as StatFs;
-
-#[cfg(any(
-    target_os = "linux",
-    target_os = "android",
-    target_vendor = "apple",
-    target_os = "freebsd",
-    target_os = "openbsd",
-    target_os = "redox"
-))]
-pub use libc::statfs as statfs_fn;
-#[cfg(any(
-    target_os = "netbsd",
-    target_os = "bitrig",
-    target_os = "illumos",
-    target_os = "solaris",
-    target_os = "dragonfly"
-))]
-pub use libc::statvfs as statfs_fn;
-
-pub trait BirthTime {
-    fn pretty_birth(&self) -> String;
-    fn birth(&self) -> u64;
-}
-
-use std::fs::Metadata;
-impl BirthTime for Metadata {
-    fn pretty_birth(&self) -> String {
-        self.created()
-            .ok()
-            .and_then(|t| t.duration_since(UNIX_EPOCH).ok())
-            .map(|e| pretty_time(e.as_secs() as i64, i64::from(e.subsec_nanos())))
-            .unwrap_or_else(|| "-".to_owned())
-    }
-
-    fn birth(&self) -> u64 {
-        self.created()
-            .ok()
-            .and_then(|t| t.duration_since(UNIX_EPOCH).ok())
-            .map(|e| e.as_secs())
-            .unwrap_or_default()
-    }
-}
-
-#[derive(Debug, Clone)]
-pub struct MountInfo {
-    // it stores `volume_name` in windows platform and `dev_id` in unix platform
-    pub dev_id: String,
-    pub dev_name: String,
-    pub fs_type: String,
-    pub mount_dir: String,
-    pub mount_option: String, // we only care "bind" option
-    pub mount_root: String,
-    pub remote: bool,
-    pub dummy: bool,
-}
-
-impl MountInfo {
-    fn set_missing_fields(&mut self) {
-        #[cfg(unix)]
-        {
-            use std::os::unix::fs::MetadataExt;
-            // We want to keep the dev_id on Windows
-            // but set dev_id
-            if let Ok(stat) = std::fs::metadata(&self.mount_dir) {
-                // Why do we cast this to i32?
-                self.dev_id = (stat.dev() as i32).to_string();
-            } else {
-                self.dev_id = String::new();
-            }
-        }
-        // set MountInfo::dummy
-        // spell-checker:disable
-        match self.fs_type.as_ref() {
-            "autofs" | "proc" | "subfs"
-            /* for Linux 2.6/3.x */
-            | "debugfs" | "devpts" | "fusectl" | "mqueue" | "rpc_pipefs" | "sysfs"
-            /* FreeBSD, Linux 2.4 */
-            | "devfs"
-            /* for NetBSD 3.0 */
-            | "kernfs"
-            /* for Irix 6.5 */
-            | "ignore" => self.dummy = true,
-            _ => self.dummy = self.fs_type == "none"
-                && !self.mount_option.contains(MOUNT_OPT_BIND)
-        }
-        // spell-checker:enable
-        // set MountInfo::remote
-        #[cfg(windows)]
-        {
-            self.remote = DRIVE_REMOTE == unsafe { GetDriveTypeW(String2LPWSTR!(self.mount_root)) };
-        }
-        #[cfg(unix)]
-        {
-            self.remote = self.dev_name.find(':').is_some()
-                || (self.dev_name.starts_with("//") && self.fs_type == "smbfs"
-                    || self.fs_type == "cifs")
-                || self.dev_name == "-hosts";
-        }
-    }
-
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    fn new(file_name: &str, raw: &[&str]) -> Option<Self> {
-        match file_name {
-            // spell-checker:ignore (word) noatime
-            // Format: 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
-            // "man proc" for more details
-            LINUX_MOUNTINFO => {
-                const FIELDS_OFFSET: usize = 6;
-                let after_fields = raw[FIELDS_OFFSET..].iter().position(|c| *c == "-").unwrap()
-                    + FIELDS_OFFSET
-                    + 1;
-                let mut m = Self {
-                    dev_id: String::new(),
-                    dev_name: raw[after_fields + 1].to_string(),
-                    fs_type: raw[after_fields].to_string(),
-                    mount_root: raw[3].to_string(),
-                    mount_dir: raw[4].to_string(),
-                    mount_option: raw[5].to_string(),
-                    remote: false,
-                    dummy: false,
-                };
-                m.set_missing_fields();
-                Some(m)
-            }
-            LINUX_MTAB => {
-                let mut m = Self {
-                    dev_id: String::new(),
-                    dev_name: raw[0].to_string(),
-                    fs_type: raw[2].to_string(),
-                    mount_root: String::new(),
-                    mount_dir: raw[1].to_string(),
-                    mount_option: raw[3].to_string(),
-                    remote: false,
-                    dummy: false,
-                };
-                m.set_missing_fields();
-                Some(m)
-            }
-            _ => None,
-        }
-    }
-    #[cfg(windows)]
-    fn new(mut volume_name: String) -> Option<Self> {
-        let mut dev_name_buf = [0u16; MAX_PATH];
-        volume_name.pop();
-        unsafe {
-            QueryDosDeviceW(
-                OsStr::new(&volume_name)
-                    .encode_wide()
-                    .chain(Some(0))
-                    .skip(4)
-                    .collect::<Vec<u16>>()
-                    .as_ptr(),
-                dev_name_buf.as_mut_ptr(),
-                dev_name_buf.len() as u32,
-            )
-        };
-        volume_name.push('\\');
-        let dev_name = LPWSTR2String(&dev_name_buf);
-
-        let mut mount_root_buf = [0u16; MAX_PATH];
-        let success = unsafe {
-            GetVolumePathNamesForVolumeNameW(
-                String2LPWSTR!(volume_name),
-                mount_root_buf.as_mut_ptr(),
-                mount_root_buf.len() as u32,
-                ptr::null_mut(),
-            )
-        };
-        if 0 == success {
-            // TODO: support the case when `GetLastError()` returns `ERROR_MORE_DATA`
-            return None;
-        }
-        let mount_root = LPWSTR2String(&mount_root_buf);
-
-        let mut fs_type_buf = [0u16; MAX_PATH];
-        let success = unsafe {
-            GetVolumeInformationW(
-                String2LPWSTR!(mount_root),
-                ptr::null_mut(),
-                0,
-                ptr::null_mut(),
-                ptr::null_mut(),
-                ptr::null_mut(),
-                fs_type_buf.as_mut_ptr(),
-                fs_type_buf.len() as u32,
-            )
-        };
-        let fs_type = if 0 == success {
-            None
-        } else {
-            Some(LPWSTR2String(&fs_type_buf))
-        };
-        let mut mn_info = Self {
-            dev_id: volume_name,
-            dev_name,
-            fs_type: fs_type.unwrap_or_default(),
-            mount_root,
-            mount_dir: String::new(),
-            mount_option: String::new(),
-            remote: false,
-            dummy: false,
-        };
-        mn_info.set_missing_fields();
-        Some(mn_info)
-    }
-}
-
-#[cfg(any(
-    target_os = "freebsd",
-    target_vendor = "apple",
-    target_os = "netbsd",
-    target_os = "openbsd"
-))]
-impl From<StatFs> for MountInfo {
-    fn from(statfs: StatFs) -> Self {
-        let mut info = Self {
-            dev_id: String::new(),
-            dev_name: unsafe {
-                // spell-checker:disable-next-line
-                CStr::from_ptr(&statfs.f_mntfromname[0])
-                    .to_string_lossy()
-                    .into_owned()
-            },
-            fs_type: unsafe {
-                // spell-checker:disable-next-line
-                CStr::from_ptr(&statfs.f_fstypename[0])
-                    .to_string_lossy()
-                    .into_owned()
-            },
-            mount_dir: unsafe {
-                // spell-checker:disable-next-line
-                CStr::from_ptr(&statfs.f_mntonname[0])
-                    .to_string_lossy()
-                    .into_owned()
-            },
-            mount_root: String::new(),
-            mount_option: String::new(),
-            remote: false,
-            dummy: false,
-        };
-        info.set_missing_fields();
-        info
-    }
-}
-
-#[cfg(any(
-    target_os = "freebsd",
-    target_vendor = "apple",
-    target_os = "netbsd",
-    target_os = "openbsd"
-))]
-use libc::c_int;
-#[cfg(any(
-    target_os = "freebsd",
-    target_vendor = "apple",
-    target_os = "netbsd",
-    target_os = "openbsd"
-))]
-extern "C" {
-    #[cfg(all(target_vendor = "apple", target_arch = "x86_64"))]
-    #[link_name = "getmntinfo$INODE64"] // spell-checker:disable-line
-    fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;
-
-    #[cfg(any(
-        target_os = "freebsd",
-        target_os = "netbsd",
-        target_os = "openbsd",
-        all(target_vendor = "apple", target_arch = "aarch64")
-    ))]
-    #[link_name = "getmntinfo"] // spell-checker:disable-line
-    fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int;
-}
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use std::fs::File;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use std::io::{BufRead, BufReader};
-#[cfg(any(
-    target_vendor = "apple",
-    target_os = "freebsd",
-    target_os = "windows",
-    target_os = "netbsd",
-    target_os = "openbsd"
-))]
-use std::ptr;
-#[cfg(any(
-    target_vendor = "apple",
-    target_os = "freebsd",
-    target_os = "netbsd",
-    target_os = "openbsd"
-))]
-use std::slice;
-/// Read file system list.
-pub fn read_fs_list() -> Result<Vec<MountInfo>, std::io::Error> {
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    {
-        let (file_name, f) = File::open(LINUX_MOUNTINFO)
-            .map(|f| (LINUX_MOUNTINFO, f))
-            .or_else(|_| File::open(LINUX_MTAB).map(|f| (LINUX_MTAB, f)))?;
-        let reader = BufReader::new(f);
-        Ok(reader
-            .lines()
-            .map_while(Result::ok)
-            .filter_map(|line| {
-                let raw_data = line.split_whitespace().collect::<Vec<&str>>();
-                MountInfo::new(file_name, &raw_data)
-            })
-            .collect::<Vec<_>>())
-    }
-    #[cfg(any(
-        target_os = "freebsd",
-        target_vendor = "apple",
-        target_os = "netbsd",
-        target_os = "openbsd"
-    ))]
-    {
-        let mut mount_buffer_ptr: *mut StatFs = ptr::null_mut();
-        let len = unsafe { get_mount_info(&mut mount_buffer_ptr, 1_i32) };
-        if len < 0 {
-            crash!(1, "get_mount_info() failed");
-        }
-        let mounts = unsafe { slice::from_raw_parts(mount_buffer_ptr, len as usize) };
-        Ok(mounts
-            .iter()
-            .map(|m| MountInfo::from(*m))
-            .collect::<Vec<_>>())
-    }
-    #[cfg(windows)]
-    {
-        let mut volume_name_buf = [0u16; MAX_PATH];
-        // As recommended in the MS documentation, retrieve the first volume before the others
-        let find_handle =
-            unsafe { FindFirstVolumeW(volume_name_buf.as_mut_ptr(), volume_name_buf.len() as u32) };
-        if INVALID_HANDLE_VALUE == find_handle {
-            crash!(
-                EXIT_ERR,
-                "FindFirstVolumeW failed: {}",
-                IOError::last_os_error()
-            );
-        }
-        let mut mounts = Vec::<MountInfo>::new();
-        loop {
-            let volume_name = LPWSTR2String(&volume_name_buf);
-            if !volume_name.starts_with("\\\\?\\") || !volume_name.ends_with('\\') {
-                show_warning!("A bad path was skipped: {}", volume_name);
-                continue;
-            }
-            if let Some(m) = MountInfo::new(volume_name) {
-                mounts.push(m);
-            }
-            if 0 == unsafe {
-                FindNextVolumeW(
-                    find_handle,
-                    volume_name_buf.as_mut_ptr(),
-                    volume_name_buf.len() as u32,
-                )
-            } {
-                let err = IOError::last_os_error();
-                if err.raw_os_error() != Some(ERROR_NO_MORE_FILES as i32) {
-                    crash!(EXIT_ERR, "FindNextVolumeW failed: {}", err);
-                }
-                break;
-            }
-        }
-        unsafe {
-            FindVolumeClose(find_handle);
-        }
-        Ok(mounts)
-    }
-    #[cfg(any(target_os = "redox", target_os = "illumos", target_os = "solaris"))]
-    {
-        // No method to read mounts, yet
-        Ok(Vec::new())
-    }
-}
-
-#[derive(Debug, Clone)]
-pub struct FsUsage {
-    pub blocksize: u64,
-    pub blocks: u64,
-    pub bfree: u64,
-    pub bavail: u64,
-    pub bavail_top_bit_set: bool,
-    pub files: u64,
-    pub ffree: u64,
-}
-
-impl FsUsage {
-    #[cfg(unix)]
-    pub fn new(statvfs: StatFs) -> Self {
-        {
-            #[cfg(all(not(target_os = "freebsd"), target_pointer_width = "64"))]
-            return Self {
-                blocksize: statvfs.f_bsize as u64, // or `statvfs.f_frsize` ?
-                blocks: statvfs.f_blocks,
-                bfree: statvfs.f_bfree,
-                bavail: statvfs.f_bavail,
-                bavail_top_bit_set: ((statvfs.f_bavail) & (1u64.rotate_right(1))) != 0,
-                files: statvfs.f_files,
-                ffree: statvfs.f_ffree,
-            };
-            #[cfg(all(not(target_os = "freebsd"), not(target_pointer_width = "64")))]
-            return Self {
-                blocksize: statvfs.f_bsize as u64, // or `statvfs.f_frsize` ?
-                blocks: statvfs.f_blocks.into(),
-                bfree: statvfs.f_bfree.into(),
-                bavail: statvfs.f_bavail.into(),
-                bavail_top_bit_set: ((statvfs.f_bavail as u64) & (1u64.rotate_right(1))) != 0,
-                files: statvfs.f_files.into(),
-                ffree: statvfs.f_ffree.into(),
-            };
-            #[cfg(target_os = "freebsd")]
-            return Self {
-                blocksize: statvfs.f_bsize, // or `statvfs.f_frsize` ?
-                blocks: statvfs.f_blocks,
-                bfree: statvfs.f_bfree,
-                bavail: statvfs.f_bavail.try_into().unwrap(),
-                bavail_top_bit_set: ((std::convert::TryInto::<u64>::try_into(statvfs.f_bavail)
-                    .unwrap())
-                    & (1u64.rotate_right(1)))
-                    != 0,
-                files: statvfs.f_files,
-                ffree: statvfs.f_ffree.try_into().unwrap(),
-            };
-        }
-    }
-    #[cfg(not(unix))]
-    pub fn new(path: &Path) -> Self {
-        let mut root_path = [0u16; MAX_PATH];
-        let success = unsafe {
-            GetVolumePathNamesForVolumeNameW(
-                //path_utf8.as_ptr(),
-                String2LPWSTR!(path.as_os_str()),
-                root_path.as_mut_ptr(),
-                root_path.len() as u32,
-                ptr::null_mut(),
-            )
-        };
-        if 0 == success {
-            crash!(
-                EXIT_ERR,
-                "GetVolumePathNamesForVolumeNameW failed: {}",
-                IOError::last_os_error()
-            );
-        }
-
-        let mut sectors_per_cluster = 0;
-        let mut bytes_per_sector = 0;
-        let mut number_of_free_clusters = 0;
-        let mut total_number_of_clusters = 0;
-
-        let success = unsafe {
-            GetDiskFreeSpaceW(
-                String2LPWSTR!(path.as_os_str()),
-                &mut sectors_per_cluster,
-                &mut bytes_per_sector,
-                &mut number_of_free_clusters,
-                &mut total_number_of_clusters,
-            )
-        };
-        if 0 == success {
-            // Fails in case of CD for example
-            // crash!(
-            //     EXIT_ERR,
-            //     "GetDiskFreeSpaceW failed: {}",
-            //     IOError::last_os_error()
-            // );
-        }
-
-        let bytes_per_cluster = sectors_per_cluster as u64 * bytes_per_sector as u64;
-        Self {
-            // f_bsize      File system block size.
-            blocksize: bytes_per_cluster,
-            // f_blocks - Total number of blocks on the file system, in units of f_frsize.
-            // frsize =     Fundamental file system block size (fragment size).
-            blocks: total_number_of_clusters as u64,
-            //  Total number of free blocks.
-            bfree: number_of_free_clusters as u64,
-            //  Total number of free blocks available to non-privileged processes.
-            bavail: 0,
-            bavail_top_bit_set: ((bytes_per_sector as u64) & (1u64.rotate_right(1))) != 0,
-            // Total number of file nodes (inodes) on the file system.
-            files: 0, // Not available on windows
-            // Total number of free file nodes (inodes).
-            ffree: 0, // Meaningless on Windows
-        }
-    }
-}
-
-#[cfg(unix)]
-pub trait FsMeta {
-    fn fs_type(&self) -> i64;
-    fn io_size(&self) -> u64;
-    fn block_size(&self) -> i64;
-    fn total_blocks(&self) -> u64;
-    fn free_blocks(&self) -> u64;
-    fn avail_blocks(&self) -> u64;
-    fn total_file_nodes(&self) -> u64;
-    fn free_file_nodes(&self) -> u64;
-    fn fsid(&self) -> u64;
-    fn namelen(&self) -> u64;
-}
-
-#[cfg(unix)]
-impl FsMeta for StatFs {
-    fn block_size(&self) -> i64 {
-        #[cfg(all(
-            not(target_env = "musl"),
-            not(target_vendor = "apple"),
-            not(target_os = "android"),
-            not(target_os = "freebsd"),
-            not(target_arch = "s390x"),
-            target_pointer_width = "64"
-        ))]
-        return self.f_bsize;
-        #[cfg(all(
-            not(target_env = "musl"),
-            not(target_os = "freebsd"),
-            any(
-                target_arch = "s390x",
-                target_vendor = "apple",
-                target_os = "android",
-                not(target_pointer_width = "64")
-            )
-        ))]
-        return self.f_bsize.into();
-        #[cfg(any(target_env = "musl", target_os = "freebsd"))]
-        return self.f_bsize.try_into().unwrap();
-    }
-    fn total_blocks(&self) -> u64 {
-        #[cfg(target_pointer_width = "64")]
-        return self.f_blocks;
-        #[cfg(not(target_pointer_width = "64"))]
-        return self.f_blocks.into();
-    }
-    fn free_blocks(&self) -> u64 {
-        #[cfg(target_pointer_width = "64")]
-        return self.f_bfree;
-        #[cfg(not(target_pointer_width = "64"))]
-        return self.f_bfree.into();
-    }
-    fn avail_blocks(&self) -> u64 {
-        #[cfg(all(not(target_os = "freebsd"), target_pointer_width = "64"))]
-        return self.f_bavail;
-        #[cfg(all(not(target_os = "freebsd"), not(target_pointer_width = "64")))]
-        return self.f_bavail.into();
-        #[cfg(target_os = "freebsd")]
-        return self.f_bavail.try_into().unwrap();
-    }
-    fn total_file_nodes(&self) -> u64 {
-        #[cfg(target_pointer_width = "64")]
-        return self.f_files;
-        #[cfg(not(target_pointer_width = "64"))]
-        return self.f_files.into();
-    }
-    fn free_file_nodes(&self) -> u64 {
-        #[cfg(all(not(target_os = "freebsd"), target_pointer_width = "64"))]
-        return self.f_ffree;
-        #[cfg(all(not(target_os = "freebsd"), not(target_pointer_width = "64")))]
-        return self.f_ffree.into();
-        #[cfg(target_os = "freebsd")]
-        return self.f_ffree.try_into().unwrap();
-    }
-    #[cfg(any(
-        target_os = "linux",
-        target_os = "android",
-        target_vendor = "apple",
-        target_os = "freebsd"
-    ))]
-    fn fs_type(&self) -> i64 {
-        #[cfg(all(
-            not(target_env = "musl"),
-            not(target_vendor = "apple"),
-            not(target_os = "android"),
-            not(target_os = "freebsd"),
-            not(target_arch = "s390x"),
-            target_pointer_width = "64"
-        ))]
-        return self.f_type;
-        #[cfg(all(
-            not(target_env = "musl"),
-            any(
-                target_vendor = "apple",
-                target_os = "android",
-                target_os = "freebsd",
-                target_arch = "s390x",
-                not(target_pointer_width = "64")
-            )
-        ))]
-        return self.f_type.into();
-        #[cfg(target_env = "musl")]
-        return self.f_type.try_into().unwrap();
-    }
-    #[cfg(not(any(
-        target_os = "linux",
-        target_os = "android",
-        target_vendor = "apple",
-        target_os = "freebsd"
-    )))]
-    fn fs_type(&self) -> i64 {
-        // FIXME: statvfs doesn't have an equivalent, so we need to do something else
-        unimplemented!()
-    }
-
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    fn io_size(&self) -> u64 {
-        self.f_frsize as u64
-    }
-    #[cfg(any(target_vendor = "apple", target_os = "freebsd", target_os = "netbsd"))]
-    fn io_size(&self) -> u64 {
-        #[cfg(target_os = "freebsd")]
-        return self.f_iosize;
-        #[cfg(not(target_os = "freebsd"))]
-        return self.f_iosize as u64;
-    }
-    // XXX: dunno if this is right
-    #[cfg(not(any(
-        target_vendor = "apple",
-        target_os = "freebsd",
-        target_os = "linux",
-        target_os = "android",
-        target_os = "netbsd"
-    )))]
-    fn io_size(&self) -> u64 {
-        self.f_bsize as u64
-    }
-
-    // Linux, SunOS, HP-UX, 4.4BSD, FreeBSD have a system call statfs() that returns
-    // a struct statfs, containing a fsid_t f_fsid, where fsid_t is defined
-    // as struct { int val[2];  }
-    //
-    // Solaris, Irix and POSIX have a system call statvfs(2) that returns a
-    // struct statvfs, containing an  unsigned  long  f_fsid
-    #[cfg(any(
-        target_vendor = "apple",
-        target_os = "freebsd",
-        target_os = "linux",
-        target_os = "android",
-        target_os = "openbsd"
-    ))]
-    fn fsid(&self) -> u64 {
-        let f_fsid: &[u32; 2] =
-            unsafe { &*(&self.f_fsid as *const nix::sys::statfs::fsid_t as *const [u32; 2]) };
-        (u64::from(f_fsid[0])) << 32 | u64::from(f_fsid[1])
-    }
-    #[cfg(not(any(
-        target_vendor = "apple",
-        target_os = "freebsd",
-        target_os = "linux",
-        target_os = "android",
-        target_os = "openbsd"
-    )))]
-    fn fsid(&self) -> u64 {
-        self.f_fsid as u64
-    }
-
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    fn namelen(&self) -> u64 {
-        self.f_namelen as u64
-    }
-    #[cfg(target_vendor = "apple")]
-    fn namelen(&self) -> u64 {
-        1024
-    }
-    #[cfg(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))]
-    fn namelen(&self) -> u64 {
-        self.f_namemax as u64 // spell-checker:disable-line
-    }
-    // XXX: should everything just use statvfs?
-    #[cfg(not(any(
-        target_vendor = "apple",
-        target_os = "freebsd",
-        target_os = "linux",
-        target_os = "android",
-        target_os = "netbsd",
-        target_os = "openbsd"
-    )))]
-    fn namelen(&self) -> u64 {
-        self.f_namemax as u64 // spell-checker:disable-line
-    }
-}
-
-#[cfg(unix)]
-pub fn statfs<P>(path: P) -> Result<StatFs, String>
-where
-    P: Into<Vec<u8>>,
-{
-    match CString::new(path) {
-        Ok(p) => {
-            let mut buffer: StatFs = unsafe { mem::zeroed() };
-            unsafe {
-                match statfs_fn(p.as_ptr(), &mut buffer) {
-                    0 => Ok(buffer),
-                    _ => {
-                        let errno = IOError::last_os_error().raw_os_error().unwrap_or(0);
-                        Err(CStr::from_ptr(strerror(errno))
-                            .to_str()
-                            .map_err(|_| "Error message contains invalid UTF-8".to_owned())?
-                            .to_owned())
-                    }
-                }
-            }
-        }
-        Err(e) => Err(e.to_string()),
-    }
-}
-
-// match strftime "%Y-%m-%d %H:%M:%S.%f %z"
-const PRETTY_DATETIME_FORMAT: &[time::format_description::FormatItem] = format_description!(
-    "\
-[year]-[month]-[day padding:zero] \
-[hour]:[minute]:[second].[subsecond digits:9] \
-[offset_hour sign:mandatory][offset_minute]"
-);
-
-pub fn pretty_time(sec: i64, nsec: i64) -> String {
-    // sec == seconds since UNIX_EPOCH
-    // nsec == nanoseconds since (UNIX_EPOCH + sec)
-    let ts_nanos: i128 = (sec * 1_000_000_000 + nsec).into();
-
-    // Return the date in UTC
-    let tm = match time::OffsetDateTime::from_unix_timestamp_nanos(ts_nanos) {
-        Ok(tm) => tm,
-        Err(e) => {
-            panic!("error: {e}");
-        }
-    };
-
-    // Get the offset to convert to local time
-    // Because of DST (daylight saving), we get the local time back when
-    // the date was set
-    let local_offset = match UtcOffset::local_offset_at(tm) {
-        Ok(lo) => lo,
-        Err(e) => {
-            panic!("error: {e}");
-        }
-    };
-
-    // Include the conversion to local time
-    let res = tm
-        .to_offset(local_offset)
-        .format(&PRETTY_DATETIME_FORMAT)
-        .unwrap();
-    if res.ends_with(" -0000") {
-        res.replace(" -0000", " +0000")
-    } else {
-        res
-    }
-}
-
-#[cfg(unix)]
-pub fn pretty_filetype<'a>(mode: mode_t, size: u64) -> &'a str {
-    match mode & S_IFMT {
-        S_IFREG => {
-            if size == 0 {
-                "regular empty file"
-            } else {
-                "regular file"
-            }
-        }
-        S_IFDIR => "directory",
-        S_IFLNK => "symbolic link",
-        S_IFCHR => "character special file",
-        S_IFBLK => "block special file",
-        S_IFIFO => "fifo",
-        S_IFSOCK => "socket",
-        // TODO: Other file types
-        // See coreutils/gnulib/lib/file-type.c // spell-checker:disable-line
-        _ => "weird file",
-    }
-}
-
-pub fn pretty_fstype<'a>(fstype: i64) -> Cow<'a, str> {
-    // spell-checker:disable
-    match fstype {
-        0x6163_6673 => "acfs".into(),
-        0xADF5 => "adfs".into(),
-        0xADFF => "affs".into(),
-        0x5346_414F => "afs".into(),
-        0x0904_1934 => "anon-inode FS".into(),
-        0x6175_6673 => "aufs".into(),
-        0x0187 => "autofs".into(),
-        0x4246_5331 => "befs".into(),
-        0x6264_6576 => "bdevfs".into(),
-        0x1BAD_FACE => "bfs".into(),
-        0xCAFE_4A11 => "bpf_fs".into(),
-        0x4249_4E4D => "binfmt_misc".into(),
-        0x9123_683E => "btrfs".into(),
-        0x7372_7279 => "btrfs_test".into(),
-        0x00C3_6400 => "ceph".into(),
-        0x0027_E0EB => "cgroupfs".into(),
-        0xFF53_4D42 => "cifs".into(),
-        0x7375_7245 => "coda".into(),
-        0x012F_F7B7 => "coh".into(),
-        0x6265_6570 => "configfs".into(),
-        0x28CD_3D45 => "cramfs".into(),
-        0x453D_CD28 => "cramfs-wend".into(),
-        0x6462_6720 => "debugfs".into(),
-        0x1373 => "devfs".into(),
-        0x1CD1 => "devpts".into(),
-        0xF15F => "ecryptfs".into(),
-        0xDE5E_81E4 => "efivarfs".into(),
-        0x0041_4A53 => "efs".into(),
-        0x5DF5 => "exofs".into(),
-        0x137D => "ext".into(),
-        0xEF53 => "ext2/ext3".into(),
-        0xEF51 => "ext2".into(),
-        0xF2F5_2010 => "f2fs".into(),
-        0x4006 => "fat".into(),
-        0x1983_0326 => "fhgfs".into(),
-        0x6573_5546 => "fuseblk".into(),
-        0x6573_5543 => "fusectl".into(),
-        0x0BAD_1DEA => "futexfs".into(),
-        0x0116_1970 => "gfs/gfs2".into(),
-        0x4750_4653 => "gpfs".into(),
-        0x4244 => "hfs".into(),
-        0x482B => "hfs+".into(),
-        0x4858 => "hfsx".into(),
-        0x00C0_FFEE => "hostfs".into(),
-        0xF995_E849 => "hpfs".into(),
-        0x9584_58F6 => "hugetlbfs".into(),
-        0x1130_7854 => "inodefs".into(),
-        0x0131_11A8 => "ibrix".into(),
-        0x2BAD_1DEA => "inotifyfs".into(),
-        0x9660 => "isofs".into(),
-        0x4004 => "isofs".into(),
-        0x4000 => "isofs".into(),
-        0x07C0 => "jffs".into(),
-        0x72B6 => "jffs2".into(),
-        0x3153_464A => "jfs".into(),
-        0x6B41_4653 => "k-afs".into(),
-        0xC97E_8168 => "logfs".into(),
-        0x0BD0_0BD0 => "lustre".into(),
-        0x5346_314D => "m1fs".into(),
-        0x137F => "minix".into(),
-        0x138F => "minix (30 char.)".into(),
-        0x2468 => "minix v2".into(),
-        0x2478 => "minix v2 (30 char.)".into(),
-        0x4D5A => "minix3".into(),
-        0x1980_0202 => "mqueue".into(),
-        0x4D44 => "msdos".into(),
-        0x564C => "novell".into(),
-        0x6969 => "nfs".into(),
-        0x6E66_7364 => "nfsd".into(),
-        0x3434 => "nilfs".into(),
-        0x6E73_6673 => "nsfs".into(),
-        0x5346_544E => "ntfs".into(),
-        0x9FA1 => "openprom".into(),
-        0x7461_636F => "ocfs2".into(),
-        0x794C_7630 => "overlayfs".into(),
-        0xAAD7_AAEA => "panfs".into(),
-        0x5049_5045 => "pipefs".into(),
-        0x7C7C_6673 => "prl_fs".into(),
-        0x9FA0 => "proc".into(),
-        0x6165_676C => "pstorefs".into(),
-        0x002F => "qnx4".into(),
-        0x6819_1122 => "qnx6".into(),
-        0x8584_58F6 => "ramfs".into(),
-        0x5265_4973 => "reiserfs".into(),
-        0x7275 => "romfs".into(),
-        0x6759_6969 => "rpc_pipefs".into(),
-        0x7363_6673 => "securityfs".into(),
-        0xF97C_FF8C => "selinux".into(),
-        0x4341_5D53 => "smackfs".into(),
-        0x517B => "smb".into(),
-        0xFE53_4D42 => "smb2".into(),
-        0xBEEF_DEAD => "snfs".into(),
-        0x534F_434B => "sockfs".into(),
-        0x7371_7368 => "squashfs".into(),
-        0x6265_6572 => "sysfs".into(),
-        0x012F_F7B6 => "sysv2".into(),
-        0x012F_F7B5 => "sysv4".into(),
-        0x0102_1994 => "tmpfs".into(),
-        0x7472_6163 => "tracefs".into(),
-        0x2405_1905 => "ubifs".into(),
-        0x1501_3346 => "udf".into(),
-        0x0001_1954 => "ufs".into(),
-        0x5419_0100 => "ufs".into(),
-        0x9FA2 => "usbdevfs".into(),
-        0x0102_1997 => "v9fs".into(),
-        0xBACB_ACBC => "vmhgfs".into(),
-        0xA501_FCF5 => "vxfs".into(),
-        0x565A_4653 => "vzfs".into(),
-        0x5346_4846 => "wslfs".into(),
-        0xABBA_1974 => "xenfs".into(),
-        0x012F_F7B4 => "xenix".into(),
-        0x5846_5342 => "xfs".into(),
-        0x012F_D16D => "xia".into(),
-        0x2FC1_2FC1 => "zfs".into(),
-        other => format!("UNKNOWN ({other:#x})").into(),
-    }
-    // spell-checker:enable
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    #[cfg(unix)]
-    fn test_file_type() {
-        assert_eq!("block special file", pretty_filetype(S_IFBLK, 0));
-        assert_eq!("character special file", pretty_filetype(S_IFCHR, 0));
-        assert_eq!("regular file", pretty_filetype(S_IFREG, 1));
-        assert_eq!("regular empty file", pretty_filetype(S_IFREG, 0));
-        assert_eq!("weird file", pretty_filetype(0, 0));
-    }
-
-    #[test]
-    fn test_fs_type() {
-        // spell-checker:disable
-        assert_eq!("ext2/ext3", pretty_fstype(0xEF53));
-        assert_eq!("tmpfs", pretty_fstype(0x01021994));
-        assert_eq!("nfs", pretty_fstype(0x6969));
-        assert_eq!("btrfs", pretty_fstype(0x9123683e));
-        assert_eq!("xfs", pretty_fstype(0x58465342));
-        assert_eq!("zfs", pretty_fstype(0x2FC12FC1));
-        assert_eq!("ntfs", pretty_fstype(0x5346544e));
-        assert_eq!("fat", pretty_fstype(0x4006));
-        assert_eq!("UNKNOWN (0x1234)", pretty_fstype(0x1234));
-        // spell-checker:enable
-    }
-
-    #[test]
-    #[cfg(any(target_os = "linux", target_os = "android"))]
-    fn test_mountinfo() {
-        // spell-checker:ignore (word) relatime
-        let info = MountInfo::new(
-            LINUX_MOUNTINFO,
-            &"106 109 253:6 / /mnt rw,relatime - xfs /dev/fs0 rw"
-                .split_ascii_whitespace()
-                .collect::<Vec<_>>(),
-        )
-        .unwrap();
-
-        assert_eq!(info.mount_root, "/");
-        assert_eq!(info.mount_dir, "/mnt");
-        assert_eq!(info.mount_option, "rw,relatime");
-        assert_eq!(info.fs_type, "xfs");
-        assert_eq!(info.dev_name, "/dev/fs0");
-
-        // Test parsing with different amounts of optional fields.
-        let info = MountInfo::new(
-            LINUX_MOUNTINFO,
-            &"106 109 253:6 / /mnt rw,relatime master:1 - xfs /dev/fs0 rw"
-                .split_ascii_whitespace()
-                .collect::<Vec<_>>(),
-        )
-        .unwrap();
-
-        assert_eq!(info.fs_type, "xfs");
-        assert_eq!(info.dev_name, "/dev/fs0");
-
-        let info = MountInfo::new(
-            LINUX_MOUNTINFO,
-            &"106 109 253:6 / /mnt rw,relatime master:1 shared:2 - xfs /dev/fs0 rw"
-                .split_ascii_whitespace()
-                .collect::<Vec<_>>(),
-        )
-        .unwrap();
-
-        assert_eq!(info.fs_type, "xfs");
-        assert_eq!(info.dev_name, "/dev/fs0");
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/lines.rs.html b/coreutils/dev/src/uucore/features/lines.rs.html deleted file mode 100644 index d322e7cba..000000000 --- a/coreutils/dev/src/uucore/features/lines.rs.html +++ /dev/null @@ -1,227 +0,0 @@ -lines.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-// spell-checker:ignore (vars)
-//! Iterate over lines, including the line ending character(s).
-//!
-//! This module provides the [`lines`] function, similar to the
-//! [`BufRead::lines`] method. While the [`BufRead::lines`] method
-//! yields [`String`] instances that do not include the line ending
-//! characters (`"\n"` or `"\r\n"`), our functions yield
-//! [`Vec`]<['u8']> instances that include the line ending
-//! characters. This is useful if the input data does not end with a
-//! newline character and you want to preserve the exact form of the
-//! input data.
-use std::io::BufRead;
-
-/// Returns an iterator over the lines, including line ending characters.
-///
-/// This function is just like [`BufRead::lines`], but it includes the
-/// line ending characters in each yielded [`String`] if the input
-/// data has them. Set the `sep` parameter to the line ending
-/// character; for Unix line endings, use `b'\n'`.
-///
-/// # Examples
-///
-/// Use `sep` to specify an alternate character for line endings. For
-/// example, if lines are terminated by the null character `b'\0'`:
-///
-/// ```rust,ignore
-/// use std::io::BufRead;
-/// use std::io::Cursor;
-///
-/// let cursor = Cursor::new(b"x\0y\0z\0");
-/// let mut it = lines(cursor, b'\0').map(|l| l.unwrap());
-///
-/// assert_eq!(it.next(), Some(Vec::from("x\0")));
-/// assert_eq!(it.next(), Some(Vec::from("y\0")));
-/// assert_eq!(it.next(), Some(Vec::from("z\0")));
-/// assert_eq!(it.next(), None);
-/// ```
-///
-/// If the input data does not end with a newline character (`'\n'`),
-/// then the last [`String`] yielded by this iterator also does not
-/// end with a newline:
-///
-/// ```rust,ignore
-/// let cursor = Cursor::new(b"x\ny\nz");
-/// let mut it = lines(cursor, b'\n').map(|l| l.unwrap());
-///
-/// assert_eq!(it.next(), Some(Vec::from("x\n")));
-/// assert_eq!(it.next(), Some(Vec::from("y\n")));
-/// assert_eq!(it.next(), Some(Vec::from("z")));
-/// assert_eq!(it.next(), None);
-/// ```
-pub fn lines<B>(reader: B, sep: u8) -> Lines<B>
-where
-    B: BufRead,
-{
-    Lines { buf: reader, sep }
-}
-
-/// An iterator over the lines of an instance of `BufRead`.
-///
-/// This struct is generally created by calling [`lines`] on a `BufRead`.
-/// Please see the documentation of [`lines`] for more details.
-pub struct Lines<B> {
-    buf: B,
-    sep: u8,
-}
-
-impl<B: BufRead> Iterator for Lines<B> {
-    type Item = std::io::Result<Vec<u8>>;
-
-    fn next(&mut self) -> Option<std::io::Result<Vec<u8>>> {
-        let mut buf = Vec::new();
-        match self.buf.read_until(self.sep, &mut buf) {
-            Ok(0) => None,
-            Ok(_n) => Some(Ok(buf)),
-            Err(e) => Some(Err(e)),
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::lines::lines;
-    use std::io::Cursor;
-
-    #[test]
-    fn test_lines() {
-        let cursor = Cursor::new(b"x\ny\nz");
-        let mut it = lines(cursor, b'\n').map(|l| l.unwrap());
-
-        assert_eq!(it.next(), Some(Vec::from("x\n")));
-        assert_eq!(it.next(), Some(Vec::from("y\n")));
-        assert_eq!(it.next(), Some(Vec::from("z")));
-        assert_eq!(it.next(), None);
-    }
-
-    #[test]
-    fn test_lines_zero_terminated() {
-        use std::io::Cursor;
-
-        let cursor = Cursor::new(b"x\0y\0z\0");
-        let mut it = lines(cursor, b'\0').map(|l| l.unwrap());
-
-        assert_eq!(it.next(), Some(Vec::from("x\0")));
-        assert_eq!(it.next(), Some(Vec::from("y\0")));
-        assert_eq!(it.next(), Some(Vec::from("z\0")));
-        assert_eq!(it.next(), None);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/memo.rs.html b/coreutils/dev/src/uucore/features/memo.rs.html deleted file mode 100644 index 65a654ab4..000000000 --- a/coreutils/dev/src/uucore/features/memo.rs.html +++ /dev/null @@ -1,351 +0,0 @@ -memo.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-
//! Main entry point for our implementation of printf.
-//!
-//! The [`printf`] and [`sprintf`] closely match the behavior of the
-//! corresponding C functions: the former renders a formatted string
-//! to stdout, the latter renders to a new [`String`] object.
-use crate::display::Quotable;
-use crate::error::{UResult, USimpleError};
-use crate::features::tokenize::sub::SubParser;
-use crate::features::tokenize::token::Token;
-use crate::features::tokenize::unescaped_text::UnescapedText;
-use crate::show_warning;
-use itertools::put_back_n;
-use std::io::{stdout, Cursor, Write};
-use std::iter::Peekable;
-use std::slice::Iter;
-
-/// Memo runner of printf
-/// Takes a format string and arguments
-/// 1. tokenize format string into tokens, consuming
-/// any subst. arguments along the way.
-/// 2. feeds remaining arguments into function
-/// that prints tokens.
-struct Memo {
-    tokens: Vec<Token>,
-}
-
-fn warn_excess_args(first_arg: &str) {
-    show_warning!(
-        "ignoring excess arguments, starting with {}",
-        first_arg.quote()
-    );
-}
-
-impl Memo {
-    fn new<W>(
-        writer: &mut W,
-        pf_string: &str,
-        pf_args_it: &mut Peekable<Iter<String>>,
-    ) -> UResult<Self>
-    where
-        W: Write,
-    {
-        let mut pm = Self { tokens: Vec::new() };
-        let mut it = put_back_n(pf_string.chars());
-        let mut has_sub = false;
-        loop {
-            if let Some(x) = UnescapedText::from_it_core(writer, &mut it, false) {
-                pm.tokens.push(x);
-            }
-            if let Some(x) = SubParser::from_it(writer, &mut it, pf_args_it)? {
-                if !has_sub {
-                    has_sub = true;
-                }
-                pm.tokens.push(x);
-            }
-            if let Some(x) = it.next() {
-                it.put_back(x);
-            } else {
-                break;
-            }
-        }
-        if !has_sub {
-            let mut drain = false;
-            if let Some(first_arg) = pf_args_it.peek() {
-                warn_excess_args(first_arg);
-                drain = true;
-            }
-            if drain {
-                loop {
-                    // drain remaining args;
-                    if pf_args_it.next().is_none() {
-                        break;
-                    }
-                }
-            }
-        }
-        Ok(pm)
-    }
-    fn apply<W>(&self, writer: &mut W, pf_args_it: &mut Peekable<Iter<String>>)
-    where
-        W: Write,
-    {
-        for tkn in &self.tokens {
-            tkn.write(writer, pf_args_it);
-        }
-    }
-    fn run_all<W>(writer: &mut W, pf_string: &str, pf_args: &[String]) -> UResult<()>
-    where
-        W: Write,
-    {
-        let mut arg_it = pf_args.iter().peekable();
-        let pm = Self::new(writer, pf_string, &mut arg_it)?;
-        loop {
-            if arg_it.peek().is_none() {
-                return Ok(());
-            }
-            pm.apply(writer, &mut arg_it);
-        }
-    }
-}
-
-/// Write a formatted string to stdout.
-///
-/// `format_string` contains the template and `args` contains the
-/// arguments to render into the template.
-///
-/// See also [`sprintf`], which creates a new formatted [`String`].
-///
-/// # Examples
-///
-/// ```rust
-/// use uucore::memo::printf;
-///
-/// printf("hello %s", &["world".to_string()]).unwrap();
-/// // prints "hello world"
-/// ```
-pub fn printf(format_string: &str, args: &[String]) -> UResult<()> {
-    let mut writer = stdout();
-    Memo::run_all(&mut writer, format_string, args)
-}
-
-/// Create a new formatted string.
-///
-/// `format_string` contains the template and `args` contains the
-/// arguments to render into the template.
-///
-/// See also [`printf`], which prints to stdout.
-///
-/// # Examples
-///
-/// ```rust
-/// use uucore::memo::sprintf;
-///
-/// let s = sprintf("hello %s", &["world".to_string()]).unwrap();
-/// assert_eq!(s, "hello world".to_string());
-/// ```
-pub fn sprintf(format_string: &str, args: &[String]) -> UResult<String> {
-    let mut writer = Cursor::new(vec![]);
-    Memo::run_all(&mut writer, format_string, args)?;
-    let buf = writer.into_inner();
-    match String::from_utf8(buf) {
-        Ok(s) => Ok(s),
-        Err(e) => Err(USimpleError::new(
-            1,
-            format!("failed to parse formatted string as UTF-8: {e}"),
-        )),
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::memo::sprintf;
-
-    #[test]
-    fn test_sprintf_smoke() {
-        assert_eq!(sprintf("", &[]).unwrap(), "".to_string());
-    }
-
-    #[test]
-    fn test_sprintf_no_args() {
-        assert_eq!(
-            sprintf("hello world", &[]).unwrap(),
-            "hello world".to_string()
-        );
-    }
-
-    #[test]
-    fn test_sprintf_string() {
-        assert_eq!(
-            sprintf("hello %s", &["world".to_string()]).unwrap(),
-            "hello world".to_string()
-        );
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/mode.rs.html b/coreutils/dev/src/uucore/features/mode.rs.html deleted file mode 100644 index fe185033f..000000000 --- a/coreutils/dev/src/uucore/features/mode.rs.html +++ /dev/null @@ -1,449 +0,0 @@ -mode.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-
// This file is part of the uutils coreutils package.
-//
-// (c) Alex Lyon <arcterus@mail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-//! Set of functions to parse modes
-
-// spell-checker:ignore (vars) fperm srwx
-
-use libc::{mode_t, umask, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IWUSR};
-
-pub fn parse_numeric(fperm: u32, mut mode: &str, considering_dir: bool) -> Result<u32, String> {
-    let (op, pos) = parse_op(mode).map_or_else(|_| (None, 0), |(op, pos)| (Some(op), pos));
-    mode = mode[pos..].trim();
-    let change = if mode.is_empty() {
-        0
-    } else {
-        u32::from_str_radix(mode, 8).map_err(|e| e.to_string())?
-    };
-    if change > 0o7777 {
-        Err(format!("mode is too large ({change} > 7777"))
-    } else {
-        Ok(match op {
-            Some('+') => fperm | change,
-            Some('-') => fperm & !change,
-            // If this is a directory, we keep the setgid and setuid bits,
-            // unless the mode contains 5 or more octal digits or the mode is "="
-            None if considering_dir && mode.len() < 5 => change | (fperm & (0o4000 | 0o2000)),
-            None | Some('=') => change,
-            Some(_) => unreachable!(),
-        })
-    }
-}
-
-pub fn parse_symbolic(
-    mut fperm: u32,
-    mut mode: &str,
-    umask: u32,
-    considering_dir: bool,
-) -> Result<u32, String> {
-    let (mask, pos) = parse_levels(mode);
-    if pos == mode.len() {
-        return Err(format!("invalid mode ({mode})"));
-    }
-    let respect_umask = pos == 0;
-    mode = &mode[pos..];
-    while !mode.is_empty() {
-        let (op, pos) = parse_op(mode)?;
-        mode = &mode[pos..];
-        let (mut srwx, pos) = parse_change(mode, fperm, considering_dir);
-        if respect_umask {
-            srwx &= !umask;
-        }
-        mode = &mode[pos..];
-        match op {
-            '+' => fperm |= srwx & mask,
-            '-' => fperm &= !(srwx & mask),
-            '=' => {
-                if considering_dir {
-                    // keep the setgid and setuid bits for directories
-                    srwx |= fperm & (0o4000 | 0o2000);
-                }
-                fperm = (fperm & !mask) | (srwx & mask);
-            }
-            _ => unreachable!(),
-        }
-    }
-    Ok(fperm)
-}
-
-fn parse_levels(mode: &str) -> (u32, usize) {
-    let mut mask = 0;
-    let mut pos = 0;
-    for ch in mode.chars() {
-        mask |= match ch {
-            'u' => 0o4700,
-            'g' => 0o2070,
-            'o' => 0o1007,
-            'a' => 0o7777,
-            _ => break,
-        };
-        pos += 1;
-    }
-    if pos == 0 {
-        mask = 0o7777; // default to 'a'
-    }
-    (mask, pos)
-}
-
-fn parse_op(mode: &str) -> Result<(char, usize), String> {
-    let ch = mode
-        .chars()
-        .next()
-        .ok_or_else(|| "unexpected end of mode".to_owned())?;
-    match ch {
-        '+' | '-' | '=' => Ok((ch, 1)),
-        _ => Err(format!(
-            "invalid operator (expected +, -, or =, but found {ch})"
-        )),
-    }
-}
-
-fn parse_change(mode: &str, fperm: u32, considering_dir: bool) -> (u32, usize) {
-    let mut srwx = 0;
-    let mut pos = 0;
-    for ch in mode.chars() {
-        match ch {
-            'r' => srwx |= 0o444,
-            'w' => srwx |= 0o222,
-            'x' => srwx |= 0o111,
-            'X' => {
-                if considering_dir || (fperm & 0o0111) != 0 {
-                    srwx |= 0o111;
-                }
-            }
-            's' => srwx |= 0o4000 | 0o2000,
-            't' => srwx |= 0o1000,
-            'u' => srwx = (fperm & 0o700) | ((fperm >> 3) & 0o070) | ((fperm >> 6) & 0o007),
-            'g' => srwx = ((fperm << 3) & 0o700) | (fperm & 0o070) | ((fperm >> 3) & 0o007),
-            'o' => srwx = ((fperm << 6) & 0o700) | ((fperm << 3) & 0o070) | (fperm & 0o007),
-            _ => break,
-        };
-        if ch == 'u' || ch == 'g' || ch == 'o' {
-            // symbolic modes only allows perms to be a single letter of 'ugo'
-            // therefore this must either be the first char or it is unexpected
-            if pos != 0 {
-                break;
-            }
-            pos = 1;
-            break;
-        }
-        pos += 1;
-    }
-    if pos == 0 {
-        srwx = 0;
-    }
-    (srwx, pos)
-}
-
-pub fn parse_mode(mode: &str) -> Result<mode_t, String> {
-    #[cfg(all(
-        not(target_os = "freebsd"),
-        not(target_vendor = "apple"),
-        not(target_os = "android")
-    ))]
-    let fperm = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
-    #[cfg(any(target_os = "freebsd", target_vendor = "apple", target_os = "android"))]
-    let fperm = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) as u32;
-
-    let arr: &[char] = &['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
-    let result = if mode.contains(arr) {
-        parse_numeric(fperm, mode, true)
-    } else {
-        parse_symbolic(fperm, mode, get_umask(), true)
-    };
-    result.map(|mode| mode as mode_t)
-}
-
-pub fn get_umask() -> u32 {
-    // There's no portable way to read the umask without changing it.
-    // We have to replace it and then quickly set it back, hopefully before
-    // some other thread is affected.
-    // On modern Linux kernels the current umask could instead be read
-    // from /proc/self/status. But that's a lot of work.
-    // SAFETY: umask always succeeds and doesn't operate on memory. Races are
-    // possible but it can't violate Rust's guarantees.
-    let mask = unsafe { umask(0) };
-    unsafe { umask(mask) };
-    #[cfg(all(
-        not(target_os = "freebsd"),
-        not(target_vendor = "apple"),
-        not(target_os = "android")
-    ))]
-    return mask;
-    #[cfg(any(target_os = "freebsd", target_vendor = "apple", target_os = "android"))]
-    return mask.into();
-}
-
-// Iterate 'args' and delete the first occurrence
-// of a prefix '-' if it's associated with MODE
-// e.g. "chmod -v -xw -R FILE" -> "chmod -v xw -R FILE"
-pub fn strip_minus_from_mode(args: &mut Vec<String>) -> bool {
-    for arg in args {
-        if arg == "--" {
-            break;
-        }
-        if let Some(arg_stripped) = arg.strip_prefix('-') {
-            if let Some(second) = arg.chars().nth(1) {
-                match second {
-                    'r' | 'w' | 'x' | 'X' | 's' | 't' | 'u' | 'g' | 'o' | '0'..='7' => {
-                        *arg = arg_stripped.to_string();
-                        return true;
-                    }
-                    _ => {}
-                }
-            }
-        }
-    }
-    false
-}
-
-#[cfg(test)]
-mod test {
-
-    #[test]
-    fn symbolic_modes() {
-        assert_eq!(super::parse_mode("u+x").unwrap(), 0o766);
-        assert_eq!(
-            super::parse_mode("+x").unwrap(),
-            if crate::os::is_wsl_1() { 0o776 } else { 0o777 }
-        );
-        assert_eq!(super::parse_mode("a-w").unwrap(), 0o444);
-        assert_eq!(super::parse_mode("g-r").unwrap(), 0o626);
-    }
-
-    #[test]
-    fn numeric_modes() {
-        assert_eq!(super::parse_mode("644").unwrap(), 0o644);
-        assert_eq!(super::parse_mode("+100").unwrap(), 0o766);
-        assert_eq!(super::parse_mode("-4").unwrap(), 0o662);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/perms.rs.html b/coreutils/dev/src/uucore/features/perms.rs.html deleted file mode 100644 index 52a46922f..000000000 --- a/coreutils/dev/src/uucore/features/perms.rs.html +++ /dev/null @@ -1,1185 +0,0 @@ -perms.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-
// This file is part of the uutils coreutils package.
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-//! Common functions to manage permissions
-
-use crate::display::Quotable;
-use crate::error::strip_errno;
-use crate::error::UResult;
-use crate::error::USimpleError;
-pub use crate::features::entries;
-use crate::fs::resolve_relative_path;
-use crate::show_error;
-use clap::Arg;
-use clap::ArgMatches;
-use clap::Command;
-use libc::{self, gid_t, uid_t};
-use walkdir::WalkDir;
-
-use std::io::Error as IOError;
-use std::io::Result as IOResult;
-
-use std::ffi::CString;
-use std::fs::Metadata;
-use std::os::unix::fs::MetadataExt;
-
-use std::os::unix::ffi::OsStrExt;
-use std::path::Path;
-
-/// The various level of verbosity
-#[derive(PartialEq, Eq, Clone, Debug)]
-pub enum VerbosityLevel {
-    Silent,
-    Changes,
-    Verbose,
-    Normal,
-}
-#[derive(PartialEq, Eq, Clone, Debug)]
-pub struct Verbosity {
-    pub groups_only: bool,
-    pub level: VerbosityLevel,
-}
-
-/// Actually perform the change of owner on a path
-fn chown<P: AsRef<Path>>(path: P, uid: uid_t, gid: gid_t, follow: bool) -> IOResult<()> {
-    let path = path.as_ref();
-    let s = CString::new(path.as_os_str().as_bytes()).unwrap();
-    let ret = unsafe {
-        if follow {
-            libc::chown(s.as_ptr(), uid, gid)
-        } else {
-            libc::lchown(s.as_ptr(), uid, gid)
-        }
-    };
-    if ret == 0 {
-        Ok(())
-    } else {
-        Err(IOError::last_os_error())
-    }
-}
-
-/// Perform the change of owner on a path
-/// with the various options
-/// and error messages management
-pub fn wrap_chown<P: AsRef<Path>>(
-    path: P,
-    meta: &Metadata,
-    dest_uid: Option<u32>,
-    dest_gid: Option<u32>,
-    follow: bool,
-    verbosity: Verbosity,
-) -> Result<String, String> {
-    let dest_uid = dest_uid.unwrap_or_else(|| meta.uid());
-    let dest_gid = dest_gid.unwrap_or_else(|| meta.gid());
-    let path = path.as_ref();
-    let mut out: String = String::new();
-
-    if let Err(e) = chown(path, dest_uid, dest_gid, follow) {
-        match verbosity.level {
-            VerbosityLevel::Silent => (),
-            level => {
-                out = format!(
-                    "changing {} of {}: {}",
-                    if verbosity.groups_only {
-                        "group"
-                    } else {
-                        "ownership"
-                    },
-                    path.quote(),
-                    e
-                );
-                if level == VerbosityLevel::Verbose {
-                    out = if verbosity.groups_only {
-                        let gid = meta.gid();
-                        format!(
-                            "{}\nfailed to change group of {} from {} to {}",
-                            out,
-                            path.quote(),
-                            entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string()),
-                            entries::gid2grp(dest_gid).unwrap_or_else(|_| dest_gid.to_string())
-                        )
-                    } else {
-                        let uid = meta.uid();
-                        let gid = meta.gid();
-                        format!(
-                            "{}\nfailed to change ownership of {} from {}:{} to {}:{}",
-                            out,
-                            path.quote(),
-                            entries::uid2usr(uid).unwrap_or_else(|_| uid.to_string()),
-                            entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string()),
-                            entries::uid2usr(dest_uid).unwrap_or_else(|_| dest_uid.to_string()),
-                            entries::gid2grp(dest_gid).unwrap_or_else(|_| dest_gid.to_string())
-                        )
-                    };
-                };
-            }
-        }
-        return Err(out);
-    } else {
-        let changed = dest_uid != meta.uid() || dest_gid != meta.gid();
-        if changed {
-            match verbosity.level {
-                VerbosityLevel::Changes | VerbosityLevel::Verbose => {
-                    let gid = meta.gid();
-                    out = if verbosity.groups_only {
-                        format!(
-                            "changed group of {} from {} to {}",
-                            path.quote(),
-                            entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string()),
-                            entries::gid2grp(dest_gid).unwrap_or_else(|_| dest_gid.to_string())
-                        )
-                    } else {
-                        let gid = meta.gid();
-                        let uid = meta.uid();
-                        format!(
-                            "changed ownership of {} from {}:{} to {}:{}",
-                            path.quote(),
-                            entries::uid2usr(uid).unwrap_or_else(|_| uid.to_string()),
-                            entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string()),
-                            entries::uid2usr(dest_uid).unwrap_or_else(|_| dest_uid.to_string()),
-                            entries::gid2grp(dest_gid).unwrap_or_else(|_| dest_gid.to_string())
-                        )
-                    };
-                }
-                _ => (),
-            };
-        } else if verbosity.level == VerbosityLevel::Verbose {
-            out = if verbosity.groups_only {
-                format!(
-                    "group of {} retained as {}",
-                    path.quote(),
-                    entries::gid2grp(dest_gid).unwrap_or_default()
-                )
-            } else {
-                format!(
-                    "ownership of {} retained as {}:{}",
-                    path.quote(),
-                    entries::uid2usr(dest_uid).unwrap_or_else(|_| dest_uid.to_string()),
-                    entries::gid2grp(dest_gid).unwrap_or_else(|_| dest_gid.to_string())
-                )
-            };
-        }
-    }
-    Ok(out)
-}
-
-pub enum IfFrom {
-    All,
-    User(u32),
-    Group(u32),
-    UserGroup(u32, u32),
-}
-
-#[derive(PartialEq, Eq)]
-pub enum TraverseSymlinks {
-    None,
-    First,
-    All,
-}
-
-pub struct ChownExecutor {
-    pub dest_uid: Option<u32>,
-    pub dest_gid: Option<u32>,
-    pub raw_owner: String, // The owner of the file as input by the user in the command line.
-    pub traverse_symlinks: TraverseSymlinks,
-    pub verbosity: Verbosity,
-    pub filter: IfFrom,
-    pub files: Vec<String>,
-    pub recursive: bool,
-    pub preserve_root: bool,
-    pub dereference: bool,
-}
-
-impl ChownExecutor {
-    pub fn exec(&self) -> UResult<()> {
-        let mut ret = 0;
-        for f in &self.files {
-            ret |= self.traverse(f);
-        }
-        if ret != 0 {
-            return Err(ret.into());
-        }
-        Ok(())
-    }
-
-    #[allow(clippy::cognitive_complexity)]
-    fn traverse<P: AsRef<Path>>(&self, root: P) -> i32 {
-        let path = root.as_ref();
-        let meta = match self.obtain_meta(path, self.dereference) {
-            Some(m) => m,
-            _ => {
-                if self.verbosity.level == VerbosityLevel::Verbose {
-                    println!(
-                        "failed to change ownership of {} to {}",
-                        path.quote(),
-                        self.raw_owner
-                    );
-                }
-                return 1;
-            }
-        };
-
-        // Prohibit only if:
-        // (--preserve-root and -R present) &&
-        // (
-        //     (argument is not symlink && resolved to be '/') ||
-        //     (argument is symlink && should follow argument && resolved to be '/')
-        // )
-        if self.recursive && self.preserve_root {
-            let may_exist = if self.dereference {
-                path.canonicalize().ok()
-            } else {
-                let real = resolve_relative_path(path);
-                if real.is_dir() {
-                    Some(real.canonicalize().expect("failed to get real path"))
-                } else {
-                    Some(real.into_owned())
-                }
-            };
-
-            if let Some(p) = may_exist {
-                if p.parent().is_none() {
-                    show_error!("it is dangerous to operate recursively on '/'");
-                    show_error!("use --no-preserve-root to override this failsafe");
-                    return 1;
-                }
-            }
-        }
-
-        let ret = if self.matched(meta.uid(), meta.gid()) {
-            match wrap_chown(
-                path,
-                &meta,
-                self.dest_uid,
-                self.dest_gid,
-                self.dereference,
-                self.verbosity.clone(),
-            ) {
-                Ok(n) => {
-                    if !n.is_empty() {
-                        show_error!("{}", n);
-                    }
-                    0
-                }
-                Err(e) => {
-                    if self.verbosity.level != VerbosityLevel::Silent {
-                        show_error!("{}", e);
-                    }
-                    1
-                }
-            }
-        } else {
-            self.print_verbose_ownership_retained_as(
-                path,
-                meta.uid(),
-                self.dest_gid.map(|_| meta.gid()),
-            );
-            0
-        };
-
-        if self.recursive {
-            ret | self.dive_into(&root)
-        } else {
-            ret
-        }
-    }
-
-    #[allow(clippy::cognitive_complexity)]
-    fn dive_into<P: AsRef<Path>>(&self, root: P) -> i32 {
-        let root = root.as_ref();
-
-        // walkdir always dereferences the root directory, so we have to check it ourselves
-        if self.traverse_symlinks == TraverseSymlinks::None && root.is_symlink() {
-            return 0;
-        }
-
-        let mut ret = 0;
-        let mut iterator = WalkDir::new(root)
-            .follow_links(self.traverse_symlinks == TraverseSymlinks::All)
-            .min_depth(1)
-            .into_iter();
-        // We can't use a for loop because we need to manipulate the iterator inside the loop.
-        while let Some(entry) = iterator.next() {
-            let entry = match entry {
-                Err(e) => {
-                    ret = 1;
-                    if let Some(path) = e.path() {
-                        show_error!(
-                            "cannot access '{}': {}",
-                            path.display(),
-                            if let Some(error) = e.io_error() {
-                                strip_errno(error)
-                            } else {
-                                "Too many levels of symbolic links".into()
-                            }
-                        );
-                    } else {
-                        show_error!("{}", e);
-                    }
-                    continue;
-                }
-                Ok(entry) => entry,
-            };
-            let path = entry.path();
-            let meta = match self.obtain_meta(path, self.dereference) {
-                Some(m) => m,
-                _ => {
-                    ret = 1;
-                    if entry.file_type().is_dir() {
-                        // Instruct walkdir to skip this directory to avoid getting another error
-                        // when walkdir tries to query the children of this directory.
-                        iterator.skip_current_dir();
-                    }
-                    continue;
-                }
-            };
-
-            if !self.matched(meta.uid(), meta.gid()) {
-                self.print_verbose_ownership_retained_as(
-                    path,
-                    meta.uid(),
-                    self.dest_gid.map(|_| meta.gid()),
-                );
-                continue;
-            }
-
-            ret = match wrap_chown(
-                path,
-                &meta,
-                self.dest_uid,
-                self.dest_gid,
-                self.dereference,
-                self.verbosity.clone(),
-            ) {
-                Ok(n) => {
-                    if !n.is_empty() {
-                        show_error!("{}", n);
-                    }
-                    0
-                }
-                Err(e) => {
-                    if self.verbosity.level != VerbosityLevel::Silent {
-                        show_error!("{}", e);
-                    }
-                    1
-                }
-            }
-        }
-        ret
-    }
-
-    fn obtain_meta<P: AsRef<Path>>(&self, path: P, follow: bool) -> Option<Metadata> {
-        let path = path.as_ref();
-        let meta = if follow {
-            path.metadata()
-        } else {
-            path.symlink_metadata()
-        };
-        match meta {
-            Err(e) => {
-                match self.verbosity.level {
-                    VerbosityLevel::Silent => (),
-                    _ => show_error!(
-                        "cannot {} {}: {}",
-                        if follow { "dereference" } else { "access" },
-                        path.quote(),
-                        strip_errno(&e)
-                    ),
-                }
-                None
-            }
-            Ok(meta) => Some(meta),
-        }
-    }
-
-    #[inline]
-    fn matched(&self, uid: uid_t, gid: gid_t) -> bool {
-        match self.filter {
-            IfFrom::All => true,
-            IfFrom::User(u) => u == uid,
-            IfFrom::Group(g) => g == gid,
-            IfFrom::UserGroup(u, g) => u == uid && g == gid,
-        }
-    }
-
-    fn print_verbose_ownership_retained_as(&self, path: &Path, uid: u32, gid: Option<u32>) {
-        if self.verbosity.level == VerbosityLevel::Verbose {
-            match (self.dest_uid, self.dest_gid, gid) {
-                (Some(_), Some(_), Some(gid)) => {
-                    println!(
-                        "ownership of {} retained as {}:{}",
-                        path.quote(),
-                        entries::uid2usr(uid).unwrap_or_else(|_| uid.to_string()),
-                        entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string()),
-                    );
-                }
-                (None, Some(_), Some(gid)) => {
-                    println!(
-                        "ownership of {} retained as {}",
-                        path.quote(),
-                        entries::gid2grp(gid).unwrap_or_else(|_| gid.to_string()),
-                    );
-                }
-                (_, _, _) => {
-                    println!(
-                        "ownership of {} retained as {}",
-                        path.quote(),
-                        entries::uid2usr(uid).unwrap_or_else(|_| uid.to_string()),
-                    );
-                }
-            }
-        }
-    }
-}
-
-pub mod options {
-    pub const HELP: &str = "help";
-    pub mod verbosity {
-        pub const CHANGES: &str = "changes";
-        pub const QUIET: &str = "quiet";
-        pub const SILENT: &str = "silent";
-        pub const VERBOSE: &str = "verbose";
-    }
-    pub mod preserve_root {
-        pub const PRESERVE: &str = "preserve-root";
-        pub const NO_PRESERVE: &str = "no-preserve-root";
-    }
-    pub mod dereference {
-        pub const DEREFERENCE: &str = "dereference";
-        pub const NO_DEREFERENCE: &str = "no-dereference";
-    }
-    pub const FROM: &str = "from";
-    pub const RECURSIVE: &str = "recursive";
-    pub mod traverse {
-        pub const TRAVERSE: &str = "H";
-        pub const NO_TRAVERSE: &str = "P";
-        pub const EVERY: &str = "L";
-    }
-    pub const REFERENCE: &str = "reference";
-    pub const ARG_OWNER: &str = "OWNER";
-    pub const ARG_GROUP: &str = "GROUP";
-    pub const ARG_FILES: &str = "FILE";
-}
-
-pub struct GidUidOwnerFilter {
-    pub dest_gid: Option<u32>,
-    pub dest_uid: Option<u32>,
-    pub raw_owner: String,
-    pub filter: IfFrom,
-}
-type GidUidFilterOwnerParser = fn(&ArgMatches) -> UResult<GidUidOwnerFilter>;
-
-/// Base implementation for `chgrp` and `chown`.
-///
-/// An argument called `add_arg_if_not_reference` will be added to `command` if
-/// `args` does not contain the `--reference` option.
-/// `parse_gid_uid_and_filter` will be called to obtain the target gid and uid, and the filter,
-/// from `ArgMatches`.
-/// `groups_only` determines whether verbose output will only mention the group.
-#[allow(clippy::cognitive_complexity)]
-pub fn chown_base(
-    mut command: Command,
-    args: impl crate::Args,
-    add_arg_if_not_reference: &'static str,
-    parse_gid_uid_and_filter: GidUidFilterOwnerParser,
-    groups_only: bool,
-) -> UResult<()> {
-    let args: Vec<_> = args.collect();
-    let mut reference = false;
-    let mut help = false;
-    // stop processing options on --
-    for arg in args.iter().take_while(|s| *s != "--") {
-        if arg.to_string_lossy().starts_with("--reference=") || arg == "--reference" {
-            reference = true;
-        } else if arg == "--help" {
-            // we stop processing once we see --help,
-            // as it doesn't matter if we've seen reference or not
-            help = true;
-            break;
-        }
-    }
-
-    if help || !reference {
-        // add both positional arguments
-        // arg_group is only required if
-        command = command.arg(
-            Arg::new(add_arg_if_not_reference)
-                .value_name(add_arg_if_not_reference)
-                .required(true),
-        );
-    }
-    command = command.arg(
-        Arg::new(options::ARG_FILES)
-            .value_name(options::ARG_FILES)
-            .value_hint(clap::ValueHint::FilePath)
-            .action(clap::ArgAction::Append)
-            .required(true)
-            .num_args(1..),
-    );
-    let matches = command.try_get_matches_from(args)?;
-
-    let files: Vec<String> = matches
-        .get_many::<String>(options::ARG_FILES)
-        .map(|v| v.map(ToString::to_string).collect())
-        .unwrap_or_default();
-
-    let preserve_root = matches.get_flag(options::preserve_root::PRESERVE);
-
-    let mut dereference = if matches.get_flag(options::dereference::DEREFERENCE) {
-        Some(true)
-    } else if matches.get_flag(options::dereference::NO_DEREFERENCE) {
-        Some(false)
-    } else {
-        None
-    };
-
-    let mut traverse_symlinks = if matches.get_flag(options::traverse::TRAVERSE) {
-        TraverseSymlinks::First
-    } else if matches.get_flag(options::traverse::EVERY) {
-        TraverseSymlinks::All
-    } else {
-        TraverseSymlinks::None
-    };
-
-    let recursive = matches.get_flag(options::RECURSIVE);
-    if recursive {
-        if traverse_symlinks == TraverseSymlinks::None {
-            if dereference == Some(true) {
-                return Err(USimpleError::new(1, "-R --dereference requires -H or -L"));
-            }
-            dereference = Some(false);
-        }
-    } else {
-        traverse_symlinks = TraverseSymlinks::None;
-    }
-
-    let verbosity_level = if matches.get_flag(options::verbosity::CHANGES) {
-        VerbosityLevel::Changes
-    } else if matches.get_flag(options::verbosity::SILENT)
-        || matches.get_flag(options::verbosity::QUIET)
-    {
-        VerbosityLevel::Silent
-    } else if matches.get_flag(options::verbosity::VERBOSE) {
-        VerbosityLevel::Verbose
-    } else {
-        VerbosityLevel::Normal
-    };
-    let GidUidOwnerFilter {
-        dest_gid,
-        dest_uid,
-        raw_owner,
-        filter,
-    } = parse_gid_uid_and_filter(&matches)?;
-
-    let executor = ChownExecutor {
-        traverse_symlinks,
-        dest_gid,
-        dest_uid,
-        raw_owner,
-        verbosity: Verbosity {
-            groups_only,
-            level: verbosity_level,
-        },
-        recursive,
-        dereference: dereference.unwrap_or(true),
-        preserve_root,
-        files,
-        filter,
-    };
-    executor.exec()
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/pipes.rs.html b/coreutils/dev/src/uucore/features/pipes.rs.html deleted file mode 100644 index 0067a8ba8..000000000 --- a/coreutils/dev/src/uucore/features/pipes.rs.html +++ /dev/null @@ -1,143 +0,0 @@ -pipes.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-
/// Thin pipe-related wrappers around functions from the `nix` crate.
-use std::fs::File;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use std::io::IoSlice;
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use std::os::unix::io::AsRawFd;
-use std::os::unix::io::FromRawFd;
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-use nix::fcntl::SpliceFFlags;
-
-pub use nix::{Error, Result};
-
-/// A wrapper around [`nix::unistd::pipe`] that ensures the pipe is cleaned up.
-///
-/// Returns two `File` objects: everything written to the second can be read
-/// from the first.
-pub fn pipe() -> Result<(File, File)> {
-    let (read, write) = nix::unistd::pipe()?;
-    // SAFETY: The file descriptors do not have other owners.
-    unsafe { Ok((File::from_raw_fd(read), File::from_raw_fd(write))) }
-}
-
-/// Less noisy wrapper around [`nix::fcntl::splice`].
-///
-/// Up to `len` bytes are moved from `source` to `target`. Returns the number
-/// of successfully moved bytes.
-///
-/// At least one of `source` and `target` must be some sort of pipe.
-/// To get around this requirement, consider splicing from your source into
-/// a [`pipe`] and then from the pipe into your target (with `splice_exact`):
-/// this is still very efficient.
-#[cfg(any(target_os = "linux", target_os = "android"))]
-pub fn splice(source: &impl AsRawFd, target: &impl AsRawFd, len: usize) -> Result<usize> {
-    nix::fcntl::splice(
-        source.as_raw_fd(),
-        None,
-        target.as_raw_fd(),
-        None,
-        len,
-        SpliceFFlags::empty(),
-    )
-}
-
-/// Splice wrapper which fully finishes the write.
-///
-/// Exactly `len` bytes are moved from `source` into `target`.
-///
-/// Panics if `source` runs out of data before `len` bytes have been moved.
-#[cfg(any(target_os = "linux", target_os = "android"))]
-pub fn splice_exact(source: &impl AsRawFd, target: &impl AsRawFd, len: usize) -> Result<()> {
-    let mut left = len;
-    while left != 0 {
-        let written = splice(source, target, left)?;
-        assert_ne!(written, 0, "unexpected end of data");
-        left -= written;
-    }
-    Ok(())
-}
-
-/// Copy data from `bytes` into `target`, which must be a pipe.
-///
-/// Returns the number of successfully copied bytes.
-#[cfg(any(target_os = "linux", target_os = "android"))]
-pub fn vmsplice(target: &impl AsRawFd, bytes: &[u8]) -> Result<usize> {
-    nix::fcntl::vmsplice(
-        target.as_raw_fd(),
-        &[IoSlice::new(bytes)],
-        SpliceFFlags::empty(),
-    )
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/process.rs.html b/coreutils/dev/src/uucore/features/process.rs.html deleted file mode 100644 index 7e9ef6f4a..000000000 --- a/coreutils/dev/src/uucore/features/process.rs.html +++ /dev/null @@ -1,211 +0,0 @@ -process.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-
// This file is part of the uutils coreutils package.
-//
-// (c) Maciej Dziardziel <fiedzia@gmail.com>
-// (c) Jian Zeng <anonymousknight96 AT gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-// spell-checker:ignore (vars) cvar exitstatus
-// spell-checker:ignore (sys/unix) WIFSIGNALED
-
-//! Set of functions to manage IDs
-
-use libc::{gid_t, pid_t, uid_t};
-use std::io;
-use std::process::Child;
-use std::process::ExitStatus;
-use std::thread;
-use std::time::{Duration, Instant};
-
-// SAFETY: These functions always succeed and return simple integers.
-
-/// `geteuid()` returns the effective user ID of the calling process.
-pub fn geteuid() -> uid_t {
-    unsafe { libc::geteuid() }
-}
-
-/// `getegid()` returns the effective group ID of the calling process.
-pub fn getegid() -> gid_t {
-    unsafe { libc::getegid() }
-}
-
-/// `getgid()` returns the real group ID of the calling process.
-pub fn getgid() -> gid_t {
-    unsafe { libc::getgid() }
-}
-
-/// `getuid()` returns the real user ID of the calling process.
-pub fn getuid() -> uid_t {
-    unsafe { libc::getuid() }
-}
-
-/// Missing methods for Child objects
-pub trait ChildExt {
-    /// Send a signal to a Child process.
-    ///
-    /// Caller beware: if the process already exited then you may accidentally
-    /// send the signal to an unrelated process that recycled the PID.
-    fn send_signal(&mut self, signal: usize) -> io::Result<()>;
-
-    /// Send a signal to a process group.
-    fn send_signal_group(&mut self, signal: usize) -> io::Result<()>;
-
-    /// Wait for a process to finish or return after the specified duration.
-    /// A `timeout` of zero disables the timeout.
-    fn wait_or_timeout(&mut self, timeout: Duration) -> io::Result<Option<ExitStatus>>;
-}
-
-impl ChildExt for Child {
-    fn send_signal(&mut self, signal: usize) -> io::Result<()> {
-        if unsafe { libc::kill(self.id() as pid_t, signal as i32) } == 0 {
-            Ok(())
-        } else {
-            Err(io::Error::last_os_error())
-        }
-    }
-
-    fn send_signal_group(&mut self, signal: usize) -> io::Result<()> {
-        // Ignore the signal, so we don't go into a signal loop.
-        if unsafe { libc::signal(signal as i32, libc::SIG_IGN) } != 0 {
-            return Err(io::Error::last_os_error());
-        }
-        if unsafe { libc::kill(0, signal as i32) } == 0 {
-            Ok(())
-        } else {
-            Err(io::Error::last_os_error())
-        }
-    }
-
-    fn wait_or_timeout(&mut self, timeout: Duration) -> io::Result<Option<ExitStatus>> {
-        if timeout == Duration::from_micros(0) {
-            return self.wait().map(Some);
-        }
-        // .try_wait() doesn't drop stdin, so we do it manually
-        drop(self.stdin.take());
-
-        let start = Instant::now();
-        loop {
-            if let Some(status) = self.try_wait()? {
-                return Ok(Some(status));
-            }
-
-            if start.elapsed() >= timeout {
-                break;
-            }
-
-            // XXX: this is kinda gross, but it's cleaner than starting a thread just to wait
-            //      (which was the previous solution).  We might want to use a different duration
-            //      here as well
-            thread::sleep(Duration::from_millis(100));
-        }
-
-        Ok(None)
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/ringbuffer.rs.html b/coreutils/dev/src/uucore/features/ringbuffer.rs.html deleted file mode 100644 index e305dcc67..000000000 --- a/coreutils/dev/src/uucore/features/ringbuffer.rs.html +++ /dev/null @@ -1,273 +0,0 @@ -ringbuffer.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-
//! A fixed-size ring buffer.
-use std::collections::VecDeque;
-
-/// A fixed-size ring buffer backed by a `VecDeque`.
-///
-/// If the ring buffer is not full, then calling the [`push_back`]
-/// method appends elements, as in a [`VecDeque`]. If the ring buffer
-/// is full, then calling [`push_back`] removes the element at the
-/// front of the buffer (in a first-in, first-out manner) before
-/// appending the new element to the back of the buffer.
-///
-/// Use [`from_iter`] to take the last `size` elements from an
-/// iterator.
-///
-/// # Examples
-///
-/// After exceeding the size limit, the oldest elements are dropped in
-/// favor of the newest element:
-///
-/// ```rust,ignore
-/// let mut buffer: RingBuffer<u8> = RingBuffer::new(2);
-/// buffer.push_back(0);
-/// buffer.push_back(1);
-/// buffer.push_back(2);
-/// assert_eq!(vec![1, 2], buffer.data);
-/// ```
-///
-/// Take the last `n` elements from an iterator:
-///
-/// ```rust,ignore
-/// let iter = [0, 1, 2].iter();
-/// let actual = RingBuffer::from_iter(iter, 2).data;
-/// let expected = VecDeque::from_iter([1, 2].iter());
-/// assert_eq!(expected, actual);
-/// ```
-///
-/// [`push_back`]: struct.RingBuffer.html#method.push_back
-/// [`from_iter`]: struct.RingBuffer.html#method.from_iter
-pub struct RingBuffer<T> {
-    pub data: VecDeque<T>,
-    size: usize,
-}
-
-impl<T> RingBuffer<T> {
-    pub fn new(size: usize) -> Self {
-        Self {
-            data: VecDeque::new(),
-            size,
-        }
-    }
-
-    pub fn from_iter(iter: impl Iterator<Item = T>, size: usize) -> Self {
-        let mut ring_buffer = Self::new(size);
-        for value in iter {
-            ring_buffer.push_back(value);
-        }
-        ring_buffer
-    }
-
-    /// Append a value to the end of the ring buffer.
-    ///
-    /// If the ring buffer is not full, this method return [`None`]. If
-    /// the ring buffer is full, appending a new element will cause the
-    /// oldest element to be evicted. In that case this method returns
-    /// that element, or `None`.
-    ///
-    /// In the special case where the size limit is zero, each call to
-    /// this method with input `value` returns `Some(value)`, because
-    /// the input is immediately evicted.
-    ///
-    /// # Examples
-    ///
-    /// Appending an element when the buffer is full returns the oldest
-    /// element:
-    ///
-    /// ```rust,ignore
-    /// let mut buf = RingBuffer::new(3);
-    /// assert_eq!(None, buf.push_back(0));
-    /// assert_eq!(None, buf.push_back(1));
-    /// assert_eq!(None, buf.push_back(2));
-    /// assert_eq!(Some(0), buf.push_back(3));
-    /// ```
-    ///
-    /// If the size limit is zero, then this method always returns the
-    /// input value:
-    ///
-    /// ```rust,ignore
-    /// let mut buf = RingBuffer::new(0);
-    /// assert_eq!(Some(0), buf.push_back(0));
-    /// assert_eq!(Some(1), buf.push_back(1));
-    /// assert_eq!(Some(2), buf.push_back(2));
-    /// ```
-    pub fn push_back(&mut self, value: T) -> Option<T> {
-        if self.size == 0 {
-            return Some(value);
-        }
-        let result = if self.size <= self.data.len() {
-            self.data.pop_front()
-        } else {
-            None
-        };
-        self.data.push_back(value);
-        result
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::ringbuffer::RingBuffer;
-    use std::collections::VecDeque;
-
-    #[test]
-    fn test_size_limit_zero() {
-        let mut buf = RingBuffer::new(0);
-        assert_eq!(Some(0), buf.push_back(0));
-        assert_eq!(Some(1), buf.push_back(1));
-        assert_eq!(Some(2), buf.push_back(2));
-    }
-
-    #[test]
-    fn test_evict_oldest() {
-        let mut buf = RingBuffer::new(2);
-        assert_eq!(None, buf.push_back(0));
-        assert_eq!(None, buf.push_back(1));
-        assert_eq!(Some(0), buf.push_back(2));
-    }
-
-    #[test]
-    fn test_from_iter() {
-        let iter = [0, 1, 2].iter();
-        let actual = RingBuffer::from_iter(iter, 2).data;
-        let expected: VecDeque<&i32> = [1, 2].iter().collect();
-        assert_eq!(expected, actual);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/signals.rs.html b/coreutils/dev/src/uucore/features/signals.rs.html deleted file mode 100644 index 65335c2a8..000000000 --- a/coreutils/dev/src/uucore/features/signals.rs.html +++ /dev/null @@ -1,495 +0,0 @@ -signals.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-
// This file is part of the uutils coreutils package.
-//
-// (c) Maciej Dziardziel <fiedzia@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-// spell-checker:ignore (vars/api) fcntl setrlimit setitimer
-// spell-checker:ignore (vars/signals) ABRT ALRM CHLD SEGV SIGABRT SIGALRM SIGBUS SIGCHLD SIGCONT SIGEMT SIGFPE SIGHUP SIGILL SIGINFO SIGINT SIGIO SIGIOT SIGKILL SIGPIPE SIGPROF SIGPWR SIGQUIT SIGSEGV SIGSTOP SIGSYS SIGTERM SIGTRAP SIGTSTP SIGTHR SIGTTIN SIGTTOU SIGURG SIGUSR SIGVTALRM SIGWINCH SIGXCPU SIGXFSZ STKFLT PWR THR TSTP TTIN TTOU VTALRM XCPU XFSZ
-#[cfg(unix)]
-use nix::errno::Errno;
-#[cfg(unix)]
-use nix::sys::signal::{
-    signal, SigHandler::SigDfl, SigHandler::SigIgn, Signal::SIGINT, Signal::SIGPIPE,
-};
-pub static DEFAULT_SIGNAL: usize = 15;
-
-/*
-
-Linux Programmer's Manual
-
- 1 HUP      2 INT      3 QUIT     4 ILL      5 TRAP     6 ABRT     7 BUS
- 8 FPE      9 KILL    10 USR1    11 SEGV    12 USR2    13 PIPE    14 ALRM
-15 TERM    16 STKFLT  17 CHLD    18 CONT    19 STOP    20 TSTP    21 TTIN
-22 TTOU    23 URG     24 XCPU    25 XFSZ    26 VTALRM  27 PROF    28 WINCH
-29 POLL    30 PWR     31 SYS
-
-
-*/
-
-#[cfg(any(target_os = "linux", target_os = "android"))]
-pub static ALL_SIGNALS: [&str; 32] = [
-    "EXIT", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV",
-    "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU",
-    "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "POLL", "PWR", "SYS",
-];
-
-/*
-
-
-https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/signal.3.html
-
-
-No    Name         Default Action       Description
-1     SIGHUP       terminate process    terminal line hangup
-2     SIGINT       terminate process    interrupt program
-3     SIGQUIT      create core image    quit program
-4     SIGILL       create core image    illegal instruction
-5     SIGTRAP      create core image    trace trap
-6     SIGABRT      create core image    abort program (formerly SIGIOT)
-7     SIGEMT       create core image    emulate instruction executed
-8     SIGFPE       create core image    floating-point exception
-9     SIGKILL      terminate process    kill program
-10    SIGBUS       create core image    bus error
-11    SIGSEGV      create core image    segmentation violation
-12    SIGSYS       create core image    non-existent system call invoked
-13    SIGPIPE      terminate process    write on a pipe with no reader
-14    SIGALRM      terminate process    real-time timer expired
-15    SIGTERM      terminate process    software termination signal
-16    SIGURG       discard signal       urgent condition present on socket
-17    SIGSTOP      stop process         stop (cannot be caught or ignored)
-18    SIGTSTP      stop process         stop signal generated from keyboard
-19    SIGCONT      discard signal       continue after stop
-20    SIGCHLD      discard signal       child status has changed
-21    SIGTTIN      stop process         background read attempted from control terminal
-22    SIGTTOU      stop process         background write attempted to control terminal
-23    SIGIO        discard signal       I/O is possible on a descriptor (see fcntl(2))
-24    SIGXCPU      terminate process    cpu time limit exceeded (see setrlimit(2))
-25    SIGXFSZ      terminate process    file size limit exceeded (see setrlimit(2))
-26    SIGVTALRM    terminate process    virtual time alarm (see setitimer(2))
-27    SIGPROF      terminate process    profiling timer alarm (see setitimer(2))
-28    SIGWINCH     discard signal       Window size change
-29    SIGINFO      discard signal       status request from keyboard
-30    SIGUSR1      terminate process    User defined signal 1
-31    SIGUSR2      terminate process    User defined signal 2
-
-*/
-
-#[cfg(any(target_vendor = "apple", target_os = "freebsd"))]
-pub static ALL_SIGNALS: [&str; 32] = [
-    "EXIT", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV",
-    "SYS", "PIPE", "ALRM", "TERM", "URG", "STOP", "TSTP", "CONT", "CHLD", "TTIN", "TTOU", "IO",
-    "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "INFO", "USR1", "USR2",
-];
-
-/*
-
-     The following signals are defined in NetBSD:
-
-     SIGHUP           1     Hangup
-     SIGINT           2     Interrupt
-     SIGQUIT          3     Quit
-     SIGILL           4     Illegal instruction
-     SIGTRAP          5     Trace/BPT trap
-     SIGABRT          6     Abort trap
-     SIGEMT           7     EMT trap
-     SIGFPE           8     Floating point exception
-     SIGKILL          9     Killed
-     SIGBUS           10    Bus error
-     SIGSEGV          11    Segmentation fault
-     SIGSYS           12    Bad system call
-     SIGPIPE          13    Broken pipe
-     SIGALRM          14    Alarm clock
-     SIGTERM          15    Terminated
-     SIGURG           16    Urgent I/O condition
-     SIGSTOP          17    Suspended (signal)
-     SIGTSTP          18    Suspended
-     SIGCONT          19    Continued
-     SIGCHLD          20    Child exited, stopped or continued
-     SIGTTIN          21    Stopped (tty input)
-     SIGTTOU          22    Stopped (tty output)
-     SIGIO            23    I/O possible
-     SIGXCPU          24    CPU time limit exceeded
-     SIGXFSZ          25    File size limit exceeded
-     SIGVTALRM        26    Virtual timer expired
-     SIGPROF          27    Profiling timer expired
-     SIGWINCH         28    Window size changed
-     SIGINFO          29    Information request
-     SIGUSR1          30    User defined signal 1
-     SIGUSR2          31    User defined signal 2
-     SIGPWR           32    Power fail/restart
-*/
-
-#[cfg(target_os = "netbsd")]
-pub static ALL_SIGNALS: [&str; 33] = [
-    "EXIT", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV",
-    "SYS", "PIPE", "ALRM", "TERM", "URG", "STOP", "TSTP", "CONT", "CHLD", "TTIN", "TTOU", "IO",
-    "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "INFO", "USR1", "USR2", "PWR",
-];
-
-/*
-
-     The following signals are defined in OpenBSD:
-
-     SIGHUP       terminate process    terminal line hangup
-     SIGINT       terminate process    interrupt program
-     SIGQUIT      create core image    quit program
-     SIGILL       create core image    illegal instruction
-     SIGTRAP      create core image    trace trap
-     SIGABRT      create core image    abort(3) call (formerly SIGIOT)
-     SIGEMT       create core image    emulate instruction executed
-     SIGFPE       create core image    floating-point exception
-     SIGKILL      terminate process    kill program (cannot be caught or
-                                       ignored)
-     SIGBUS       create core image    bus error
-     SIGSEGV      create core image    segmentation violation
-     SIGSYS       create core image    system call given invalid argument
-     SIGPIPE      terminate process    write on a pipe with no reader
-     SIGALRM      terminate process    real-time timer expired
-     SIGTERM      terminate process    software termination signal
-     SIGURG       discard signal       urgent condition present on socket
-     SIGSTOP      stop process         stop (cannot be caught or ignored)
-     SIGTSTP      stop process         stop signal generated from keyboard
-     SIGCONT      discard signal       continue after stop
-     SIGCHLD      discard signal       child status has changed
-     SIGTTIN      stop process         background read attempted from control
-                                       terminal
-     SIGTTOU      stop process         background write attempted to control
-                                       terminal
-     SIGIO        discard signal       I/O is possible on a descriptor (see
-                                       fcntl(2))
-     SIGXCPU      terminate process    CPU time limit exceeded (see
-                                       setrlimit(2))
-     SIGXFSZ      terminate process    file size limit exceeded (see
-                                       setrlimit(2))
-     SIGVTALRM    terminate process    virtual time alarm (see setitimer(2))
-     SIGPROF      terminate process    profiling timer alarm (see
-                                       setitimer(2))
-     SIGWINCH     discard signal       window size change
-     SIGINFO      discard signal       status request from keyboard
-     SIGUSR1      terminate process    user-defined signal 1
-     SIGUSR2      terminate process    user-defined signal 2
-     SIGTHR       discard signal       thread AST
-*/
-
-#[cfg(target_os = "openbsd")]
-pub static ALL_SIGNALS: [&str; 33] = [
-    "EXIT", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV",
-    "SYS", "PIPE", "ALRM", "TERM", "URG", "STOP", "TSTP", "CONT", "CHLD", "TTIN", "TTOU", "IO",
-    "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "INFO", "USR1", "USR2", "THR",
-];
-
-pub fn signal_by_name_or_value(signal_name_or_value: &str) -> Option<usize> {
-    if let Ok(value) = signal_name_or_value.parse() {
-        if is_signal(value) {
-            return Some(value);
-        } else {
-            return None;
-        }
-    }
-    let signal_name = signal_name_or_value.trim_start_matches("SIG");
-
-    ALL_SIGNALS.iter().position(|&s| s == signal_name)
-}
-
-pub fn is_signal(num: usize) -> bool {
-    num < ALL_SIGNALS.len()
-}
-
-pub fn signal_name_by_value(signal_value: usize) -> Option<&'static str> {
-    ALL_SIGNALS.get(signal_value).copied()
-}
-
-#[cfg(unix)]
-pub fn enable_pipe_errors() -> Result<(), Errno> {
-    // We pass the error as is, the return value would just be Ok(SigDfl), so we can safely ignore it.
-    // SAFETY: this function is safe as long as we do not use a custom SigHandler -- we use the default one.
-    unsafe { signal(SIGPIPE, SigDfl) }.map(|_| ())
-}
-#[cfg(unix)]
-pub fn ignore_interrupts() -> Result<(), Errno> {
-    // We pass the error as is, the return value would just be Ok(SigIgn), so we can safely ignore it.
-    // SAFETY: this function is safe as long as we do not use a custom SigHandler -- we use the default one.
-    unsafe { signal(SIGINT, SigIgn) }.map(|_| ())
-}
-
-#[test]
-fn signal_by_value() {
-    assert_eq!(signal_by_name_or_value("0"), Some(0));
-    for (value, _signal) in ALL_SIGNALS.iter().enumerate() {
-        assert_eq!(signal_by_name_or_value(&value.to_string()), Some(value));
-    }
-}
-
-#[test]
-fn signal_by_short_name() {
-    for (value, signal) in ALL_SIGNALS.iter().enumerate() {
-        assert_eq!(signal_by_name_or_value(signal), Some(value));
-    }
-}
-
-#[test]
-fn signal_by_long_name() {
-    for (value, signal) in ALL_SIGNALS.iter().enumerate() {
-        assert_eq!(
-            signal_by_name_or_value(&format!("SIG{signal}")),
-            Some(value)
-        );
-    }
-}
-
-#[test]
-fn name() {
-    for (value, signal) in ALL_SIGNALS.iter().enumerate() {
-        assert_eq!(signal_name_by_value(value), Some(*signal));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/sum.rs.html b/coreutils/dev/src/uucore/features/sum.rs.html deleted file mode 100644 index 23faeb422..000000000 --- a/coreutils/dev/src/uucore/features/sum.rs.html +++ /dev/null @@ -1,1019 +0,0 @@ -sum.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-
// This file is part of the uutils coreutils package.
-//
-// (c) Yuan YangHao <yuanyanghau@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE file
-// that was distributed with this source code.
-
-// spell-checker:ignore memmem algo
-
-//! Implementations of digest functions, like md5 and sha1.
-//!
-//! The [`Digest`] trait represents the interface for providing inputs
-//! to these digest functions and accessing the resulting hash. The
-//! [`DigestWriter`] struct provides a wrapper around [`Digest`] that
-//! implements the [`Write`] trait, for use in situations where calling
-//! [`write`] would be useful.
-use std::io::Write;
-
-use hex::encode;
-#[cfg(windows)]
-use memchr::memmem;
-
-pub trait Digest {
-    fn new() -> Self
-    where
-        Self: Sized;
-    fn hash_update(&mut self, input: &[u8]);
-    fn hash_finalize(&mut self, out: &mut [u8]);
-    fn reset(&mut self);
-    fn output_bits(&self) -> usize;
-    fn output_bytes(&self) -> usize {
-        (self.output_bits() + 7) / 8
-    }
-    fn result_str(&mut self) -> String {
-        let mut buf: Vec<u8> = vec![0; self.output_bytes()];
-        self.hash_finalize(&mut buf);
-        encode(buf)
-    }
-}
-
-/// first element of the tuple is the blake2b state
-/// second is the number of output bits
-pub struct Blake2b(blake2b_simd::State, usize);
-
-impl Blake2b {
-    /// Return a new Blake2b instance with a custom output bytes length
-    pub fn with_output_bytes(output_bytes: usize) -> Self {
-        let mut params = blake2b_simd::Params::new();
-        params.hash_length(output_bytes);
-
-        let state = params.to_state();
-        Self(state, output_bytes * 8)
-    }
-}
-
-impl Digest for Blake2b {
-    fn new() -> Self {
-        // by default, Blake2b output is 512 bits long (= 64B)
-        Self::with_output_bytes(64)
-    }
-
-    fn hash_update(&mut self, input: &[u8]) {
-        self.0.update(input);
-    }
-
-    fn hash_finalize(&mut self, out: &mut [u8]) {
-        let hash_result = &self.0.finalize();
-        out.copy_from_slice(hash_result.as_bytes());
-    }
-
-    fn reset(&mut self) {
-        *self = Self::with_output_bytes(self.output_bytes());
-    }
-
-    fn output_bits(&self) -> usize {
-        self.1
-    }
-}
-
-pub struct Blake3(blake3::Hasher);
-impl Digest for Blake3 {
-    fn new() -> Self {
-        Self(blake3::Hasher::new())
-    }
-
-    fn hash_update(&mut self, input: &[u8]) {
-        self.0.update(input);
-    }
-
-    fn hash_finalize(&mut self, out: &mut [u8]) {
-        let hash_result = &self.0.finalize();
-        out.copy_from_slice(hash_result.as_bytes());
-    }
-
-    fn reset(&mut self) {
-        *self = Self::new();
-    }
-
-    fn output_bits(&self) -> usize {
-        256
-    }
-}
-
-pub struct Sm3(sm3::Sm3);
-impl Digest for Sm3 {
-    fn new() -> Self {
-        Self(<sm3::Sm3 as sm3::Digest>::new())
-    }
-
-    fn hash_update(&mut self, input: &[u8]) {
-        <sm3::Sm3 as sm3::Digest>::update(&mut self.0, input);
-    }
-
-    fn hash_finalize(&mut self, out: &mut [u8]) {
-        out.copy_from_slice(&<sm3::Sm3 as sm3::Digest>::finalize(self.0.clone()));
-    }
-
-    fn reset(&mut self) {
-        *self = Self::new();
-    }
-
-    fn output_bits(&self) -> usize {
-        256
-    }
-}
-
-// NOTE: CRC_TABLE_LEN *must* be <= 256 as we cast 0..CRC_TABLE_LEN to u8
-const CRC_TABLE_LEN: usize = 256;
-
-pub struct CRC {
-    state: u32,
-    size: usize,
-    crc_table: [u32; CRC_TABLE_LEN],
-}
-impl CRC {
-    fn generate_crc_table() -> [u32; CRC_TABLE_LEN] {
-        let mut table = [0; CRC_TABLE_LEN];
-
-        for (i, elt) in table.iter_mut().enumerate().take(CRC_TABLE_LEN) {
-            *elt = Self::crc_entry(i as u8);
-        }
-
-        table
-    }
-    fn crc_entry(input: u8) -> u32 {
-        let mut crc = (input as u32) << 24;
-
-        let mut i = 0;
-        while i < 8 {
-            let if_condition = crc & 0x8000_0000;
-            let if_body = (crc << 1) ^ 0x04c1_1db7;
-            let else_body = crc << 1;
-
-            // NOTE: i feel like this is easier to understand than emulating an if statement in bitwise
-            //       ops
-            let condition_table = [else_body, if_body];
-
-            crc = condition_table[(if_condition != 0) as usize];
-            i += 1;
-        }
-
-        crc
-    }
-
-    fn update(&mut self, input: u8) {
-        self.state = (self.state << 8)
-            ^ self.crc_table[((self.state >> 24) as usize ^ input as usize) & 0xFF];
-    }
-}
-
-impl Digest for CRC {
-    fn new() -> Self {
-        Self {
-            state: 0,
-            size: 0,
-            crc_table: Self::generate_crc_table(),
-        }
-    }
-
-    fn hash_update(&mut self, input: &[u8]) {
-        for &elt in input.iter() {
-            self.update(elt);
-        }
-        self.size += input.len();
-    }
-
-    fn hash_finalize(&mut self, out: &mut [u8]) {
-        let mut sz = self.size;
-        while sz != 0 {
-            self.update(sz as u8);
-            sz >>= 8;
-        }
-        self.state = !self.state;
-        out.copy_from_slice(&self.state.to_ne_bytes());
-    }
-
-    fn result_str(&mut self) -> String {
-        let mut _out: Vec<u8> = vec![0; 4];
-        self.hash_finalize(&mut _out);
-        format!("{}", self.state)
-    }
-
-    fn reset(&mut self) {
-        *self = Self::new();
-    }
-
-    fn output_bits(&self) -> usize {
-        256
-    }
-}
-
-// This can be replaced with usize::div_ceil once it is stabilized.
-// This implementation approach is optimized for when `b` is a constant,
-// particularly a power of two.
-pub fn div_ceil(a: usize, b: usize) -> usize {
-    (a + b - 1) / b
-}
-
-pub struct BSD {
-    state: u16,
-}
-impl Digest for BSD {
-    fn new() -> Self {
-        Self { state: 0 }
-    }
-
-    fn hash_update(&mut self, input: &[u8]) {
-        for &byte in input.iter() {
-            self.state = (self.state >> 1) + ((self.state & 1) << 15);
-            self.state = self.state.wrapping_add(u16::from(byte));
-        }
-    }
-
-    fn hash_finalize(&mut self, out: &mut [u8]) {
-        out.copy_from_slice(&self.state.to_ne_bytes());
-    }
-
-    fn result_str(&mut self) -> String {
-        let mut _out: Vec<u8> = vec![0; 2];
-        self.hash_finalize(&mut _out);
-        format!("{}", self.state)
-    }
-
-    fn reset(&mut self) {
-        *self = Self::new();
-    }
-
-    fn output_bits(&self) -> usize {
-        128
-    }
-}
-
-pub struct SYSV {
-    state: u32,
-}
-impl Digest for SYSV {
-    fn new() -> Self {
-        Self { state: 0 }
-    }
-
-    fn hash_update(&mut self, input: &[u8]) {
-        for &byte in input.iter() {
-            self.state = self.state.wrapping_add(u32::from(byte));
-        }
-    }
-
-    fn hash_finalize(&mut self, out: &mut [u8]) {
-        self.state = (self.state & 0xffff) + (self.state >> 16);
-        self.state = (self.state & 0xffff) + (self.state >> 16);
-        out.copy_from_slice(&(self.state as u16).to_ne_bytes());
-    }
-
-    fn result_str(&mut self) -> String {
-        let mut _out: Vec<u8> = vec![0; 2];
-        self.hash_finalize(&mut _out);
-        format!("{}", self.state)
-    }
-
-    fn reset(&mut self) {
-        *self = Self::new();
-    }
-
-    fn output_bits(&self) -> usize {
-        512
-    }
-}
-
-// Implements the Digest trait for sha2 / sha3 algorithms with fixed output
-macro_rules! impl_digest_common {
-    ($algo_type: ty, $size: expr) => {
-        impl Digest for $algo_type {
-            fn new() -> Self {
-                Self(Default::default())
-            }
-
-            fn hash_update(&mut self, input: &[u8]) {
-                digest::Digest::update(&mut self.0, input);
-            }
-
-            fn hash_finalize(&mut self, out: &mut [u8]) {
-                digest::Digest::finalize_into_reset(&mut self.0, out.into());
-            }
-
-            fn reset(&mut self) {
-                *self = Self::new();
-            }
-
-            fn output_bits(&self) -> usize {
-                $size
-            }
-        }
-    };
-}
-
-// Implements the Digest trait for sha2 / sha3 algorithms with variable output
-macro_rules! impl_digest_shake {
-    ($algo_type: ty) => {
-        impl Digest for $algo_type {
-            fn new() -> Self {
-                Self(Default::default())
-            }
-
-            fn hash_update(&mut self, input: &[u8]) {
-                digest::Update::update(&mut self.0, input);
-            }
-
-            fn hash_finalize(&mut self, out: &mut [u8]) {
-                digest::ExtendableOutputReset::finalize_xof_reset_into(&mut self.0, out);
-            }
-
-            fn reset(&mut self) {
-                *self = Self::new();
-            }
-
-            fn output_bits(&self) -> usize {
-                0
-            }
-        }
-    };
-}
-
-pub struct Md5(md5::Md5);
-pub struct Sha1(sha1::Sha1);
-pub struct Sha224(sha2::Sha224);
-pub struct Sha256(sha2::Sha256);
-pub struct Sha384(sha2::Sha384);
-pub struct Sha512(sha2::Sha512);
-impl_digest_common!(Md5, 128);
-impl_digest_common!(Sha1, 160);
-impl_digest_common!(Sha224, 224);
-impl_digest_common!(Sha256, 256);
-impl_digest_common!(Sha384, 384);
-impl_digest_common!(Sha512, 512);
-
-pub struct Sha3_224(sha3::Sha3_224);
-pub struct Sha3_256(sha3::Sha3_256);
-pub struct Sha3_384(sha3::Sha3_384);
-pub struct Sha3_512(sha3::Sha3_512);
-impl_digest_common!(Sha3_224, 224);
-impl_digest_common!(Sha3_256, 256);
-impl_digest_common!(Sha3_384, 384);
-impl_digest_common!(Sha3_512, 512);
-
-pub struct Shake128(sha3::Shake128);
-pub struct Shake256(sha3::Shake256);
-impl_digest_shake!(Shake128);
-impl_digest_shake!(Shake256);
-
-/// A struct that writes to a digest.
-///
-/// This struct wraps a [`Digest`] and provides a [`Write`]
-/// implementation that passes input bytes directly to the
-/// [`Digest::hash_update`].
-///
-/// On Windows, if `binary` is `false`, then the [`write`]
-/// implementation replaces instances of "\r\n" with "\n" before passing
-/// the input bytes to the [`digest`].
-pub struct DigestWriter<'a> {
-    digest: &'a mut Box<dyn Digest>,
-
-    /// Whether to write to the digest in binary mode or text mode on Windows.
-    ///
-    /// If this is `false`, then instances of "\r\n" are replaced with
-    /// "\n" before passing input bytes to the [`digest`].
-    #[allow(dead_code)]
-    binary: bool,
-
-    /// Whether the previous
-    #[allow(dead_code)]
-    was_last_character_carriage_return: bool,
-    // TODO These are dead code only on non-Windows operating systems.
-    // It might be better to use a `#[cfg(windows)]` guard here.
-}
-
-impl<'a> DigestWriter<'a> {
-    pub fn new(digest: &'a mut Box<dyn Digest>, binary: bool) -> DigestWriter {
-        let was_last_character_carriage_return = false;
-        DigestWriter {
-            digest,
-            binary,
-            was_last_character_carriage_return,
-        }
-    }
-
-    pub fn finalize(&mut self) -> bool {
-        if self.was_last_character_carriage_return {
-            self.digest.hash_update(&[b'\r']);
-            true
-        } else {
-            false
-        }
-    }
-}
-
-impl<'a> Write for DigestWriter<'a> {
-    #[cfg(not(windows))]
-    fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
-        self.digest.hash_update(buf);
-        Ok(buf.len())
-    }
-
-    #[cfg(windows)]
-    fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
-        if self.binary {
-            self.digest.hash_update(buf);
-            return Ok(buf.len());
-        }
-
-        // The remaining code handles Windows text mode, where we must
-        // replace each occurrence of "\r\n" with "\n".
-        //
-        // First, if the last character written was "\r" and the first
-        // character in the current buffer to write is not "\n", then we
-        // need to write the "\r" that we buffered from the previous
-        // call to `write()`.
-        let n = buf.len();
-        if self.was_last_character_carriage_return && n > 0 && buf[0] != b'\n' {
-            self.digest.hash_update(&[b'\r']);
-        }
-
-        // Next, find all occurrences of "\r\n", inputting the slice
-        // just before the "\n" in the previous instance of "\r\n" and
-        // the beginning of this "\r\n".
-        let mut i_prev = 0;
-        for i in memmem::find_iter(buf, b"\r\n") {
-            self.digest.hash_update(&buf[i_prev..i]);
-            i_prev = i + 1;
-        }
-
-        // Finally, check whether the last character is "\r". If so,
-        // buffer it until we know that the next character is not "\n",
-        // which can only be known on the next call to `write()`.
-        //
-        // This all assumes that `write()` will be called on adjacent
-        // blocks of the input.
-        if n > 0 && buf[n - 1] == b'\r' {
-            self.was_last_character_carriage_return = true;
-            self.digest.hash_update(&buf[i_prev..n - 1]);
-        } else {
-            self.was_last_character_carriage_return = false;
-            self.digest.hash_update(&buf[i_prev..n]);
-        }
-
-        // Even though we dropped a "\r" for each "\r\n" we found, we
-        // still report the number of bytes written as `n`. This is
-        // because the meaning of the returned number is supposed to be
-        // the number of bytes consumed by the writer, so that if the
-        // calling code were calling `write()` in a loop, it would know
-        // where the next contiguous slice of the buffer starts.
-        Ok(n)
-    }
-
-    fn flush(&mut self) -> std::io::Result<()> {
-        Ok(())
-    }
-}
-
-#[cfg(test)]
-mod tests {
-
-    /// Test for replacing a "\r\n" sequence with "\n" when the "\r" is
-    /// at the end of one block and the "\n" is at the beginning of the
-    /// next block, when reading in blocks.
-    #[cfg(windows)]
-    #[test]
-    fn test_crlf_across_blocks() {
-        use std::io::Write;
-
-        use crate::digest::Digest;
-        use crate::digest::DigestWriter;
-
-        // Writing "\r" in one call to `write()`, and then "\n" in another.
-        let mut digest = Box::new(md5::Md5::new()) as Box<dyn Digest>;
-        let mut writer_crlf = DigestWriter::new(&mut digest, false);
-        writer_crlf.write_all(&[b'\r']).unwrap();
-        writer_crlf.write_all(&[b'\n']).unwrap();
-        writer_crlf.hash_finalize();
-        let result_crlf = digest.result_str();
-
-        // We expect "\r\n" to be replaced with "\n" in text mode on Windows.
-        let mut digest = Box::new(md5::Md5::new()) as Box<dyn Digest>;
-        let mut writer_lf = DigestWriter::new(&mut digest, false);
-        writer_lf.write_all(&[b'\n']).unwrap();
-        writer_lf.hash_finalize();
-        let result_lf = digest.result_str();
-
-        assert_eq!(result_crlf, result_lf);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/mod.rs.html b/coreutils/dev/src/uucore/features/tokenize/mod.rs.html deleted file mode 100644 index 10d1b00c3..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/mod.rs.html +++ /dev/null @@ -1,11 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-
#[allow(clippy::module_inception)]
-mod num_format;
-pub mod sub;
-pub mod token;
-pub mod unescaped_text;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/format_field.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/format_field.rs.html deleted file mode 100644 index 4da62f9b4..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/format_field.rs.html +++ /dev/null @@ -1,87 +0,0 @@ -format_field.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-
// spell-checker:ignore (vars) charf decf floatf intf scif strf Cninety
-
-//! Primitives used by Sub Tokenizer
-//! and num_format modules
-#[derive(Clone)]
-pub enum FieldType {
-    Strf,
-    Floatf,
-    CninetyNineHexFloatf,
-    Scif,
-    Decf,
-    Intf,
-    Charf,
-}
-
-// #[allow(non_camel_case_types)]
-// pub enum FChar {
-// d,
-// e,
-// E,
-// i,
-// f,
-// F,
-// g,
-// G,
-// u,
-// x,
-// X,
-// o
-// }
-//
-
-// a Sub Tokens' fields are stored
-// as a single object so they can be more simply
-// passed by ref to num_format in a Sub method
-#[derive(Clone)]
-pub struct FormatField<'a> {
-    pub min_width: Option<isize>,
-    pub second_field: Option<u32>,
-    pub field_char: &'a char,
-    pub field_type: &'a FieldType,
-    pub orig: &'a String,
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatter.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatter.rs.html deleted file mode 100644 index 2964306e7..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatter.rs.html +++ /dev/null @@ -1,119 +0,0 @@ -formatter.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-
//! Primitives used by num_format and sub_modules.
-//! never dealt with above (e.g. Sub Tokenizer never uses these)
-
-use crate::{display::Quotable, show_error};
-use itertools::{put_back_n, PutBackN};
-use std::str::Chars;
-
-use super::format_field::FormatField;
-
-// contains the rough ingredients to final
-// output for a number, organized together
-// to allow for easy generalization of output manipulation
-// (e.g. max number of digits after decimal)
-#[derive(Default)]
-pub struct FormatPrimitive {
-    pub prefix: Option<String>,
-    pub pre_decimal: Option<String>,
-    pub post_decimal: Option<String>,
-    pub suffix: Option<String>,
-}
-
-#[derive(Clone, PartialEq, Eq)]
-pub enum Base {
-    Ten = 10,
-    Hex = 16,
-    Octal = 8,
-}
-
-// information from the beginning of a numeric argument
-// the precedes the beginning of a numeric value
-pub struct InitialPrefix {
-    pub radix_in: Base,
-    pub sign: i8,
-    pub offset: usize,
-}
-
-pub trait Formatter {
-    //  return a FormatPrimitive for
-    // particular field char(s), given the argument
-    // string and prefix information (sign, radix)
-    fn get_primitive(
-        &self,
-        field: &FormatField,
-        in_prefix: &InitialPrefix,
-        str_in: &str,
-    ) -> Option<FormatPrimitive>;
-    // return a string from a FormatPrimitive,
-    // given information about the field
-    fn primitive_to_str(&self, prim: &FormatPrimitive, field: FormatField) -> String;
-}
-pub fn get_it_at(offset: usize, str_in: &str) -> PutBackN<Chars> {
-    put_back_n(str_in[offset..].chars())
-}
-
-// TODO: put this somewhere better
-pub fn warn_incomplete_conv(pf_arg: &str) {
-    // important: keep println here not print
-    show_error!("{}: value not completely converted", pf_arg.maybe_quote());
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/base_conv/mod.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/base_conv/mod.rs.html deleted file mode 100644 index 16f4ea27c..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/base_conv/mod.rs.html +++ /dev/null @@ -1,541 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-
// spell-checker:ignore (ToDO) arrnum arr_num mult basenum bufferval refd vals arrfloat conv intermed addl
-
-pub fn arrnum_int_mult(arr_num: &[u8], basenum: u8, base_ten_int_fact: u8) -> Vec<u8> {
-    let mut carry: u16 = 0;
-    let mut rem: u16;
-    let mut new_amount: u16;
-    let fact: u16 = u16::from(base_ten_int_fact);
-    let base: u16 = u16::from(basenum);
-
-    let mut ret_rev: Vec<u8> = Vec::new();
-    let mut it = arr_num.iter().rev();
-    loop {
-        let i = it.next();
-        match i {
-            Some(u) => {
-                new_amount = (u16::from(*u) * fact) + carry;
-                rem = new_amount % base;
-                carry = (new_amount - rem) / base;
-                ret_rev.push(rem as u8);
-            }
-            None => {
-                while carry != 0 {
-                    rem = carry % base;
-                    carry = (carry - rem) / base;
-                    ret_rev.push(rem as u8);
-                }
-                break;
-            }
-        }
-    }
-    let ret: Vec<u8> = ret_rev.into_iter().rev().collect();
-    ret
-}
-
-#[allow(dead_code)]
-pub struct Remainder<'a> {
-    pub position: usize,
-    pub replace: Vec<u8>,
-    pub arr_num: &'a Vec<u8>,
-}
-
-#[allow(dead_code)]
-pub struct DivOut<'a> {
-    pub quotient: u8,
-    pub remainder: Remainder<'a>,
-}
-
-#[allow(dead_code)]
-pub fn arrnum_int_div_step<'a>(
-    rem_in: &'a Remainder,
-    radix_in: u8,
-    base_ten_int_divisor: u8,
-    after_decimal: bool,
-) -> DivOut<'a> {
-    let mut rem_out = Remainder {
-        position: rem_in.position,
-        replace: Vec::new(),
-        arr_num: rem_in.arr_num,
-    };
-
-    let mut bufferval: u16 = 0;
-    let base: u16 = u16::from(radix_in);
-    let divisor: u16 = u16::from(base_ten_int_divisor);
-    let mut traversed = 0;
-
-    let mut quotient = 0;
-    let refd_vals = &rem_in.arr_num[rem_in.position + rem_in.replace.len()..];
-    let mut it_replace = rem_in.replace.iter();
-    let mut it_f = refd_vals.iter();
-    loop {
-        let u = match it_replace.next() {
-            Some(u_rep) => u16::from(*u_rep),
-            None => match it_f.next() {
-                Some(u_orig) => u16::from(*u_orig),
-                None => {
-                    if !after_decimal {
-                        break;
-                    }
-                    0
-                }
-            },
-        };
-        traversed += 1;
-        bufferval += u;
-        if bufferval > divisor {
-            while bufferval >= divisor {
-                quotient += 1;
-                bufferval -= divisor;
-            }
-            rem_out.replace = if bufferval == 0 {
-                Vec::new()
-            } else {
-                let remainder_as_arrnum = unsigned_to_arrnum(bufferval);
-                base_conv_vec(&remainder_as_arrnum, 10, radix_in)
-            };
-            rem_out.position += 1 + (traversed - rem_out.replace.len());
-            break;
-        } else {
-            bufferval *= base;
-        }
-    }
-    DivOut {
-        quotient,
-        remainder: rem_out,
-    }
-}
-pub fn arrnum_int_add(arrnum: &[u8], basenum: u8, base_ten_int_term: u8) -> Vec<u8> {
-    let mut carry: u16 = u16::from(base_ten_int_term);
-    let mut rem: u16;
-    let mut new_amount: u16;
-    let base: u16 = u16::from(basenum);
-
-    let mut ret_rev: Vec<u8> = Vec::new();
-    let mut it = arrnum.iter().rev();
-    loop {
-        let i = it.next();
-        match i {
-            Some(u) => {
-                new_amount = u16::from(*u) + carry;
-                rem = new_amount % base;
-                carry = (new_amount - rem) / base;
-                ret_rev.push(rem as u8);
-            }
-            None => {
-                while carry != 0 {
-                    rem = carry % base;
-                    carry = (carry - rem) / base;
-                    ret_rev.push(rem as u8);
-                }
-                break;
-            }
-        }
-    }
-    let ret: Vec<u8> = ret_rev.into_iter().rev().collect();
-    ret
-}
-
-pub fn base_conv_vec(src: &[u8], radix_src: u8, radix_dest: u8) -> Vec<u8> {
-    let mut result = vec![0];
-    for i in src {
-        result = arrnum_int_mult(&result, radix_dest, radix_src);
-        result = arrnum_int_add(&result, radix_dest, *i);
-    }
-    result
-}
-
-#[allow(dead_code)]
-pub fn unsigned_to_arrnum(src: u16) -> Vec<u8> {
-    let mut result: Vec<u8> = Vec::new();
-    let mut src_tmp: u16 = src;
-    while src_tmp > 0 {
-        result.push((src_tmp % 10) as u8);
-        src_tmp /= 10;
-    }
-    result.reverse();
-    result
-}
-
-// temporary needs-improvement-function
-pub fn base_conv_float(src: &[u8], radix_src: u8, _radix_dest: u8) -> f64 {
-    // it would require a lot of addl code
-    // to implement this for arbitrary string input.
-    // until then, the below operates as an outline
-    // of how it would work.
-    let mut factor: f64 = 1_f64;
-    let radix_src_float: f64 = f64::from(radix_src);
-    let mut r: f64 = 0_f64;
-    for (i, u) in src.iter().enumerate() {
-        if i > 15 {
-            break;
-        }
-        factor /= radix_src_float;
-        r += factor * f64::from(*u);
-    }
-    r
-}
-
-pub fn str_to_arrnum(src: &str, radix_def_src: &dyn RadixDef) -> Vec<u8> {
-    let mut intermed_in: Vec<u8> = Vec::new();
-    for c in src.chars() {
-        #[allow(clippy::single_match)]
-        match radix_def_src.parse_char(c) {
-            Some(u) => {
-                intermed_in.push(u);
-            }
-            None => {} //todo err msg on incorrect
-        }
-    }
-    intermed_in
-}
-
-pub fn arrnum_to_str(src: &[u8], radix_def_dest: &dyn RadixDef) -> String {
-    let mut str_out = String::new();
-    for u in src.iter() {
-        #[allow(clippy::single_match)]
-        match radix_def_dest.format_u8(*u) {
-            Some(c) => {
-                str_out.push(c);
-            }
-            None => {} //todo
-        }
-    }
-    str_out
-}
-
-pub fn base_conv_str(
-    src: &str,
-    radix_def_src: &dyn RadixDef,
-    radix_def_dest: &dyn RadixDef,
-) -> String {
-    let intermed_in: Vec<u8> = str_to_arrnum(src, radix_def_src);
-    let intermed_out = base_conv_vec(
-        &intermed_in,
-        radix_def_src.get_max(),
-        radix_def_dest.get_max(),
-    );
-    arrnum_to_str(&intermed_out, radix_def_dest)
-}
-
-pub trait RadixDef {
-    fn get_max(&self) -> u8;
-    fn parse_char(&self, x: char) -> Option<u8>;
-    fn format_u8(&self, x: u8) -> Option<char>;
-}
-pub struct RadixTen;
-
-const ZERO_ASC: u8 = b'0';
-const UPPER_A_ASC: u8 = b'A';
-const LOWER_A_ASC: u8 = b'a';
-
-impl RadixDef for RadixTen {
-    fn get_max(&self) -> u8 {
-        10
-    }
-    fn parse_char(&self, c: char) -> Option<u8> {
-        match c {
-            '0'..='9' => Some(c as u8 - ZERO_ASC),
-            _ => None,
-        }
-    }
-    fn format_u8(&self, u: u8) -> Option<char> {
-        match u {
-            0..=9 => Some((ZERO_ASC + u) as char),
-            _ => None,
-        }
-    }
-}
-pub struct RadixHex;
-impl RadixDef for RadixHex {
-    fn get_max(&self) -> u8 {
-        16
-    }
-    fn parse_char(&self, c: char) -> Option<u8> {
-        match c {
-            '0'..='9' => Some(c as u8 - ZERO_ASC),
-            'A'..='F' => Some(c as u8 + 10 - UPPER_A_ASC),
-            'a'..='f' => Some(c as u8 + 10 - LOWER_A_ASC),
-            _ => None,
-        }
-    }
-    fn format_u8(&self, u: u8) -> Option<char> {
-        match u {
-            0..=9 => Some((ZERO_ASC + u) as char),
-            10..=15 => Some((UPPER_A_ASC + (u - 10)) as char),
-            _ => None,
-        }
-    }
-}
-
-mod tests;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/base_conv/tests.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/base_conv/tests.rs.html deleted file mode 100644 index 696fdcc4f..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/base_conv/tests.rs.html +++ /dev/null @@ -1,113 +0,0 @@ -tests.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-
// spell-checker:ignore (ToDO) arrnum mult
-
-#[cfg(test)]
-use super::*;
-
-#[test]
-fn test_arrnum_int_mult() {
-    // (in base 10) 12 * 4 = 48
-    let factor: Vec<u8> = vec![1, 2];
-    let base_num = 10;
-    let base_ten_int_fact: u8 = 4;
-    let should_output: Vec<u8> = vec![4, 8];
-
-    let product = arrnum_int_mult(&factor, base_num, base_ten_int_fact);
-    assert!(product == should_output);
-}
-
-#[test]
-fn test_arrnum_int_non_base_10() {
-    // (in base 3)
-    // 5 * 4 = 20
-    let factor: Vec<u8> = vec![1, 2];
-    let base_num = 3;
-    let base_ten_int_fact: u8 = 4;
-    let should_output: Vec<u8> = vec![2, 0, 2];
-
-    let product = arrnum_int_mult(&factor, base_num, base_ten_int_fact);
-    assert!(product == should_output);
-}
-
-#[test]
-fn test_arrnum_int_div_short_circuit() {
-    // (
-    let arrnum: Vec<u8> = vec![5, 5, 5, 5, 0];
-    let base_num = 10;
-    let base_ten_int_divisor: u8 = 41;
-    let remainder_passed_in = Remainder {
-        position: 1,
-        replace: vec![1, 3],
-        arr_num: &arrnum,
-    };
-
-    // the "replace" should mean the number being divided
-    // is 1350, the first time you can get 41 to go into
-    // 1350, its at 135, where you can get a quotient of
-    // 3 and a remainder of 12;
-
-    let quotient_should_be: u8 = 3;
-    let remainder_position_should_be: usize = 3;
-    let remainder_replace_should_be = vec![1, 2];
-
-    let result = arrnum_int_div_step(&remainder_passed_in, base_num, base_ten_int_divisor, false);
-    assert!(quotient_should_be == result.quotient);
-    assert!(remainder_position_should_be == result.remainder.position);
-    assert!(remainder_replace_should_be == result.remainder.replace);
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/cninetyninehexfloatf.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/cninetyninehexfloatf.rs.html deleted file mode 100644 index 7b9ab4d5b..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/cninetyninehexfloatf.rs.html +++ /dev/null @@ -1,231 +0,0 @@ -cninetyninehexfloatf.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-
// spell-checker:ignore (vars) charf decf floatf intf scif strf Cninety
-// spell-checker:ignore (ToDO) arrnum
-
-//! formatter for %a %F C99 Hex-floating-point subs
-use super::super::format_field::FormatField;
-use super::super::formatter::{FormatPrimitive, Formatter, InitialPrefix};
-use super::base_conv;
-use super::base_conv::RadixDef;
-use super::float_common::{primitive_to_str_common, FloatAnalysis};
-
-#[derive(Default)]
-pub struct CninetyNineHexFloatf {
-    #[allow(dead_code)]
-    as_num: f64,
-}
-impl CninetyNineHexFloatf {
-    pub fn new() -> Self {
-        Self::default()
-    }
-}
-
-impl Formatter for CninetyNineHexFloatf {
-    fn get_primitive(
-        &self,
-        field: &FormatField,
-        initial_prefix: &InitialPrefix,
-        str_in: &str,
-    ) -> Option<FormatPrimitive> {
-        let second_field = field.second_field.unwrap_or(6) + 1;
-        let analysis = FloatAnalysis::analyze(
-            str_in,
-            initial_prefix,
-            Some(second_field as usize),
-            None,
-            true,
-        );
-        let f = get_primitive_hex(
-            initial_prefix,
-            &str_in[initial_prefix.offset..],
-            &analysis,
-            second_field as usize,
-            *field.field_char == 'A',
-        );
-        Some(f)
-    }
-    fn primitive_to_str(&self, prim: &FormatPrimitive, field: FormatField) -> String {
-        primitive_to_str_common(prim, &field)
-    }
-}
-
-// c99 hex has unique requirements of all floating point subs in pretty much every part of building a primitive, from prefix and suffix to need for base conversion (in all other cases if you don't have decimal you must have decimal, here it's the other way around)
-
-// on the todo list is to have a trait for get_primitive that is implemented by each float formatter and can override a default. when that happens we can take the parts of get_primitive_dec specific to dec and spin them out to their own functions that can be overridden.
-fn get_primitive_hex(
-    initial_prefix: &InitialPrefix,
-    _str_in: &str,
-    _analysis: &FloatAnalysis,
-    _last_dec_place: usize,
-    capitalized: bool,
-) -> FormatPrimitive {
-    let prefix = Some(String::from(if initial_prefix.sign == -1 {
-        "-0x"
-    } else {
-        "0x"
-    }));
-
-    // TODO actual conversion, make sure to get back mantissa.
-    // for hex to hex, it's really just a matter of moving the
-    // decimal point and calculating the mantissa by its initial
-    // position and its moves, with every position counting for
-    // the addition or subtraction of 4 (2**4, because 4 bits in a hex digit)
-    // to the exponent.
-    // decimal's going to be a little more complicated. correct simulation
-    // of glibc will require after-decimal division to a specified precision.
-    // the difficult part of this (arrnum_int_div_step) is already implemented.
-
-    // the hex float name may be a bit misleading in terms of how to go about the
-    // conversion. The best way to do it is to just convert the float number
-    // directly to base 2 and then at the end translate back to hex.
-    let mantissa = 0;
-    let suffix = Some({
-        let ind = if capitalized { "P" } else { "p" };
-        if mantissa >= 0 {
-            format!("{ind}+{mantissa}")
-        } else {
-            format!("{ind}{mantissa}")
-        }
-    });
-    FormatPrimitive {
-        prefix,
-        suffix,
-        ..Default::default()
-    }
-}
-
-#[allow(dead_code)]
-fn to_hex(src: &str, before_decimal: bool) -> String {
-    let radix_ten = base_conv::RadixTen;
-    let radix_hex = base_conv::RadixHex;
-    if before_decimal {
-        base_conv::base_conv_str(src, &radix_ten, &radix_hex)
-    } else {
-        let as_arrnum_ten = base_conv::str_to_arrnum(src, &radix_ten);
-        let s = format!(
-            "{}",
-            base_conv::base_conv_float(&as_arrnum_ten, radix_ten.get_max(), radix_hex.get_max())
-        );
-        if s.len() > 2 {
-            String::from(&s[2..])
-        } else {
-            // zero
-            s
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/decf.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/decf.rs.html deleted file mode 100644 index e2016f62f..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/decf.rs.html +++ /dev/null @@ -1,371 +0,0 @@ -decf.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-
// spell-checker:ignore (vars) charf decf floatf intf scif strf Cninety
-
-//! formatter for %g %G decimal subs
-use super::super::format_field::FormatField;
-use super::super::formatter::{FormatPrimitive, Formatter, InitialPrefix};
-use super::float_common::{get_primitive_dec, primitive_to_str_common, FloatAnalysis};
-
-const SIGNIFICANT_FIGURES: usize = 6;
-
-// Parse a numeric string as the nearest integer with a given significance.
-// This is a helper function for round().
-// Examples:
-//  round_to_significance("456", 1) == 500
-//  round_to_significance("456", 2) == 460
-//  round_to_significance("456", 9) == 456
-fn round_to_significance(input: &str, significant_figures: usize) -> u32 {
-    if significant_figures < input.len() {
-        // If the input has too many digits, use a float intermediary
-        // to round it before converting to an integer. Otherwise,
-        // converting straight to integer will truncate.
-        // There might be a cleaner way to do this...
-        let digits = &input[..significant_figures + 1];
-        let float_representation = digits.parse::<f32>().unwrap();
-        (float_representation / 10.0).round() as u32
-    } else {
-        input.parse::<u32>().unwrap_or(0)
-    }
-}
-
-// Removing trailing zeroes, expressing the result as an integer where
-// possible. This is a helper function for round().
-fn truncate(mut format: FormatPrimitive) -> FormatPrimitive {
-    if let Some(ref post_dec) = format.post_decimal {
-        let trimmed = post_dec.trim_end_matches('0');
-
-        if trimmed.is_empty() {
-            // If there are no nonzero digits after the decimal point,
-            // use integer formatting by clearing post_decimal and suffix.
-            format.post_decimal = Some(String::new());
-            if format.suffix == Some("e+00".into()) {
-                format.suffix = Some(String::new());
-            }
-        } else if trimmed.len() != post_dec.len() {
-            // Otherwise, update the format to remove only the trailing
-            // zeroes (e.g. "4.50" becomes "4.5", not "4"). If there were
-            // no trailing zeroes, do nothing.
-            format.post_decimal = Some(trimmed.to_owned());
-        }
-    }
-    format
-}
-
-// Round a format to six significant figures and remove trailing zeroes.
-fn round(mut format: FormatPrimitive) -> FormatPrimitive {
-    let mut significant_digits_remaining = SIGNIFICANT_FIGURES;
-
-    // First, take as many significant digits as possible from pre_decimal,
-    if format.pre_decimal.is_some() {
-        let input = format.pre_decimal.as_ref().unwrap();
-        let rounded = round_to_significance(input, significant_digits_remaining);
-        let mut rounded_str = rounded.to_string();
-        significant_digits_remaining -= rounded_str.len();
-
-        // If the pre_decimal has exactly enough significant digits,
-        // round the input to the nearest integer. If the first
-        // post_decimal digit is 5 or higher, round up by incrementing
-        // the pre_decimal number. Otherwise, use the pre_decimal as-is.
-        if significant_digits_remaining == 0 {
-            if let Some(digits) = &format.post_decimal {
-                if digits.chars().next().unwrap_or('0') >= '5' {
-                    let rounded = rounded + 1;
-                    rounded_str = rounded.to_string();
-                }
-            }
-        }
-        format.pre_decimal = Some(rounded_str);
-    }
-
-    // If no significant digits remain, or there's no post_decimal to
-    // round, return the rounded pre_decimal value with no post_decimal.
-    // Otherwise, round the post_decimal to the remaining significance.
-    if significant_digits_remaining == 0 {
-        format.post_decimal = Some(String::new());
-    } else if let Some(input) = format.post_decimal {
-        let leading_zeroes = input.len() - input.trim_start_matches('0').len();
-        let digits = &input[leading_zeroes..];
-
-        // In the post_decimal, leading zeroes are significant. "01.0010"
-        // has one significant digit in pre_decimal, and 3 from post_decimal.
-        let mut post_decimal_str = String::with_capacity(significant_digits_remaining);
-        for _ in 0..leading_zeroes {
-            post_decimal_str.push('0');
-        }
-
-        if leading_zeroes < significant_digits_remaining {
-            // After significant leading zeroes, round the remaining digits
-            // to any remaining significance.
-            let rounded = round_to_significance(digits, significant_digits_remaining);
-            post_decimal_str.push_str(&rounded.to_string());
-        } else if leading_zeroes == significant_digits_remaining
-            && digits.chars().next().unwrap_or('0') >= '5'
-        {
-            // If necessary, round up the post_decimal ("1.000009" should
-            // round to 1.00001, instead of truncating after the last
-            // significant leading zero).
-            post_decimal_str.pop();
-            post_decimal_str.push('1');
-        } else {
-            // If the rounded post_decimal is entirely zeroes, discard
-            // it and use integer formatting instead.
-            post_decimal_str = String::new();
-        }
-
-        format.post_decimal = Some(post_decimal_str);
-    }
-    truncate(format)
-}
-
-// Given an exponent used in scientific notation, return whether the
-// number is small enough to be expressed as a decimal instead. "Small
-// enough" is based only on the number's magnitude, not the length of
-// any string representation.
-fn should_represent_as_decimal(suffix: &Option<String>) -> bool {
-    match suffix {
-        Some(exponent) => {
-            if exponent.chars().nth(1) == Some('-') {
-                exponent < &"e-05".into()
-            } else {
-                exponent < &"e+06".into()
-            }
-        }
-        None => true,
-    }
-}
-
-pub struct Decf;
-
-impl Decf {
-    pub fn new() -> Self {
-        Self
-    }
-}
-impl Formatter for Decf {
-    fn get_primitive(
-        &self,
-        field: &FormatField,
-        initial_prefix: &InitialPrefix,
-        str_in: &str,
-    ) -> Option<FormatPrimitive> {
-        let second_field = field.second_field.unwrap_or(6) + 1;
-        // default to scif interpretation so as to not truncate input vals
-        // (that would be displayed in scif) based on relation to decimal place
-        let analysis = FloatAnalysis::analyze(
-            str_in,
-            initial_prefix,
-            Some(second_field as usize + 1),
-            None,
-            false,
-        );
-        let mut f_dec = get_primitive_dec(
-            initial_prefix,
-            &str_in[initial_prefix.offset..],
-            &analysis,
-            second_field as usize,
-            Some(*field.field_char == 'G'),
-        );
-
-        if should_represent_as_decimal(&f_dec.suffix) {
-            // Use decimal formatting instead of scientific notation
-            // if the input's magnitude is small.
-            f_dec = get_primitive_dec(
-                initial_prefix,
-                &str_in[initial_prefix.offset..],
-                &analysis,
-                second_field as usize,
-                None,
-            );
-        }
-
-        Some(round(f_dec))
-    }
-    fn primitive_to_str(&self, prim: &FormatPrimitive, field: FormatField) -> String {
-        primitive_to_str_common(prim, &field)
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/float_common.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/float_common.rs.html deleted file mode 100644 index 496a08cc9..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/float_common.rs.html +++ /dev/null @@ -1,755 +0,0 @@ -float_common.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-
// spell-checker:ignore (vars) charf decf floatf intf scif strf Cninety
-// spell-checker:ignore (ToDO) arrnum
-
-use super::super::format_field::FormatField;
-use super::super::formatter::{
-    get_it_at, warn_incomplete_conv, Base, FormatPrimitive, InitialPrefix,
-};
-use super::base_conv;
-use super::base_conv::RadixDef;
-
-// if the memory, copy, and comparison cost of chars
-//  becomes an issue, we can always operate in vec<u8> here
-//  rather than just at de_hex
-
-pub struct FloatAnalysis {
-    pub len_important: usize,
-    // none means no decimal point.
-    pub decimal_pos: Option<usize>,
-    pub follow: Option<char>,
-}
-fn has_enough_digits(
-    hex_input: bool,
-    hex_output: bool,
-    string_position: usize,
-    starting_position: usize,
-    limit: usize,
-) -> bool {
-    // -1s are for rounding
-    if hex_output {
-        if hex_input {
-            (string_position - 1) - starting_position >= limit
-        } else {
-            false //undecidable without converting
-        }
-    } else if hex_input {
-        (((string_position - 1) - starting_position) * 9) / 8 >= limit
-    } else {
-        (string_position - 1) - starting_position >= limit
-    }
-}
-
-impl FloatAnalysis {
-    #[allow(clippy::cognitive_complexity)]
-    pub fn analyze(
-        str_in: &str,
-        initial_prefix: &InitialPrefix,
-        max_sd_opt: Option<usize>,
-        max_after_dec_opt: Option<usize>,
-        hex_output: bool,
-    ) -> Self {
-        // this fn assumes
-        // the input string
-        // has no leading spaces or 0s
-        let str_it = get_it_at(initial_prefix.offset, str_in);
-        let mut ret = Self {
-            len_important: 0,
-            decimal_pos: None,
-            follow: None,
-        };
-        let hex_input = match initial_prefix.radix_in {
-            Base::Hex => true,
-            Base::Ten => false,
-            Base::Octal => {
-                panic!("this should never happen: floats should never receive octal input");
-            }
-        };
-        let mut i = 0;
-        let mut pos_before_first_nonzero_after_decimal: Option<usize> = None;
-        for c in str_it {
-            match c {
-                e @ ('0'..='9' | 'A'..='F' | 'a'..='f') => {
-                    if !hex_input {
-                        match e {
-                            '0'..='9' => {}
-                            _ => {
-                                warn_incomplete_conv(str_in);
-                                break;
-                            }
-                        }
-                    }
-                    if ret.decimal_pos.is_some()
-                        && pos_before_first_nonzero_after_decimal.is_none()
-                        && e != '0'
-                    {
-                        pos_before_first_nonzero_after_decimal = Some(i - 1);
-                    }
-                    if let Some(max_sd) = max_sd_opt {
-                        if i == max_sd {
-                            // follow is used in cases of %g
-                            // where the character right after the last
-                            // sd is considered is rounded affecting
-                            // the previous digit in 1/2 of instances
-                            ret.follow = Some(e);
-                        } else if ret.decimal_pos.is_some() && i > max_sd {
-                            break;
-                        }
-                    }
-                    if let Some(max_after_dec) = max_after_dec_opt {
-                        if let Some(p) = ret.decimal_pos {
-                            if has_enough_digits(hex_input, hex_output, i, p, max_after_dec) {
-                                break;
-                            }
-                        }
-                    } else if let Some(max_sd) = max_sd_opt {
-                        if let Some(p) = pos_before_first_nonzero_after_decimal {
-                            if has_enough_digits(hex_input, hex_output, i, p, max_sd) {
-                                break;
-                            }
-                        }
-                    }
-                }
-                '.' => {
-                    if ret.decimal_pos.is_none() {
-                        ret.decimal_pos = Some(i);
-                    } else {
-                        warn_incomplete_conv(str_in);
-                        break;
-                    }
-                }
-                _ => {
-                    warn_incomplete_conv(str_in);
-                    break;
-                }
-            };
-            i += 1;
-        }
-        ret.len_important = i;
-        ret
-    }
-}
-
-fn de_hex(src: &str, before_decimal: bool) -> String {
-    let radix_ten = base_conv::RadixTen;
-    let radix_hex = base_conv::RadixHex;
-    if before_decimal {
-        base_conv::base_conv_str(src, &radix_hex, &radix_ten)
-    } else {
-        let as_arrnum_hex = base_conv::str_to_arrnum(src, &radix_hex);
-        let s = format!(
-            "{}",
-            base_conv::base_conv_float(&as_arrnum_hex, radix_hex.get_max(), radix_ten.get_max())
-        );
-        if s.len() > 2 {
-            String::from(&s[2..])
-        } else {
-            // zero
-            s
-        }
-    }
-}
-
-// takes a string in,
-// truncates to a position,
-// bumps the last digit up one,
-// and if the digit was nine
-// propagate to the next, etc.
-// If before the decimal and the most
-// significant digit is a 9, it becomes a 1
-fn _round_str_from(in_str: &str, position: usize, before_dec: bool) -> (String, bool) {
-    let mut it = in_str[0..position].chars();
-    let mut rev = String::new();
-    let mut i = position;
-    let mut finished_in_dec = false;
-    while let Some(c) = it.next_back() {
-        i -= 1;
-        match c {
-            '9' => {
-                // If we're before the decimal
-                // and on the most significant digit,
-                // round 9 to 1, else to 0.
-                if before_dec && i == 0 {
-                    rev.push('1');
-                } else {
-                    rev.push('0');
-                }
-            }
-            e => {
-                rev.push(((e as u8) + 1) as char);
-                finished_in_dec = true;
-                break;
-            }
-        }
-    }
-    let mut fwd = String::from(&in_str[0..i]);
-    for ch in rev.chars().rev() {
-        fwd.push(ch);
-    }
-    (fwd, finished_in_dec)
-}
-
-fn round_terminal_digit(
-    before_dec: String,
-    after_dec: String,
-    position: usize,
-) -> (String, String, bool) {
-    if position < after_dec.len() {
-        let digit_at_pos: char;
-        {
-            digit_at_pos = after_dec[position..=position].chars().next().expect("");
-        }
-        if let '5'..='9' = digit_at_pos {
-            let (new_after_dec, finished_in_dec) = _round_str_from(&after_dec, position, false);
-            if finished_in_dec {
-                return (before_dec, new_after_dec, false);
-            } else {
-                let (new_before_dec, _) = _round_str_from(&before_dec, before_dec.len(), true);
-                let mut dec_place_chg = false;
-                let mut before_dec_chars = new_before_dec.chars();
-                if before_dec_chars.next() == Some('1') && before_dec_chars.all(|c| c == '0') {
-                    // If the first digit is a one and remaining are zeros, we have
-                    // rounded to a new decimal place, so the decimal place must be updated.
-                    // Only update decimal place if the before decimal != 0
-                    dec_place_chg = before_dec != "0";
-                }
-                return (new_before_dec, new_after_dec, dec_place_chg);
-            }
-            // TODO
-        }
-    }
-    (before_dec, after_dec, false)
-}
-
-#[allow(clippy::cognitive_complexity)]
-pub fn get_primitive_dec(
-    initial_prefix: &InitialPrefix,
-    str_in: &str,
-    analysis: &FloatAnalysis,
-    last_dec_place: usize,
-    sci_mode: Option<bool>,
-) -> FormatPrimitive {
-    let mut f = FormatPrimitive::default();
-
-    // add negative sign section
-    if initial_prefix.sign == -1 {
-        f.prefix = Some(String::from("-"));
-    }
-
-    // assign the digits before and after the decimal points
-    // to separate slices. If no digits after decimal point,
-    // assign 0
-    let (mut first_segment_raw, second_segment_raw) = match analysis.decimal_pos {
-        Some(pos) => (&str_in[..pos], &str_in[pos + 1..]),
-        None => (str_in, "0"),
-    };
-    if first_segment_raw.is_empty() {
-        first_segment_raw = "0";
-    }
-    // convert to string, de_hexifying if input is in hex   // spell-checker:disable-line
-    let (first_segment, second_segment) = match initial_prefix.radix_in {
-        Base::Hex => (
-            de_hex(first_segment_raw, true),
-            de_hex(second_segment_raw, false),
-        ),
-        _ => (
-            String::from(first_segment_raw),
-            String::from(second_segment_raw),
-        ),
-    };
-    let (pre_dec_unrounded, post_dec_unrounded, mut mantissa) = if sci_mode.is_some() {
-        if first_segment.len() > 1 {
-            let mut post_dec = String::from(&first_segment[1..]);
-            post_dec.push_str(&second_segment);
-            (
-                String::from(&first_segment[0..1]),
-                post_dec,
-                first_segment.len() as isize - 1,
-            )
-        } else {
-            match first_segment
-                .chars()
-                .next()
-                .expect("float_common: no chars in first segment.")
-            {
-                '0' => {
-                    let it = second_segment.chars().enumerate();
-                    let mut m: isize = 0;
-                    let mut pre = String::from("0");
-                    let mut post = String::from("0");
-                    for (i, c) in it {
-                        match c {
-                            '0' => {}
-                            _ => {
-                                m = -((i as isize) + 1);
-                                pre = String::from(&second_segment[i..=i]);
-                                post = String::from(&second_segment[i + 1..]);
-                                break;
-                            }
-                        }
-                    }
-                    (pre, post, m)
-                }
-                _ => (first_segment, second_segment, 0),
-            }
-        }
-    } else {
-        (first_segment, second_segment, 0)
-    };
-
-    let (pre_dec_draft, post_dec_draft, dec_place_chg) =
-        round_terminal_digit(pre_dec_unrounded, post_dec_unrounded, last_dec_place - 1);
-    f.post_decimal = Some(post_dec_draft);
-    if let Some(capitalized) = sci_mode {
-        let si_ind = if capitalized { 'E' } else { 'e' };
-        // Increase the mantissa if we're adding a decimal place
-        if dec_place_chg {
-            mantissa += 1;
-        }
-        f.suffix = Some(if mantissa >= 0 {
-            format!("{si_ind}+{mantissa:02}")
-        } else {
-            // negative sign is considered in format!s
-            // leading zeroes
-            format!("{si_ind}{mantissa:03}")
-        });
-        f.pre_decimal = Some(pre_dec_draft);
-    } else if dec_place_chg {
-        // We've rounded up to a new decimal place so append 0
-        f.pre_decimal = Some(pre_dec_draft + "0");
-    } else {
-        f.pre_decimal = Some(pre_dec_draft);
-    }
-
-    f
-}
-
-pub fn primitive_to_str_common(prim: &FormatPrimitive, field: &FormatField) -> String {
-    let mut final_str = String::new();
-    if let Some(ref prefix) = prim.prefix {
-        final_str.push_str(prefix);
-    }
-    match prim.pre_decimal {
-        Some(ref pre_decimal) => {
-            final_str.push_str(pre_decimal);
-        }
-        None => {
-            panic!(
-                "error, format primitives provided to int, will, incidentally under correct \
-                 behavior, always have a pre_dec value."
-            );
-        }
-    }
-    let decimal_places = field.second_field.unwrap_or(6);
-    match prim.post_decimal {
-        Some(ref post_decimal) => {
-            if !post_decimal.is_empty() && decimal_places > 0 {
-                final_str.push('.');
-                let len_avail = post_decimal.len() as u32;
-
-                if decimal_places >= len_avail {
-                    // println!("dec {}, len avail {}", decimal_places, len_avail);
-                    final_str.push_str(post_decimal);
-
-                    if *field.field_char != 'g' && *field.field_char != 'G' {
-                        let diff = decimal_places - len_avail;
-                        for _ in 0..diff {
-                            final_str.push('0');
-                        }
-                    }
-                } else {
-                    // println!("printing to only {}", decimal_places);
-                    final_str.push_str(&post_decimal[0..decimal_places as usize]);
-                }
-            }
-        }
-        None => {
-            panic!(
-                "error, format primitives provided to int, will, incidentally under correct \
-                 behavior, always have a pre_dec value."
-            );
-        }
-    }
-    if let Some(ref suffix) = prim.suffix {
-        final_str.push_str(suffix);
-    }
-
-    final_str
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/floatf.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/floatf.rs.html deleted file mode 100644 index 33c4a0613..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/floatf.rs.html +++ /dev/null @@ -1,87 +0,0 @@ -floatf.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-
// spell-checker:ignore (vars) charf decf floatf intf scif strf Cninety
-// spell-checker:ignore (ToDO) arrnum
-
-//! formatter for %f %F common-notation floating-point subs
-use super::super::format_field::FormatField;
-use super::super::formatter::{FormatPrimitive, Formatter, InitialPrefix};
-use super::float_common::{get_primitive_dec, primitive_to_str_common, FloatAnalysis};
-
-#[derive(Default)]
-pub struct Floatf;
-impl Floatf {
-    pub fn new() -> Self {
-        Self
-    }
-}
-impl Formatter for Floatf {
-    fn get_primitive(
-        &self,
-        field: &FormatField,
-        initial_prefix: &InitialPrefix,
-        str_in: &str,
-    ) -> Option<FormatPrimitive> {
-        let second_field = field.second_field.unwrap_or(6) + 1;
-        let analysis = FloatAnalysis::analyze(
-            str_in,
-            initial_prefix,
-            None,
-            Some(second_field as usize),
-            false,
-        );
-        let f = get_primitive_dec(
-            initial_prefix,
-            &str_in[initial_prefix.offset..],
-            &analysis,
-            second_field as usize,
-            None,
-        );
-        Some(f)
-    }
-    fn primitive_to_str(&self, prim: &FormatPrimitive, field: FormatField) -> String {
-        primitive_to_str_common(prim, &field)
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/intf.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/intf.rs.html deleted file mode 100644 index b80df38f6..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/intf.rs.html +++ /dev/null @@ -1,565 +0,0 @@ -intf.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-
// spell-checker:ignore (vars) charf decf floatf intf scif strf Cninety
-// spell-checker:ignore (ToDO) arrnum
-
-//! formatter for unsigned and signed int subs
-//! unsigned int: %X %x (hex u64) %o (octal u64) %u (base ten u64)
-//! signed int: %i %d (both base ten i64)
-use super::super::format_field::FormatField;
-use super::super::formatter::{
-    get_it_at, warn_incomplete_conv, Base, FormatPrimitive, Formatter, InitialPrefix,
-};
-use std::i64;
-use std::u64;
-
-#[derive(Default)]
-pub struct Intf {
-    _a: u32,
-}
-
-// see the Intf::analyze() function below
-struct IntAnalysis {
-    check_past_max: bool,
-    past_max: bool,
-    is_zero: bool,
-    len_digits: u8,
-}
-
-impl Intf {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    // take a ref to argument string, and basic information
-    // about prefix (offset, radix, sign), and analyze string
-    // to gain the IntAnalysis information above
-    // check_past_max: true if the number *may* be above max,
-    //   but we don't know either way. One of several reasons
-    //   we may have to parse as int.
-    // past_max: true if the object is past max, false if not
-    //  in the future we should probably combine these into an
-    //  Option<bool>
-    // is_zero: true if number is zero, false otherwise
-    // len_digits: length of digits used to create the int
-    //   important, for example, if we run into a non-valid character
-    #[allow(clippy::cognitive_complexity)]
-    fn analyze(str_in: &str, signed_out: bool, initial_prefix: &InitialPrefix) -> IntAnalysis {
-        // the maximum number of digits we could conceivably
-        // have before the decimal point without exceeding the
-        // max
-        let mut str_it = get_it_at(initial_prefix.offset, str_in);
-        let max_sd_in = if signed_out {
-            match initial_prefix.radix_in {
-                Base::Ten => 19,
-                Base::Octal => 21,
-                Base::Hex => 16,
-            }
-        } else {
-            match initial_prefix.radix_in {
-                Base::Ten => 20,
-                Base::Octal => 22,
-                Base::Hex => 16,
-            }
-        };
-        let mut ret = IntAnalysis {
-            check_past_max: false,
-            past_max: false,
-            is_zero: false,
-            len_digits: 0,
-        };
-
-        // todo turn this to a while let now that we know
-        // no special behavior on EOI break
-        loop {
-            let c_opt = str_it.next();
-            if let Some(c) = c_opt {
-                match c {
-                    '0'..='9' | 'a'..='f' | 'A'..='F' => {
-                        if ret.len_digits == 0 && c == '0' {
-                            ret.is_zero = true;
-                        } else if ret.is_zero {
-                            ret.is_zero = false;
-                        }
-                        ret.len_digits += 1;
-                        if ret.len_digits == max_sd_in {
-                            if let Some(next_ch) = str_it.next() {
-                                match next_ch {
-                                    '0'..='9' => {
-                                        ret.past_max = true;
-                                    }
-                                    _ => {
-                                        // force conversion
-                                        // to check if its above max.
-                                        // todo: spin out convert
-                                        // into fn, call it here to try
-                                        // read val, on Ok()
-                                        // save val for reuse later
-                                        // that way on same-base in and out
-                                        // we don't needlessly convert int
-                                        // to str, we can just copy it over.
-                                        ret.check_past_max = true;
-                                        str_it.put_back(next_ch);
-                                    }
-                                }
-                                if ret.past_max {
-                                    break;
-                                }
-                            } else {
-                                ret.check_past_max = true;
-                            }
-                        }
-                    }
-                    _ => {
-                        warn_incomplete_conv(str_in);
-                        break;
-                    }
-                }
-            } else {
-                // breaks on EOL
-                break;
-            }
-        }
-        ret
-    }
-    // get a FormatPrimitive of the maximum value for the field char
-    //  and given sign
-    fn get_max(field_char: char, sign: i8) -> FormatPrimitive {
-        let mut fmt_primitive = FormatPrimitive::default();
-        fmt_primitive.pre_decimal = Some(String::from(match field_char {
-            'd' | 'i' => match sign {
-                1 => "9223372036854775807",
-                _ => {
-                    fmt_primitive.prefix = Some(String::from("-"));
-                    "9223372036854775808"
-                }
-            },
-            'x' | 'X' => "ffffffffffffffff",
-            'o' => "1777777777777777777777",
-            /* 'u' | */ _ => "18446744073709551615",
-        }));
-        fmt_primitive
-    }
-    // conv_from_segment contract:
-    // 1. takes
-    // - a string that begins with a non-zero digit, and proceeds
-    //  with zero or more following digits until the end of the string
-    // - a radix to interpret those digits as
-    // - a char that communicates:
-    //     whether to interpret+output the string as an i64 or u64
-    //     what radix to write the parsed number as.
-    // 2. parses it as a rust integral type
-    // 3. outputs FormatPrimitive with:
-    // - if the string falls within bounds:
-    //   number parsed and written in the correct radix
-    // - if the string falls outside bounds:
-    //   for i64 output, the int minimum or int max (depending on sign)
-    //   for u64 output, the u64 max in the output radix
-    fn conv_from_segment(
-        segment: &str,
-        radix_in: Base,
-        field_char: char,
-        sign: i8,
-    ) -> FormatPrimitive {
-        match field_char {
-            'i' | 'd' => match i64::from_str_radix(segment, radix_in as u32) {
-                Ok(i) => {
-                    let mut fmt_prim = FormatPrimitive::default();
-                    if sign == -1 {
-                        fmt_prim.prefix = Some(String::from("-"));
-                    }
-                    fmt_prim.pre_decimal = Some(format!("{i}"));
-                    fmt_prim
-                }
-                Err(_) => Self::get_max(field_char, sign),
-            },
-            _ => match u64::from_str_radix(segment, radix_in as u32) {
-                Ok(u) => {
-                    let mut fmt_prim = FormatPrimitive::default();
-                    let u_f = if sign == -1 { u64::MAX - (u - 1) } else { u };
-                    fmt_prim.pre_decimal = Some(match field_char {
-                        'X' => format!("{u_f:X}"),
-                        'x' => format!("{u_f:x}"),
-                        'o' => format!("{u_f:o}"),
-                        _ => format!("{u_f}"),
-                    });
-                    fmt_prim
-                }
-                Err(_) => Self::get_max(field_char, sign),
-            },
-        }
-    }
-}
-impl Formatter for Intf {
-    fn get_primitive(
-        &self,
-        field: &FormatField,
-        initial_prefix: &InitialPrefix,
-        str_in: &str,
-    ) -> Option<FormatPrimitive> {
-        let begin = initial_prefix.offset;
-
-        // get information about the string. see Intf::Analyze
-        // def above.
-        let convert_hints = Self::analyze(
-            str_in,
-            *field.field_char == 'i' || *field.field_char == 'd',
-            initial_prefix,
-        );
-        // We always will have a format primitive to return
-        Some(if convert_hints.len_digits == 0 || convert_hints.is_zero {
-            // if non-digit or end is reached before a non-zero digit
-            FormatPrimitive {
-                pre_decimal: Some(String::from("0")),
-                ..Default::default()
-            }
-        } else if !convert_hints.past_max {
-            // if the number is or may be below the bounds limit
-            let radix_out = match *field.field_char {
-                'd' | 'i' | 'u' => Base::Ten,
-                'x' | 'X' => Base::Hex,
-                /* 'o' | */ _ => Base::Octal,
-            };
-            let radix_mismatch = !radix_out.eq(&initial_prefix.radix_in);
-            let decrease_from_max: bool = initial_prefix.sign == -1 && *field.field_char != 'i';
-            let end = begin + convert_hints.len_digits as usize;
-
-            // convert to int if any one of these is true:
-            // - number of digits in int indicates it may be past max
-            // - we're subtracting from the max
-            // - we're converting the base
-            if convert_hints.check_past_max || decrease_from_max || radix_mismatch {
-                // radix of in and out is the same.
-                let segment = String::from(&str_in[begin..end]);
-                Self::conv_from_segment(
-                    &segment,
-                    initial_prefix.radix_in.clone(),
-                    *field.field_char,
-                    initial_prefix.sign,
-                )
-            } else {
-                // otherwise just do a straight string copy.
-                let mut fmt_prim = FormatPrimitive::default();
-
-                // this is here and not earlier because
-                // zero doesn't get a sign, and conv_from_segment
-                // creates its format primitive separately
-                if initial_prefix.sign == -1 && *field.field_char == 'i' {
-                    fmt_prim.prefix = Some(String::from("-"));
-                }
-                fmt_prim.pre_decimal = Some(String::from(&str_in[begin..end]));
-                fmt_prim
-            }
-        } else {
-            Self::get_max(*field.field_char, initial_prefix.sign)
-        })
-    }
-    fn primitive_to_str(&self, prim: &FormatPrimitive, field: FormatField) -> String {
-        let mut final_str: String = String::new();
-        if let Some(ref prefix) = prim.prefix {
-            final_str.push_str(prefix);
-        }
-        // integral second fields is zero-padded minimum-width
-        // which gets handled before general minimum-width
-        match prim.pre_decimal {
-            Some(ref pre_decimal) => {
-                if let Some(min) = field.second_field {
-                    let mut i = min;
-                    let len = pre_decimal.len() as u32;
-                    while i > len {
-                        final_str.push('0');
-                        i -= 1;
-                    }
-                }
-                final_str.push_str(pre_decimal);
-            }
-            None => {
-                panic!(
-                    "error, format primitives provided to int, will, incidentally under \
-                     correct behavior, always have a pre_dec value."
-                );
-            }
-        }
-        final_str
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/mod.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/mod.rs.html deleted file mode 100644 index d0e1efdfb..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/mod.rs.html +++ /dev/null @@ -1,19 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-
// spell-checker:ignore (vars) charf cninetyninehexfloatf decf floatf intf scif strf Cninety
-
-mod base_conv;
-pub mod cninetyninehexfloatf;
-pub mod decf;
-mod float_common;
-pub mod floatf;
-pub mod intf;
-pub mod scif;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/scif.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/scif.rs.html deleted file mode 100644 index d10fdef31..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/formatters/scif.rs.html +++ /dev/null @@ -1,87 +0,0 @@ -scif.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-
// spell-checker:ignore (vars) charf cninetyninehexfloatf decf floatf intf scif strf Cninety
-
-//! formatter for %e %E scientific notation subs
-use super::super::format_field::FormatField;
-use super::super::formatter::{FormatPrimitive, Formatter, InitialPrefix};
-use super::float_common::{get_primitive_dec, primitive_to_str_common, FloatAnalysis};
-
-#[derive(Default)]
-pub struct Scif;
-
-impl Scif {
-    pub fn new() -> Self {
-        Self
-    }
-}
-impl Formatter for Scif {
-    fn get_primitive(
-        &self,
-        field: &FormatField,
-        initial_prefix: &InitialPrefix,
-        str_in: &str,
-    ) -> Option<FormatPrimitive> {
-        let second_field = field.second_field.unwrap_or(6) + 1;
-        let analysis = FloatAnalysis::analyze(
-            str_in,
-            initial_prefix,
-            Some(second_field as usize + 1),
-            None,
-            false,
-        );
-        let f = get_primitive_dec(
-            initial_prefix,
-            &str_in[initial_prefix.offset..],
-            &analysis,
-            second_field as usize,
-            Some(*field.field_char == 'E'),
-        );
-        Some(f)
-    }
-    fn primitive_to_str(&self, prim: &FormatPrimitive, field: FormatField) -> String {
-        primitive_to_str_common(prim, &field)
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/mod.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/mod.rs.html deleted file mode 100644 index 210964f05..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/mod.rs.html +++ /dev/null @@ -1,9 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-
pub mod format_field;
-mod formatter;
-mod formatters;
-pub mod num_format;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/num_format/num_format.rs.html b/coreutils/dev/src/uucore/features/tokenize/num_format/num_format.rs.html deleted file mode 100644 index 5468a86ac..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/num_format/num_format.rs.html +++ /dev/null @@ -1,543 +0,0 @@ -num_format.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-
// spell-checker:ignore (vars) charf cninetyninehexfloatf decf floatf intf scif strf Cninety
-
-//! handles creating printed output for numeric substitutions
-
-// spell-checker:ignore (vars) charf decf floatf intf scif strf Cninety
-
-use std::env;
-use std::vec::Vec;
-
-use crate::display::Quotable;
-use crate::{show_error, show_warning};
-
-use super::format_field::{FieldType, FormatField};
-use super::formatter::{Base, FormatPrimitive, Formatter, InitialPrefix};
-use super::formatters::cninetyninehexfloatf::CninetyNineHexFloatf;
-use super::formatters::decf::Decf;
-use super::formatters::floatf::Floatf;
-use super::formatters::intf::Intf;
-use super::formatters::scif::Scif;
-
-pub fn warn_expected_numeric(pf_arg: &str) {
-    // important: keep println here not print
-    show_error!("{}: expected a numeric value", pf_arg.maybe_quote());
-}
-
-// when character constant arguments have excess characters
-// issue a warning when POSIXLY_CORRECT is not set
-fn warn_char_constant_ign(remaining_bytes: &[u8]) {
-    match env::var("POSIXLY_CORRECT") {
-        Ok(_) => {}
-        Err(e) => {
-            if let env::VarError::NotPresent = e {
-                show_warning!(
-                    "{:?}: character(s) following character \
-                     constant have been ignored",
-                    remaining_bytes
-                );
-            }
-        }
-    }
-}
-
-// this function looks at the first few
-// characters of an argument and returns a value if we can learn
-// a value from that (e.g. no argument? return 0, char constant? ret value)
-fn get_provided(str_in_opt: Option<&String>) -> Option<u8> {
-    const C_S_QUOTE: u8 = 39;
-    const C_D_QUOTE: u8 = 34;
-    match str_in_opt {
-        Some(str_in) => {
-            let mut byte_it = str_in.bytes();
-            if let Some(ch) = byte_it.next() {
-                match ch {
-                    C_S_QUOTE | C_D_QUOTE => {
-                        Some(match byte_it.next() {
-                            Some(second_byte) => {
-                                let mut ignored: Vec<u8> = Vec::new();
-                                for cont in byte_it {
-                                    ignored.push(cont);
-                                }
-                                if !ignored.is_empty() {
-                                    warn_char_constant_ign(&ignored);
-                                }
-                                second_byte
-                            }
-                            // no byte after quote
-                            None => {
-                                let so_far = (ch as char).to_string();
-                                warn_expected_numeric(&so_far);
-                                0_u8
-                            }
-                        })
-                    }
-                    // first byte is not quote
-                    _ => None, // no first byte
-                }
-            } else {
-                Some(0_u8)
-            }
-        }
-        None => Some(0),
-    }
-}
-
-// takes a string and returns
-// a sign,
-// a base,
-// and an offset for index after all
-//  initial spacing, sign, base prefix, and leading zeroes
-#[allow(clippy::cognitive_complexity)]
-fn get_initial_prefix(str_in: &str, field_type: &FieldType) -> InitialPrefix {
-    let mut str_it = str_in.chars();
-    let mut ret = InitialPrefix {
-        radix_in: Base::Ten,
-        sign: 1,
-        offset: 0,
-    };
-    let mut top_char = str_it.next();
-    // skip spaces and ensure top_char is the first non-space char
-    // (or None if none exists)
-    while let Some(' ') = top_char {
-        ret.offset += 1;
-        top_char = str_it.next();
-    }
-    // parse sign
-    match top_char {
-        Some('+') => {
-            ret.offset += 1;
-            top_char = str_it.next();
-        }
-        Some('-') => {
-            ret.sign = -1;
-            ret.offset += 1;
-            top_char = str_it.next();
-        }
-        _ => {}
-    }
-    // we want to exit with offset being
-    // the index of the first non-zero
-    // digit before the decimal point or
-    // if there is none, the zero before the
-    // decimal point, or, if there is none,
-    // the decimal point.
-
-    // while we are determining the offset
-    // we will ensure as a convention
-    // the offset is always on the first character
-    // that we are yet unsure if it is the
-    // final offset. If the zero could be before
-    // a decimal point we don't move past the zero.
-    let mut is_hex = false;
-    if Some('0') == top_char {
-        if let Some(base) = str_it.next() {
-            // lead zeroes can only exist in
-            // octal and hex base
-            let mut do_clean_lead_zeroes = false;
-            match base {
-                'x' | 'X' => {
-                    is_hex = true;
-                    ret.offset += 2;
-                    ret.radix_in = Base::Hex;
-                    do_clean_lead_zeroes = true;
-                }
-                e @ '0'..='9' => {
-                    ret.offset += 1;
-                    if let FieldType::Intf = *field_type {
-                        ret.radix_in = Base::Octal;
-                    }
-                    if e == '0' {
-                        do_clean_lead_zeroes = true;
-                    }
-                }
-                _ => {}
-            }
-            if do_clean_lead_zeroes {
-                let mut first = true;
-                for ch_zero in str_it {
-                    // see notes on offset above:
-                    // this is why the offset for octal and decimal numbers
-                    // that reach this branch is 1 even though
-                    // they have already eaten the characters '00'
-                    // this is also why when hex encounters its
-                    // first zero it does not move its offset
-                    // forward because it does not know for sure
-                    // that it's current offset (of that zero)
-                    // is not the final offset,
-                    // whereas at that point octal knows its
-                    // current offset is not the final offset.
-                    match ch_zero {
-                        '0' => {
-                            if !(is_hex && first) {
-                                ret.offset += 1;
-                            }
-                        }
-                        // if decimal, keep last zero if one exists
-                        // (it's possible for last zero to
-                        // not exist at this branch if we're in hex input)
-                        '.' => break,
-                        // other digit, etc.
-                        _ => {
-                            if !(is_hex && first) {
-                                ret.offset += 1;
-                            }
-                            break;
-                        }
-                    }
-                    if first {
-                        first = false;
-                    }
-                }
-            }
-        }
-    }
-    ret
-}
-
-// this is the function a Sub's print will delegate to
-// if it is a numeric field, passing the field details
-// and an iterator to the argument
-pub fn num_format(field: &FormatField, in_str_opt: Option<&String>) -> Option<String> {
-    let field_char = field.field_char;
-
-    // num format mainly operates by further delegating to one of
-    // several Formatter structs depending on the field
-    // see formatter.rs for more details
-
-    // to do switch to static dispatch
-    let formatter: Box<dyn Formatter> = match *field.field_type {
-        FieldType::Intf => Box::new(Intf::new()),
-        FieldType::Floatf => Box::new(Floatf::new()),
-        FieldType::CninetyNineHexFloatf => Box::new(CninetyNineHexFloatf::new()),
-        FieldType::Scif => Box::new(Scif::new()),
-        FieldType::Decf => Box::new(Decf::new()),
-        _ => {
-            panic!("asked to do num format with non-num field type");
-        }
-    };
-    let prim_opt=
-        // if we can get an assumed value from looking at the first
-        // few characters, use that value to create the FormatPrimitive
-        if let Some(provided_num) = get_provided(in_str_opt) {
-            let mut tmp = FormatPrimitive::default();
-            match field_char {
-                'u' | 'i' | 'd' => {
-                    tmp.pre_decimal = Some(
-                        format!("{provided_num}"));
-                },
-                'x' | 'X' => {
-                    tmp.pre_decimal = Some(
-                        format!("{provided_num:x}"));
-                },
-                'o' => {
-                    tmp.pre_decimal = Some(
-                        format!("{provided_num:o}"));
-                },
-                'e' | 'E' | 'g' | 'G' => {
-                    let as_str = format!("{provided_num}");
-                    let initial_prefix = get_initial_prefix(
-                        &as_str,
-                        field.field_type
-                    );
-                    tmp=formatter.get_primitive(field, &initial_prefix, &as_str)
-                        .expect("err during default provided num");
-                },
-                _ => {
-                    tmp.pre_decimal = Some(
-                        format!("{provided_num}"));
-                    tmp.post_decimal = Some(String::from("0"));
-                }
-            }
-            Some(tmp)
-        } else {
-            // otherwise we'll interpret the argument as a number
-            // using the appropriate Formatter
-            let in_str = in_str_opt.expect(
-                "please send the devs this message:
-                \n get_provided is failing to ret as Some(0) on no str ");
-            // first get information about the beginning of the
-            // numeric argument that would be useful for
-            // any formatter (int or float)
-            let initial_prefix = get_initial_prefix(
-                in_str,
-                field.field_type
-            );
-            // then get the FormatPrimitive from the Formatter
-            formatter.get_primitive(field, &initial_prefix, in_str)
-        };
-    // if we have a formatPrimitive, print its results
-    // according to the field-char appropriate Formatter
-    prim_opt.map(|prim| formatter.primitive_to_str(&prim, field.clone()))
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/sub.rs.html b/coreutils/dev/src/uucore/features/tokenize/sub.rs.html deleted file mode 100644 index 5e36986c3..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/sub.rs.html +++ /dev/null @@ -1,905 +0,0 @@ -sub.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-
// spell-checker:ignore (vars) charf decf floatf intf scif strf Cninety
-
-//! Sub is a token that represents a
-//! segment of the format string that is a substitution
-//! it is created by Sub's implementation of the Tokenizer trait
-//! Subs which have numeric field chars make use of the num_format
-//! submodule
-use crate::error::{UError, UResult};
-use itertools::{put_back_n, PutBackN};
-use std::error::Error;
-use std::fmt::Display;
-use std::io::Write;
-use std::iter::Peekable;
-use std::process::exit;
-use std::slice::Iter;
-use std::str::Chars;
-// use std::collections::HashSet;
-
-use super::num_format::format_field::{FieldType, FormatField};
-use super::num_format::num_format;
-use super::token;
-use super::unescaped_text::UnescapedText;
-
-const EXIT_ERR: i32 = 1;
-
-#[derive(Debug)]
-pub enum SubError {
-    InvalidSpec(String),
-}
-
-impl Display for SubError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
-        match self {
-            Self::InvalidSpec(s) => write!(f, "%{s}: invalid conversion specification"),
-        }
-    }
-}
-
-impl Error for SubError {}
-
-impl UError for SubError {}
-
-fn convert_asterisk_arg_int(asterisk_arg: &str) -> isize {
-    // this is a costly way to parse the
-    // args used for asterisk values into integers
-    // from various bases. Actually doing it correctly
-    // (going through the pipeline to intf, but returning
-    // the integer instead of writing it to string and then
-    // back) is on the refactoring TODO
-    let field_type = FieldType::Intf;
-    let field_char = 'i';
-    let field_info = FormatField {
-        min_width: Some(0),
-        second_field: Some(0),
-        orig: &asterisk_arg.to_string(),
-        field_type: &field_type,
-        field_char: &field_char,
-    };
-    num_format::num_format(&field_info, Some(&asterisk_arg.to_string()))
-        .unwrap()
-        .parse::<isize>()
-        .unwrap()
-}
-
-pub enum CanAsterisk<T> {
-    Fixed(T),
-    Asterisk,
-}
-
-// Sub is a tokenizer which creates tokens
-// for substitution segments of a format string
-pub struct Sub {
-    min_width: CanAsterisk<Option<isize>>,
-    second_field: CanAsterisk<Option<u32>>,
-    field_char: char,
-    field_type: FieldType,
-    orig: String,
-    prefix_char: char,
-}
-impl Sub {
-    pub fn new(
-        min_width: CanAsterisk<Option<isize>>,
-        second_field: CanAsterisk<Option<u32>>,
-        field_char: char,
-        orig: String,
-        prefix_char: char,
-    ) -> Self {
-        // for more dry printing, field characters are grouped
-        // in initialization of token.
-        let field_type = match field_char {
-            's' | 'b' => FieldType::Strf,
-            'd' | 'i' | 'u' | 'o' | 'x' | 'X' => FieldType::Intf,
-            'f' | 'F' => FieldType::Floatf,
-            'a' | 'A' => FieldType::CninetyNineHexFloatf,
-            'e' | 'E' => FieldType::Scif,
-            'g' | 'G' => FieldType::Decf,
-            'c' => FieldType::Charf,
-            _ => {
-                // should be unreachable.
-                println!("Invalid field type");
-                exit(EXIT_ERR);
-            }
-        };
-        Self {
-            min_width,
-            second_field,
-            field_char,
-            field_type,
-            orig,
-            prefix_char,
-        }
-    }
-}
-
-#[derive(Default)]
-pub(crate) struct SubParser {
-    min_width_tmp: Option<String>,
-    min_width_is_asterisk: bool,
-    past_decimal: bool,
-    second_field_tmp: Option<String>,
-    second_field_is_asterisk: bool,
-    specifiers_found: bool,
-    field_char: Option<char>,
-    text_so_far: String,
-}
-
-impl SubParser {
-    fn new() -> Self {
-        Self::default()
-    }
-    pub(crate) fn from_it<W>(
-        writer: &mut W,
-        it: &mut PutBackN<Chars>,
-        args: &mut Peekable<Iter<String>>,
-    ) -> UResult<Option<token::Token>>
-    where
-        W: Write,
-    {
-        let mut parser = Self::new();
-        if parser.sub_vals_retrieved(it)? {
-            let t = Self::build_token(parser);
-            t.write(writer, args);
-            Ok(Some(t))
-        } else {
-            Ok(None)
-        }
-    }
-    fn build_token(parser: Self) -> token::Token {
-        // not a self method so as to allow move of sub-parser vals.
-        // return new Sub struct as token
-        let prefix_char = match &parser.min_width_tmp {
-            Some(width) if width.starts_with('0') => '0',
-            _ => ' ',
-        };
-
-        token::Token::Sub(Sub::new(
-            if parser.min_width_is_asterisk {
-                CanAsterisk::Asterisk
-            } else {
-                CanAsterisk::Fixed(
-                    parser
-                        .min_width_tmp
-                        .map(|x| x.parse::<isize>().unwrap_or(1)),
-                )
-            },
-            if parser.second_field_is_asterisk {
-                CanAsterisk::Asterisk
-            } else {
-                CanAsterisk::Fixed(parser.second_field_tmp.map(|x| x.parse::<u32>().unwrap()))
-            },
-            parser.field_char.unwrap(),
-            parser.text_so_far,
-            prefix_char,
-        ))
-    }
-    #[allow(clippy::cognitive_complexity)]
-    fn sub_vals_retrieved(&mut self, it: &mut PutBackN<Chars>) -> UResult<bool> {
-        if !Self::successfully_eat_prefix(it, &mut self.text_so_far)? {
-            return Ok(false);
-        }
-        // this fn in particular is much longer than it needs to be
-        // .could get a lot
-        // of code savings just by cleaning it up. shouldn't use a regex
-        // though, as we want to mimic the original behavior of printing
-        // the field as interpreted up until the error in the field.
-
-        let mut legal_fields = vec![
-            // 'a', 'A', //c99 hex float implementation not yet complete
-            'b', 'c', 'd', 'e', 'E', 'f', 'F', 'g', 'G', 'i', 'o', 's', 'u', 'x', 'X',
-        ];
-        let mut specifiers = vec!['h', 'j', 'l', 'L', 't', 'z'];
-        legal_fields.sort_unstable();
-        specifiers.sort_unstable();
-
-        // divide substitution from %([0-9]+)?(.[0-9+])?([a-zA-Z])
-        // into min_width, second_field, field_char
-        for ch in it {
-            self.text_so_far.push(ch);
-            match ch {
-                '-' | '*' | '0'..='9' => {
-                    if self.past_decimal {
-                        // second field should never have a
-                        // negative value
-                        if self.second_field_is_asterisk || ch == '-' || self.specifiers_found {
-                            return Err(SubError::InvalidSpec(self.text_so_far.clone()).into());
-                        }
-                        if self.second_field_tmp.is_none() {
-                            self.second_field_tmp = Some(String::new());
-                        }
-                        match self.second_field_tmp.as_mut() {
-                            Some(x) => {
-                                if ch == '*' && !x.is_empty() {
-                                    return Err(
-                                        SubError::InvalidSpec(self.text_so_far.clone()).into()
-                                    );
-                                }
-                                if ch == '*' {
-                                    self.second_field_is_asterisk = true;
-                                }
-                                x.push(ch);
-                            }
-                            None => {
-                                panic!("should be unreachable");
-                            }
-                        }
-                    } else {
-                        if self.min_width_is_asterisk || self.specifiers_found {
-                            return Err(SubError::InvalidSpec(self.text_so_far.clone()).into());
-                        }
-                        if self.min_width_tmp.is_none() {
-                            self.min_width_tmp = Some(String::new());
-                        }
-                        match self.min_width_tmp.as_mut() {
-                            Some(x) => {
-                                if (ch == '-' || ch == '*') && !x.is_empty() {
-                                    return Err(
-                                        SubError::InvalidSpec(self.text_so_far.clone()).into()
-                                    );
-                                }
-                                if ch == '*' {
-                                    self.min_width_is_asterisk = true;
-                                }
-                                x.push(ch);
-                            }
-                            None => {
-                                panic!("should be unreachable");
-                            }
-                        }
-                    }
-                }
-                '.' => {
-                    if self.past_decimal {
-                        return Err(SubError::InvalidSpec(self.text_so_far.clone()).into());
-                    } else {
-                        self.past_decimal = true;
-                    }
-                }
-                x if legal_fields.binary_search(&x).is_ok() => {
-                    self.field_char = Some(ch);
-                    self.text_so_far.push(ch);
-                    break;
-                }
-                x if specifiers.binary_search(&x).is_ok() => {
-                    if !self.past_decimal {
-                        self.past_decimal = true;
-                    }
-                    if !self.specifiers_found {
-                        self.specifiers_found = true;
-                    }
-                }
-                _ => {
-                    return Err(SubError::InvalidSpec(self.text_so_far.clone()).into());
-                }
-            }
-        }
-        if self.field_char.is_none() {
-            return Err(SubError::InvalidSpec(self.text_so_far.clone()).into());
-        }
-        let field_char_retrieved = self.field_char.unwrap();
-        if self.past_decimal && self.second_field_tmp.is_none() {
-            self.second_field_tmp = Some(String::from("0"));
-        }
-        self.validate_field_params(field_char_retrieved)?;
-        // if the dot is provided without a second field
-        // printf interprets it as 0.
-        if let Some(x) = self.second_field_tmp.as_mut() {
-            if x.is_empty() {
-                self.min_width_tmp = Some(String::from("0"));
-            }
-        }
-
-        Ok(true)
-    }
-    fn successfully_eat_prefix(
-        it: &mut PutBackN<Chars>,
-        text_so_far: &mut String,
-    ) -> UResult<bool> {
-        // get next two chars,
-        // if they're '%%' we're not tokenizing it
-        // else put chars back
-        let preface = it.next();
-        let n_ch = it.next();
-        if preface == Some('%') && n_ch != Some('%') {
-            match n_ch {
-                Some(x) => {
-                    it.put_back(x);
-                    Ok(true)
-                }
-                None => {
-                    text_so_far.push('%');
-                    Err(SubError::InvalidSpec(text_so_far.clone()).into())
-                }
-            }
-        } else {
-            if let Some(x) = n_ch {
-                it.put_back(x);
-            };
-            if let Some(x) = preface {
-                it.put_back(x);
-            };
-            Ok(false)
-        }
-    }
-    fn validate_field_params(&self, field_char: char) -> UResult<()> {
-        // check for illegal combinations here when possible vs
-        // on each application so we check less per application
-        // to do: move these checks to Sub::new
-        if (field_char == 's' && self.min_width_tmp == Some(String::from("0")))
-            || (field_char == 'c'
-                && (self.min_width_tmp == Some(String::from("0")) || self.past_decimal))
-            || (field_char == 'b'
-                && (self.min_width_tmp.is_some()
-                    || self.past_decimal
-                    || self.second_field_tmp.is_some()))
-        {
-            // invalid string substitution
-            // to do: include information about an invalid
-            // string substitution
-            return Err(SubError::InvalidSpec(self.text_so_far.clone()).into());
-        }
-        Ok(())
-    }
-}
-
-impl Sub {
-    #[allow(clippy::cognitive_complexity)]
-    pub(crate) fn write<W>(&self, writer: &mut W, pf_args_it: &mut Peekable<Iter<String>>)
-    where
-        W: Write,
-    {
-        let field = FormatField {
-            min_width: match self.min_width {
-                CanAsterisk::Fixed(x) => x,
-                CanAsterisk::Asterisk => {
-                    match pf_args_it.next() {
-                        // temporary, use intf.rs instead
-                        Some(x) => Some(convert_asterisk_arg_int(x)),
-                        None => Some(0),
-                    }
-                }
-            },
-            second_field: match self.second_field {
-                CanAsterisk::Fixed(x) => x,
-                CanAsterisk::Asterisk => {
-                    match pf_args_it.next() {
-                        // temporary, use intf.rs instead
-                        Some(x) => {
-                            let result = convert_asterisk_arg_int(x);
-                            if result < 0 {
-                                None
-                            } else {
-                                Some(result as u32)
-                            }
-                        }
-                        None => Some(0),
-                    }
-                }
-            },
-            field_char: &self.field_char,
-            field_type: &self.field_type,
-            orig: &self.orig,
-        };
-        let pf_arg = pf_args_it.next();
-
-        // minimum width is handled independently of actual
-        // field char
-        let pre_min_width_opt: Option<String> = match *field.field_type {
-            // if %s just return arg
-            // if %b use UnescapedText module's unescape-fn
-            // if %c return first char of arg
-            FieldType::Strf | FieldType::Charf => {
-                match pf_arg {
-                    Some(arg_string) => {
-                        match *field.field_char {
-                            's' => Some(match field.second_field {
-                                Some(max) => String::from(&arg_string[..max as usize]),
-                                None => arg_string.clone(),
-                            }),
-                            'b' => {
-                                let mut a_it = put_back_n(arg_string.chars());
-                                UnescapedText::from_it_core(writer, &mut a_it, true);
-                                None
-                            }
-                            // for 'c': get iter of string vals,
-                            // get opt<char> of first val
-                            // and map it to opt<String>
-                            /* 'c' | */
-                            _ => arg_string.chars().next().map(|x| x.to_string()),
-                        }
-                    }
-                    None => None,
-                }
-            }
-            _ => {
-                // non string/char fields are delegated to num_format
-                num_format::num_format(&field, pf_arg)
-            }
-        };
-        if let Some(pre_min_width) = pre_min_width_opt {
-            // if have a string, print it, ensuring minimum width is met.
-            write!(
-                writer,
-                "{}",
-                match field.min_width {
-                    Some(min_width) => {
-                        let diff: isize = min_width.abs() - pre_min_width.len() as isize;
-                        if diff > 0 {
-                            let mut final_str = String::new();
-                            // definitely more efficient ways
-                            //  to do this.
-                            let pad_before = min_width > 0;
-                            if !pad_before {
-                                final_str.push_str(&pre_min_width);
-                            }
-                            for _ in 0..diff {
-                                final_str.push(self.prefix_char);
-                            }
-                            if pad_before {
-                                final_str.push_str(&pre_min_width);
-                            }
-                            final_str
-                        } else {
-                            pre_min_width
-                        }
-                    }
-                    None => pre_min_width,
-                }
-            )
-            .ok();
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/token.rs.html b/coreutils/dev/src/uucore/features/tokenize/token.rs.html deleted file mode 100644 index 93f30b2e9..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/token.rs.html +++ /dev/null @@ -1,79 +0,0 @@ -token.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-
//! Traits and enums dealing with Tokenization of printf Format String
-use std::io::Write;
-use std::iter::Peekable;
-use std::slice::Iter;
-
-use crate::features::tokenize::sub::Sub;
-use crate::features::tokenize::unescaped_text::UnescapedText;
-
-// A token object is an object that can print the expected output
-// of a contiguous segment of the format string, and
-// requires at most 1 argument
-pub enum Token {
-    Sub(Sub),
-    UnescapedText(UnescapedText),
-}
-
-impl Token {
-    pub(crate) fn write<W>(&self, writer: &mut W, args: &mut Peekable<Iter<String>>)
-    where
-        W: Write,
-    {
-        match self {
-            Self::Sub(sub) => sub.write(writer, args),
-            Self::UnescapedText(unescaped_text) => unescaped_text.write(writer),
-        }
-    }
-}
-
-// A tokenizer object is an object that takes an iterator
-// at a position in a format string, and sees whether
-// it can return a token of a type it knows how to produce
-// if so, return the token, move the iterator past the
-// format string text the token represents, and if an
-// argument is used move the argument iter forward one
-
-// creating token of a format string segment should also cause
-// printing of that token's value. Essentially tokenizing
-// a whole format string will print the format string and consume
-// a number of arguments equal to the number of argument-using tokens
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/tokenize/unescaped_text.rs.html b/coreutils/dev/src/uucore/features/tokenize/unescaped_text.rs.html deleted file mode 100644 index be331da46..000000000 --- a/coreutils/dev/src/uucore/features/tokenize/unescaped_text.rs.html +++ /dev/null @@ -1,559 +0,0 @@ -unescaped_text.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-
//! UnescapedText is a tokenizer impl
-//! for tokenizing character literals,
-//! and escaped character literals (of allowed escapes),
-//! into an unescaped text byte array
-
-// spell-checker:ignore (ToDO) retval hexchars octals printf's bvec vals coreutil addchar eval bytecode bslice
-
-use itertools::PutBackN;
-use std::char::from_u32;
-use std::io::Write;
-use std::process::exit;
-use std::str::Chars;
-
-use super::token;
-
-const EXIT_OK: i32 = 0;
-const EXIT_ERR: i32 = 1;
-
-// by default stdout only flushes
-// to console when a newline is passed.
-macro_rules! write_and_flush {
-    ($writer:expr, $($args:tt)+) => ({
-        write!($writer, "{}", $($args)+).ok();
-        $writer.flush().ok();
-    })
-}
-
-fn flush_bytes<W>(writer: &mut W, bslice: &[u8])
-where
-    W: Write,
-{
-    writer.write_all(bslice).ok();
-    writer.flush().ok();
-}
-
-#[derive(Default)]
-pub struct UnescapedText(Vec<u8>);
-impl UnescapedText {
-    fn new() -> Self {
-        Self::default()
-    }
-    // take an iterator to the format string
-    // consume between min and max chars
-    // and return it as a base-X number
-    fn base_to_u32(min_chars: u8, max_chars: u8, base: u32, it: &mut PutBackN<Chars>) -> u32 {
-        let mut retval: u32 = 0;
-        let mut found = 0;
-        while found < max_chars {
-            // if end of input break
-            let nc = it.next();
-            match nc {
-                Some(digit) => {
-                    // if end of hexchars break
-                    match digit.to_digit(base) {
-                        Some(d) => {
-                            found += 1;
-                            retval *= base;
-                            retval += d;
-                        }
-                        None => {
-                            it.put_back(digit);
-                            break;
-                        }
-                    }
-                }
-                None => {
-                    break;
-                }
-            }
-        }
-        if found < min_chars {
-            // only ever expected for hex
-            println!("missing hexadecimal number in escape"); //todo stderr
-            exit(EXIT_ERR);
-        }
-        retval
-    }
-    // validates against valid
-    // IEC 10646 vals - these values
-    // are pinned against the more popular
-    // printf so as to not disrupt when
-    // dropped-in as a replacement.
-    fn validate_iec(val: u32, eight_word: bool) {
-        let mut preface = 'u';
-        let leading_zeros = if eight_word {
-            preface = 'U';
-            8
-        } else {
-            4
-        };
-        let err_msg = format!("invalid universal character name {preface}{val:0leading_zeros$x}");
-        if (val < 159 && (val != 36 && val != 64 && val != 96)) || (val > 55296 && val < 57343) {
-            println!("{err_msg}"); //todo stderr
-            exit(EXIT_ERR);
-        }
-    }
-    // pass an iterator that succeeds an '/',
-    // and process the remaining character
-    // adding the unescaped bytes
-    // to the passed byte_vec
-    // in subs_mode change octal behavior
-    fn handle_escaped<W>(
-        writer: &mut W,
-        byte_vec: &mut Vec<u8>,
-        it: &mut PutBackN<Chars>,
-        subs_mode: bool,
-    ) where
-        W: Write,
-    {
-        let ch = it.next().unwrap_or('\\');
-        match ch {
-            '0'..='9' | 'x' => {
-                let min_len = 1;
-                let mut max_len = 2;
-                let mut base = 16;
-                let ignore = false;
-                match ch {
-                    'x' => {}
-                    e @ '0'..='9' => {
-                        max_len = 3;
-                        base = 8;
-                        // in practice, gnu coreutils printf
-                        // interprets octals without a
-                        // leading zero in %b
-                        // but it only skips leading zeros
-                        // in %b mode.
-                        // if we ever want to match gnu coreutil
-                        // printf's docs instead of its behavior
-                        // we'd set this to true.
-                        // if subs_mode && e != '0'
-                        //  { ignore = true; }
-                        if !subs_mode || e != '0' {
-                            it.put_back(ch);
-                        }
-                    }
-                    _ => {}
-                }
-                if ignore {
-                    byte_vec.push(ch as u8);
-                } else {
-                    let val = (Self::base_to_u32(min_len, max_len, base, it) % 256) as u8;
-                    byte_vec.push(val);
-                    let bvec = [val];
-                    flush_bytes(writer, &bvec);
-                }
-            }
-            e => {
-                // only for hex and octal
-                // is byte encoding specified.
-                // otherwise, why not leave the door open
-                // for other encodings unless it turns out
-                // a bottleneck.
-                let mut s = String::new();
-                let ch = match e {
-                    '\\' => '\\',
-                    '"' => '"',
-                    'n' => '\n',
-                    'r' => '\r',
-                    't' => '\t',
-                    // bell
-                    'a' => '\x07',
-                    // backspace
-                    'b' => '\x08',
-                    // vertical tab
-                    'v' => '\x0B',
-                    // form feed
-                    'f' => '\x0C',
-                    // escape character
-                    'e' => '\x1B',
-                    'c' => exit(EXIT_OK),
-                    'u' | 'U' => {
-                        let len = match e {
-                            'u' => 4,
-                            /* 'U' | */ _ => 8,
-                        };
-                        let val = Self::base_to_u32(len, len, 16, it);
-                        Self::validate_iec(val, false);
-                        if let Some(c) = from_u32(val) {
-                            c
-                        } else {
-                            '-'
-                        }
-                    }
-                    _ => {
-                        s.push('\\');
-                        ch
-                    }
-                };
-                s.push(ch);
-                write_and_flush!(writer, &s);
-                byte_vec.extend(s.bytes());
-            }
-        };
-    }
-
-    // take an iterator to a string,
-    // and return a wrapper around a Vec<u8> of unescaped bytes
-    // break on encounter of sub symbol ('%[^%]') unless called
-    // through %b subst.
-    #[allow(clippy::cognitive_complexity)]
-    pub fn from_it_core<W>(
-        writer: &mut W,
-        it: &mut PutBackN<Chars>,
-        subs_mode: bool,
-    ) -> Option<token::Token>
-    where
-        W: Write,
-    {
-        let mut addchar = false;
-        let mut new_text = Self::new();
-        let mut tmp_str = String::new();
-        {
-            let new_vec: &mut Vec<u8> = &mut (new_text.0);
-            while let Some(ch) = it.next() {
-                if !addchar {
-                    addchar = true;
-                }
-                match ch {
-                    x if x != '\\' && x != '%' => {
-                        // lazy branch eval
-                        // remember this fn could be called
-                        // many times in a single exec through %b
-                        write_and_flush!(writer, ch);
-                        tmp_str.push(ch);
-                    }
-                    '\\' => {
-                        // the literal may be a literal bytecode
-                        // and not valid utf-8. Str only supports
-                        // valid utf-8.
-                        // if we find the unnecessary drain
-                        // on non hex or octal escapes is costly
-                        // then we can make it faster/more complex
-                        // with as-necessary draining.
-                        if !tmp_str.is_empty() {
-                            new_vec.extend(tmp_str.bytes());
-                            tmp_str = String::new();
-                        }
-                        Self::handle_escaped(writer, new_vec, it, subs_mode);
-                    }
-                    x if x == '%' && !subs_mode => {
-                        if let Some(follow) = it.next() {
-                            if follow == '%' {
-                                write_and_flush!(writer, ch);
-                                tmp_str.push(ch);
-                            } else {
-                                it.put_back(follow);
-                                it.put_back(ch);
-                                break;
-                            }
-                        } else {
-                            it.put_back(ch);
-                            break;
-                        }
-                    }
-                    _ => {
-                        write_and_flush!(writer, ch);
-                        tmp_str.push(ch);
-                    }
-                }
-            }
-            if !tmp_str.is_empty() {
-                new_vec.extend(tmp_str.bytes());
-            }
-        }
-        if addchar {
-            Some(token::Token::UnescapedText(new_text))
-        } else {
-            None
-        }
-    }
-}
-impl UnescapedText {
-    pub(crate) fn write<W>(&self, writer: &mut W)
-    where
-        W: Write,
-    {
-        flush_bytes(writer, &self.0[..]);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/features/utmpx.rs.html b/coreutils/dev/src/uucore/features/utmpx.rs.html deleted file mode 100644 index ec8642e93..000000000 --- a/coreutils/dev/src/uucore/features/utmpx.rs.html +++ /dev/null @@ -1,713 +0,0 @@ -utmpx.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-
// This file is part of the uutils coreutils package.
-//
-// (c) Jian Zeng <anonymousknight96@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-//
-//! Aims to provide platform-independent methods to obtain login records
-//!
-//! **ONLY** support linux, macos and freebsd for the time being
-//!
-//! # Examples:
-//!
-//! ```
-//! use uucore::utmpx::Utmpx;
-//! for ut in Utmpx::iter_all_records() {
-//!     if ut.is_user_process() {
-//!         println!("{}: {}", ut.host(), ut.user())
-//!     }
-//! }
-//! ```
-//!
-//! Specifying the path to login record:
-//!
-//! ```
-//! use uucore::utmpx::Utmpx;
-//! for ut in Utmpx::iter_all_records_from("/some/where/else") {
-//!     if ut.is_user_process() {
-//!         println!("{}: {}", ut.host(), ut.user())
-//!     }
-//! }
-//! ```
-
-pub extern crate time;
-
-use std::ffi::CString;
-use std::io::Result as IOResult;
-use std::marker::PhantomData;
-use std::os::unix::ffi::OsStrExt;
-use std::path::Path;
-use std::ptr;
-use std::sync::{Mutex, MutexGuard};
-
-pub use self::ut::*;
-pub use libc::endutxent;
-pub use libc::getutxent;
-pub use libc::setutxent;
-use libc::utmpx;
-#[cfg(any(target_vendor = "apple", target_os = "linux", target_os = "netbsd"))]
-pub use libc::utmpxname;
-
-/// # Safety
-/// Just fixed the clippy warning. Please add description here.
-#[cfg(target_os = "freebsd")]
-pub unsafe extern "C" fn utmpxname(_file: *const libc::c_char) -> libc::c_int {
-    0
-}
-
-use once_cell::sync::Lazy;
-
-use crate::*; // import macros from `../../macros.rs`
-
-// In case the c_char array doesn't end with NULL
-macro_rules! chars2string {
-    ($arr:expr) => {
-        $arr.iter()
-            .take_while(|i| **i > 0)
-            .map(|&i| i as u8 as char)
-            .collect::<String>()
-    };
-}
-
-#[cfg(target_os = "linux")]
-mod ut {
-    pub static DEFAULT_FILE: &str = "/var/run/utmp";
-
-    pub use libc::__UT_HOSTSIZE as UT_HOSTSIZE;
-    pub use libc::__UT_LINESIZE as UT_LINESIZE;
-    pub use libc::__UT_NAMESIZE as UT_NAMESIZE;
-    pub const UT_IDSIZE: usize = 4;
-
-    pub use libc::ACCOUNTING;
-    pub use libc::BOOT_TIME;
-    pub use libc::DEAD_PROCESS;
-    pub use libc::EMPTY;
-    pub use libc::INIT_PROCESS;
-    pub use libc::LOGIN_PROCESS;
-    pub use libc::NEW_TIME;
-    pub use libc::OLD_TIME;
-    pub use libc::RUN_LVL;
-    pub use libc::USER_PROCESS;
-}
-
-#[cfg(target_vendor = "apple")]
-mod ut {
-    pub static DEFAULT_FILE: &str = "/var/run/utmpx";
-
-    pub use libc::_UTX_HOSTSIZE as UT_HOSTSIZE;
-    pub use libc::_UTX_IDSIZE as UT_IDSIZE;
-    pub use libc::_UTX_LINESIZE as UT_LINESIZE;
-    pub use libc::_UTX_USERSIZE as UT_NAMESIZE;
-
-    pub use libc::ACCOUNTING;
-    pub use libc::BOOT_TIME;
-    pub use libc::DEAD_PROCESS;
-    pub use libc::EMPTY;
-    pub use libc::INIT_PROCESS;
-    pub use libc::LOGIN_PROCESS;
-    pub use libc::NEW_TIME;
-    pub use libc::OLD_TIME;
-    pub use libc::RUN_LVL;
-    pub use libc::SHUTDOWN_TIME;
-    pub use libc::SIGNATURE;
-    pub use libc::USER_PROCESS;
-}
-
-#[cfg(target_os = "freebsd")]
-mod ut {
-    pub static DEFAULT_FILE: &str = "";
-
-    pub const UT_LINESIZE: usize = 16;
-    pub const UT_NAMESIZE: usize = 32;
-    pub const UT_IDSIZE: usize = 8;
-    pub const UT_HOSTSIZE: usize = 128;
-
-    pub use libc::BOOT_TIME;
-    pub use libc::DEAD_PROCESS;
-    pub use libc::EMPTY;
-    pub use libc::INIT_PROCESS;
-    pub use libc::LOGIN_PROCESS;
-    pub use libc::NEW_TIME;
-    pub use libc::OLD_TIME;
-    pub use libc::SHUTDOWN_TIME;
-    pub use libc::USER_PROCESS;
-}
-
-#[cfg(target_os = "netbsd")]
-mod ut {
-    pub static DEFAULT_FILE: &str = "/var/run/utmpx";
-
-    pub const ACCOUNTING: usize = 9;
-    pub const SHUTDOWN_TIME: usize = 11;
-
-    pub use libc::_UTX_HOSTSIZE as UT_HOSTSIZE;
-    pub use libc::_UTX_IDSIZE as UT_IDSIZE;
-    pub use libc::_UTX_LINESIZE as UT_LINESIZE;
-    pub use libc::_UTX_USERSIZE as UT_NAMESIZE;
-
-    pub use libc::ACCOUNTING;
-    pub use libc::DEAD_PROCESS;
-    pub use libc::EMPTY;
-    pub use libc::INIT_PROCESS;
-    pub use libc::LOGIN_PROCESS;
-    pub use libc::NEW_TIME;
-    pub use libc::OLD_TIME;
-    pub use libc::RUN_LVL;
-    pub use libc::SIGNATURE;
-    pub use libc::USER_PROCESS;
-}
-
-pub struct Utmpx {
-    inner: utmpx,
-}
-
-impl Utmpx {
-    /// A.K.A. ut.ut_type
-    pub fn record_type(&self) -> i16 {
-        self.inner.ut_type
-    }
-    /// A.K.A. ut.ut_pid
-    pub fn pid(&self) -> i32 {
-        self.inner.ut_pid
-    }
-    /// A.K.A. ut.ut_id
-    pub fn terminal_suffix(&self) -> String {
-        chars2string!(self.inner.ut_id)
-    }
-    /// A.K.A. ut.ut_user
-    pub fn user(&self) -> String {
-        chars2string!(self.inner.ut_user)
-    }
-    /// A.K.A. ut.ut_host
-    pub fn host(&self) -> String {
-        chars2string!(self.inner.ut_host)
-    }
-    /// A.K.A. ut.ut_line
-    pub fn tty_device(&self) -> String {
-        chars2string!(self.inner.ut_line)
-    }
-    /// A.K.A. ut.ut_tv
-    pub fn login_time(&self) -> time::OffsetDateTime {
-        #[allow(clippy::unnecessary_cast)]
-        let ts_nanos: i128 = (1_000_000_000_i64 * self.inner.ut_tv.tv_sec as i64
-            + 1_000_i64 * self.inner.ut_tv.tv_usec as i64)
-            .into();
-        let local_offset = time::OffsetDateTime::now_local().unwrap().offset();
-        time::OffsetDateTime::from_unix_timestamp_nanos(ts_nanos)
-            .unwrap()
-            .to_offset(local_offset)
-    }
-    /// A.K.A. ut.ut_exit
-    ///
-    /// Return (e_termination, e_exit)
-    #[cfg(target_os = "linux")]
-    pub fn exit_status(&self) -> (i16, i16) {
-        (self.inner.ut_exit.e_termination, self.inner.ut_exit.e_exit)
-    }
-    /// A.K.A. ut.ut_exit
-    ///
-    /// Return (0, 0) on Non-Linux platform
-    #[cfg(not(target_os = "linux"))]
-    pub fn exit_status(&self) -> (i16, i16) {
-        (0, 0)
-    }
-    /// Consumes the `Utmpx`, returning the underlying C struct utmpx
-    pub fn into_inner(self) -> utmpx {
-        self.inner
-    }
-    pub fn is_user_process(&self) -> bool {
-        !self.user().is_empty() && self.record_type() == USER_PROCESS
-    }
-
-    /// Canonicalize host name using DNS
-    pub fn canon_host(&self) -> IOResult<String> {
-        let host = self.host();
-
-        let (hostname, display) = host.split_once(':').unwrap_or((&host, ""));
-
-        if !hostname.is_empty() {
-            use dns_lookup::{getaddrinfo, AddrInfoHints};
-
-            const AI_CANONNAME: i32 = 0x2;
-            let hints = AddrInfoHints {
-                flags: AI_CANONNAME,
-                ..AddrInfoHints::default()
-            };
-            if let Ok(sockets) = getaddrinfo(Some(hostname), None, Some(hints)) {
-                let sockets = sockets.collect::<IOResult<Vec<_>>>()?;
-                for socket in sockets {
-                    if let Some(ai_canonname) = socket.canonname {
-                        return Ok(if display.is_empty() {
-                            ai_canonname
-                        } else {
-                            format!("{ai_canonname}:{display}")
-                        });
-                    }
-                }
-            } else {
-                // GNU coreutils has this behavior
-                return Ok(hostname.to_string());
-            }
-        }
-
-        Ok(host.to_string())
-    }
-
-    /// Iterate through all the utmp records.
-    ///
-    /// This will use the default location, or the path [`Utmpx::iter_all_records_from`]
-    /// was most recently called with.
-    ///
-    /// Only one instance of [`UtmpxIter`] may be active at a time. This
-    /// function will block as long as one is still active. Beware!
-    pub fn iter_all_records() -> UtmpxIter {
-        let iter = UtmpxIter::new();
-        unsafe {
-            // This can technically fail, and it would be nice to detect that,
-            // but it doesn't return anything so we'd have to do nasty things
-            // with errno.
-            setutxent();
-        }
-        iter
-    }
-
-    /// Iterate through all the utmp records from a specific file.
-    ///
-    /// No failure is reported or detected.
-    ///
-    /// This function affects subsequent calls to [`Utmpx::iter_all_records`].
-    ///
-    /// The same caveats as for [`Utmpx::iter_all_records`] apply.
-    pub fn iter_all_records_from<P: AsRef<Path>>(path: P) -> UtmpxIter {
-        let iter = UtmpxIter::new();
-        let path = CString::new(path.as_ref().as_os_str().as_bytes()).unwrap();
-        unsafe {
-            // In glibc, utmpxname() only fails if there's not enough memory
-            // to copy the string.
-            // Solaris returns 1 on success instead of 0. Supposedly there also
-            // exist systems where it returns void.
-            // GNU who on Debian seems to output nothing if an invalid filename
-            // is specified, no warning or anything.
-            // So this function is pretty crazy and we don't try to detect errors.
-            // Not much we can do besides pray.
-            utmpxname(path.as_ptr());
-            setutxent();
-        }
-        iter
-    }
-}
-
-// On some systems these functions are not thread-safe. On others they're
-// thread-local. Therefore we use a mutex to allow only one guard to exist at
-// a time, and make sure UtmpxIter cannot be sent across threads.
-//
-// I believe the only technical memory unsafety that could happen is a data
-// race while copying the data out of the pointer returned by getutxent(), but
-// ordinary race conditions are also very much possible.
-static LOCK: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
-
-/// Iterator of login records
-pub struct UtmpxIter {
-    #[allow(dead_code)]
-    guard: MutexGuard<'static, ()>,
-    /// Ensure UtmpxIter is !Send. Technically redundant because MutexGuard
-    /// is also !Send.
-    phantom: PhantomData<std::rc::Rc<()>>,
-}
-
-impl UtmpxIter {
-    fn new() -> Self {
-        // PoisonErrors can safely be ignored
-        let guard = LOCK.lock().unwrap_or_else(|err| err.into_inner());
-        Self {
-            guard,
-            phantom: PhantomData,
-        }
-    }
-}
-
-impl Iterator for UtmpxIter {
-    type Item = Utmpx;
-    fn next(&mut self) -> Option<Self::Item> {
-        unsafe {
-            let res = getutxent();
-            if res.is_null() {
-                None
-            } else {
-                // The data behind this pointer will be replaced by the next
-                // call to getutxent(), so we have to read it now.
-                // All the strings live inline in the struct as arrays, which
-                // makes things easier.
-                Some(Utmpx {
-                    inner: ptr::read(res as *const _),
-                })
-            }
-        }
-    }
-}
-
-impl Drop for UtmpxIter {
-    fn drop(&mut self) {
-        unsafe {
-            endutxent();
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/lib.rs.html b/coreutils/dev/src/uucore/lib.rs.html deleted file mode 100644 index 32c94b1fb..000000000 --- a/coreutils/dev/src/uucore/lib.rs.html +++ /dev/null @@ -1,587 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-
// library ~ (core/bundler file)
-
-// Copyright (C) ~ Alex Lyon <arcterus@mail.com>
-// Copyright (C) ~ Roy Ivy III <rivy.dev@gmail.com>; MIT license
-
-// * feature-gated external crates (re-shared as public internal modules)
-#[cfg(feature = "libc")]
-pub extern crate libc;
-#[cfg(all(feature = "windows-sys", target_os = "windows"))]
-pub extern crate windows_sys;
-
-//## internal modules
-
-mod features; // feature-gated code modules
-mod macros; // crate macros (macro_rules-type; exported to `crate::...`)
-mod mods; // core cross-platform modules
-mod parser; // string parsing modules
-
-pub use uucore_procs::*;
-
-// * cross-platform modules
-pub use crate::mods::backup_control;
-pub use crate::mods::display;
-pub use crate::mods::error;
-pub use crate::mods::line_ending;
-pub use crate::mods::os;
-pub use crate::mods::panic;
-pub use crate::mods::quoting_style;
-pub use crate::mods::ranges;
-pub use crate::mods::update_control;
-pub use crate::mods::version_cmp;
-
-// * string parsing modules
-pub use crate::parser::parse_glob;
-pub use crate::parser::parse_size;
-pub use crate::parser::parse_time;
-pub use crate::parser::shortcut_value_parser;
-
-// * feature-gated modules
-#[cfg(feature = "encoding")]
-pub use crate::features::encoding;
-#[cfg(feature = "fs")]
-pub use crate::features::fs;
-#[cfg(feature = "fsext")]
-pub use crate::features::fsext;
-#[cfg(feature = "lines")]
-pub use crate::features::lines;
-#[cfg(feature = "memo")]
-pub use crate::features::memo;
-#[cfg(feature = "ringbuffer")]
-pub use crate::features::ringbuffer;
-#[cfg(feature = "sum")]
-pub use crate::features::sum;
-
-// * (platform-specific) feature-gated modules
-// ** non-windows (i.e. Unix + Fuchsia)
-#[cfg(all(not(windows), feature = "mode"))]
-pub use crate::features::mode;
-// ** unix-only
-#[cfg(all(unix, feature = "entries"))]
-pub use crate::features::entries;
-#[cfg(all(unix, feature = "perms"))]
-pub use crate::features::perms;
-#[cfg(all(unix, feature = "pipes"))]
-pub use crate::features::pipes;
-#[cfg(all(unix, feature = "process"))]
-pub use crate::features::process;
-#[cfg(all(unix, not(target_os = "fuchsia"), feature = "signals"))]
-pub use crate::features::signals;
-#[cfg(all(
-    unix,
-    not(target_os = "android"),
-    not(target_os = "fuchsia"),
-    not(target_os = "redox"),
-    not(target_env = "musl"),
-    feature = "utmpx"
-))]
-pub use crate::features::utmpx;
-// ** windows-only
-#[cfg(all(windows, feature = "wide"))]
-pub use crate::features::wide;
-
-//## core functions
-
-use std::ffi::OsString;
-use std::sync::atomic::Ordering;
-
-use once_cell::sync::Lazy;
-
-/// Execute utility code for `util`.
-///
-/// This macro expands to a main function that invokes the `uumain` function in `util`
-/// Exits with code returned by `uumain`.
-#[macro_export]
-macro_rules! bin {
-    ($util:ident) => {
-        pub fn main() {
-            use std::io::Write;
-            uucore::panic::mute_sigpipe_panic(); // suppress extraneous error output for SIGPIPE failures/panics
-            let code = $util::uumain(uucore::args_os()); // execute utility code
-            std::io::stdout().flush().expect("could not flush stdout"); // (defensively) flush stdout for utility prior to exit; see <https://github.com/rust-lang/rust/issues/23818>
-            std::process::exit(code);
-        }
-    };
-}
-
-/// Generate the usage string for clap.
-///
-/// This function does two things. It indents all but the first line to align
-/// the lines because clap adds "Usage: " to the first line. And it replaces
-/// all occurrences of `{}` with the execution phrase and returns the resulting
-/// `String`. It does **not** support more advanced formatting features such
-/// as `{0}`.
-pub fn format_usage(s: &str) -> String {
-    let s = s.replace('\n', &format!("\n{}", " ".repeat(7)));
-    s.replace("{}", crate::execution_phrase())
-}
-
-pub fn get_utility_is_second_arg() -> bool {
-    crate::macros::UTILITY_IS_SECOND_ARG.load(Ordering::SeqCst)
-}
-
-pub fn set_utility_is_second_arg() {
-    crate::macros::UTILITY_IS_SECOND_ARG.store(true, Ordering::SeqCst);
-}
-
-// args_os() can be expensive to call, it copies all of argv before iterating.
-// So if we want only the first arg or so it's overkill. We cache it.
-static ARGV: Lazy<Vec<OsString>> = Lazy::new(|| wild::args_os().collect());
-
-static UTIL_NAME: Lazy<String> = Lazy::new(|| {
-    let base_index = if get_utility_is_second_arg() { 1 } else { 0 };
-    let is_man = if ARGV[base_index].eq("manpage") { 1 } else { 0 };
-    let argv_index = base_index + is_man;
-
-    ARGV[argv_index].to_string_lossy().into_owned()
-});
-
-/// Derive the utility name.
-pub fn util_name() -> &'static str {
-    &UTIL_NAME
-}
-
-static EXECUTION_PHRASE: Lazy<String> = Lazy::new(|| {
-    if get_utility_is_second_arg() {
-        ARGV.iter()
-            .take(2)
-            .map(|os_str| os_str.to_string_lossy().into_owned())
-            .collect::<Vec<_>>()
-            .join(" ")
-    } else {
-        ARGV[0].to_string_lossy().into_owned()
-    }
-});
-
-/// Derive the complete execution phrase for "usage".
-pub fn execution_phrase() -> &'static str {
-    &EXECUTION_PHRASE
-}
-
-pub trait Args: Iterator<Item = OsString> + Sized {
-    /// Collects the iterator into a `Vec<String>`, lossily converting the `OsString`s to `Strings`.
-    fn collect_lossy(self) -> Vec<String> {
-        self.map(|s| s.to_string_lossy().into_owned()).collect()
-    }
-
-    /// Collects the iterator into a `Vec<String>`, removing any elements that contain invalid encoding.
-    fn collect_ignore(self) -> Vec<String> {
-        self.filter_map(|s| s.into_string().ok()).collect()
-    }
-}
-
-impl<T: Iterator<Item = OsString> + Sized> Args for T {}
-
-pub fn args_os() -> impl Iterator<Item = OsString> {
-    ARGV.iter().cloned()
-}
-
-/// Read a line from stdin and check whether the first character is `'y'` or `'Y'`
-pub fn read_yes() -> bool {
-    let mut s = String::new();
-    match std::io::stdin().read_line(&mut s) {
-        Ok(_) => matches!(s.chars().next(), Some('y' | 'Y')),
-        _ => false,
-    }
-}
-
-/// Prompt the user with a formatted string and returns `true` if they reply `'y'` or `'Y'`
-///
-/// This macro functions accepts the same syntax as `format!`. The prompt is written to
-/// `stderr`. A space is also printed at the end for nice spacing between the prompt and
-/// the user input. Any input starting with `'y'` or `'Y'` is interpreted as `yes`.
-///
-/// # Examples
-/// ```
-/// use uucore::prompt_yes;
-/// let file = "foo.rs";
-/// prompt_yes!("Do you want to delete '{}'?", file);
-/// ```
-/// will print something like below to `stderr` (with `util_name` substituted by the actual
-/// util name) and will wait for user input.
-/// ```txt
-/// util_name: Do you want to delete 'foo.rs'?
-/// ```
-#[macro_export]
-macro_rules! prompt_yes(
-    ($($args:tt)+) => ({
-        use std::io::Write;
-        eprint!("{}: ", uucore::util_name());
-        eprint!($($args)+);
-        eprint!(" ");
-        uucore::crash_if_err!(1, std::io::stderr().flush());
-        uucore::read_yes()
-    })
-);
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use std::ffi::OsStr;
-
-    fn make_os_vec(os_str: &OsStr) -> Vec<OsString> {
-        vec![
-            OsString::from("test"),
-            OsString::from("สวัสดี"), // spell-checker:disable-line
-            os_str.to_os_string(),
-        ]
-    }
-
-    #[cfg(any(unix, target_os = "redox"))]
-    fn test_invalid_utf8_args_lossy(os_str: &OsStr) {
-        // assert our string is invalid utf8
-        assert!(os_str.to_os_string().into_string().is_err());
-        let test_vec = make_os_vec(os_str);
-        let collected_to_str = test_vec.clone().into_iter().collect_lossy();
-        // conservation of length - when accepting lossy conversion no arguments may be dropped
-        assert_eq!(collected_to_str.len(), test_vec.len());
-        // first indices identical
-        for index in 0..2 {
-            assert_eq!(collected_to_str[index], test_vec[index].to_str().unwrap());
-        }
-        // lossy conversion for string with illegal encoding is done
-        assert_eq!(
-            *collected_to_str[2],
-            os_str.to_os_string().to_string_lossy()
-        );
-    }
-
-    #[cfg(any(unix, target_os = "redox"))]
-    fn test_invalid_utf8_args_ignore(os_str: &OsStr) {
-        // assert our string is invalid utf8
-        assert!(os_str.to_os_string().into_string().is_err());
-        let test_vec = make_os_vec(os_str);
-        let collected_to_str = test_vec.clone().into_iter().collect_ignore();
-        // assert that the broken entry is filtered out
-        assert_eq!(collected_to_str.len(), test_vec.len() - 1);
-        // assert that the unbroken indices are converted as expected
-        for index in 0..2 {
-            assert_eq!(
-                collected_to_str.get(index).unwrap(),
-                test_vec.get(index).unwrap().to_str().unwrap()
-            );
-        }
-    }
-
-    #[test]
-    fn valid_utf8_encoding_args() {
-        // create a vector containing only correct encoding
-        let test_vec = make_os_vec(&OsString::from("test2"));
-        // expect complete conversion without losses, even when lossy conversion is accepted
-        let _ = test_vec.into_iter().collect_lossy();
-    }
-
-    #[cfg(any(unix, target_os = "redox"))]
-    #[test]
-    fn invalid_utf8_args_unix() {
-        use std::os::unix::ffi::OsStrExt;
-
-        let source = [0x66, 0x6f, 0x80, 0x6f];
-        let os_str = OsStr::from_bytes(&source[..]);
-        test_invalid_utf8_args_lossy(os_str);
-        test_invalid_utf8_args_ignore(os_str);
-    }
-
-    #[test]
-    fn test_format_usage() {
-        assert_eq!(format_usage("expr EXPRESSION"), "expr EXPRESSION");
-        assert_eq!(
-            format_usage("expr EXPRESSION\nexpr OPTION"),
-            "expr EXPRESSION\n       expr OPTION"
-        );
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/macros.rs.html b/coreutils/dev/src/uucore/macros.rs.html deleted file mode 100644 index ef8cd13e1..000000000 --- a/coreutils/dev/src/uucore/macros.rs.html +++ /dev/null @@ -1,467 +0,0 @@ -macros.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-
// TODO fix broken links
-#![allow(rustdoc::broken_intra_doc_links)]
-//! Macros for the uucore utilities.
-//!
-//! This module bundles all macros used across the uucore utilities. These
-//! include macros for reporting errors in various formats, aborting program
-//! execution and more.
-//!
-//! To make use of all macros in this module, they must be imported like so:
-//!
-//! ```ignore
-//! #[macro_use]
-//! extern crate uucore;
-//! ```
-//!
-//! Alternatively, you can import single macros by importing them through their
-//! fully qualified name like this:
-//!
-//! ```no_run
-//! use uucore::{show, crash};
-//! ```
-//!
-//! Here's an overview of the macros sorted by purpose
-//!
-//! - Print errors
-//!   - From types implementing [`crate::error::UError`]: [`show!`],
-//!     [`show_if_err!`]
-//!   - From custom messages: [`show_error!`]
-//! - Print warnings: [`show_warning!`]
-//! - Terminate util execution
-//!   - Crash program: [`crash!`], [`crash_if_err!`]
-
-// spell-checker:ignore sourcepath targetpath rustdoc
-
-use std::sync::atomic::AtomicBool;
-
-// This file is part of the uutils coreutils package.
-//
-// (c) Alex Lyon <arcterus@mail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-/// Whether we were called as a multicall binary (`coreutils <utility>`)
-pub static UTILITY_IS_SECOND_ARG: AtomicBool = AtomicBool::new(false);
-
-//====
-
-/// Display a [`crate::error::UError`] and set global exit code.
-///
-/// Prints the error message contained in an [`crate::error::UError`] to stderr
-/// and sets the exit code through [`crate::error::set_exit_code`]. The printed
-/// error message is prepended with the calling utility's name. A call to this
-/// macro will not finish program execution.
-///
-/// # Examples
-///
-/// The following example would print a message "Some error occurred" and set
-/// the utility's exit code to 2.
-///
-/// ```
-/// # #[macro_use]
-/// # extern crate uucore;
-///
-/// use uucore::error::{self, USimpleError};
-///
-/// fn main() {
-///     let err = USimpleError::new(2, "Some error occurred.");
-///     show!(err);
-///     assert_eq!(error::get_exit_code(), 2);
-/// }
-/// ```
-///
-/// If not using [`crate::error::UError`], one may achieve the same behavior
-/// like this:
-///
-/// ```
-/// # #[macro_use]
-/// # extern crate uucore;
-///
-/// use uucore::error::set_exit_code;
-///
-/// fn main() {
-///     set_exit_code(2);
-///     show_error!("Some error occurred.");
-/// }
-/// ```
-#[macro_export]
-macro_rules! show(
-    ($err:expr) => ({
-        let e = $err;
-        $crate::error::set_exit_code(e.code());
-        eprintln!("{}: {}", $crate::util_name(), e);
-    })
-);
-
-/// Display an error and set global exit code in error case.
-///
-/// Wraps around [`show!`] and takes a [`crate::error::UResult`] instead of a
-/// [`crate::error::UError`] type. This macro invokes [`show!`] if the
-/// [`crate::error::UResult`] is an `Err`-variant. This can be invoked directly
-/// on the result of a function call, like in the `install` utility:
-///
-/// ```ignore
-/// show_if_err!(copy(sourcepath, &targetpath, b));
-/// ```
-///
-/// # Examples
-///
-/// ```ignore
-/// # #[macro_use]
-/// # extern crate uucore;
-/// # use uucore::error::{UError, UIoError, UResult, USimpleError};
-///
-/// # fn main() {
-/// let is_ok = Ok(1);
-/// // This does nothing at all
-/// show_if_err!(is_ok);
-///
-/// let is_err = Err(USimpleError::new(1, "I'm an error").into());
-/// // Calls `show!` on the contained USimpleError
-/// show_if_err!(is_err);
-/// # }
-/// ```
-///
-///
-#[macro_export]
-macro_rules! show_if_err(
-    ($res:expr) => ({
-        if let Err(e) = $res {
-            show!(e);
-        }
-    })
-);
-
-/// Show an error to stderr in a similar style to GNU coreutils.
-///
-/// Takes a [`format!`]-like input and prints it to stderr. The output is
-/// prepended with the current utility's name.
-///
-/// # Examples
-///
-/// ```
-/// # #[macro_use]
-/// # extern crate uucore;
-/// # fn main() {
-/// show_error!("Couldn't apply {} to {}", "foo", "bar");
-/// # }
-/// ```
-#[macro_export]
-macro_rules! show_error(
-    ($($args:tt)+) => ({
-        eprint!("{}: ", $crate::util_name());
-        eprintln!($($args)+);
-    })
-);
-
-/// Print a warning message to stderr.
-///
-/// Takes [`format!`]-compatible input and prepends it with the current
-/// utility's name and "warning: " before printing to stderr.
-///
-/// # Examples
-///
-/// ```
-/// # #[macro_use]
-/// # extern crate uucore;
-/// # fn main() {
-/// // outputs <name>: warning: Couldn't apply foo to bar
-/// show_warning!("Couldn't apply {} to {}", "foo", "bar");
-/// # }
-/// ```
-#[macro_export]
-macro_rules! show_warning(
-    ($($args:tt)+) => ({
-        eprint!("{}: warning: ", $crate::util_name());
-        eprintln!($($args)+);
-    })
-);
-
-/// Display an error and [`std::process::exit`]
-///
-/// Displays the provided error message using [`show_error!`], then invokes
-/// [`std::process::exit`] with the provided exit code.
-///
-/// # Examples
-///
-/// ```should_panic
-/// # #[macro_use]
-/// # extern crate uucore;
-/// # fn main() {
-/// // outputs <name>: Couldn't apply foo to bar
-/// // and terminates execution
-/// crash!(1, "Couldn't apply {} to {}", "foo", "bar");
-/// # }
-/// ```
-#[macro_export]
-macro_rules! crash(
-    ($exit_code:expr, $($args:tt)+) => ({
-        $crate::show_error!($($args)+);
-        std::process::exit($exit_code);
-    })
-);
-
-/// Unwrap a [`std::result::Result`], crashing instead of panicking.
-///
-/// If the result is an `Ok`-variant, returns the value contained inside. If it
-/// is an `Err`-variant, invokes [`crash!`] with the formatted error instead.
-///
-/// # Examples
-///
-/// ```should_panic
-/// # #[macro_use]
-/// # extern crate uucore;
-/// # fn main() {
-/// let is_ok: Result<u32, &str> = Ok(1);
-/// // Does nothing
-/// crash_if_err!(1, is_ok);
-///
-/// let is_err: Result<u32, &str> = Err("This didn't work...");
-/// // Calls `crash!`
-/// crash_if_err!(1, is_err);
-/// # }
-/// ```
-#[macro_export]
-macro_rules! crash_if_err(
-    ($exit_code:expr, $exp:expr) => (
-        match $exp {
-            Ok(m) => m,
-            Err(f) => $crate::crash!($exit_code, "{}", f),
-        }
-    )
-);
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods.rs.html b/coreutils/dev/src/uucore/mods.rs.html deleted file mode 100644 index 8e21ea686..000000000 --- a/coreutils/dev/src/uucore/mods.rs.html +++ /dev/null @@ -1,27 +0,0 @@ -mods.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-
// mods ~ cross-platforms modules (core/bundler file)
-
-pub mod backup_control;
-pub mod display;
-pub mod error;
-pub mod line_ending;
-pub mod os;
-pub mod panic;
-pub mod ranges;
-pub mod update_control;
-pub mod version_cmp;
-// dir and vdir also need access to the quoting_style module
-pub mod quoting_style;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/backup_control.rs.html b/coreutils/dev/src/uucore/mods/backup_control.rs.html deleted file mode 100644 index 2fb21b4ed..000000000 --- a/coreutils/dev/src/uucore/mods/backup_control.rs.html +++ /dev/null @@ -1,1363 +0,0 @@ -backup_control.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-
//! Implement GNU-style backup functionality.
-//!
-//! This module implements the backup functionality as described in the [GNU
-//! manual][1]. It provides
-//!
-//! - pre-defined [`clap`-Arguments][2] for inclusion in utilities that
-//!   implement backups
-//! - determination of the [backup mode][3]
-//! - determination of the [backup suffix][4]
-//! - [backup target path construction][5]
-//! - [Error types][6] for backup-related errors
-//! - GNU-compliant [help texts][7] for backup-related errors
-//!
-//! Backup-functionality is implemented by the following utilities:
-//!
-//! - `cp`
-//! - `install`
-//! - `ln`
-//! - `mv`
-//!
-//!
-//! [1]: https://www.gnu.org/software/coreutils/manual/html_node/Backup-options.html
-//! [2]: arguments
-//! [3]: `determine_backup_mode()`
-//! [4]: `determine_backup_suffix()`
-//! [5]: `get_backup_path()`
-//! [6]: `BackupError`
-//! [7]: `BACKUP_CONTROL_LONG_HELP`
-//!
-//!
-//! # Usage example
-//!
-//! ```
-//! #[macro_use]
-//! extern crate uucore;
-//!
-//! use clap::{Command, Arg, ArgMatches};
-//! use std::path::{Path, PathBuf};
-//! use uucore::backup_control::{self, BackupMode};
-//! use uucore::error::{UError, UResult};
-//!
-//! fn main() {
-//!     let usage = String::from("command [OPTION]... ARG");
-//!     let long_usage = String::from("And here's a detailed explanation");
-//!
-//!     let matches = Command::new("command")
-//!         .arg(backup_control::arguments::backup())
-//!         .arg(backup_control::arguments::backup_no_args())
-//!         .arg(backup_control::arguments::suffix())
-//!         .override_usage(usage)
-//!         .after_help(format!(
-//!             "{}\n{}",
-//!             long_usage,
-//!             backup_control::BACKUP_CONTROL_LONG_HELP
-//!         ))
-//!         .get_matches_from(vec![
-//!             "command", "--backup=t", "--suffix=bak~"
-//!         ]);
-//!
-//!     let backup_mode = match backup_control::determine_backup_mode(&matches) {
-//!         Err(e) => {
-//!             show!(e);
-//!             return;
-//!         },
-//!         Ok(mode) => mode,
-//!     };
-//!     let backup_suffix = backup_control::determine_backup_suffix(&matches);
-//!     let target_path = Path::new("/tmp/example");
-//!
-//!     let backup_path = backup_control::get_backup_path(
-//!         backup_mode, target_path, &backup_suffix
-//!     );
-//!
-//!     // Perform your backups here.
-//!
-//! }
-//! ```
-
-// spell-checker:ignore backupopt
-
-use crate::{
-    display::Quotable,
-    error::{UError, UResult},
-};
-use clap::ArgMatches;
-use std::{
-    env,
-    error::Error,
-    fmt::{Debug, Display},
-    path::{Path, PathBuf},
-};
-
-pub static BACKUP_CONTROL_VALUES: &[&str] = &[
-    "simple", "never", "numbered", "t", "existing", "nil", "none", "off",
-];
-
-pub const BACKUP_CONTROL_LONG_HELP: &str =
-    "The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
-The version control method may be selected via the --backup option or through
-the VERSION_CONTROL environment variable.  Here are the values:
-
-  none, off       never make backups (even if --backup is given)
-  numbered, t     make numbered backups
-  existing, nil   numbered if numbered backups exist, simple otherwise
-  simple, never   always make simple backups";
-
-static VALID_ARGS_HELP: &str = "Valid arguments are:
-  - 'none', 'off'
-  - 'simple', 'never'
-  - 'existing', 'nil'
-  - 'numbered', 't'";
-
-/// Available backup modes.
-///
-/// The mapping of the backup modes to the CLI arguments is annotated on the
-/// enum variants.
-#[derive(Debug, Clone, Copy, Eq, PartialEq)]
-pub enum BackupMode {
-    /// Argument 'none', 'off'
-    NoBackup,
-    /// Argument 'simple', 'never'
-    SimpleBackup,
-    /// Argument 'numbered', 't'
-    NumberedBackup,
-    /// Argument 'existing', 'nil'
-    ExistingBackup,
-}
-
-/// Backup error types.
-///
-/// Errors are currently raised by [`determine_backup_mode`] only. All errors
-/// are implemented as [`UError`] for uniform handling across utilities.
-#[derive(Debug, Eq, PartialEq)]
-pub enum BackupError {
-    /// An invalid argument (e.g. 'foo') was given as backup type. First
-    /// parameter is the argument, second is the arguments origin (CLI or
-    /// ENV-var)
-    InvalidArgument(String, String),
-    /// An ambiguous argument (e.g. 'n') was given as backup type. First
-    /// parameter is the argument, second is the arguments origin (CLI or
-    /// ENV-var)
-    AmbiguousArgument(String, String),
-    /// Currently unused
-    BackupImpossible(),
-    // BackupFailed(PathBuf, PathBuf, std::io::Error),
-}
-
-impl UError for BackupError {
-    fn code(&self) -> i32 {
-        match self {
-            Self::BackupImpossible() => 2,
-            _ => 1,
-        }
-    }
-
-    fn usage(&self) -> bool {
-        // Suggested by clippy.
-        matches!(
-            self,
-            Self::InvalidArgument(_, _) | Self::AmbiguousArgument(_, _)
-        )
-    }
-}
-
-impl Error for BackupError {}
-
-impl Display for BackupError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::InvalidArgument(arg, origin) => write!(
-                f,
-                "invalid argument {} for '{}'\n{}",
-                arg.quote(),
-                origin,
-                VALID_ARGS_HELP
-            ),
-            Self::AmbiguousArgument(arg, origin) => write!(
-                f,
-                "ambiguous argument {} for '{}'\n{}",
-                arg.quote(),
-                origin,
-                VALID_ARGS_HELP
-            ),
-            Self::BackupImpossible() => write!(f, "cannot create backup"),
-            // Placeholder for later
-            // Self::BackupFailed(from, to, e) => Display::fmt(
-            //     &uio_error!(e, "failed to backup {} to {}", from.quote(), to.quote()),
-            //     f
-            // ),
-        }
-    }
-}
-
-/// Arguments for backup-related functionality.
-///
-/// Rather than implementing the `clap`-Arguments for every utility, it is
-/// recommended to include the `clap` arguments via the functions provided here.
-/// This way the backup-specific arguments are handled uniformly across
-/// utilities and can be maintained in one central place.
-pub mod arguments {
-    use clap::ArgAction;
-
-    pub static OPT_BACKUP: &str = "backupopt_backup";
-    pub static OPT_BACKUP_NO_ARG: &str = "backupopt_b";
-    pub static OPT_SUFFIX: &str = "backupopt_suffix";
-
-    /// '--backup' argument
-    pub fn backup() -> clap::Arg {
-        clap::Arg::new(OPT_BACKUP)
-            .long("backup")
-            .help("make a backup of each existing destination file")
-            .action(clap::ArgAction::Set)
-            .require_equals(true)
-            .num_args(0..=1)
-            .value_name("CONTROL")
-    }
-
-    /// '-b' argument
-    pub fn backup_no_args() -> clap::Arg {
-        clap::Arg::new(OPT_BACKUP_NO_ARG)
-            .short('b')
-            .help("like --backup but does not accept an argument")
-            .action(ArgAction::SetTrue)
-    }
-
-    /// '-S, --suffix' argument
-    pub fn suffix() -> clap::Arg {
-        clap::Arg::new(OPT_SUFFIX)
-            .short('S')
-            .long("suffix")
-            .help("override the usual backup suffix")
-            .action(clap::ArgAction::Set)
-            .value_name("SUFFIX")
-            .allow_hyphen_values(true)
-    }
-}
-
-/// Obtain the suffix to use for a backup.
-///
-/// In order of precedence, this function obtains the backup suffix
-///
-/// 1. From the '-S' or '--suffix' CLI argument, if present
-/// 2. From the "SIMPLE_BACKUP_SUFFIX" environment variable, if present
-/// 3. By using the default '~' if none of the others apply
-///
-/// This function directly takes [`clap::ArgMatches`] as argument and looks for
-/// the '-S' and '--suffix' arguments itself.
-pub fn determine_backup_suffix(matches: &ArgMatches) -> String {
-    let supplied_suffix = matches.get_one::<String>(arguments::OPT_SUFFIX);
-    if let Some(suffix) = supplied_suffix {
-        String::from(suffix)
-    } else {
-        env::var("SIMPLE_BACKUP_SUFFIX").unwrap_or_else(|_| "~".to_owned())
-    }
-}
-
-/// Determine the "mode" for the backup operation to perform, if any.
-///
-/// Parses the backup options according to the [GNU manual][1], and converts
-/// them to an instance of `BackupMode` for further processing.
-///
-/// Takes [`clap::ArgMatches`] as argument which **must** contain the options
-/// from [`arguments::backup()`] and [`arguments::backup_no_args()`]. Otherwise
-/// the `NoBackup` mode is returned unconditionally.
-///
-/// It is recommended for anyone who would like to implement the
-/// backup-functionality to use the arguments prepared in the `arguments`
-/// submodule (see examples)
-///
-/// [1]: https://www.gnu.org/software/coreutils/manual/html_node/Backup-options.html
-///
-///
-/// # Errors
-///
-/// If an argument supplied directly to the long `backup` option, or read in
-/// through the `VERSION CONTROL` env var is ambiguous (i.e. may resolve to
-/// multiple backup modes) or invalid, an [`InvalidArgument`][10] or
-/// [`AmbiguousArgument`][11] error is returned, respectively.
-///
-/// [10]: BackupError::InvalidArgument
-/// [11]: BackupError::AmbiguousArgument
-///
-///
-/// # Examples
-///
-/// Here's how one would integrate the backup mode determination into an
-/// application.
-///
-/// ```
-/// #[macro_use]
-/// extern crate uucore;
-/// use uucore::backup_control::{self, BackupMode};
-/// use clap::{Command, Arg, ArgMatches};
-///
-/// fn main() {
-///     let matches = Command::new("command")
-///         .arg(backup_control::arguments::backup())
-///         .arg(backup_control::arguments::backup_no_args())
-///         .get_matches_from(vec![
-///             "command", "-b", "--backup=t"
-///         ]);
-///
-///     let backup_mode = backup_control::determine_backup_mode(&matches).unwrap();
-///     assert_eq!(backup_mode, BackupMode::NumberedBackup)
-/// }
-/// ```
-///
-/// This example shows an ambiguous input, as 'n' may resolve to 4 different
-/// backup modes.
-///
-///
-/// ```
-/// #[macro_use]
-/// extern crate uucore;
-/// use uucore::backup_control::{self, BackupMode, BackupError};
-/// use clap::{Command, Arg, ArgMatches};
-///
-/// fn main() {
-///     let matches = Command::new("command")
-///         .arg(backup_control::arguments::backup())
-///         .arg(backup_control::arguments::backup_no_args())
-///         .get_matches_from(vec![
-///             "command", "-b", "--backup=n"
-///         ]);
-///
-///     let backup_mode = backup_control::determine_backup_mode(&matches);
-///
-///     assert!(backup_mode.is_err());
-///     let err = backup_mode.unwrap_err();
-///     // assert_eq!(err, BackupError::AmbiguousArgument);
-///     // Use uucore functionality to show the error to the user
-///     show!(err);
-/// }
-/// ```
-pub fn determine_backup_mode(matches: &ArgMatches) -> UResult<BackupMode> {
-    if matches.contains_id(arguments::OPT_BACKUP) {
-        // Use method to determine the type of backups to make. When this option
-        // is used but method is not specified, then the value of the
-        // VERSION_CONTROL environment variable is used. And if VERSION_CONTROL
-        // is not set, the default backup type is 'existing'.
-        if let Some(method) = matches.get_one::<String>(arguments::OPT_BACKUP) {
-            // Second argument is for the error string that is returned.
-            match_method(method, "backup type")
-        } else if let Ok(method) = env::var("VERSION_CONTROL") {
-            // Second argument is for the error string that is returned.
-            match_method(&method, "$VERSION_CONTROL")
-        } else {
-            // Default if no argument is provided to '--backup'
-            Ok(BackupMode::ExistingBackup)
-        }
-    } else if matches.get_flag(arguments::OPT_BACKUP_NO_ARG) {
-        // the short form of this option, -b does not accept any argument.
-        // Using -b is equivalent to using --backup=existing.
-        Ok(BackupMode::ExistingBackup)
-    } else {
-        // No option was present at all
-        Ok(BackupMode::NoBackup)
-    }
-}
-
-/// Match a backup option string to a `BackupMode`.
-///
-/// The GNU manual specifies that abbreviations to options are valid as long as
-/// they aren't ambiguous. This function matches the given `method` argument
-/// against all valid backup options (via `starts_with`), and returns a valid
-/// [`BackupMode`] if exactly one backup option matches the `method` given.
-///
-/// `origin` is required in order to format the generated error message
-/// properly, when an error occurs.
-///
-///
-/// # Errors
-///
-/// If `method` is invalid or ambiguous (i.e. may resolve to multiple backup
-/// modes), an [`InvalidArgument`][10] or [`AmbiguousArgument`][11] error is
-/// returned, respectively.
-///
-/// [10]: BackupError::InvalidArgument
-/// [11]: BackupError::AmbiguousArgument
-fn match_method(method: &str, origin: &str) -> UResult<BackupMode> {
-    let matches: Vec<&&str> = BACKUP_CONTROL_VALUES
-        .iter()
-        .filter(|val| val.starts_with(method))
-        .collect();
-    if matches.len() == 1 {
-        match *matches[0] {
-            "simple" | "never" => Ok(BackupMode::SimpleBackup),
-            "numbered" | "t" => Ok(BackupMode::NumberedBackup),
-            "existing" | "nil" => Ok(BackupMode::ExistingBackup),
-            "none" | "off" => Ok(BackupMode::NoBackup),
-            _ => unreachable!(), // cannot happen as we must have exactly one match
-                                 // from the list above.
-        }
-    } else if matches.is_empty() {
-        Err(BackupError::InvalidArgument(method.to_string(), origin.to_string()).into())
-    } else {
-        Err(BackupError::AmbiguousArgument(method.to_string(), origin.to_string()).into())
-    }
-}
-
-pub fn get_backup_path(
-    backup_mode: BackupMode,
-    backup_path: &Path,
-    suffix: &str,
-) -> Option<PathBuf> {
-    match backup_mode {
-        BackupMode::NoBackup => None,
-        BackupMode::SimpleBackup => Some(simple_backup_path(backup_path, suffix)),
-        BackupMode::NumberedBackup => Some(numbered_backup_path(backup_path)),
-        BackupMode::ExistingBackup => Some(existing_backup_path(backup_path, suffix)),
-    }
-}
-
-fn simple_backup_path(path: &Path, suffix: &str) -> PathBuf {
-    let mut p = path.to_string_lossy().into_owned();
-    p.push_str(suffix);
-    PathBuf::from(p)
-}
-
-fn numbered_backup_path(path: &Path) -> PathBuf {
-    for i in 1_u64.. {
-        let path_str = &format!("{}.~{}~", path.to_string_lossy(), i);
-        let path = Path::new(path_str);
-        if !path.exists() {
-            return path.to_path_buf();
-        }
-    }
-    panic!("cannot create backup")
-}
-
-fn existing_backup_path(path: &Path, suffix: &str) -> PathBuf {
-    let test_path_str = &format!("{}.~1~", path.to_string_lossy());
-    let test_path = Path::new(test_path_str);
-    if test_path.exists() {
-        numbered_backup_path(path)
-    } else {
-        simple_backup_path(path, suffix)
-    }
-}
-
-/// Returns true if the source file is likely to be the simple backup file for the target file.
-///
-/// # Arguments
-///
-/// * `source` - A Path reference that holds the source (backup) file path.
-/// * `target` - A Path reference that holds the target file path.
-/// * `suffix` - Str that holds the backup suffix.
-///
-/// # Examples
-///
-/// ```
-/// use std::path::Path;
-/// use uucore::backup_control::source_is_target_backup;
-/// let source = Path::new("data.txt~");
-/// let target = Path::new("data.txt");
-/// let suffix = String::from("~");
-///
-/// assert_eq!(source_is_target_backup(&source, &target, &suffix), true);
-/// ```
-///
-pub fn source_is_target_backup(source: &Path, target: &Path, suffix: &str) -> bool {
-    let source_filename = source.to_string_lossy();
-    let target_backup_filename = format!("{}{suffix}", target.to_string_lossy());
-    source_filename == target_backup_filename
-}
-
-//
-// Tests for this module
-//
-#[cfg(test)]
-mod tests {
-    use super::*;
-    use std::env;
-    // Required to instantiate mutex in shared context
-    use clap::Command;
-    use once_cell::sync::Lazy;
-    use std::sync::Mutex;
-
-    // The mutex is required here as by default all tests are run as separate
-    // threads under the same parent process. As environment variables are
-    // specific to processes (and thus shared among threads), data races *will*
-    // occur if no precautions are taken. Thus we have all tests that rely on
-    // environment variables lock this empty mutex to ensure they don't access
-    // it concurrently.
-    static TEST_MUTEX: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
-
-    // Environment variable for "VERSION_CONTROL"
-    static ENV_VERSION_CONTROL: &str = "VERSION_CONTROL";
-
-    fn make_app() -> clap::Command {
-        Command::new("command")
-            .arg(arguments::backup())
-            .arg(arguments::backup_no_args())
-            .arg(arguments::suffix())
-    }
-
-    // Defaults to --backup=existing
-    #[test]
-    fn test_backup_mode_short_only() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        let matches = make_app().get_matches_from(vec!["command", "-b"]);
-
-        let result = determine_backup_mode(&matches).unwrap();
-
-        assert_eq!(result, BackupMode::ExistingBackup);
-    }
-
-    // --backup takes precedence over -b
-    #[test]
-    fn test_backup_mode_long_preferred_over_short() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        let matches = make_app().get_matches_from(vec!["command", "-b", "--backup=none"]);
-
-        let result = determine_backup_mode(&matches).unwrap();
-
-        assert_eq!(result, BackupMode::NoBackup);
-    }
-
-    // --backup can be passed without an argument
-    #[test]
-    fn test_backup_mode_long_without_args_no_env() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        let matches = make_app().get_matches_from(vec!["command", "--backup"]);
-
-        let result = determine_backup_mode(&matches).unwrap();
-
-        assert_eq!(result, BackupMode::ExistingBackup);
-    }
-
-    // --backup can be passed with an argument only
-    #[test]
-    fn test_backup_mode_long_with_args() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        let matches = make_app().get_matches_from(vec!["command", "--backup=simple"]);
-
-        let result = determine_backup_mode(&matches).unwrap();
-
-        assert_eq!(result, BackupMode::SimpleBackup);
-    }
-
-    // --backup errors on invalid argument
-    #[test]
-    fn test_backup_mode_long_with_args_invalid() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        let matches = make_app().get_matches_from(vec!["command", "--backup=foobar"]);
-
-        let result = determine_backup_mode(&matches);
-
-        assert!(result.is_err());
-        let text = format!("{}", result.unwrap_err());
-        assert!(text.contains("invalid argument 'foobar' for 'backup type'"));
-    }
-
-    // --backup errors on ambiguous argument
-    #[test]
-    fn test_backup_mode_long_with_args_ambiguous() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        let matches = make_app().get_matches_from(vec!["command", "--backup=n"]);
-
-        let result = determine_backup_mode(&matches);
-
-        assert!(result.is_err());
-        let text = format!("{}", result.unwrap_err());
-        assert!(text.contains("ambiguous argument 'n' for 'backup type'"));
-    }
-
-    // --backup accepts shortened arguments (si for simple)
-    #[test]
-    fn test_backup_mode_long_with_arg_shortened() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        let matches = make_app().get_matches_from(vec!["command", "--backup=si"]);
-
-        let result = determine_backup_mode(&matches).unwrap();
-
-        assert_eq!(result, BackupMode::SimpleBackup);
-    }
-
-    // -b ignores the "VERSION_CONTROL" environment variable
-    #[test]
-    fn test_backup_mode_short_only_ignore_env() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        env::set_var(ENV_VERSION_CONTROL, "none");
-        let matches = make_app().get_matches_from(vec!["command", "-b"]);
-
-        let result = determine_backup_mode(&matches).unwrap();
-
-        assert_eq!(result, BackupMode::ExistingBackup);
-        env::remove_var(ENV_VERSION_CONTROL);
-    }
-
-    // --backup can be passed without an argument, but reads env var if existent
-    #[test]
-    fn test_backup_mode_long_without_args_with_env() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        env::set_var(ENV_VERSION_CONTROL, "none");
-        let matches = make_app().get_matches_from(vec!["command", "--backup"]);
-
-        let result = determine_backup_mode(&matches).unwrap();
-
-        assert_eq!(result, BackupMode::NoBackup);
-        env::remove_var(ENV_VERSION_CONTROL);
-    }
-
-    // --backup errors on invalid VERSION_CONTROL env var
-    #[test]
-    fn test_backup_mode_long_with_env_var_invalid() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        env::set_var(ENV_VERSION_CONTROL, "foobar");
-        let matches = make_app().get_matches_from(vec!["command", "--backup"]);
-
-        let result = determine_backup_mode(&matches);
-
-        assert!(result.is_err());
-        let text = format!("{}", result.unwrap_err());
-        assert!(text.contains("invalid argument 'foobar' for '$VERSION_CONTROL'"));
-        env::remove_var(ENV_VERSION_CONTROL);
-    }
-
-    // --backup errors on ambiguous VERSION_CONTROL env var
-    #[test]
-    fn test_backup_mode_long_with_env_var_ambiguous() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        env::set_var(ENV_VERSION_CONTROL, "n");
-        let matches = make_app().get_matches_from(vec!["command", "--backup"]);
-
-        let result = determine_backup_mode(&matches);
-
-        assert!(result.is_err());
-        let text = format!("{}", result.unwrap_err());
-        assert!(text.contains("ambiguous argument 'n' for '$VERSION_CONTROL'"));
-        env::remove_var(ENV_VERSION_CONTROL);
-    }
-
-    // --backup accepts shortened env vars (si for simple)
-    #[test]
-    fn test_backup_mode_long_with_env_var_shortened() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        env::set_var(ENV_VERSION_CONTROL, "si");
-        let matches = make_app().get_matches_from(vec!["command", "--backup"]);
-
-        let result = determine_backup_mode(&matches).unwrap();
-
-        assert_eq!(result, BackupMode::SimpleBackup);
-        env::remove_var(ENV_VERSION_CONTROL);
-    }
-
-    #[test]
-    fn test_suffix_takes_hyphen_value() {
-        let _dummy = TEST_MUTEX.lock().unwrap();
-        let matches = make_app().get_matches_from(vec!["command", "-b", "--suffix", "-v"]);
-
-        let result = determine_backup_suffix(&matches);
-        assert_eq!(result, "-v");
-    }
-    #[test]
-    fn test_source_is_target_backup() {
-        let source = Path::new("data.txt.bak");
-        let target = Path::new("data.txt");
-        let suffix = String::from(".bak");
-
-        assert!(source_is_target_backup(&source, &target, &suffix));
-    }
-
-    #[test]
-    fn test_source_is_not_target_backup() {
-        let source = Path::new("data.txt");
-        let target = Path::new("backup.txt");
-        let suffix = String::from(".bak");
-
-        assert!(!source_is_target_backup(&source, &target, &suffix));
-    }
-
-    #[test]
-    fn test_source_is_target_backup_with_tilde_suffix() {
-        let source = Path::new("example~");
-        let target = Path::new("example");
-        let suffix = String::from("~");
-
-        assert!(source_is_target_backup(&source, &target, &suffix));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/display.rs.html b/coreutils/dev/src/uucore/mods/display.rs.html deleted file mode 100644 index 4a687a80e..000000000 --- a/coreutils/dev/src/uucore/mods/display.rs.html +++ /dev/null @@ -1,139 +0,0 @@ -display.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-
/// Utilities for printing paths, with special attention paid to special
-/// characters and invalid unicode.
-///
-/// For displaying paths in informational messages use `Quotable::quote`. This
-/// will wrap quotes around the filename and add the necessary escapes to make
-/// it copy/paste-able into a shell.
-///
-/// For writing raw paths to stdout when the output should not be quoted or escaped,
-/// use `println_verbatim`. This will preserve invalid unicode.
-///
-/// # Examples
-/// ```
-/// use std::path::Path;
-/// use uucore::display::{Quotable, println_verbatim};
-///
-/// let path = Path::new("foo/bar.baz");
-///
-/// println!("Found file {}", path.quote()); // Prints "Found file 'foo/bar.baz'"
-/// println_verbatim(path)?; // Prints "foo/bar.baz"
-/// # Ok::<(), std::io::Error>(())
-/// ```
-use std::ffi::OsStr;
-use std::io::{self, Write as IoWrite};
-
-#[cfg(unix)]
-use std::os::unix::ffi::OsStrExt;
-#[cfg(target_os = "wasi")]
-use std::os::wasi::ffi::OsStrExt;
-
-// These used to be defined here, but they live in their own crate now.
-pub use os_display::{Quotable, Quoted};
-
-/// Print a path (or `OsStr`-like object) directly to stdout, with a trailing newline,
-/// without losing any information if its encoding is invalid.
-///
-/// This function is appropriate for commands where printing paths is the point and the
-/// output is likely to be captured, like `pwd` and `basename`. For informational output
-/// use `Quotable::quote`.
-///
-/// FIXME: This is lossy on Windows. It could probably be implemented using some low-level
-/// API that takes UTF-16, without going through io::Write. This is not a big priority
-/// because broken filenames are much rarer on Windows than on Unix.
-pub fn println_verbatim<S: AsRef<OsStr>>(text: S) -> io::Result<()> {
-    let stdout = io::stdout();
-    let mut stdout = stdout.lock();
-    #[cfg(any(unix, target_os = "wasi"))]
-    {
-        stdout.write_all(text.as_ref().as_bytes())?;
-        stdout.write_all(b"\n")?;
-    }
-    #[cfg(not(any(unix, target_os = "wasi")))]
-    {
-        writeln!(stdout, "{}", std::path::Path::new(text.as_ref()).display())?;
-    }
-    Ok(())
-}
-
-/// Like `println_verbatim`, without the trailing newline.
-pub fn print_verbatim<S: AsRef<OsStr>>(text: S) -> io::Result<()> {
-    let mut stdout = io::stdout();
-    #[cfg(any(unix, target_os = "wasi"))]
-    {
-        stdout.write_all(text.as_ref().as_bytes())
-    }
-    #[cfg(not(any(unix, target_os = "wasi")))]
-    {
-        write!(stdout, "{}", std::path::Path::new(text.as_ref()).display())
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/error.rs.html b/coreutils/dev/src/uucore/mods/error.rs.html deleted file mode 100644 index d9e779d17..000000000 --- a/coreutils/dev/src/uucore/mods/error.rs.html +++ /dev/null @@ -1,1535 +0,0 @@ -error.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-
// TODO fix broken links
-#![allow(rustdoc::broken_intra_doc_links)]
-//! All utils return exit with an exit code. Usually, the following scheme is used:
-//! * `0`: succeeded
-//! * `1`: minor problems
-//! * `2`: major problems
-//!
-//! This module provides types to reconcile these exit codes with idiomatic Rust error
-//! handling. This has a couple advantages over manually using [`std::process::exit`]:
-//! 1. It enables the use of `?`, `map_err`, `unwrap_or`, etc. in `uumain`.
-//! 1. It encourages the use of [`UResult`]/[`Result`] in functions in the utils.
-//! 1. The error messages are largely standardized across utils.
-//! 1. Standardized error messages can be created from external result types
-//!    (i.e. [`std::io::Result`] & `clap::ClapResult`).
-//! 1. [`set_exit_code`] takes away the burden of manually tracking exit codes for non-fatal errors.
-//!
-//! # Usage
-//! The signature of a typical util should be:
-//! ```ignore
-//! fn uumain(args: impl uucore::Args) -> UResult<()> {
-//!     ...
-//! }
-//! ```
-//! [`UResult`] is a simple wrapper around [`Result`] with a custom error trait: [`UError`]. The
-//! most important difference with types implementing [`std::error::Error`] is that [`UError`]s
-//! can specify the exit code of the program when they are returned from `uumain`:
-//! * When `Ok` is returned, the code set with [`set_exit_code`] is used as exit code. If
-//!   [`set_exit_code`] was not used, then `0` is used.
-//! * When `Err` is returned, the code corresponding with the error is used as exit code and the
-//! error message is displayed.
-//!
-//! Additionally, the errors can be displayed manually with the [`show`] and [`show_if_err`] macros:
-//! ```ignore
-//! let res = Err(USimpleError::new(1, "Error!!"));
-//! show_if_err!(res);
-//! // or
-//! if let Err(e) = res {
-//!    show!(e);
-//! }
-//! ```
-//!
-//! **Note**: The [`show`] and [`show_if_err`] macros set the exit code of the program using
-//! [`set_exit_code`]. See the documentation on that function for more information.
-//!
-//! # Guidelines
-//! * Use error types from `uucore` where possible.
-//! * Add error types to `uucore` if an error appears in multiple utils.
-//! * Prefer proper custom error types over [`ExitCode`] and [`USimpleError`].
-//! * [`USimpleError`] may be used in small utils with simple error handling.
-//! * Using [`ExitCode`] is not recommended but can be useful for converting utils to use
-//!   [`UResult`].
-
-// spell-checker:ignore uioerror rustdoc
-
-use clap;
-use std::{
-    error::Error,
-    fmt::{Display, Formatter},
-    sync::atomic::{AtomicI32, Ordering},
-};
-
-static EXIT_CODE: AtomicI32 = AtomicI32::new(0);
-
-/// Get the last exit code set with [`set_exit_code`].
-/// The default value is `0`.
-pub fn get_exit_code() -> i32 {
-    EXIT_CODE.load(Ordering::SeqCst)
-}
-
-/// Set the exit code for the program if `uumain` returns `Ok(())`.
-///
-/// This function is most useful for non-fatal errors, for example when applying an operation to
-/// multiple files:
-/// ```ignore
-/// use uucore::error::{UResult, set_exit_code};
-///
-/// fn uumain(args: impl uucore::Args) -> UResult<()> {
-///     ...
-///     for file in files {
-///         let res = some_operation_that_might_fail(file);
-///         match res {
-///             Ok() => {},
-///             Err(_) => set_exit_code(1),
-///         }
-///     }
-///     Ok(()) // If any of the operations failed, 1 is returned.
-/// }
-/// ```
-pub fn set_exit_code(code: i32) {
-    EXIT_CODE.store(code, Ordering::SeqCst);
-}
-
-/// Result type that should be returned by all utils.
-pub type UResult<T> = Result<T, Box<dyn UError>>;
-
-/// Custom errors defined by the utils and `uucore`.
-///
-/// All errors should implement [`std::error::Error`], [`std::fmt::Display`] and
-/// [`std::fmt::Debug`] and have an additional `code` method that specifies the
-/// exit code of the program if the error is returned from `uumain`.
-///
-/// An example of a custom error from `ls`:
-///
-/// ```
-/// use uucore::{
-///     display::Quotable,
-///     error::{UError, UResult}
-/// };
-/// use std::{
-///     error::Error,
-///     fmt::{Display, Debug},
-///     path::PathBuf
-/// };
-///
-/// #[derive(Debug)]
-/// enum LsError {
-///     InvalidLineWidth(String),
-///     NoMetadata(PathBuf),
-/// }
-///
-/// impl UError for LsError {
-///     fn code(&self) -> i32 {
-///         match self {
-///             LsError::InvalidLineWidth(_) => 2,
-///             LsError::NoMetadata(_) => 1,
-///         }
-///     }
-/// }
-///
-/// impl Error for LsError {}
-///
-/// impl Display for LsError {
-///     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-///         match self {
-///             LsError::InvalidLineWidth(s) => write!(f, "invalid line width: {}", s.quote()),
-///             LsError::NoMetadata(p) => write!(f, "could not open file: {}", p.quote()),
-///         }
-///     }
-/// }
-/// ```
-///
-/// The main routine would look like this:
-///
-/// ```ignore
-/// #[uucore::main]
-/// pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-///     // Perform computations here ...
-///     return Err(LsError::InvalidLineWidth(String::from("test")).into())
-/// }
-/// ```
-///
-/// The call to `into()` is required to convert the `LsError` to
-/// [`Box<dyn UError>`]. The implementation for `From` is provided automatically.
-///
-/// A crate like [`quick_error`](https://crates.io/crates/quick-error) might
-/// also be used, but will still require an `impl` for the `code` method.
-pub trait UError: Error + Send {
-    /// Error code of a custom error.
-    ///
-    /// Set a return value for each variant of an enum-type to associate an
-    /// error code (which is returned to the system shell) with an error
-    /// variant.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use uucore::{
-    ///     display::Quotable,
-    ///     error::UError
-    /// };
-    /// use std::{
-    ///     error::Error,
-    ///     fmt::{Display, Debug},
-    ///     path::PathBuf
-    /// };
-    ///
-    /// #[derive(Debug)]
-    /// enum MyError {
-    ///     Foo(String),
-    ///     Bar(PathBuf),
-    ///     Bing(),
-    /// }
-    ///
-    /// impl UError for MyError {
-    ///     fn code(&self) -> i32 {
-    ///         match self {
-    ///             MyError::Foo(_) => 2,
-    ///             // All other errors yield the same error code, there's no
-    ///             // need to list them explicitly.
-    ///             _ => 1,
-    ///         }
-    ///     }
-    /// }
-    ///
-    /// impl Error for MyError {}
-    ///
-    /// impl Display for MyError {
-    ///     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-    ///         use MyError as ME;
-    ///         match self {
-    ///             ME::Foo(s) => write!(f, "Unknown Foo: {}", s.quote()),
-    ///             ME::Bar(p) => write!(f, "Couldn't find Bar: {}", p.quote()),
-    ///             ME::Bing() => write!(f, "Exterminate!"),
-    ///         }
-    ///     }
-    /// }
-    /// ```
-    fn code(&self) -> i32 {
-        1
-    }
-
-    /// Print usage help to a custom error.
-    ///
-    /// Return true or false to control whether a short usage help is printed
-    /// below the error message. The usage help is in the format: "Try `{name}
-    /// --help` for more information." and printed only if `true` is returned.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use uucore::{
-    ///     display::Quotable,
-    ///     error::UError
-    /// };
-    /// use std::{
-    ///     error::Error,
-    ///     fmt::{Display, Debug},
-    ///     path::PathBuf
-    /// };
-    ///
-    /// #[derive(Debug)]
-    /// enum MyError {
-    ///     Foo(String),
-    ///     Bar(PathBuf),
-    ///     Bing(),
-    /// }
-    ///
-    /// impl UError for MyError {
-    ///     fn usage(&self) -> bool {
-    ///         match self {
-    ///             // This will have a short usage help appended
-    ///             MyError::Bar(_) => true,
-    ///             // These matches won't have a short usage help appended
-    ///             _ => false,
-    ///         }
-    ///     }
-    /// }
-    ///
-    /// impl Error for MyError {}
-    ///
-    /// impl Display for MyError {
-    ///     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-    ///         use MyError as ME;
-    ///         match self {
-    ///             ME::Foo(s) => write!(f, "Unknown Foo: {}", s.quote()),
-    ///             ME::Bar(p) => write!(f, "Couldn't find Bar: {}", p.quote()),
-    ///             ME::Bing() => write!(f, "Exterminate!"),
-    ///         }
-    ///     }
-    /// }
-    /// ```
-    fn usage(&self) -> bool {
-        false
-    }
-}
-
-impl<T> From<T> for Box<dyn UError>
-where
-    T: UError + 'static,
-{
-    fn from(t: T) -> Self {
-        Box::new(t)
-    }
-}
-
-/// A simple error type with an exit code and a message that implements [`UError`].
-///
-/// ```
-/// use uucore::error::{UResult, USimpleError};
-/// let err = USimpleError { code: 1, message: "error!".into()};
-/// let res: UResult<()> = Err(err.into());
-/// // or using the `new` method:
-/// let res: UResult<()> = Err(USimpleError::new(1, "error!"));
-/// ```
-#[derive(Debug)]
-pub struct USimpleError {
-    pub code: i32,
-    pub message: String,
-}
-
-impl USimpleError {
-    #[allow(clippy::new_ret_no_self)]
-    pub fn new<S: Into<String>>(code: i32, message: S) -> Box<dyn UError> {
-        Box::new(Self {
-            code,
-            message: message.into(),
-        })
-    }
-}
-
-impl Error for USimpleError {}
-
-impl Display for USimpleError {
-    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
-        self.message.fmt(f)
-    }
-}
-
-impl UError for USimpleError {
-    fn code(&self) -> i32 {
-        self.code
-    }
-}
-
-#[derive(Debug)]
-pub struct UUsageError {
-    pub code: i32,
-    pub message: String,
-}
-
-impl UUsageError {
-    #[allow(clippy::new_ret_no_self)]
-    pub fn new<S: Into<String>>(code: i32, message: S) -> Box<dyn UError> {
-        Box::new(Self {
-            code,
-            message: message.into(),
-        })
-    }
-}
-
-impl Error for UUsageError {}
-
-impl Display for UUsageError {
-    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
-        self.message.fmt(f)
-    }
-}
-
-impl UError for UUsageError {
-    fn code(&self) -> i32 {
-        self.code
-    }
-
-    fn usage(&self) -> bool {
-        true
-    }
-}
-
-/// Wrapper type around [`std::io::Error`].
-///
-/// The messages displayed by [`UIoError`] should match the error messages displayed by GNU
-/// coreutils.
-///
-/// There are two ways to construct this type: with [`UIoError::new`] or by calling the
-/// [`FromIo::map_err_context`] method on a [`std::io::Result`] or [`std::io::Error`].
-/// ```
-/// use uucore::{
-///     display::Quotable,
-///     error::{FromIo, UResult, UIoError, UError}
-/// };
-/// use std::fs::File;
-/// use std::path::Path;
-/// let path = Path::new("test.txt");
-///
-/// // Manual construction
-/// let e: Box<dyn UError> = UIoError::new(
-///     std::io::ErrorKind::NotFound,
-///     format!("cannot access {}", path.quote())
-/// );
-/// let res: UResult<()> = Err(e.into());
-///
-/// // Converting from an `std::io::Error`.
-/// let res: UResult<File> = File::open(path).map_err_context(|| format!("cannot access {}", path.quote()));
-/// ```
-#[derive(Debug)]
-pub struct UIoError {
-    context: Option<String>,
-    inner: std::io::Error,
-}
-
-impl UIoError {
-    #[allow(clippy::new_ret_no_self)]
-    pub fn new<S: Into<String>>(kind: std::io::ErrorKind, context: S) -> Box<dyn UError> {
-        Box::new(Self {
-            context: Some(context.into()),
-            inner: kind.into(),
-        })
-    }
-}
-
-impl UError for UIoError {}
-
-impl Error for UIoError {}
-
-impl Display for UIoError {
-    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
-        use std::io::ErrorKind::*;
-
-        let message;
-        let message = if self.inner.raw_os_error().is_some() {
-            // These are errors that come directly from the OS.
-            // We want to normalize their messages across systems,
-            // and we want to strip the "(os error X)" suffix.
-            match self.inner.kind() {
-                NotFound => "No such file or directory",
-                PermissionDenied => "Permission denied",
-                ConnectionRefused => "Connection refused",
-                ConnectionReset => "Connection reset",
-                ConnectionAborted => "Connection aborted",
-                NotConnected => "Not connected",
-                AddrInUse => "Address in use",
-                AddrNotAvailable => "Address not available",
-                BrokenPipe => "Broken pipe",
-                AlreadyExists => "Already exists",
-                WouldBlock => "Would block",
-                InvalidInput => "Invalid input",
-                InvalidData => "Invalid data",
-                TimedOut => "Timed out",
-                WriteZero => "Write zero",
-                Interrupted => "Interrupted",
-                UnexpectedEof => "Unexpected end of file",
-                _ => {
-                    // TODO: When the new error variants
-                    // (https://github.com/rust-lang/rust/issues/86442)
-                    // are stabilized, we should add them to the match statement.
-                    message = strip_errno(&self.inner);
-                    &message
-                }
-            }
-        } else {
-            // These messages don't need as much normalization, and the above
-            // messages wouldn't always be a good substitute.
-            // For example, ErrorKind::NotFound doesn't necessarily mean it was
-            // a file that was not found.
-            // There are also errors with entirely custom messages.
-            message = self.inner.to_string();
-            &message
-        };
-        if let Some(ctx) = &self.context {
-            write!(f, "{ctx}: {message}")
-        } else {
-            write!(f, "{message}")
-        }
-    }
-}
-
-/// Strip the trailing " (os error XX)" from io error strings.
-pub fn strip_errno(err: &std::io::Error) -> String {
-    let mut msg = err.to_string();
-    if let Some(pos) = msg.find(" (os error ") {
-        msg.truncate(pos);
-    }
-    msg
-}
-
-/// Enables the conversion from [`std::io::Error`] to [`UError`] and from [`std::io::Result`] to
-/// [`UResult`].
-pub trait FromIo<T> {
-    fn map_err_context(self, context: impl FnOnce() -> String) -> T;
-}
-
-impl FromIo<Box<UIoError>> for std::io::Error {
-    fn map_err_context(self, context: impl FnOnce() -> String) -> Box<UIoError> {
-        Box::new(UIoError {
-            context: Some((context)()),
-            inner: self,
-        })
-    }
-}
-
-impl<T> FromIo<UResult<T>> for std::io::Result<T> {
-    fn map_err_context(self, context: impl FnOnce() -> String) -> UResult<T> {
-        self.map_err(|e| e.map_err_context(context) as Box<dyn UError>)
-    }
-}
-
-impl FromIo<Box<UIoError>> for std::io::ErrorKind {
-    fn map_err_context(self, context: impl FnOnce() -> String) -> Box<UIoError> {
-        Box::new(UIoError {
-            context: Some((context)()),
-            inner: std::io::Error::new(self, ""),
-        })
-    }
-}
-
-impl From<std::io::Error> for UIoError {
-    fn from(f: std::io::Error) -> Self {
-        Self {
-            context: None,
-            inner: f,
-        }
-    }
-}
-
-impl From<std::io::Error> for Box<dyn UError> {
-    fn from(f: std::io::Error) -> Self {
-        let u_error: UIoError = f.into();
-        Box::new(u_error) as Self
-    }
-}
-
-/// Enables the conversion from [`Result<T, nix::Error>`] to [`UResult<T>`].
-///
-/// # Examples
-///
-/// ```
-/// use uucore::error::FromIo;
-/// use nix::errno::Errno;
-///
-/// let nix_err = Err::<(), nix::Error>(Errno::EACCES);
-/// let uio_result = nix_err.map_err_context(|| String::from("fix me please!"));
-///
-/// // prints "fix me please!: Permission denied"
-/// println!("{}", uio_result.unwrap_err());
-/// ```
-#[cfg(unix)]
-impl<T> FromIo<UResult<T>> for Result<T, nix::Error> {
-    fn map_err_context(self, context: impl FnOnce() -> String) -> UResult<T> {
-        self.map_err(|e| {
-            Box::new(UIoError {
-                context: Some((context)()),
-                inner: std::io::Error::from_raw_os_error(e as i32),
-            }) as Box<dyn UError>
-        })
-    }
-}
-
-#[cfg(unix)]
-impl<T> FromIo<UResult<T>> for nix::Error {
-    fn map_err_context(self, context: impl FnOnce() -> String) -> UResult<T> {
-        Err(Box::new(UIoError {
-            context: Some((context)()),
-            inner: std::io::Error::from_raw_os_error(self as i32),
-        }) as Box<dyn UError>)
-    }
-}
-
-#[cfg(unix)]
-impl From<nix::Error> for UIoError {
-    fn from(f: nix::Error) -> Self {
-        Self {
-            context: None,
-            inner: std::io::Error::from_raw_os_error(f as i32),
-        }
-    }
-}
-
-#[cfg(unix)]
-impl From<nix::Error> for Box<dyn UError> {
-    fn from(f: nix::Error) -> Self {
-        let u_error: UIoError = f.into();
-        Box::new(u_error) as Self
-    }
-}
-
-/// Shorthand to construct [`UIoError`]-instances.
-///
-/// This macro serves as a convenience call to quickly construct instances of
-/// [`UIoError`]. It takes:
-///
-/// - An instance of [`std::io::Error`]
-/// - A `format!`-compatible string and
-/// - An arbitrary number of arguments to the format string
-///
-/// In exactly this order. It is equivalent to the more verbose code seen in the
-/// example.
-///
-/// # Examples
-///
-/// ```
-/// use uucore::error::UIoError;
-/// use uucore::uio_error;
-///
-/// let io_err = std::io::Error::new(
-///     std::io::ErrorKind::PermissionDenied, "fix me please!"
-/// );
-///
-/// let uio_err = UIoError::new(
-///     io_err.kind(),
-///     format!("Error code: {}", 2)
-/// );
-///
-/// let other_uio_err = uio_error!(io_err, "Error code: {}", 2);
-///
-/// // prints "fix me please!: Permission denied"
-/// println!("{}", uio_err);
-/// // prints "Error code: 2: Permission denied"
-/// println!("{}", other_uio_err);
-/// ```
-///
-/// The [`std::fmt::Display`] impl of [`UIoError`] will then ensure that an
-/// appropriate error message relating to the actual error kind of the
-/// [`std::io::Error`] is appended to whatever error message is defined in
-/// addition (as secondary argument).
-///
-/// If you want to show only the error message for the [`std::io::ErrorKind`]
-/// that's contained in [`UIoError`], pass the second argument as empty string:
-///
-/// ```
-/// use uucore::error::UIoError;
-/// use uucore::uio_error;
-///
-/// let io_err = std::io::Error::new(
-///     std::io::ErrorKind::PermissionDenied, "fix me please!"
-/// );
-///
-/// let other_uio_err = uio_error!(io_err, "");
-///
-/// // prints: ": Permission denied"
-/// println!("{}", other_uio_err);
-/// ```
-//#[macro_use]
-#[macro_export]
-macro_rules! uio_error(
-    ($err:expr, $($args:tt)+) => ({
-        UIoError::new(
-            $err.kind(),
-            format!($($args)+)
-        )
-    })
-);
-
-/// A special error type that does not print any message when returned from
-/// `uumain`. Especially useful for porting utilities to using [`UResult`].
-///
-/// There are two ways to construct an [`ExitCode`]:
-/// ```
-/// use uucore::error::{ExitCode, UResult};
-/// // Explicit
-/// let res: UResult<()> = Err(ExitCode(1).into());
-///
-/// // Using into on `i32`:
-/// let res: UResult<()> = Err(1.into());
-/// ```
-/// This type is especially useful for a trivial conversion from utils returning [`i32`] to
-/// returning [`UResult`].
-#[derive(Debug)]
-pub struct ExitCode(pub i32);
-
-impl ExitCode {
-    #[allow(clippy::new_ret_no_self)]
-    pub fn new(code: i32) -> Box<dyn UError> {
-        Box::new(Self(code))
-    }
-}
-
-impl Error for ExitCode {}
-
-impl Display for ExitCode {
-    fn fmt(&self, _: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
-        Ok(())
-    }
-}
-
-impl UError for ExitCode {
-    fn code(&self) -> i32 {
-        self.0
-    }
-}
-
-impl From<i32> for Box<dyn UError> {
-    fn from(i: i32) -> Self {
-        ExitCode::new(i)
-    }
-}
-
-/// A wrapper for `clap::Error` that implements [`UError`]
-///
-/// Contains a custom error code. When `Display::fmt` is called on this struct
-/// the [`clap::Error`] will be printed _directly to `stdout` or `stderr`_.
-/// This is because `clap` only supports colored output when it prints directly.
-///
-/// [`ClapErrorWrapper`] is generally created by calling the
-/// [`UClapError::with_exit_code`] method on [`clap::Error`] or using the [`From`]
-/// implementation from [`clap::Error`] to `Box<dyn UError>`, which constructs
-/// a [`ClapErrorWrapper`] with an exit code of `1`.
-///
-/// ```rust
-/// use uucore::error::{ClapErrorWrapper, UError, UClapError};
-/// let command = clap::Command::new("test");
-/// let result: Result<_, ClapErrorWrapper> = command.try_get_matches().with_exit_code(125);
-///
-/// let command = clap::Command::new("test");
-/// let result: Result<_, Box<dyn UError>> = command.try_get_matches().map_err(Into::into);
-/// ```
-#[derive(Debug)]
-pub struct ClapErrorWrapper {
-    code: i32,
-    error: clap::Error,
-}
-
-/// Extension trait for `clap::Error` to adjust the exit code.
-pub trait UClapError<T> {
-    fn with_exit_code(self, code: i32) -> T;
-}
-
-impl From<clap::Error> for Box<dyn UError> {
-    fn from(e: clap::Error) -> Self {
-        Box::new(ClapErrorWrapper { code: 1, error: e })
-    }
-}
-
-impl UClapError<ClapErrorWrapper> for clap::Error {
-    fn with_exit_code(self, code: i32) -> ClapErrorWrapper {
-        ClapErrorWrapper { code, error: self }
-    }
-}
-
-impl UClapError<Result<clap::ArgMatches, ClapErrorWrapper>>
-    for Result<clap::ArgMatches, clap::Error>
-{
-    fn with_exit_code(self, code: i32) -> Result<clap::ArgMatches, ClapErrorWrapper> {
-        self.map_err(|e| e.with_exit_code(code))
-    }
-}
-
-impl UError for ClapErrorWrapper {
-    fn code(&self) -> i32 {
-        // If the error is a DisplayHelp or DisplayVersion variant,
-        // we don't want to apply the custom error code, but leave
-        // it 0.
-        if let clap::error::ErrorKind::DisplayHelp | clap::error::ErrorKind::DisplayVersion =
-            self.error.kind()
-        {
-            0
-        } else {
-            self.code
-        }
-    }
-}
-
-impl Error for ClapErrorWrapper {}
-
-// This is abuse of the Display trait
-impl Display for ClapErrorWrapper {
-    fn fmt(&self, _f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
-        self.error.print().unwrap();
-        Ok(())
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    #[test]
-    #[cfg(unix)]
-    fn test_nix_error_conversion() {
-        use super::{FromIo, UIoError};
-        use nix::errno::Errno;
-        use std::io::ErrorKind;
-
-        for (nix_error, expected_error_kind) in [
-            (Errno::EACCES, ErrorKind::PermissionDenied),
-            (Errno::ENOENT, ErrorKind::NotFound),
-            (Errno::EEXIST, ErrorKind::AlreadyExists),
-        ] {
-            let error = UIoError::from(nix_error);
-            assert_eq!(expected_error_kind, error.inner.kind());
-        }
-        assert_eq!(
-            "test: Permission denied",
-            Err::<(), nix::Error>(Errno::EACCES)
-                .map_err_context(|| String::from("test"))
-                .unwrap_err()
-                .to_string()
-        );
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/line_ending.rs.html b/coreutils/dev/src/uucore/mods/line_ending.rs.html deleted file mode 100644 index f5d32e872..000000000 --- a/coreutils/dev/src/uucore/mods/line_ending.rs.html +++ /dev/null @@ -1,99 +0,0 @@ -line_ending.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-
//! Provides consistent newline/zero terminator handling for `-z`/`--zero` flags.
-//!
-//! See the [`LineEnding`] struct for more information.
-use std::fmt::Display;
-
-/// Line ending of either `\n` or `\0`
-///
-/// Used by various utilities that have the option to separate lines by nul
-/// characters instead of `\n`. Usually, this is specified with the `-z` or
-/// `--zero` flag.
-///
-/// The [`Display`] implementation writes the character corresponding to the
-/// variant to the formatter.
-#[repr(u8)]
-#[derive(Clone, Copy, Debug, Default, PartialEq)]
-pub enum LineEnding {
-    #[default]
-    Newline = b'\n',
-    Nul = 0,
-}
-
-impl Display for LineEnding {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            Self::Newline => writeln!(f),
-            Self::Nul => write!(f, "\0"),
-        }
-    }
-}
-
-impl From<LineEnding> for u8 {
-    fn from(line_ending: LineEnding) -> Self {
-        line_ending as Self
-    }
-}
-
-impl LineEnding {
-    /// Create a [`LineEnding`] from a `-z`/`--zero` flag
-    ///
-    /// If `is_zero_terminated` is true, [`LineEnding::Nul`] is returned,
-    /// otherwise [`LineEnding::Newline`].
-    pub fn from_zero_flag(is_zero_terminated: bool) -> Self {
-        if is_zero_terminated {
-            Self::Nul
-        } else {
-            Self::Newline
-        }
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/os.rs.html b/coreutils/dev/src/uucore/mods/os.rs.html deleted file mode 100644 index 3fea24df3..000000000 --- a/coreutils/dev/src/uucore/mods/os.rs.html +++ /dev/null @@ -1,67 +0,0 @@ -os.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-
/// Test if the program is running under WSL
-// ref: <https://github.com/microsoft/WSL/issues/4555> @@ <https://archive.is/dP0bz>
-
-// spell-checker:ignore (path) osrelease
-
-pub fn is_wsl_1() -> bool {
-    #[cfg(target_os = "linux")]
-    {
-        if is_wsl_2() {
-            return false;
-        }
-        if let Ok(b) = std::fs::read("/proc/sys/kernel/osrelease") {
-            if let Ok(s) = std::str::from_utf8(&b) {
-                let a = s.to_ascii_lowercase();
-                return a.contains("microsoft") || a.contains("wsl");
-            }
-        }
-    }
-    false
-}
-
-pub fn is_wsl_2() -> bool {
-    #[cfg(target_os = "linux")]
-    {
-        if let Ok(b) = std::fs::read("/proc/sys/kernel/osrelease") {
-            if let Ok(s) = std::str::from_utf8(&b) {
-                let a = s.to_ascii_lowercase();
-                return a.contains("wsl2");
-            }
-        }
-    }
-    false
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/panic.rs.html b/coreutils/dev/src/uucore/mods/panic.rs.html deleted file mode 100644 index bb2fa60b7..000000000 --- a/coreutils/dev/src/uucore/mods/panic.rs.html +++ /dev/null @@ -1,85 +0,0 @@ -panic.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-
//! Custom panic hooks that allow silencing certain types of errors.
-//!
-//! Use the [`mute_sigpipe_panic`] function to silence panics caused by
-//! broken pipe errors. This can happen when a process is still
-//! producing data when the consuming process terminates and closes the
-//! pipe. For example,
-//!
-//! ```sh
-//! $ seq inf | head -n 1
-//! ```
-//!
-use std::panic;
-use std::panic::PanicInfo;
-
-/// Decide whether a panic was caused by a broken pipe (SIGPIPE) error.
-fn is_broken_pipe(info: &PanicInfo) -> bool {
-    if let Some(res) = info.payload().downcast_ref::<String>() {
-        if res.contains("BrokenPipe") || res.contains("Broken pipe") {
-            return true;
-        }
-    }
-    false
-}
-
-/// Terminate without error on panics that occur due to broken pipe errors.
-///
-/// For background discussions on `SIGPIPE` handling, see
-///
-/// * `<https://github.com/uutils/coreutils/issues/374>`
-/// * `<https://github.com/uutils/coreutils/pull/1106>`
-/// * `<https://github.com/rust-lang/rust/issues/62569>`
-/// * `<https://github.com/BurntSushi/ripgrep/issues/200>`
-/// * `<https://github.com/crev-dev/cargo-crev/issues/287>`
-///
-pub fn mute_sigpipe_panic() {
-    let hook = panic::take_hook();
-    panic::set_hook(Box::new(move |info| {
-        if !is_broken_pipe(info) {
-            hook(info);
-        }
-    }));
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/quoting_style.rs.html b/coreutils/dev/src/uucore/mods/quoting_style.rs.html deleted file mode 100644 index 437ac16a6..000000000 --- a/coreutils/dev/src/uucore/mods/quoting_style.rs.html +++ /dev/null @@ -1,1463 +0,0 @@ -quoting_style.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-
use std::char::from_digit;
-use std::ffi::OsStr;
-
-// These are characters with special meaning in the shell (e.g. bash).
-// The first const contains characters that only have a special meaning when they appear at the beginning of a name.
-const SPECIAL_SHELL_CHARS_START: &[char] = &['~', '#'];
-const SPECIAL_SHELL_CHARS: &str = "`$&*()|[]{};\\'\"<>?! ";
-
-pub enum QuotingStyle {
-    Shell {
-        escape: bool,
-        always_quote: bool,
-        show_control: bool,
-    },
-    C {
-        quotes: Quotes,
-    },
-    Literal {
-        show_control: bool,
-    },
-}
-
-#[derive(Clone, Copy)]
-pub enum Quotes {
-    None,
-    Single,
-    Double,
-    // TODO: Locale
-}
-
-// This implementation is heavily inspired by the std::char::EscapeDefault implementation
-// in the Rust standard library. This custom implementation is needed because the
-// characters \a, \b, \e, \f & \v are not recognized by Rust.
-struct EscapedChar {
-    state: EscapeState,
-}
-
-enum EscapeState {
-    Done,
-    Char(char),
-    Backslash(char),
-    ForceQuote(char),
-    Octal(EscapeOctal),
-}
-
-struct EscapeOctal {
-    c: char,
-    state: EscapeOctalState,
-    idx: usize,
-}
-
-enum EscapeOctalState {
-    Done,
-    Backslash,
-    Value,
-}
-
-impl Iterator for EscapeOctal {
-    type Item = char;
-
-    fn next(&mut self) -> Option<char> {
-        match self.state {
-            EscapeOctalState::Done => None,
-            EscapeOctalState::Backslash => {
-                self.state = EscapeOctalState::Value;
-                Some('\\')
-            }
-            EscapeOctalState::Value => {
-                let octal_digit = ((self.c as u32) >> (self.idx * 3)) & 0o7;
-                if self.idx == 0 {
-                    self.state = EscapeOctalState::Done;
-                } else {
-                    self.idx -= 1;
-                }
-                Some(from_digit(octal_digit, 8).unwrap())
-            }
-        }
-    }
-}
-
-impl EscapeOctal {
-    fn from(c: char) -> Self {
-        Self {
-            c,
-            idx: 2,
-            state: EscapeOctalState::Backslash,
-        }
-    }
-}
-
-impl EscapedChar {
-    fn new_literal(c: char) -> Self {
-        Self {
-            state: EscapeState::Char(c),
-        }
-    }
-
-    fn new_c(c: char, quotes: Quotes) -> Self {
-        use EscapeState::*;
-        let init_state = match c {
-            '\x07' => Backslash('a'),
-            '\x08' => Backslash('b'),
-            '\t' => Backslash('t'),
-            '\n' => Backslash('n'),
-            '\x0B' => Backslash('v'),
-            '\x0C' => Backslash('f'),
-            '\r' => Backslash('r'),
-            '\\' => Backslash('\\'),
-            '\'' => match quotes {
-                Quotes::Single => Backslash('\''),
-                _ => Char('\''),
-            },
-            '"' => match quotes {
-                Quotes::Double => Backslash('"'),
-                _ => Char('"'),
-            },
-            ' ' => match quotes {
-                Quotes::None => Backslash(' '),
-                _ => Char(' '),
-            },
-            _ if c.is_ascii_control() => Octal(EscapeOctal::from(c)),
-            _ => Char(c),
-        };
-        Self { state: init_state }
-    }
-
-    fn new_shell(c: char, escape: bool, quotes: Quotes) -> Self {
-        use EscapeState::*;
-        let init_state = match c {
-            _ if !escape && c.is_control() => Char(c),
-            '\x07' => Backslash('a'),
-            '\x08' => Backslash('b'),
-            '\t' => Backslash('t'),
-            '\n' => Backslash('n'),
-            '\x0B' => Backslash('v'),
-            '\x0C' => Backslash('f'),
-            '\r' => Backslash('r'),
-            '\x00'..='\x1F' | '\x7F' => Octal(EscapeOctal::from(c)),
-            '\'' => match quotes {
-                Quotes::Single => Backslash('\''),
-                _ => Char('\''),
-            },
-            _ if SPECIAL_SHELL_CHARS.contains(c) => ForceQuote(c),
-            _ => Char(c),
-        };
-        Self { state: init_state }
-    }
-
-    fn hide_control(self) -> Self {
-        match self.state {
-            EscapeState::Char(c) if c.is_control() => Self {
-                state: EscapeState::Char('?'),
-            },
-            _ => self,
-        }
-    }
-}
-
-impl Iterator for EscapedChar {
-    type Item = char;
-
-    fn next(&mut self) -> Option<char> {
-        match self.state {
-            EscapeState::Backslash(c) => {
-                self.state = EscapeState::Char(c);
-                Some('\\')
-            }
-            EscapeState::Char(c) | EscapeState::ForceQuote(c) => {
-                self.state = EscapeState::Done;
-                Some(c)
-            }
-            EscapeState::Done => None,
-            EscapeState::Octal(ref mut iter) => iter.next(),
-        }
-    }
-}
-
-fn shell_without_escape(name: &str, quotes: Quotes, show_control_chars: bool) -> (String, bool) {
-    let mut must_quote = false;
-    let mut escaped_str = String::with_capacity(name.len());
-
-    for c in name.chars() {
-        let escaped = {
-            let ec = EscapedChar::new_shell(c, false, quotes);
-            if show_control_chars {
-                ec
-            } else {
-                ec.hide_control()
-            }
-        };
-
-        match escaped.state {
-            EscapeState::Backslash('\'') => escaped_str.push_str("'\\''"),
-            EscapeState::ForceQuote(x) => {
-                must_quote = true;
-                escaped_str.push(x);
-            }
-            _ => {
-                for char in escaped {
-                    escaped_str.push(char);
-                }
-            }
-        }
-    }
-
-    must_quote = must_quote || name.starts_with(SPECIAL_SHELL_CHARS_START);
-    (escaped_str, must_quote)
-}
-
-fn shell_with_escape(name: &str, quotes: Quotes) -> (String, bool) {
-    // We need to keep track of whether we are in a dollar expression
-    // because e.g. \b\n is escaped as $'\b\n' and not like $'b'$'n'
-    let mut in_dollar = false;
-    let mut must_quote = false;
-    let mut escaped_str = String::with_capacity(name.len());
-
-    for c in name.chars() {
-        let escaped = EscapedChar::new_shell(c, true, quotes);
-        match escaped.state {
-            EscapeState::Char(x) => {
-                if in_dollar {
-                    escaped_str.push_str("''");
-                    in_dollar = false;
-                }
-                escaped_str.push(x);
-            }
-            EscapeState::ForceQuote(x) => {
-                if in_dollar {
-                    escaped_str.push_str("''");
-                    in_dollar = false;
-                }
-                must_quote = true;
-                escaped_str.push(x);
-            }
-            // Single quotes are not put in dollar expressions, but are escaped
-            // if the string also contains double quotes. In that case, they must
-            // be handled separately.
-            EscapeState::Backslash('\'') => {
-                must_quote = true;
-                in_dollar = false;
-                escaped_str.push_str("'\\''");
-            }
-            _ => {
-                if !in_dollar {
-                    escaped_str.push_str("'$'");
-                    in_dollar = true;
-                }
-                must_quote = true;
-                for char in escaped {
-                    escaped_str.push(char);
-                }
-            }
-        }
-    }
-    must_quote = must_quote || name.starts_with(SPECIAL_SHELL_CHARS_START);
-    (escaped_str, must_quote)
-}
-
-pub fn escape_name(name: &OsStr, style: &QuotingStyle) -> String {
-    match style {
-        QuotingStyle::Literal { show_control } => {
-            if *show_control {
-                name.to_string_lossy().into_owned()
-            } else {
-                name.to_string_lossy()
-                    .chars()
-                    .flat_map(|c| EscapedChar::new_literal(c).hide_control())
-                    .collect()
-            }
-        }
-        QuotingStyle::C { quotes } => {
-            let escaped_str: String = name
-                .to_string_lossy()
-                .chars()
-                .flat_map(|c| EscapedChar::new_c(c, *quotes))
-                .collect();
-
-            match quotes {
-                Quotes::Single => format!("'{escaped_str}'"),
-                Quotes::Double => format!("\"{escaped_str}\""),
-                Quotes::None => escaped_str,
-            }
-        }
-        QuotingStyle::Shell {
-            escape,
-            always_quote,
-            show_control,
-        } => {
-            let name = name.to_string_lossy();
-            let (quotes, must_quote) = if name.contains(&['"', '`', '$', '\\'][..]) {
-                (Quotes::Single, true)
-            } else if name.contains('\'') {
-                (Quotes::Double, true)
-            } else if *always_quote {
-                (Quotes::Single, true)
-            } else {
-                (Quotes::Single, false)
-            };
-
-            let (escaped_str, contains_quote_chars) = if *escape {
-                shell_with_escape(&name, quotes)
-            } else {
-                shell_without_escape(&name, quotes, *show_control)
-            };
-
-            match (must_quote | contains_quote_chars, quotes) {
-                (true, Quotes::Single) => format!("'{escaped_str}'"),
-                (true, Quotes::Double) => format!("\"{escaped_str}\""),
-                _ => escaped_str,
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::quoting_style::{escape_name, Quotes, QuotingStyle};
-
-    // spell-checker:ignore (tests/words) one\'two one'two
-
-    fn get_style(s: &str) -> QuotingStyle {
-        match s {
-            "literal" => QuotingStyle::Literal {
-                show_control: false,
-            },
-            "literal-show" => QuotingStyle::Literal { show_control: true },
-            "escape" => QuotingStyle::C {
-                quotes: Quotes::None,
-            },
-            "c" => QuotingStyle::C {
-                quotes: Quotes::Double,
-            },
-            "shell" => QuotingStyle::Shell {
-                escape: false,
-                always_quote: false,
-                show_control: false,
-            },
-            "shell-show" => QuotingStyle::Shell {
-                escape: false,
-                always_quote: false,
-                show_control: true,
-            },
-            "shell-always" => QuotingStyle::Shell {
-                escape: false,
-                always_quote: true,
-                show_control: false,
-            },
-            "shell-always-show" => QuotingStyle::Shell {
-                escape: false,
-                always_quote: true,
-                show_control: true,
-            },
-            "shell-escape" => QuotingStyle::Shell {
-                escape: true,
-                always_quote: false,
-                show_control: false,
-            },
-            "shell-escape-always" => QuotingStyle::Shell {
-                escape: true,
-                always_quote: true,
-                show_control: false,
-            },
-            _ => panic!("Invalid name!"),
-        }
-    }
-
-    fn check_names(name: &str, map: &[(&str, &str)]) {
-        assert_eq!(
-            map.iter()
-                .map(|(_, style)| escape_name(name.as_ref(), &get_style(style)))
-                .collect::<Vec<String>>(),
-            map.iter()
-                .map(|(correct, _)| correct.to_string())
-                .collect::<Vec<String>>()
-        );
-    }
-
-    #[test]
-    fn test_simple_names() {
-        check_names(
-            "one_two",
-            &[
-                ("one_two", "literal"),
-                ("one_two", "literal-show"),
-                ("one_two", "escape"),
-                ("\"one_two\"", "c"),
-                ("one_two", "shell"),
-                ("one_two", "shell-show"),
-                ("\'one_two\'", "shell-always"),
-                ("\'one_two\'", "shell-always-show"),
-                ("one_two", "shell-escape"),
-                ("\'one_two\'", "shell-escape-always"),
-            ],
-        );
-    }
-
-    #[test]
-    fn test_spaces() {
-        check_names(
-            "one two",
-            &[
-                ("one two", "literal"),
-                ("one two", "literal-show"),
-                ("one\\ two", "escape"),
-                ("\"one two\"", "c"),
-                ("\'one two\'", "shell"),
-                ("\'one two\'", "shell-show"),
-                ("\'one two\'", "shell-always"),
-                ("\'one two\'", "shell-always-show"),
-                ("\'one two\'", "shell-escape"),
-                ("\'one two\'", "shell-escape-always"),
-            ],
-        );
-
-        check_names(
-            " one",
-            &[
-                (" one", "literal"),
-                (" one", "literal-show"),
-                ("\\ one", "escape"),
-                ("\" one\"", "c"),
-                ("' one'", "shell"),
-                ("' one'", "shell-show"),
-                ("' one'", "shell-always"),
-                ("' one'", "shell-always-show"),
-                ("' one'", "shell-escape"),
-                ("' one'", "shell-escape-always"),
-            ],
-        );
-    }
-
-    #[test]
-    fn test_quotes() {
-        // One double quote
-        check_names(
-            "one\"two",
-            &[
-                ("one\"two", "literal"),
-                ("one\"two", "literal-show"),
-                ("one\"two", "escape"),
-                ("\"one\\\"two\"", "c"),
-                ("'one\"two'", "shell"),
-                ("'one\"two'", "shell-show"),
-                ("'one\"two'", "shell-always"),
-                ("'one\"two'", "shell-always-show"),
-                ("'one\"two'", "shell-escape"),
-                ("'one\"two'", "shell-escape-always"),
-            ],
-        );
-
-        // One single quote
-        check_names(
-            "one\'two",
-            &[
-                ("one'two", "literal"),
-                ("one'two", "literal-show"),
-                ("one'two", "escape"),
-                ("\"one'two\"", "c"),
-                ("\"one'two\"", "shell"),
-                ("\"one'two\"", "shell-show"),
-                ("\"one'two\"", "shell-always"),
-                ("\"one'two\"", "shell-always-show"),
-                ("\"one'two\"", "shell-escape"),
-                ("\"one'two\"", "shell-escape-always"),
-            ],
-        );
-
-        // One single quote and one double quote
-        check_names(
-            "one'two\"three",
-            &[
-                ("one'two\"three", "literal"),
-                ("one'two\"three", "literal-show"),
-                ("one'two\"three", "escape"),
-                ("\"one'two\\\"three\"", "c"),
-                ("'one'\\''two\"three'", "shell"),
-                ("'one'\\''two\"three'", "shell-show"),
-                ("'one'\\''two\"three'", "shell-always"),
-                ("'one'\\''two\"three'", "shell-always-show"),
-                ("'one'\\''two\"three'", "shell-escape"),
-                ("'one'\\''two\"three'", "shell-escape-always"),
-            ],
-        );
-
-        // Consecutive quotes
-        check_names(
-            "one''two\"\"three",
-            &[
-                ("one''two\"\"three", "literal"),
-                ("one''two\"\"three", "literal-show"),
-                ("one''two\"\"three", "escape"),
-                ("\"one''two\\\"\\\"three\"", "c"),
-                ("'one'\\'''\\''two\"\"three'", "shell"),
-                ("'one'\\'''\\''two\"\"three'", "shell-show"),
-                ("'one'\\'''\\''two\"\"three'", "shell-always"),
-                ("'one'\\'''\\''two\"\"three'", "shell-always-show"),
-                ("'one'\\'''\\''two\"\"three'", "shell-escape"),
-                ("'one'\\'''\\''two\"\"three'", "shell-escape-always"),
-            ],
-        );
-    }
-
-    #[test]
-    fn test_control_chars() {
-        // A simple newline
-        check_names(
-            "one\ntwo",
-            &[
-                ("one?two", "literal"),
-                ("one\ntwo", "literal-show"),
-                ("one\\ntwo", "escape"),
-                ("\"one\\ntwo\"", "c"),
-                ("one?two", "shell"),
-                ("one\ntwo", "shell-show"),
-                ("'one?two'", "shell-always"),
-                ("'one\ntwo'", "shell-always-show"),
-                ("'one'$'\\n''two'", "shell-escape"),
-                ("'one'$'\\n''two'", "shell-escape-always"),
-            ],
-        );
-
-        // A control character followed by a special shell character
-        check_names(
-            "one\n&two",
-            &[
-                ("one?&two", "literal"),
-                ("one\n&two", "literal-show"),
-                ("one\\n&two", "escape"),
-                ("\"one\\n&two\"", "c"),
-                ("'one?&two'", "shell"),
-                ("'one\n&two'", "shell-show"),
-                ("'one?&two'", "shell-always"),
-                ("'one\n&two'", "shell-always-show"),
-                ("'one'$'\\n''&two'", "shell-escape"),
-                ("'one'$'\\n''&two'", "shell-escape-always"),
-            ],
-        );
-
-        // The first 16 control characters. NUL is also included, even though it is of
-        // no importance for file names.
-        check_names(
-            "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
-            &[
-                ("????????????????", "literal"),
-                (
-                    "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
-                    "literal-show",
-                ),
-                (
-                    "\\000\\001\\002\\003\\004\\005\\006\\a\\b\\t\\n\\v\\f\\r\\016\\017",
-                    "escape",
-                ),
-                (
-                    "\"\\000\\001\\002\\003\\004\\005\\006\\a\\b\\t\\n\\v\\f\\r\\016\\017\"",
-                    "c",
-                ),
-                ("????????????????", "shell"),
-                (
-                    "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
-                    "shell-show",
-                ),
-                ("'????????????????'", "shell-always"),
-                (
-                    "'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F'",
-                    "shell-always-show",
-                ),
-                (
-                    "''$'\\000\\001\\002\\003\\004\\005\\006\\a\\b\\t\\n\\v\\f\\r\\016\\017'",
-                    "shell-escape",
-                ),
-                (
-                    "''$'\\000\\001\\002\\003\\004\\005\\006\\a\\b\\t\\n\\v\\f\\r\\016\\017'",
-                    "shell-escape-always",
-                ),
-            ],
-        );
-
-        // The last 16 control characters.
-        check_names(
-            "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F",
-            &[
-                ("????????????????", "literal"),
-                (
-                    "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F",
-                    "literal-show",
-                ),
-                (
-                    "\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037",
-                    "escape",
-                ),
-                (
-                    "\"\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037\"",
-                    "c",
-                ),
-                ("????????????????", "shell"),
-                (
-                    "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F",
-                    "shell-show",
-                ),
-                ("'????????????????'", "shell-always"),
-                (
-                    "'\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F'",
-                    "shell-always-show",
-                ),
-                (
-                    "''$'\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037'",
-                    "shell-escape",
-                ),
-                (
-                    "''$'\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037'",
-                    "shell-escape-always",
-                ),
-            ],
-        );
-
-        // DEL
-        check_names(
-            "\x7F",
-            &[
-                ("?", "literal"),
-                ("\x7F", "literal-show"),
-                ("\\177", "escape"),
-                ("\"\\177\"", "c"),
-                ("?", "shell"),
-                ("\x7F", "shell-show"),
-                ("'?'", "shell-always"),
-                ("'\x7F'", "shell-always-show"),
-                ("''$'\\177'", "shell-escape"),
-                ("''$'\\177'", "shell-escape-always"),
-            ],
-        );
-    }
-
-    #[test]
-    fn test_question_mark() {
-        // A question mark must force quotes in shell and shell-always, unless
-        // it is in place of a control character (that case is already covered
-        // in other tests)
-        check_names(
-            "one?two",
-            &[
-                ("one?two", "literal"),
-                ("one?two", "literal-show"),
-                ("one?two", "escape"),
-                ("\"one?two\"", "c"),
-                ("'one?two'", "shell"),
-                ("'one?two'", "shell-show"),
-                ("'one?two'", "shell-always"),
-                ("'one?two'", "shell-always-show"),
-                ("'one?two'", "shell-escape"),
-                ("'one?two'", "shell-escape-always"),
-            ],
-        );
-    }
-
-    #[test]
-    fn test_backslash() {
-        // Escaped in C-style, but not in Shell-style escaping
-        check_names(
-            "one\\two",
-            &[
-                ("one\\two", "literal"),
-                ("one\\two", "literal-show"),
-                ("one\\\\two", "escape"),
-                ("\"one\\\\two\"", "c"),
-                ("'one\\two'", "shell"),
-                ("\'one\\two\'", "shell-always"),
-                ("'one\\two'", "shell-escape"),
-                ("'one\\two'", "shell-escape-always"),
-            ],
-        );
-    }
-
-    #[test]
-    fn test_tilde_and_hash() {
-        check_names("~", &[("'~'", "shell"), ("'~'", "shell-escape")]);
-        check_names(
-            "~name",
-            &[("'~name'", "shell"), ("'~name'", "shell-escape")],
-        );
-        check_names(
-            "some~name",
-            &[("some~name", "shell"), ("some~name", "shell-escape")],
-        );
-        check_names("name~", &[("name~", "shell"), ("name~", "shell-escape")]);
-
-        check_names("#", &[("'#'", "shell"), ("'#'", "shell-escape")]);
-        check_names(
-            "#name",
-            &[("'#name'", "shell"), ("'#name'", "shell-escape")],
-        );
-        check_names(
-            "some#name",
-            &[("some#name", "shell"), ("some#name", "shell-escape")],
-        );
-        check_names("name#", &[("name#", "shell"), ("name#", "shell-escape")]);
-    }
-
-    #[test]
-    fn test_special_chars_in_double_quotes() {
-        check_names(
-            "can'$t",
-            &[
-                ("'can'\\''$t'", "shell"),
-                ("'can'\\''$t'", "shell-always"),
-                ("'can'\\''$t'", "shell-escape"),
-                ("'can'\\''$t'", "shell-escape-always"),
-            ],
-        );
-
-        check_names(
-            "can'`t",
-            &[
-                ("'can'\\''`t'", "shell"),
-                ("'can'\\''`t'", "shell-always"),
-                ("'can'\\''`t'", "shell-escape"),
-                ("'can'\\''`t'", "shell-escape-always"),
-            ],
-        );
-
-        check_names(
-            "can'\\t",
-            &[
-                ("'can'\\''\\t'", "shell"),
-                ("'can'\\''\\t'", "shell-always"),
-                ("'can'\\''\\t'", "shell-escape"),
-                ("'can'\\''\\t'", "shell-escape-always"),
-            ],
-        );
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/ranges.rs.html b/coreutils/dev/src/uucore/mods/ranges.rs.html deleted file mode 100644 index ac22e7cd8..000000000 --- a/coreutils/dev/src/uucore/mods/ranges.rs.html +++ /dev/null @@ -1,469 +0,0 @@ -ranges.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-
// This file is part of the uutils coreutils package.
-//
-// (c) Rolf Morel <rolfmorel@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) inval
-
-use std::cmp::max;
-use std::str::FromStr;
-
-use crate::display::Quotable;
-
-#[derive(PartialEq, Eq, PartialOrd, Ord, Debug)]
-pub struct Range {
-    pub low: usize,
-    pub high: usize,
-}
-
-impl FromStr for Range {
-    type Err = &'static str;
-
-    /// Parse a string of the form `a-b` into a `Range`
-    ///
-    /// ```
-    /// use std::str::FromStr;
-    /// use uucore::ranges::Range;
-    /// assert_eq!(Range::from_str("5"), Ok(Range { low: 5, high: 5 }));
-    /// assert_eq!(Range::from_str("4-"), Ok(Range { low: 4, high: usize::MAX - 1 }));
-    /// assert_eq!(Range::from_str("-4"), Ok(Range { low: 1, high: 4 }));
-    /// assert_eq!(Range::from_str("2-4"), Ok(Range { low: 2, high: 4 }));
-    /// assert!(Range::from_str("0-4").is_err());
-    /// assert!(Range::from_str("4-2").is_err());
-    /// assert!(Range::from_str("-").is_err());
-    /// assert!(Range::from_str("a").is_err());
-    /// assert!(Range::from_str("a-b").is_err());
-    /// ```
-    fn from_str(s: &str) -> Result<Self, &'static str> {
-        fn parse(s: &str) -> Result<usize, &'static str> {
-            match s.parse::<usize>() {
-                Ok(0) => Err("fields and positions are numbered from 1"),
-                Ok(n) => Ok(n),
-                Err(_) => Err("failed to parse range"),
-            }
-        }
-
-        Ok(match s.split_once('-') {
-            None => {
-                let n = parse(s)?;
-                Self { low: n, high: n }
-            }
-            Some(("", "")) => return Err("invalid range with no endpoint"),
-            Some((low, "")) => Self {
-                low: parse(low)?,
-                high: usize::MAX - 1,
-            },
-            Some(("", high)) => Self {
-                low: 1,
-                high: parse(high)?,
-            },
-            Some((low, high)) => {
-                let (low, high) = (parse(low)?, parse(high)?);
-                if low <= high {
-                    Self { low, high }
-                } else {
-                    return Err("high end of range less than low end");
-                }
-            }
-        })
-    }
-}
-
-impl Range {
-    pub fn from_list(list: &str) -> Result<Vec<Self>, String> {
-        let mut ranges = Vec::new();
-
-        for item in list.split(&[',', ' ']) {
-            let range_item = FromStr::from_str(item)
-                .map_err(|e| format!("range {} was invalid: {}", item.quote(), e))?;
-            ranges.push(range_item);
-        }
-
-        Ok(Self::merge(ranges))
-    }
-
-    /// Merge any overlapping ranges
-    ///
-    /// Is guaranteed to return only disjoint ranges in a sorted order.
-    fn merge(mut ranges: Vec<Self>) -> Vec<Self> {
-        ranges.sort();
-
-        // merge overlapping ranges
-        for i in 0..ranges.len() {
-            let j = i + 1;
-
-            // The +1 is a small optimization, because we can merge adjacent Ranges.
-            // For example (1,3) and (4,6), because in the integers, there are no
-            // possible values between 3 and 4, this is equivalent to (1,6).
-            while j < ranges.len() && ranges[j].low <= ranges[i].high + 1 {
-                let j_high = ranges.remove(j).high;
-                ranges[i].high = max(ranges[i].high, j_high);
-            }
-        }
-        ranges
-    }
-}
-
-pub fn complement(ranges: &[Range]) -> Vec<Range> {
-    let mut prev_high = 0;
-    let mut complements = Vec::with_capacity(ranges.len() + 1);
-
-    for range in ranges {
-        if range.low > prev_high + 1 {
-            complements.push(Range {
-                low: prev_high + 1,
-                high: range.low - 1,
-            });
-        }
-        prev_high = range.high;
-    }
-
-    if prev_high < usize::MAX - 1 {
-        complements.push(Range {
-            low: prev_high + 1,
-            high: usize::MAX - 1,
-        });
-    }
-
-    complements
-}
-
-/// Test if at least one of the given Ranges contain the supplied value.
-///
-/// Examples:
-///
-/// ```
-/// let ranges = uucore::ranges::Range::from_list("11,2,6-8").unwrap();
-///
-/// assert!(!uucore::ranges::contain(&ranges, 0));
-/// assert!(!uucore::ranges::contain(&ranges, 1));
-/// assert!(!uucore::ranges::contain(&ranges, 5));
-/// assert!(!uucore::ranges::contain(&ranges, 10));
-///
-/// assert!(uucore::ranges::contain(&ranges, 2));
-/// assert!(uucore::ranges::contain(&ranges, 6));
-/// assert!(uucore::ranges::contain(&ranges, 7));
-/// assert!(uucore::ranges::contain(&ranges, 8));
-/// assert!(uucore::ranges::contain(&ranges, 11));
-/// ```
-pub fn contain(ranges: &[Range], n: usize) -> bool {
-    for range in ranges {
-        if n >= range.low && n <= range.high {
-            return true;
-        }
-    }
-
-    false
-}
-
-#[cfg(test)]
-mod test {
-    use super::{complement, Range};
-
-    fn m(a: Vec<Range>, b: &[Range]) {
-        assert_eq!(Range::merge(a), b);
-    }
-
-    fn r(low: usize, high: usize) -> Range {
-        Range { low, high }
-    }
-
-    #[test]
-    fn merging() {
-        // Single element
-        m(vec![r(1, 2)], &[r(1, 2)]);
-
-        // Disjoint in wrong order
-        m(vec![r(4, 5), r(1, 2)], &[r(1, 2), r(4, 5)]);
-
-        // Two elements must be merged
-        m(vec![r(1, 3), r(2, 4), r(6, 7)], &[r(1, 4), r(6, 7)]);
-
-        // Two merges and a duplicate
-        m(
-            vec![r(1, 3), r(6, 7), r(2, 4), r(6, 7)],
-            &[r(1, 4), r(6, 7)],
-        );
-
-        // One giant
-        m(
-            vec![
-                r(110, 120),
-                r(10, 20),
-                r(100, 200),
-                r(130, 140),
-                r(150, 160),
-            ],
-            &[r(10, 20), r(100, 200)],
-        );
-
-        // Last one joins the previous two
-        m(vec![r(10, 20), r(30, 40), r(20, 30)], &[r(10, 40)]);
-
-        m(
-            vec![r(10, 20), r(30, 40), r(50, 60), r(20, 30)],
-            &[r(10, 40), r(50, 60)],
-        );
-
-        // Merge adjacent ranges
-        m(vec![r(1, 3), r(4, 6)], &[r(1, 6)]);
-    }
-
-    #[test]
-    fn complementing() {
-        // Simple
-        assert_eq!(complement(&[r(3, 4)]), vec![r(1, 2), r(5, usize::MAX - 1)]);
-
-        // With start
-        assert_eq!(
-            complement(&[r(1, 3), r(6, 10)]),
-            vec![r(4, 5), r(11, usize::MAX - 1)]
-        );
-
-        // With end
-        assert_eq!(
-            complement(&[r(2, 4), r(6, usize::MAX - 1)]),
-            vec![r(1, 1), r(5, 5)]
-        );
-
-        // With start and end
-        assert_eq!(complement(&[r(1, 4), r(6, usize::MAX - 1)]), vec![r(5, 5)]);
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/update_control.rs.html b/coreutils/dev/src/uucore/mods/update_control.rs.html deleted file mode 100644 index 00397435d..000000000 --- a/coreutils/dev/src/uucore/mods/update_control.rs.html +++ /dev/null @@ -1,279 +0,0 @@ -update_control.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-
// This file is part of the uutils coreutils package.
-//
-// (c) John Shin <shinhs0506@gmail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-//! Implement GNU-style update functionality.
-//!
-//! - pre-defined [`clap`-Arguments][1] for inclusion in utilities that
-//!   implement updates
-//! - determination of the [update mode][2]
-//!
-//! Update-functionality is implemented by the following utilities:
-//!
-//! - `cp`
-//! - `mv`
-//!
-//!
-//! [1]: arguments
-//! [2]: `determine_update_mode()`
-//!
-//!
-//! # Usage example
-//!
-//! ```
-//! #[macro_use]
-//! extern crate uucore;
-//!
-//! use clap::{Command, Arg, ArgMatches};
-//! use uucore::update_control::{self, UpdateMode};
-//!
-//! fn main() {
-//!     let matches = Command::new("command")
-//!         .arg(update_control::arguments::update())
-//!         .arg(update_control::arguments::update_no_args())
-//!         .get_matches_from(vec![
-//!             "command", "--update=older"
-//!         ]);
-//!
-//!     let update_mode = update_control::determine_update_mode(&matches);
-//!
-//!     // handle cases
-//!     if update_mode == UpdateMode::ReplaceIfOlder {
-//!         // do
-//!     } else {
-//!         unreachable!()
-//!     }
-//! }
-//! ```
-use clap::ArgMatches;
-
-// Available update mode
-#[derive(Clone, Debug, Eq, PartialEq)]
-pub enum UpdateMode {
-    // --update=`all`, ``
-    ReplaceAll,
-    // --update=`none`
-    ReplaceNone,
-    // --update=`older`
-    // -u
-    ReplaceIfOlder,
-}
-
-pub mod arguments {
-    use clap::ArgAction;
-
-    pub static OPT_UPDATE: &str = "update";
-    pub static OPT_UPDATE_NO_ARG: &str = "u";
-
-    // `--update` argument, defaults to `older` if no values are provided
-    pub fn update() -> clap::Arg {
-        clap::Arg::new(OPT_UPDATE)
-            .long("update")
-            .help("move only when the SOURCE file is newer than the destination file or when the destination file is missing")
-            .value_parser(["none", "all", "older"])
-            .num_args(0..=1)
-            .default_missing_value("older")
-            .require_equals(true)
-            .overrides_with("update")
-            .action(clap::ArgAction::Set)
-    }
-
-    // `-u` argument
-    pub fn update_no_args() -> clap::Arg {
-        clap::Arg::new(OPT_UPDATE_NO_ARG)
-            .short('u')
-            .help("like --update but does not accept an argument")
-            .action(ArgAction::SetTrue)
-    }
-}
-
-/// Determine the "mode" for the update operation to perform, if any.
-///
-/// Parses the backup options and converts them to an instance of
-/// `UpdateMode` for further processing.
-///
-/// Takes [`clap::ArgMatches`] as argument which **must** contain the options
-/// from [`arguments::update()`] or [`arguments::update_no_args()`]. Otherwise
-/// the `ReplaceAll` mode is returned unconditionally.
-///
-/// # Examples
-///
-/// Here's how one would integrate the update mode determination into an
-/// application.
-///
-/// ```
-/// #[macro_use]
-/// extern crate uucore;
-/// use uucore::update_control::{self, UpdateMode};
-/// use clap::{Command, Arg, ArgMatches};
-///
-/// fn main() {
-///     let matches = Command::new("command")
-///         .arg(update_control::arguments::update())
-///         .arg(update_control::arguments::update_no_args())
-///         .get_matches_from(vec![
-///             "command", "--update=all"
-///         ]);
-///
-///     let update_mode = update_control::determine_update_mode(&matches);
-///     assert_eq!(update_mode, UpdateMode::ReplaceAll)
-/// }
-pub fn determine_update_mode(matches: &ArgMatches) -> UpdateMode {
-    if let Some(mode) = matches.get_one::<String>(arguments::OPT_UPDATE) {
-        match mode.as_str() {
-            "all" => UpdateMode::ReplaceAll,
-            "none" => UpdateMode::ReplaceNone,
-            "older" => UpdateMode::ReplaceIfOlder,
-            _ => unreachable!("other args restricted by clap"),
-        }
-    } else if matches.get_flag(arguments::OPT_UPDATE_NO_ARG) {
-        // short form of this option is equivalent to using --update=older
-        UpdateMode::ReplaceIfOlder
-    } else {
-        // no option was present
-        UpdateMode::ReplaceAll
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/mods/version_cmp.rs.html b/coreutils/dev/src/uucore/mods/version_cmp.rs.html deleted file mode 100644 index 46db4d4f9..000000000 --- a/coreutils/dev/src/uucore/mods/version_cmp.rs.html +++ /dev/null @@ -1,705 +0,0 @@ -version_cmp.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-
use std::cmp::Ordering;
-
-/// Compares the non-digit parts of a version.
-/// Special cases: ~ are before everything else, even ends ("a~" < "a")
-/// Letters are before non-letters
-fn version_non_digit_cmp(a: &str, b: &str) -> Ordering {
-    let mut a_chars = a.chars();
-    let mut b_chars = b.chars();
-    loop {
-        match (a_chars.next(), b_chars.next()) {
-            (Some(c1), Some(c2)) if c1 == c2 => {}
-            (None, None) => return Ordering::Equal,
-            (_, Some('~')) => return Ordering::Greater,
-            (Some('~'), _) => return Ordering::Less,
-            (None, Some(_)) => return Ordering::Less,
-            (Some(_), None) => return Ordering::Greater,
-            (Some(c1), Some(c2)) if c1.is_ascii_alphabetic() && !c2.is_ascii_alphabetic() => {
-                return Ordering::Less
-            }
-            (Some(c1), Some(c2)) if !c1.is_ascii_alphabetic() && c2.is_ascii_alphabetic() => {
-                return Ordering::Greater
-            }
-            (Some(c1), Some(c2)) => return c1.cmp(&c2),
-        }
-    }
-}
-
-/// Remove file endings matching the regex (\.[A-Za-z~][A-Za-z0-9~]*)*$
-fn remove_file_ending(a: &str) -> &str {
-    let mut ending_start = None;
-    let mut prev_was_dot = false;
-    for (idx, char) in a.char_indices() {
-        if char == '.' {
-            if ending_start.is_none() || prev_was_dot {
-                ending_start = Some(idx);
-            }
-            prev_was_dot = true;
-        } else if prev_was_dot {
-            prev_was_dot = false;
-            if !char.is_ascii_alphabetic() && char != '~' {
-                ending_start = None;
-            }
-        } else if !char.is_ascii_alphanumeric() && char != '~' {
-            ending_start = None;
-        }
-    }
-    if prev_was_dot {
-        ending_start = None;
-    }
-    if let Some(ending_start) = ending_start {
-        &a[..ending_start]
-    } else {
-        a
-    }
-}
-
-pub fn version_cmp(mut a: &str, mut b: &str) -> Ordering {
-    let str_cmp = a.cmp(b);
-    if str_cmp == Ordering::Equal {
-        return str_cmp;
-    }
-
-    // Special cases:
-    // 1. Empty strings
-    match (a.is_empty(), b.is_empty()) {
-        (true, false) => return Ordering::Less,
-        (false, true) => return Ordering::Greater,
-        (true, true) => unreachable!(),
-        (false, false) => {}
-    }
-    // 2. Dots
-    match (a == ".", b == ".") {
-        (true, false) => return Ordering::Less,
-        (false, true) => return Ordering::Greater,
-        (true, true) => unreachable!(),
-        (false, false) => {}
-    }
-    // 3. Two Dots
-    match (a == "..", b == "..") {
-        (true, false) => return Ordering::Less,
-        (false, true) => return Ordering::Greater,
-        (true, true) => unreachable!(),
-        (false, false) => {}
-    }
-    // 4. Strings starting with a dot
-    match (a.starts_with('.'), b.starts_with('.')) {
-        (true, false) => return Ordering::Less,
-        (false, true) => return Ordering::Greater,
-        (true, true) => {
-            // Strip the leading dot for later comparisons
-            a = &a[1..];
-            b = &b[1..];
-        }
-        _ => {}
-    }
-
-    // Try to strip file extensions
-    let (mut a, mut b) = match (remove_file_ending(a), remove_file_ending(b)) {
-        (a_stripped, b_stripped) if a_stripped == b_stripped => {
-            // If both would be the same after stripping file extensions, don't strip them.
-            (a, b)
-        }
-        stripped => stripped,
-    };
-
-    // 1. Compare leading non-numerical part
-    // 2. Compare leading numerical part
-    // 3. Repeat
-    while !a.is_empty() || !b.is_empty() {
-        let a_numerical_start = a.find(|c: char| c.is_ascii_digit()).unwrap_or(a.len());
-        let b_numerical_start = b.find(|c: char| c.is_ascii_digit()).unwrap_or(b.len());
-
-        let a_str = &a[..a_numerical_start];
-        let b_str = &b[..b_numerical_start];
-
-        match version_non_digit_cmp(a_str, b_str) {
-            Ordering::Equal => {}
-            ord => return ord,
-        }
-
-        a = &a[a_numerical_start..];
-        b = &b[a_numerical_start..];
-
-        let a_numerical_end = a.find(|c: char| !c.is_ascii_digit()).unwrap_or(a.len());
-        let b_numerical_end = b.find(|c: char| !c.is_ascii_digit()).unwrap_or(b.len());
-
-        let a_str = a[..a_numerical_end].trim_start_matches('0');
-        let b_str = b[..b_numerical_end].trim_start_matches('0');
-
-        match a_str.len().cmp(&b_str.len()) {
-            Ordering::Equal => {}
-            ord => return ord,
-        }
-
-        match a_str.cmp(b_str) {
-            Ordering::Equal => {}
-            ord => return ord,
-        }
-
-        a = &a[a_numerical_end..];
-        b = &b[b_numerical_end..];
-    }
-
-    Ordering::Equal
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::version_cmp::version_cmp;
-    use std::cmp::Ordering;
-    #[test]
-    fn test_version_cmp() {
-        // Identical strings
-        assert_eq!(version_cmp("hello", "hello"), Ordering::Equal);
-
-        assert_eq!(version_cmp("file12", "file12"), Ordering::Equal);
-
-        assert_eq!(
-            version_cmp("file12-suffix", "file12-suffix"),
-            Ordering::Equal
-        );
-
-        assert_eq!(
-            version_cmp("file12-suffix24", "file12-suffix24"),
-            Ordering::Equal
-        );
-
-        // Shortened names
-        assert_eq!(version_cmp("world", "wo"), Ordering::Greater,);
-
-        assert_eq!(version_cmp("hello10wo", "hello10world"), Ordering::Less,);
-
-        // Simple names
-        assert_eq!(version_cmp("world", "hello"), Ordering::Greater,);
-
-        assert_eq!(version_cmp("hello", "world"), Ordering::Less);
-
-        assert_eq!(version_cmp("apple", "ant"), Ordering::Greater);
-
-        assert_eq!(version_cmp("ant", "apple"), Ordering::Less);
-
-        // Uppercase letters
-        assert_eq!(
-            version_cmp("Beef", "apple"),
-            Ordering::Less,
-            "Uppercase letters are sorted before all lowercase letters"
-        );
-
-        assert_eq!(version_cmp("Apple", "apple"), Ordering::Less);
-
-        assert_eq!(version_cmp("apple", "aPple"), Ordering::Greater);
-
-        // Numbers
-        assert_eq!(
-            version_cmp("100", "20"),
-            Ordering::Greater,
-            "Greater numbers are greater even if they start with a smaller digit",
-        );
-
-        assert_eq!(
-            version_cmp("20", "20"),
-            Ordering::Equal,
-            "Equal numbers are equal"
-        );
-
-        assert_eq!(
-            version_cmp("15", "200"),
-            Ordering::Less,
-            "Small numbers are smaller"
-        );
-
-        // Comparing numbers with other characters
-        assert_eq!(
-            version_cmp("1000", "apple"),
-            Ordering::Less,
-            "Numbers are sorted before other characters"
-        );
-
-        assert_eq!(
-            // spell-checker:disable-next-line
-            version_cmp("file1000", "fileapple"),
-            Ordering::Less,
-            "Numbers in the middle of the name are sorted before other characters"
-        );
-
-        // Leading zeroes
-        assert_eq!(
-            version_cmp("012", "12"),
-            Ordering::Equal,
-            "A single leading zero does not make a difference"
-        );
-
-        assert_eq!(
-            version_cmp("000800", "0000800"),
-            Ordering::Equal,
-            "Multiple leading zeros do not make a difference"
-        );
-
-        // Numbers and other characters combined
-        assert_eq!(version_cmp("ab10", "aa11"), Ordering::Greater);
-
-        assert_eq!(
-            version_cmp("aa10", "aa11"),
-            Ordering::Less,
-            "Numbers after other characters are handled correctly."
-        );
-
-        assert_eq!(
-            version_cmp("aa2", "aa100"),
-            Ordering::Less,
-            "Numbers after alphabetical characters are handled correctly."
-        );
-
-        assert_eq!(
-            version_cmp("aa10bb", "aa11aa"),
-            Ordering::Less,
-            "Number is used even if alphabetical characters after it differ."
-        );
-
-        assert_eq!(
-            version_cmp("aa10aa0010", "aa11aa1"),
-            Ordering::Less,
-            "Second number is ignored if the first number differs."
-        );
-
-        assert_eq!(
-            version_cmp("aa10aa0010", "aa10aa1"),
-            Ordering::Greater,
-            "Second number is used if the rest is equal."
-        );
-
-        assert_eq!(
-            version_cmp("aa10aa0010", "aa00010aa1"),
-            Ordering::Greater,
-            "Second number is used if the rest is equal up to leading zeroes of the first number."
-        );
-
-        assert_eq!(
-            version_cmp("aa10aa0022", "aa010aa022"),
-            Ordering::Equal,
-            "Test multiple numeric values with leading zeros"
-        );
-
-        assert_eq!(
-            version_cmp("file-1.4", "file-1.13"),
-            Ordering::Less,
-            "Periods are handled as normal text, not as a decimal point."
-        );
-
-        // Greater than u64::Max
-        // u64 == 18446744073709551615 so this should be plenty:
-        //        20000000000000000000000
-        assert_eq!(
-            version_cmp("aa2000000000000000000000bb", "aa002000000000000000000001bb"),
-            Ordering::Less,
-            "Numbers larger than u64::MAX are handled correctly without crashing"
-        );
-
-        assert_eq!(
-            version_cmp("aa2000000000000000000000bb", "aa002000000000000000000000bb"),
-            Ordering::Equal,
-            "Leading zeroes for numbers larger than u64::MAX are \
-            handled correctly without crashing"
-        );
-
-        assert_eq!(
-            version_cmp("  a", "a"),
-            Ordering::Greater,
-            "Whitespace is after letters because letters are before non-letters"
-        );
-
-        assert_eq!(
-            version_cmp("a~", "ab"),
-            Ordering::Less,
-            "A tilde is before other letters"
-        );
-
-        assert_eq!(
-            version_cmp("a~", "a"),
-            Ordering::Less,
-            "A tilde is before the line end"
-        );
-        assert_eq!(
-            version_cmp("~", ""),
-            Ordering::Greater,
-            "A tilde is after the empty string"
-        );
-        assert_eq!(
-            version_cmp(".f", ".1"),
-            Ordering::Greater,
-            "if both start with a dot it is ignored for the comparison"
-        );
-
-        // The following tests are incompatible with GNU as of 2021/06.
-        // I think that's because of a bug in GNU, reported as https://lists.gnu.org/archive/html/bug-coreutils/2021-06/msg00045.html
-        assert_eq!(
-            version_cmp("a..a", "a.+"),
-            Ordering::Less,
-            ".a is stripped before the comparison"
-        );
-        assert_eq!(
-            version_cmp("a.", "a+"),
-            Ordering::Greater,
-            ". is not stripped before the comparison"
-        );
-        assert_eq!(
-            version_cmp("a\0a", "a"),
-            Ordering::Greater,
-            "NULL bytes are handled comparison"
-        );
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/parser.rs.html b/coreutils/dev/src/uucore/parser.rs.html deleted file mode 100644 index 6e8cf0f4f..000000000 --- a/coreutils/dev/src/uucore/parser.rs.html +++ /dev/null @@ -1,9 +0,0 @@ -parser.rs - source
1
-2
-3
-4
-
pub mod parse_glob;
-pub mod parse_size;
-pub mod parse_time;
-pub mod shortcut_value_parser;
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/parser/parse_glob.rs.html b/coreutils/dev/src/uucore/parser/parse_glob.rs.html deleted file mode 100644 index e03f4badb..000000000 --- a/coreutils/dev/src/uucore/parser/parse_glob.rs.html +++ /dev/null @@ -1,227 +0,0 @@ -parse_glob.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-
//! Parsing a glob Pattern from a string.
-//!
-//! Use the [`from_str`] function to parse a [`Pattern`] from a string.
-
-// cSpell:words fnmatch
-
-use glob::{Pattern, PatternError};
-
-fn fix_negation(glob: &str) -> String {
-    let mut chars = glob.chars().collect::<Vec<_>>();
-
-    let mut i = 0;
-    // Add 3 to prevent out of bounds in loop
-    while i + 3 < chars.len() {
-        if chars[i] == '[' && chars[i + 1] == '^' {
-            match chars[i + 3..].iter().position(|x| *x == ']') {
-                None => (),
-                Some(j) => {
-                    chars[i + 1] = '!';
-                    i += j + 4;
-                    continue;
-                }
-            }
-        }
-
-        i += 1;
-    }
-
-    chars.into_iter().collect::<String>()
-}
-
-/// Parse a glob Pattern from a string.
-///
-/// This function amends the input string to replace any caret or circumflex
-/// character (^) used to negate a set of characters with an exclamation mark
-/// (!), which adapts rust's glob matching to function the way the GNU utils'
-/// fnmatch does.
-///
-/// # Examples
-///
-/// ```rust
-/// use std::time::Duration;
-/// use uucore::parse_glob::from_str;
-/// assert!(!from_str("[^abc]").unwrap().matches("a"));
-/// assert!(from_str("[^abc]").unwrap().matches("x"));
-/// ```
-pub fn from_str(glob: &str) -> Result<Pattern, PatternError> {
-    Pattern::new(&fix_negation(glob))
-}
-
-#[cfg(test)]
-mod tests {
-
-    use super::*;
-
-    #[test]
-    fn test_from_str() {
-        assert_eq!(from_str("[^abc]").unwrap(), Pattern::new("[!abc]").unwrap());
-    }
-
-    #[test]
-    fn test_fix_negation() {
-        // Happy/Simple case
-        assert_eq!(fix_negation("[^abc]"), "[!abc]");
-
-        // Should fix negations in a long regex
-        assert_eq!(fix_negation("foo[abc]  bar[^def]"), "foo[abc]  bar[!def]");
-
-        // Should fix multiple negations in a regex
-        assert_eq!(fix_negation("foo[^abc]bar[^def]"), "foo[!abc]bar[!def]");
-
-        // Should fix negation of the single character ]
-        assert_eq!(fix_negation("[^]]"), "[!]]");
-
-        // Should fix negation of the single character ^
-        assert_eq!(fix_negation("[^^]"), "[!^]");
-
-        // Should fix negation of the space character
-        assert_eq!(fix_negation("[^ ]"), "[! ]");
-
-        // Complicated patterns
-        assert_eq!(fix_negation("[^][]"), "[!][]");
-        assert_eq!(fix_negation("[^[]]"), "[![]]");
-
-        // More complex patterns that should be replaced
-        assert_eq!(fix_negation("[[]] [^a]"), "[[]] [!a]");
-        assert_eq!(fix_negation("[[] [^a]"), "[[] [!a]");
-        assert_eq!(fix_negation("[]] [^a]"), "[]] [!a]");
-    }
-
-    #[test]
-    fn test_fix_negation_should_not_amend() {
-        assert_eq!(fix_negation("abc"), "abc");
-
-        // Regex specifically matches either [ or ^
-        assert_eq!(fix_negation("[[^]"), "[[^]");
-
-        // Regex that specifically matches either space or ^
-        assert_eq!(fix_negation("[ ^]"), "[ ^]");
-
-        // Regex that specifically matches either [, space or ^
-        assert_eq!(fix_negation("[[ ^]"), "[[ ^]");
-        assert_eq!(fix_negation("[ [^]"), "[ [^]");
-
-        // Invalid globs (according to rust's glob implementation) will remain unamended
-        assert_eq!(fix_negation("[^]"), "[^]");
-        assert_eq!(fix_negation("[^"), "[^");
-        assert_eq!(fix_negation("[][^]"), "[][^]");
-
-        // Issue #4479
-        assert_eq!(fix_negation("ààà[^"), "ààà[^");
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/parser/parse_size.rs.html b/coreutils/dev/src/uucore/parser/parse_size.rs.html deleted file mode 100644 index e691d2f22..000000000 --- a/coreutils/dev/src/uucore/parser/parse_size.rs.html +++ /dev/null @@ -1,1053 +0,0 @@ -parse_size.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-
//  * This file is part of the uutils coreutils package.
-//  *
-//  * For the full copyright and license information, please view the LICENSE
-//  * file that was distributed with this source code.
-
-// spell-checker:ignore (ToDO) hdsf ghead gtail ACDBK hexdigit
-
-use std::error::Error;
-use std::fmt;
-
-use crate::display::Quotable;
-
-/// Parser for sizes in SI or IEC units (multiples of 1000 or 1024 bytes).
-///
-/// The [`Parser::parse`] function performs the parse.
-#[derive(Default)]
-pub struct Parser<'parser> {
-    /// Whether to treat the suffix "B" as meaning "bytes".
-    pub capital_b_bytes: bool,
-    /// Whether to treat "b" as a "byte count" instead of "block"
-    pub b_byte_count: bool,
-    /// Whitelist for the suffix
-    pub allow_list: Option<&'parser [&'parser str]>,
-    /// Default unit when no suffix is provided
-    pub default_unit: Option<&'parser str>,
-}
-
-enum NumberSystem {
-    Decimal,
-    Octal,
-    Hexadecimal,
-}
-
-impl<'parser> Parser<'parser> {
-    pub fn with_allow_list(&mut self, allow_list: &'parser [&str]) -> &mut Self {
-        self.allow_list = Some(allow_list);
-        self
-    }
-
-    pub fn with_default_unit(&mut self, default_unit: &'parser str) -> &mut Self {
-        self.default_unit = Some(default_unit);
-        self
-    }
-
-    pub fn with_b_byte_count(&mut self, value: bool) -> &mut Self {
-        self.b_byte_count = value;
-        self
-    }
-
-    /// Parse a size string into a number of bytes.
-    ///
-    /// A size string comprises an integer and an optional unit. The unit
-    /// may be K, M, G, T, P, E, Z or Y (powers of 1024), or KB, MB,
-    /// etc. (powers of 1000), or b which is 512.
-    /// Binary prefixes can be used, too: KiB=K, MiB=M, and so on.
-    ///
-    /// # Errors
-    ///
-    /// Will return `ParseSizeError` if it's not possible to parse this
-    /// string into a number, e.g. if the string does not begin with a
-    /// numeral, or if the unit is not one of the supported units described
-    /// in the preceding section.
-    ///
-    /// # Examples
-    ///
-    /// ```rust
-    /// use uucore::parse_size::parse_size;
-    /// assert_eq!(Ok(123), parse_size("123"));
-    /// assert_eq!(Ok(9 * 1000), parse_size("9kB")); // kB is 1000
-    /// assert_eq!(Ok(2 * 1024), parse_size("2K")); // K is 1024
-    /// assert_eq!(Ok(44251 * 1024), parse_size("0xACDBK"));
-    /// ```
-    pub fn parse(&self, size: &str) -> Result<u64, ParseSizeError> {
-        if size.is_empty() {
-            return Err(ParseSizeError::parse_failure(size));
-        }
-
-        let number_system: NumberSystem = self.determine_number_system(size);
-
-        // Split the size argument into numeric and unit parts
-        // For example, if the argument is "123K", the numeric part is "123", and
-        // the unit is "K"
-        let numeric_string: String = match number_system {
-            NumberSystem::Hexadecimal => size
-                .chars()
-                .take(2)
-                .chain(size.chars().skip(2).take_while(|c| c.is_ascii_hexdigit()))
-                .collect(),
-            _ => size.chars().take_while(|c| c.is_ascii_digit()).collect(),
-        };
-        let mut unit: &str = &size[numeric_string.len()..];
-
-        if let Some(default_unit) = self.default_unit {
-            // Check if `unit` is empty then assigns `default_unit` to `unit`
-            if unit.is_empty() {
-                unit = default_unit;
-            }
-        }
-
-        // Check if `b` is a byte count and remove `b`
-        if self.b_byte_count && unit.ends_with('b') {
-            // If `unit` = 'b' then return error
-            if numeric_string.is_empty() {
-                return Err(ParseSizeError::parse_failure(size));
-            }
-            unit = &unit[0..unit.len() - 1];
-        }
-
-        if let Some(allow_list) = self.allow_list {
-            // Check if `unit` appears in `allow_list`, if not return error
-            if !allow_list.contains(&unit) && !unit.is_empty() {
-                if numeric_string.is_empty() {
-                    return Err(ParseSizeError::parse_failure(size));
-                }
-                return Err(ParseSizeError::invalid_suffix(size));
-            }
-        }
-
-        // Compute the factor the unit represents.
-        // empty string means the factor is 1.
-        //
-        // The lowercase "b" (used by `od`, `head`, `tail`, etc.) means
-        // "block" and the Posix block size is 512. The uppercase "B"
-        // means "byte".
-        let (base, exponent): (u128, u32) = match unit {
-            "" => (1, 0),
-            "B" if self.capital_b_bytes => (1, 0),
-            "b" => (512, 1),
-            "KiB" | "kiB" | "K" | "k" => (1024, 1),
-            "MiB" | "miB" | "M" | "m" => (1024, 2),
-            "GiB" | "giB" | "G" | "g" => (1024, 3),
-            "TiB" | "tiB" | "T" | "t" => (1024, 4),
-            "PiB" | "piB" | "P" | "p" => (1024, 5),
-            "EiB" | "eiB" | "E" | "e" => (1024, 6),
-            "ZiB" | "ziB" | "Z" | "z" => (1024, 7),
-            "YiB" | "yiB" | "Y" | "y" => (1024, 8),
-            "KB" | "kB" => (1000, 1),
-            "MB" | "mB" => (1000, 2),
-            "GB" | "gB" => (1000, 3),
-            "TB" | "tB" => (1000, 4),
-            "PB" | "pB" => (1000, 5),
-            "EB" | "eB" => (1000, 6),
-            "ZB" | "zB" => (1000, 7),
-            "YB" | "yB" => (1000, 8),
-            _ if numeric_string.is_empty() => return Err(ParseSizeError::parse_failure(size)),
-            _ => return Err(ParseSizeError::invalid_suffix(size)),
-        };
-        let factor = match u64::try_from(base.pow(exponent)) {
-            Ok(n) => n,
-            Err(_) => return Err(ParseSizeError::size_too_big(size)),
-        };
-
-        // parse string into u64
-        let number: u64 = match number_system {
-            NumberSystem::Decimal => {
-                if numeric_string.is_empty() {
-                    1
-                } else {
-                    self.parse_number(&numeric_string, 10, size)?
-                }
-            }
-            NumberSystem::Octal => {
-                let trimmed_string = numeric_string.trim_start_matches('0');
-                self.parse_number(trimmed_string, 8, size)?
-            }
-            NumberSystem::Hexadecimal => {
-                let trimmed_string = numeric_string.trim_start_matches("0x");
-                self.parse_number(trimmed_string, 16, size)?
-            }
-        };
-
-        number
-            .checked_mul(factor)
-            .ok_or_else(|| ParseSizeError::size_too_big(size))
-    }
-
-    fn determine_number_system(&self, size: &str) -> NumberSystem {
-        if size.len() <= 1 {
-            return NumberSystem::Decimal;
-        }
-
-        if size.starts_with("0x") {
-            return NumberSystem::Hexadecimal;
-        }
-
-        let num_digits: usize = size
-            .chars()
-            .take_while(|c| c.is_ascii_digit())
-            .collect::<String>()
-            .len();
-        let all_zeros = size.chars().all(|c| c == '0');
-        if size.starts_with('0') && num_digits > 1 && !all_zeros {
-            return NumberSystem::Octal;
-        }
-
-        NumberSystem::Decimal
-    }
-
-    fn parse_number(
-        &self,
-        numeric_string: &str,
-        radix: u32,
-        original_size: &str,
-    ) -> Result<u64, ParseSizeError> {
-        u64::from_str_radix(numeric_string, radix)
-            .map_err(|_| ParseSizeError::ParseFailure(original_size.to_string()))
-    }
-}
-
-/// Parse a size string into a number of bytes.
-///
-/// A size string comprises an integer and an optional unit. The unit
-/// may be K, M, G, T, P, E, Z or Y (powers of 1024), or KB, MB,
-/// etc. (powers of 1000), or b which is 512.
-/// Binary prefixes can be used, too: KiB=K, MiB=M, and so on.
-///
-/// # Errors
-///
-/// Will return `ParseSizeError` if it's not possible to parse this
-/// string into a number, e.g. if the string does not begin with a
-/// numeral, or if the unit is not one of the supported units described
-/// in the preceding section.
-///
-/// # Examples
-///
-/// ```rust
-/// use uucore::parse_size::parse_size;
-/// assert_eq!(Ok(123), parse_size("123"));
-/// assert_eq!(Ok(9 * 1000), parse_size("9kB")); // kB is 1000
-/// assert_eq!(Ok(2 * 1024), parse_size("2K")); // K is 1024
-/// ```
-pub fn parse_size(size: &str) -> Result<u64, ParseSizeError> {
-    Parser::default().parse(size)
-}
-
-#[derive(Debug, PartialEq, Eq)]
-pub enum ParseSizeError {
-    InvalidSuffix(String), // Suffix
-    ParseFailure(String),  // Syntax
-    SizeTooBig(String),    // Overflow
-}
-
-impl Error for ParseSizeError {
-    fn description(&self) -> &str {
-        match *self {
-            Self::InvalidSuffix(ref s) => s,
-            Self::ParseFailure(ref s) => s,
-            Self::SizeTooBig(ref s) => s,
-        }
-    }
-}
-
-impl fmt::Display for ParseSizeError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
-        let s = match self {
-            Self::InvalidSuffix(s) | Self::ParseFailure(s) | Self::SizeTooBig(s) => s,
-        };
-        write!(f, "{s}")
-    }
-}
-
-// FIXME: It's more idiomatic to move the formatting into the Display impl,
-// but there's a lot of downstream code that constructs these errors manually
-// that would be affected
-impl ParseSizeError {
-    fn invalid_suffix(s: &str) -> Self {
-        Self::InvalidSuffix(format!("{}", s.quote()))
-    }
-
-    fn parse_failure(s: &str) -> Self {
-        // stderr on linux (GNU coreutils 8.32) (LC_ALL=C)
-        // has to be handled in the respective uutils because strings differ, e.g.:
-        //
-        // `NUM`
-        // head:     invalid number of bytes: '1fb'
-        // tail:     invalid number of bytes: '1fb'
-        //
-        // `SIZE`
-        // split:    invalid number of bytes: '1fb'
-        // truncate: Invalid number: '1fb'
-        //
-        // `MODE`
-        // stdbuf:   invalid mode '1fb'
-        //
-        // `SIZE`
-        // sort:     invalid suffix in --buffer-size argument '1fb'
-        // sort:     invalid --buffer-size argument 'fb'
-        //
-        // `SIZE`
-        // du:       invalid suffix in --buffer-size argument '1fb'
-        // du:       invalid suffix in --threshold argument '1fb'
-        // du:       invalid --buffer-size argument 'fb'
-        // du:       invalid --threshold argument 'fb'
-        //
-        // `BYTES`
-        // od:       invalid suffix in --read-bytes argument '1fb'
-        // od:       invalid --read-bytes argument  argument 'fb'
-        //                   --skip-bytes
-        //                   --width
-        //                   --strings
-        // etc.
-        Self::ParseFailure(format!("{}", s.quote()))
-    }
-
-    fn size_too_big(s: &str) -> Self {
-        // stderr on linux (GNU coreutils 8.32) (LC_ALL=C)
-        // has to be handled in the respective uutils because strings differ, e.g.:
-        //
-        // head:     invalid number of bytes: '1Y': Value too large for defined data type
-        // tail:     invalid number of bytes: '1Y': Value too large for defined data type
-        // split:    invalid number of bytes: '1Y': Value too large for defined data type
-        // truncate:          Invalid number: '1Y': Value too large for defined data type
-        // stdbuf:               invalid mode '1Y': Value too large for defined data type
-        // sort:     -S argument '1Y' too large
-        // du:       -B argument '1Y' too large
-        // od:       -N argument '1Y' too large
-        // etc.
-        //
-        // stderr on macos (brew - GNU coreutils 8.32) also differs for the same version, e.g.:
-        // ghead:   invalid number of bytes: '1Y': Value too large to be stored in data type
-        // gtail:   invalid number of bytes: '1Y': Value too large to be stored in data type
-        Self::SizeTooBig(format!(
-            "{}: Value too large for defined data type",
-            s.quote()
-        ))
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    fn variant_eq(a: &ParseSizeError, b: &ParseSizeError) -> bool {
-        std::mem::discriminant(a) == std::mem::discriminant(b)
-    }
-
-    #[test]
-    fn all_suffixes() {
-        // Units  are  K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).
-        // Binary prefixes can be used, too: KiB=K, MiB=M, and so on.
-        let suffixes = [
-            ('K', 1u32),
-            ('M', 2u32),
-            ('G', 3u32),
-            ('T', 4u32),
-            ('P', 5u32),
-            ('E', 6u32),
-            // The following will always result ParseSizeError::SizeTooBig as they cannot fit in u64
-            // ('Z', 7u32),
-            // ('Y', 8u32),
-        ];
-
-        for &(c, exp) in &suffixes {
-            let s = format!("2{c}B"); // KB
-            assert_eq!(Ok((2 * (1000_u128).pow(exp)) as u64), parse_size(&s));
-            let s = format!("2{c}"); // K
-            assert_eq!(Ok((2 * (1024_u128).pow(exp)) as u64), parse_size(&s));
-            let s = format!("2{c}iB"); // KiB
-            assert_eq!(Ok((2 * (1024_u128).pow(exp)) as u64), parse_size(&s));
-            let s = format!("2{}iB", c.to_lowercase()); // kiB
-            assert_eq!(Ok((2 * (1024_u128).pow(exp)) as u64), parse_size(&s));
-
-            // suffix only
-            let s = format!("{c}B"); // KB
-            assert_eq!(Ok(((1000_u128).pow(exp)) as u64), parse_size(&s));
-            let s = format!("{c}"); // K
-            assert_eq!(Ok(((1024_u128).pow(exp)) as u64), parse_size(&s));
-            let s = format!("{c}iB"); // KiB
-            assert_eq!(Ok(((1024_u128).pow(exp)) as u64), parse_size(&s));
-            let s = format!("{}iB", c.to_lowercase()); // kiB
-            assert_eq!(Ok(((1024_u128).pow(exp)) as u64), parse_size(&s));
-        }
-    }
-
-    #[test]
-    #[cfg(not(target_pointer_width = "128"))]
-    fn overflow_x64() {
-        assert!(parse_size("10000000000000000000000").is_err());
-        assert!(parse_size("1000000000T").is_err());
-        assert!(parse_size("100000P").is_err());
-        assert!(parse_size("100E").is_err());
-        assert!(parse_size("1Z").is_err());
-        assert!(parse_size("1Y").is_err());
-
-        assert!(variant_eq(
-            &parse_size("1Z").unwrap_err(),
-            &ParseSizeError::SizeTooBig(String::new())
-        ));
-
-        assert_eq!(
-            ParseSizeError::SizeTooBig("'1Y': Value too large for defined data type".to_string()),
-            parse_size("1Y").unwrap_err()
-        );
-    }
-
-    #[test]
-    fn invalid_suffix() {
-        let test_strings = ["5mib", "1eb", "1H"];
-        for &test_string in &test_strings {
-            assert_eq!(
-                parse_size(test_string).unwrap_err(),
-                ParseSizeError::InvalidSuffix(format!("{}", test_string.quote()))
-            );
-        }
-    }
-
-    #[test]
-    fn invalid_syntax() {
-        let test_strings = ["biB", "-", "+", "", "-1", "∞"];
-        for &test_string in &test_strings {
-            assert_eq!(
-                parse_size(test_string).unwrap_err(),
-                ParseSizeError::ParseFailure(format!("{}", test_string.quote()))
-            );
-        }
-    }
-
-    #[test]
-    fn b_suffix() {
-        assert_eq!(Ok(3 * 512), parse_size("3b")); // b is 512
-    }
-
-    #[test]
-    fn no_suffix() {
-        assert_eq!(Ok(1234), parse_size("1234"));
-        assert_eq!(Ok(0), parse_size("0"));
-        assert_eq!(Ok(5), parse_size("5"));
-        assert_eq!(Ok(999), parse_size("999"));
-    }
-
-    #[test]
-    fn kilobytes_suffix() {
-        assert_eq!(Ok(123 * 1000), parse_size("123KB")); // KB is 1000
-        assert_eq!(Ok(9 * 1000), parse_size("9kB")); // kB is 1000
-        assert_eq!(Ok(2 * 1024), parse_size("2K")); // K is 1024
-        assert_eq!(Ok(0), parse_size("0K"));
-        assert_eq!(Ok(0), parse_size("0KB"));
-        assert_eq!(Ok(1000), parse_size("KB"));
-        assert_eq!(Ok(1024), parse_size("K"));
-        assert_eq!(Ok(2000), parse_size("2kB"));
-        assert_eq!(Ok(4000), parse_size("4KB"));
-    }
-
-    #[test]
-    fn megabytes_suffix() {
-        assert_eq!(Ok(123 * 1024 * 1024), parse_size("123M"));
-        assert_eq!(Ok(123 * 1000 * 1000), parse_size("123MB"));
-        assert_eq!(Ok(1024 * 1024), parse_size("M"));
-        assert_eq!(Ok(1000 * 1000), parse_size("MB"));
-        assert_eq!(Ok(2 * 1_048_576), parse_size("2m"));
-        assert_eq!(Ok(4 * 1_048_576), parse_size("4M"));
-        assert_eq!(Ok(2_000_000), parse_size("2mB"));
-        assert_eq!(Ok(4_000_000), parse_size("4MB"));
-    }
-
-    #[test]
-    fn gigabytes_suffix() {
-        assert_eq!(Ok(1_073_741_824), parse_size("1G"));
-        assert_eq!(Ok(2_000_000_000), parse_size("2GB"));
-    }
-
-    #[test]
-    #[cfg(target_pointer_width = "64")]
-    fn x64() {
-        assert_eq!(Ok(1_099_511_627_776), parse_size("1T"));
-        assert_eq!(Ok(1_125_899_906_842_624), parse_size("1P"));
-        assert_eq!(Ok(1_152_921_504_606_846_976), parse_size("1E"));
-        assert_eq!(Ok(2_000_000_000_000), parse_size("2TB"));
-        assert_eq!(Ok(2_000_000_000_000_000), parse_size("2PB"));
-        assert_eq!(Ok(2_000_000_000_000_000_000), parse_size("2EB"));
-    }
-
-    #[test]
-    fn parse_size_options() {
-        let mut parser = Parser::default();
-
-        parser
-            .with_allow_list(&["k", "K", "G", "MB", "M"])
-            .with_default_unit("K");
-
-        assert_eq!(Ok(1024), parser.parse("1"));
-        assert_eq!(Ok(2 * 1024), parser.parse("2"));
-        assert_eq!(Ok(1000 * 1000), parser.parse("1MB"));
-        assert_eq!(Ok(1024 * 1024), parser.parse("1M"));
-        assert_eq!(Ok(1024 * 1024 * 1024), parser.parse("1G"));
-
-        assert!(parser.parse("1T").is_err());
-        assert!(parser.parse("1P").is_err());
-        assert!(parser.parse("1E").is_err());
-
-        parser
-            .with_allow_list(&[
-                "b", "k", "K", "m", "M", "MB", "g", "G", "t", "T", "P", "E", "Z", "Y",
-            ])
-            .with_default_unit("K")
-            .with_b_byte_count(true);
-
-        assert_eq!(Ok(1024), parser.parse("1"));
-        assert_eq!(Ok(2 * 1024), parser.parse("2"));
-        assert_eq!(Ok(1000 * 1000), parser.parse("1MB"));
-        assert_eq!(Ok(1024 * 1024), parser.parse("1M"));
-        assert_eq!(Ok(1024 * 1024 * 1024), parser.parse("1G"));
-
-        assert_eq!(Ok(1), parser.parse("1b"));
-        assert_eq!(Ok(1024), parser.parse("1024b"));
-        assert_eq!(Ok(1024 * 1024 * 1024), parser.parse("1024Mb"));
-
-        assert!(parser.parse("b").is_err());
-        assert!(parser.parse("1B").is_err());
-        assert!(parser.parse("B").is_err());
-    }
-
-    #[test]
-    fn parse_octal_size() {
-        assert_eq!(Ok(63), parse_size("077"));
-        assert_eq!(Ok(528), parse_size("01020"));
-        assert_eq!(Ok(668 * 1024), parse_size("01234K"));
-    }
-
-    #[test]
-    fn parse_hex_size() {
-        assert_eq!(Ok(10), parse_size("0xA"));
-        assert_eq!(Ok(94722), parse_size("0x17202"));
-        assert_eq!(Ok(44251 * 1024), parse_size("0xACDBK"));
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/parser/parse_time.rs.html b/coreutils/dev/src/uucore/parser/parse_time.rs.html deleted file mode 100644 index 0e60a8af7..000000000 --- a/coreutils/dev/src/uucore/parser/parse_time.rs.html +++ /dev/null @@ -1,283 +0,0 @@ -parse_time.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-
// This file is part of the uutils coreutils package.
-//
-// (c) Alex Lyon <arcterus@mail.com>
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-// spell-checker:ignore (vars) NANOS numstr
-//! Parsing a duration from a string.
-//!
-//! Use the [`from_str`] function to parse a [`Duration`] from a string.
-
-use std::time::Duration;
-
-use crate::display::Quotable;
-
-/// Parse a duration from a string.
-///
-/// The string may contain only a number, like "123" or "4.5", or it
-/// may contain a number with a unit specifier, like "123s" meaning
-/// one hundred twenty three seconds or "4.5d" meaning four and a half
-/// days. If no unit is specified, the unit is assumed to be seconds.
-///
-/// The only allowed suffixes are
-///
-/// * "s" for seconds,
-/// * "m" for minutes,
-/// * "h" for hours,
-/// * "d" for days.
-///
-/// This function uses [`Duration::saturating_mul`] to compute the
-/// number of seconds, so it does not overflow. If overflow would have
-/// occurred, [`Duration::MAX`] is returned instead.
-///
-/// # Errors
-///
-/// This function returns an error if the input string is empty, the
-/// input is not a valid number, or the unit specifier is invalid or
-/// unknown.
-///
-/// # Examples
-///
-/// ```rust
-/// use std::time::Duration;
-/// use uucore::parse_time::from_str;
-/// assert_eq!(from_str("123"), Ok(Duration::from_secs(123)));
-/// assert_eq!(from_str("2d"), Ok(Duration::from_secs(60 * 60 * 24 * 2)));
-/// ```
-pub fn from_str(string: &str) -> Result<Duration, String> {
-    let len = string.len();
-    if len == 0 {
-        return Err("empty string".to_owned());
-    }
-    let slice = match string.get(..len - 1) {
-        Some(s) => s,
-        None => return Err(format!("invalid time interval {}", string.quote())),
-    };
-    let (numstr, times) = match string.chars().next_back().unwrap() {
-        's' => (slice, 1),
-        'm' => (slice, 60),
-        'h' => (slice, 60 * 60),
-        'd' => (slice, 60 * 60 * 24),
-        val if !val.is_alphabetic() => (string, 1),
-        _ => {
-            if string == "inf" || string == "infinity" {
-                ("inf", 1)
-            } else {
-                return Err(format!("invalid time interval {}", string.quote()));
-            }
-        }
-    };
-    let num = numstr
-        .parse::<f64>()
-        .map_err(|e| format!("invalid time interval {}: {}", string.quote(), e))?;
-
-    if num < 0. {
-        return Err(format!("invalid time interval {}", string.quote()));
-    }
-
-    const NANOS_PER_SEC: u32 = 1_000_000_000;
-    let whole_secs = num.trunc();
-    let nanos = (num.fract() * (NANOS_PER_SEC as f64)).trunc();
-    let duration = Duration::new(whole_secs as u64, nanos as u32);
-    Ok(duration.saturating_mul(times))
-}
-
-#[cfg(test)]
-mod tests {
-
-    use crate::parse_time::from_str;
-    use std::time::Duration;
-
-    #[test]
-    fn test_no_units() {
-        assert_eq!(from_str("123"), Ok(Duration::from_secs(123)));
-    }
-
-    #[test]
-    fn test_units() {
-        assert_eq!(from_str("2d"), Ok(Duration::from_secs(60 * 60 * 24 * 2)));
-    }
-
-    #[test]
-    fn test_saturating_mul() {
-        assert_eq!(from_str("9223372036854775808d"), Ok(Duration::MAX));
-    }
-
-    #[test]
-    fn test_error_empty() {
-        assert!(from_str("").is_err());
-    }
-
-    #[test]
-    fn test_error_invalid_unit() {
-        assert!(from_str("123X").is_err());
-    }
-
-    #[test]
-    fn test_error_multi_bytes_characters() {
-        assert!(from_str("10€").is_err());
-    }
-
-    #[test]
-    fn test_error_invalid_magnitude() {
-        assert!(from_str("12abc3s").is_err());
-    }
-
-    #[test]
-    fn test_negative() {
-        assert!(from_str("-1").is_err());
-    }
-
-    /// Test that capital letters are not allowed in suffixes.
-    #[test]
-    fn test_no_capital_letters() {
-        assert!(from_str("1S").is_err());
-        assert!(from_str("1M").is_err());
-        assert!(from_str("1H").is_err());
-        assert!(from_str("1D").is_err());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore/parser/shortcut_value_parser.rs.html b/coreutils/dev/src/uucore/parser/shortcut_value_parser.rs.html deleted file mode 100644 index d70083e01..000000000 --- a/coreutils/dev/src/uucore/parser/shortcut_value_parser.rs.html +++ /dev/null @@ -1,331 +0,0 @@ -shortcut_value_parser.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-
// spell-checker:ignore abcdefgh
-use clap::{
-    builder::{PossibleValue, TypedValueParser},
-    error::{ContextKind, ContextValue, ErrorKind},
-};
-
-#[derive(Clone)]
-pub struct ShortcutValueParser(Vec<PossibleValue>);
-
-/// `ShortcutValueParser` is similar to clap's `PossibleValuesParser`: it verifies that the value is
-/// from an enumerated set of `PossibleValue`.
-///
-/// Whereas `PossibleValuesParser` only accepts exact matches, `ShortcutValueParser` also accepts
-/// shortcuts as long as they are unambiguous.
-impl ShortcutValueParser {
-    pub fn new(values: impl Into<Self>) -> Self {
-        values.into()
-    }
-
-    fn generate_clap_error(
-        &self,
-        cmd: &clap::Command,
-        arg: Option<&clap::Arg>,
-        value: &str,
-    ) -> clap::Error {
-        let mut err = clap::Error::new(ErrorKind::InvalidValue).with_cmd(cmd);
-
-        if let Some(arg) = arg {
-            err.insert(
-                ContextKind::InvalidArg,
-                ContextValue::String(arg.to_string()),
-            );
-        }
-
-        err.insert(
-            ContextKind::InvalidValue,
-            ContextValue::String(value.to_string()),
-        );
-
-        err.insert(
-            ContextKind::ValidValue,
-            ContextValue::Strings(self.0.iter().map(|x| x.get_name().to_string()).collect()),
-        );
-
-        err
-    }
-}
-
-impl TypedValueParser for ShortcutValueParser {
-    type Value = String;
-
-    fn parse_ref(
-        &self,
-        cmd: &clap::Command,
-        arg: Option<&clap::Arg>,
-        value: &std::ffi::OsStr,
-    ) -> Result<Self::Value, clap::Error> {
-        let value = value
-            .to_str()
-            .ok_or(clap::Error::new(ErrorKind::InvalidUtf8))?;
-
-        let matched_values: Vec<_> = self
-            .0
-            .iter()
-            .filter(|x| x.get_name().starts_with(value))
-            .collect();
-
-        match matched_values.len() {
-            0 => Err(self.generate_clap_error(cmd, arg, value)),
-            1 => Ok(matched_values[0].get_name().to_string()),
-            _ => {
-                if let Some(direct_match) = matched_values.iter().find(|x| x.get_name() == value) {
-                    Ok(direct_match.get_name().to_string())
-                } else {
-                    Err(self.generate_clap_error(cmd, arg, value))
-                }
-            }
-        }
-    }
-
-    fn possible_values(&self) -> Option<Box<dyn Iterator<Item = PossibleValue> + '_>> {
-        Some(Box::new(self.0.iter().cloned()))
-    }
-}
-
-impl<I, T> From<I> for ShortcutValueParser
-where
-    I: IntoIterator<Item = T>,
-    T: Into<PossibleValue>,
-{
-    fn from(values: I) -> Self {
-        Self(values.into_iter().map(|t| t.into()).collect())
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use std::ffi::OsStr;
-
-    use clap::{builder::TypedValueParser, error::ErrorKind, Command};
-
-    use super::ShortcutValueParser;
-
-    #[test]
-    fn test_parse_ref() {
-        let cmd = Command::new("cmd");
-        let parser = ShortcutValueParser::new(["abcd"]);
-        let values = ["a", "ab", "abc", "abcd"];
-
-        for value in values {
-            let result = parser.parse_ref(&cmd, None, OsStr::new(value));
-            assert_eq!("abcd", result.unwrap());
-        }
-    }
-
-    #[test]
-    fn test_parse_ref_with_invalid_value() {
-        let cmd = Command::new("cmd");
-        let parser = ShortcutValueParser::new(["abcd"]);
-        let invalid_values = ["e", "abe", "abcde"];
-
-        for invalid_value in invalid_values {
-            let result = parser.parse_ref(&cmd, None, OsStr::new(invalid_value));
-            assert_eq!(ErrorKind::InvalidValue, result.unwrap_err().kind());
-        }
-    }
-
-    #[test]
-    fn test_parse_ref_with_ambiguous_value() {
-        let cmd = Command::new("cmd");
-        let parser = ShortcutValueParser::new(["abcd", "abef"]);
-        let ambiguous_values = ["a", "ab"];
-
-        for ambiguous_value in ambiguous_values {
-            let result = parser.parse_ref(&cmd, None, OsStr::new(ambiguous_value));
-            assert_eq!(ErrorKind::InvalidValue, result.unwrap_err().kind());
-        }
-
-        let result = parser.parse_ref(&cmd, None, OsStr::new("abc"));
-        assert_eq!("abcd", result.unwrap());
-
-        let result = parser.parse_ref(&cmd, None, OsStr::new("abe"));
-        assert_eq!("abef", result.unwrap());
-    }
-
-    #[test]
-    fn test_parse_ref_with_ambiguous_value_that_is_a_possible_value() {
-        let cmd = Command::new("cmd");
-        let parser = ShortcutValueParser::new(["abcd", "abcdefgh"]);
-        let result = parser.parse_ref(&cmd, None, OsStr::new("abcd"));
-        assert_eq!("abcd", result.unwrap());
-    }
-
-    #[test]
-    #[cfg(unix)]
-    fn test_parse_ref_with_invalid_utf8() {
-        use std::os::unix::prelude::OsStrExt;
-
-        let parser = ShortcutValueParser::new(["abcd"]);
-        let cmd = Command::new("cmd");
-
-        let result = parser.parse_ref(&cmd, None, OsStr::from_bytes(&[0xc3 as u8, 0x28 as u8]));
-        assert_eq!(ErrorKind::InvalidUtf8, result.unwrap_err().kind());
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uucore_procs/lib.rs.html b/coreutils/dev/src/uucore_procs/lib.rs.html deleted file mode 100644 index 10bdd0661..000000000 --- a/coreutils/dev/src/uucore_procs/lib.rs.html +++ /dev/null @@ -1,309 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-
// Copyright (C) ~ Roy Ivy III <rivy.dev@gmail.com>; MIT license
-// spell-checker:ignore backticks uuhelp
-
-use std::{fs::File, io::Read, path::PathBuf};
-
-use proc_macro::{Literal, TokenStream, TokenTree};
-use quote::quote;
-
-//## rust proc-macro background info
-//* ref: <https://dev.to/naufraghi/procedural-macro-in-rust-101-k3f> @@ <http://archive.is/Vbr5e>
-//* ref: [path construction from LitStr](https://oschwald.github.io/maxminddb-rust/syn/struct.LitStr.html) @@ <http://archive.is/8YDua>
-
-#[proc_macro_attribute]
-pub fn main(_args: TokenStream, stream: TokenStream) -> TokenStream {
-    let stream = proc_macro2::TokenStream::from(stream);
-
-    let new = quote!(
-        pub fn uumain(args: impl uucore::Args) -> i32 {
-            #stream
-            let result = uumain(args);
-            match result {
-                Ok(()) => uucore::error::get_exit_code(),
-                Err(e) => {
-                    let s = format!("{}", e);
-                    if s != "" {
-                        uucore::show_error!("{}", s);
-                    }
-                    if e.usage() {
-                        eprintln!("Try '{} --help' for more information.", uucore::execution_phrase());
-                    }
-                    e.code()
-                }
-            }
-        }
-    );
-
-    TokenStream::from(new)
-}
-
-// FIXME: This is currently a stub. We could do much more here and could
-// even pull in a full markdown parser to get better results.
-/// Render markdown into a format that's easier to read in the terminal.
-///
-/// For now, all this function does is remove backticks.
-/// Some ideas for future improvement:
-/// - Render headings as bold
-/// - Convert triple backticks to indented
-/// - Printing tables in a nice format
-fn render_markdown(s: &str) -> String {
-    s.replace('`', "")
-}
-
-/// Get the about text from the help file.
-///
-/// The about text is assumed to be the text between the first markdown
-/// code block and the next header, if any. It may span multiple lines.
-#[proc_macro]
-pub fn help_about(input: TokenStream) -> TokenStream {
-    let input: Vec<TokenTree> = input.into_iter().collect();
-    let filename = get_argument(&input, 0, "filename");
-    let text: String = uuhelp_parser::parse_about(&read_help(&filename));
-    TokenTree::Literal(Literal::string(&text)).into()
-}
-
-/// Get the usage from the help file.
-///
-/// The usage is assumed to be surrounded by markdown code fences. It may span
-/// multiple lines. The first word of each line is assumed to be the name of
-/// the util and is replaced by "{}" so that the output of this function can be
-/// used with `uucore::format_usage`.
-#[proc_macro]
-pub fn help_usage(input: TokenStream) -> TokenStream {
-    let input: Vec<TokenTree> = input.into_iter().collect();
-    let filename = get_argument(&input, 0, "filename");
-    let text: String = uuhelp_parser::parse_usage(&read_help(&filename));
-    TokenTree::Literal(Literal::string(&text)).into()
-}
-
-/// Reads a section from a file of the util as a `str` literal.
-///
-/// It reads from the file specified as the second argument, relative to the
-/// crate root. The contents of this file are read verbatim, without parsing or
-/// escaping. The name of the help file should match the name of the util.
-/// I.e. numfmt should have a file called `numfmt.md`. By convention, the file
-/// should start with a top-level section with the name of the util. The other
-/// sections must start with 2 `#` characters. Capitalization of the sections
-/// does not matter. Leading and trailing whitespace of each section will be
-/// removed.
-///
-/// Example:
-/// ```md
-/// # numfmt
-/// ## About
-/// Convert numbers from/to human-readable strings
-///
-/// ## Long help
-/// This text will be the long help
-/// ```
-///
-/// ```rust,ignore
-/// help_section!("about", "numfmt.md");
-/// ```
-#[proc_macro]
-pub fn help_section(input: TokenStream) -> TokenStream {
-    let input: Vec<TokenTree> = input.into_iter().collect();
-    let section = get_argument(&input, 0, "section");
-    let filename = get_argument(&input, 1, "filename");
-
-    if let Some(text) = uuhelp_parser::parse_section(&section, &read_help(&filename)) {
-        let rendered = render_markdown(&text);
-        TokenTree::Literal(Literal::string(&rendered)).into()
-    } else {
-        panic!(
-            "The section '{section}' could not be found in the help file. Maybe it is spelled wrong?"
-        )
-    }
-}
-
-/// Get an argument from the input vector of `TokenTree`.
-///
-/// Asserts that the argument is a string literal and returns the string value,
-/// otherwise it panics with an error.
-fn get_argument(input: &[TokenTree], index: usize, name: &str) -> String {
-    // Multiply by two to ignore the `','` in between the arguments
-    let string = match &input.get(index * 2) {
-        Some(TokenTree::Literal(lit)) => lit.to_string(),
-        Some(_) => panic!("Argument {index} should be a string literal."),
-        None => panic!("Missing argument at index {index} for {name}"),
-    };
-
-    string
-        .parse::<String>()
-        .unwrap()
-        .strip_prefix('"')
-        .unwrap()
-        .strip_suffix('"')
-        .unwrap()
-        .to_string()
-}
-
-/// Read the help file
-fn read_help(filename: &str) -> String {
-    let mut content = String::new();
-
-    let mut path = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
-    path.push(filename);
-
-    File::open(path)
-        .unwrap()
-        .read_to_string(&mut content)
-        .unwrap();
-
-    content
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uudoc/home/runner/work/uutils.github.io/uutils.github.io/coreutils/target/debug/build/coreutils-26b04f519188b879/out/uutils_map.rs.html b/coreutils/dev/src/uudoc/home/runner/work/uutils.github.io/uutils.github.io/coreutils/target/debug/build/coreutils-26b04f519188b879/out/uutils_map.rs.html deleted file mode 100644 index 4d1498776..000000000 --- a/coreutils/dev/src/uudoc/home/runner/work/uutils.github.io/uutils.github.io/coreutils/target/debug/build/coreutils-26b04f519188b879/out/uutils_map.rs.html +++ /dev/null @@ -1,551 +0,0 @@ -uutils_map.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-
type UtilityMap<T> = phf::OrderedMap<&'static str, (fn(T) -> i32, fn() -> Command)>;
-
-fn util_map<T: uucore::Args>() -> UtilityMap<T> {
-::phf::OrderedMap {
-    key: 12913932095322966823,
-    disps: &[
-        (0, 115),
-        (0, 9),
-        (1, 0),
-        (0, 16),
-        (0, 23),
-        (11, 18),
-        (0, 3),
-        (7, 37),
-        (0, 114),
-        (0, 81),
-        (1, 35),
-        (0, 46),
-        (0, 61),
-        (1, 54),
-        (0, 2),
-        (3, 41),
-        (0, 2),
-        (1, 97),
-        (4, 50),
-        (2, 7),
-        (4, 12),
-        (2, 55),
-        (0, 100),
-        (27, 53),
-    ],
-    idxs: &[
-        75,
-        25,
-        118,
-        83,
-        61,
-        103,
-        73,
-        74,
-        110,
-        67,
-        1,
-        92,
-        7,
-        91,
-        49,
-        65,
-        64,
-        5,
-        29,
-        34,
-        13,
-        109,
-        63,
-        82,
-        36,
-        17,
-        101,
-        28,
-        70,
-        27,
-        55,
-        30,
-        100,
-        32,
-        57,
-        58,
-        116,
-        19,
-        11,
-        2,
-        106,
-        114,
-        90,
-        39,
-        85,
-        80,
-        54,
-        10,
-        107,
-        38,
-        9,
-        24,
-        81,
-        31,
-        35,
-        45,
-        111,
-        56,
-        117,
-        99,
-        84,
-        22,
-        51,
-        115,
-        93,
-        4,
-        94,
-        33,
-        43,
-        48,
-        15,
-        12,
-        79,
-        0,
-        77,
-        98,
-        50,
-        102,
-        78,
-        68,
-        97,
-        113,
-        6,
-        21,
-        20,
-        76,
-        86,
-        41,
-        87,
-        105,
-        26,
-        72,
-        3,
-        69,
-        18,
-        53,
-        66,
-        40,
-        60,
-        44,
-        46,
-        52,
-        8,
-        88,
-        16,
-        14,
-        59,
-        95,
-        47,
-        62,
-        104,
-        96,
-        112,
-        71,
-        89,
-        23,
-        37,
-        108,
-        42,
-    ],
-    entries: &[
-        ("arch", (arch::uumain, arch::uu_app)),
-        ("base32", (base32::uumain, base32::uu_app)),
-        ("base64", (base64::uumain, base64::uu_app)),
-        ("basename", (basename::uumain, basename::uu_app)),
-        ("basenc", (basenc::uumain, basenc::uu_app)),
-        ("cat", (cat::uumain, cat::uu_app)),
-        ("chcon", (chcon::uumain, chcon::uu_app)),
-        ("chgrp", (chgrp::uumain, chgrp::uu_app)),
-        ("chmod", (chmod::uumain, chmod::uu_app)),
-        ("chown", (chown::uumain, chown::uu_app)),
-        ("chroot", (chroot::uumain, chroot::uu_app)),
-        ("cksum", (cksum::uumain, cksum::uu_app)),
-        ("comm", (comm::uumain, comm::uu_app)),
-        ("cp", (cp::uumain, cp::uu_app)),
-        ("csplit", (csplit::uumain, csplit::uu_app)),
-        ("cut", (cut::uumain, cut::uu_app)),
-        ("date", (date::uumain, date::uu_app)),
-        ("dd", (dd::uumain, dd::uu_app)),
-        ("df", (df::uumain, df::uu_app)),
-        ("dir", (dir::uumain, dir::uu_app)),
-        ("dircolors", (dircolors::uumain, dircolors::uu_app)),
-        ("dirname", (dirname::uumain, dirname::uu_app)),
-        ("du", (du::uumain, du::uu_app)),
-        ("echo", (echo::uumain, echo::uu_app)),
-        ("env", (env::uumain, env::uu_app)),
-        ("expand", (expand::uumain, expand::uu_app)),
-        ("expr", (expr::uumain, expr::uu_app)),
-        ("factor", (factor::uumain, factor::uu_app)),
-        ("false", (r#false::uumain, r#false::uu_app)),
-        ("fmt", (fmt::uumain, fmt::uu_app)),
-        ("fold", (fold::uumain, fold::uu_app)),
-        ("groups", (groups::uumain, groups::uu_app)),
-        ("hashsum", (hashsum::uumain, hashsum::uu_app_custom)),
-        ("md5sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha1sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha224sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha256sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha384sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha512sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha3sum", (hashsum::uumain, hashsum::uu_app_bits)),
-        ("sha3-224sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha3-256sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha3-384sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("sha3-512sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("shake128sum", (hashsum::uumain, hashsum::uu_app_bits)),
-        ("shake256sum", (hashsum::uumain, hashsum::uu_app_bits)),
-        ("b2sum", (hashsum::uumain, hashsum::uu_app_common)),
-        ("b3sum", (hashsum::uumain, hashsum::uu_app_b3sum)),
-        ("head", (head::uumain, head::uu_app)),
-        ("hostid", (hostid::uumain, hostid::uu_app)),
-        ("hostname", (hostname::uumain, hostname::uu_app)),
-        ("id", (id::uumain, id::uu_app)),
-        ("install", (install::uumain, install::uu_app)),
-        ("join", (join::uumain, join::uu_app)),
-        ("kill", (kill::uumain, kill::uu_app)),
-        ("link", (link::uumain, link::uu_app)),
-        ("ln", (ln::uumain, ln::uu_app)),
-        ("logname", (logname::uumain, logname::uu_app)),
-        ("ls", (ls::uumain, ls::uu_app)),
-        ("mkdir", (mkdir::uumain, mkdir::uu_app)),
-        ("mkfifo", (mkfifo::uumain, mkfifo::uu_app)),
-        ("mknod", (mknod::uumain, mknod::uu_app)),
-        ("mktemp", (mktemp::uumain, mktemp::uu_app)),
-        ("more", (more::uumain, more::uu_app)),
-        ("mv", (mv::uumain, mv::uu_app)),
-        ("nice", (nice::uumain, nice::uu_app)),
-        ("nl", (nl::uumain, nl::uu_app)),
-        ("nohup", (nohup::uumain, nohup::uu_app)),
-        ("nproc", (nproc::uumain, nproc::uu_app)),
-        ("numfmt", (numfmt::uumain, numfmt::uu_app)),
-        ("od", (od::uumain, od::uu_app)),
-        ("paste", (paste::uumain, paste::uu_app)),
-        ("pathchk", (pathchk::uumain, pathchk::uu_app)),
-        ("pinky", (pinky::uumain, pinky::uu_app)),
-        ("pr", (pr::uumain, pr::uu_app)),
-        ("printenv", (printenv::uumain, printenv::uu_app)),
-        ("printf", (printf::uumain, printf::uu_app)),
-        ("ptx", (ptx::uumain, ptx::uu_app)),
-        ("pwd", (pwd::uumain, pwd::uu_app)),
-        ("readlink", (readlink::uumain, readlink::uu_app)),
-        ("realpath", (realpath::uumain, realpath::uu_app)),
-        ("relpath", (relpath::uumain, relpath::uu_app)),
-        ("rm", (rm::uumain, rm::uu_app)),
-        ("rmdir", (rmdir::uumain, rmdir::uu_app)),
-        ("runcon", (runcon::uumain, runcon::uu_app)),
-        ("seq", (seq::uumain, seq::uu_app)),
-        ("shred", (shred::uumain, shred::uu_app)),
-        ("shuf", (shuf::uumain, shuf::uu_app)),
-        ("sleep", (sleep::uumain, sleep::uu_app)),
-        ("sort", (sort::uumain, sort::uu_app)),
-        ("split", (split::uumain, split::uu_app)),
-        ("stat", (stat::uumain, stat::uu_app)),
-        ("stdbuf", (stdbuf::uumain, stdbuf::uu_app)),
-        ("stty", (stty::uumain, stty::uu_app)),
-        ("sum", (sum::uumain, sum::uu_app)),
-        ("sync", (sync::uumain, sync::uu_app)),
-        ("tac", (tac::uumain, tac::uu_app)),
-        ("tail", (tail::uumain, tail::uu_app)),
-        ("tee", (tee::uumain, tee::uu_app)),
-        ("timeout", (timeout::uumain, timeout::uu_app)),
-        ("touch", (touch::uumain, touch::uu_app)),
-        ("tr", (tr::uumain, tr::uu_app)),
-        ("true", (r#true::uumain, r#true::uu_app)),
-        ("truncate", (truncate::uumain, truncate::uu_app)),
-        ("tsort", (tsort::uumain, tsort::uu_app)),
-        ("tty", (tty::uumain, tty::uu_app)),
-        ("uname", (uname::uumain, uname::uu_app)),
-        ("unexpand", (unexpand::uumain, unexpand::uu_app)),
-        ("uniq", (uniq::uumain, uniq::uu_app)),
-        ("unlink", (unlink::uumain, unlink::uu_app)),
-        ("uptime", (uptime::uumain, uptime::uu_app)),
-        ("users", (users::uumain, users::uu_app)),
-        ("test", (uu_test::uumain, uu_test::uu_app)),
-        ("[", (uu_test::uumain, uu_test::uu_app)),
-        ("vdir", (vdir::uumain, vdir::uu_app)),
-        ("wc", (wc::uumain, wc::uu_app)),
-        ("who", (who::uumain, who::uu_app)),
-        ("whoami", (whoami::uumain, whoami::uu_app)),
-        ("yes", (yes::uumain, yes::uu_app)),
-    ],
-}
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uudoc/uudoc.rs.html b/coreutils/dev/src/uudoc/uudoc.rs.html deleted file mode 100644 index 55ebb6d08..000000000 --- a/coreutils/dev/src/uudoc/uudoc.rs.html +++ /dev/null @@ -1,723 +0,0 @@ -uudoc.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-
// This file is part of the uutils coreutils package.
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-// spell-checker:ignore tldr uuhelp
-
-use clap::Command;
-use std::collections::HashMap;
-use std::ffi::OsString;
-use std::fs::File;
-use std::io::{self, Read, Seek, Write};
-use zip::ZipArchive;
-
-include!(concat!(env!("OUT_DIR"), "/uutils_map.rs"));
-
-fn main() -> io::Result<()> {
-    let mut tldr_zip = File::open("docs/tldr.zip")
-        .ok()
-        .and_then(|f| ZipArchive::new(f).ok());
-
-    if tldr_zip.is_none() {
-        println!("Warning: No tldr archive found, so the documentation will not include examples.");
-        println!("To include examples in the documentation, download the tldr archive and put it in the docs/ folder.");
-        println!();
-        println!("  curl https://tldr.sh/assets/tldr.zip -o docs/tldr.zip");
-        println!();
-    }
-
-    let utils = util_map::<Box<dyn Iterator<Item = OsString>>>();
-    match std::fs::create_dir("docs/src/utils/") {
-        Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => Ok(()),
-        x => x,
-    }?;
-
-    println!("Writing initial info to SUMMARY.md");
-    let mut summary = File::create("docs/src/SUMMARY.md")?;
-
-    let _ = write!(
-        summary,
-        "# Summary\n\
-        \n\
-        [Introduction](index.md)\n\
-        * [Installation](installation.md)\n\
-        * [Build from source](build.md)\n\
-        * [Platform support](platforms.md)\n\
-        * [Contributing](contributing.md)\n\
-        * [GNU test coverage](test_coverage.md)\n\
-        * [Extensions](extensions.md)\n\
-        \n\
-        # Reference\n\
-        * [Multi-call binary](multicall.md)\n",
-    );
-
-    println!("Gathering utils per platform");
-    let utils_per_platform = {
-        let mut map = HashMap::new();
-        for platform in ["unix", "macos", "windows", "unix_android"] {
-            let platform_utils: Vec<String> = String::from_utf8(
-                std::process::Command::new("./util/show-utils.sh")
-                    .arg(format!("--features=feat_os_{}", platform))
-                    .output()?
-                    .stdout,
-            )
-            .unwrap()
-            .trim()
-            .split(' ')
-            .map(ToString::to_string)
-            .collect();
-            map.insert(platform, platform_utils);
-        }
-
-        // Linux is a special case because it can support selinux
-        let platform_utils: Vec<String> = String::from_utf8(
-            std::process::Command::new("./util/show-utils.sh")
-                .arg("--features=feat_os_unix feat_selinux")
-                .output()?
-                .stdout,
-        )
-        .unwrap()
-        .trim()
-        .split(' ')
-        .map(ToString::to_string)
-        .collect();
-        map.insert("linux", platform_utils);
-
-        map
-    };
-
-    let mut utils = utils.entries().collect::<Vec<_>>();
-    utils.sort();
-
-    println!("Writing util per platform table");
-    {
-        let mut platform_table_file = File::create("docs/src/platform_table.md").unwrap();
-
-        // sum, cksum, b2sum, etc. are all available on all platforms, but not in the data structure
-        // otherwise, we check the map for the util name.
-        let check_supported = |name: &str, platform: &str| {
-            if name.ends_with("sum") || utils_per_platform[platform].iter().any(|u| u == name) {
-                "✓"
-            } else {
-                " "
-            }
-        };
-        writeln!(
-            platform_table_file,
-            "| util             | Linux | macOS | Windows | FreeBSD | Android |\n\
-             | ---------------- | ----- | ----- | ------- | ------- | ------- |"
-        )?;
-        for (&name, _) in &utils {
-            if name == "[" {
-                continue;
-            }
-            // The alignment is not necessary, but makes the output a bit more
-            // pretty when viewed as plain markdown.
-            writeln!(
-                platform_table_file,
-                "| {:<16} | {:<5} | {:<5} | {:<7} | {:<7} | {:<7} |",
-                format!("**{name}**"),
-                check_supported(name, "linux"),
-                check_supported(name, "macos"),
-                check_supported(name, "windows"),
-                check_supported(name, "unix"),
-                check_supported(name, "unix_android"),
-            )?;
-        }
-    }
-
-    println!("Writing to utils");
-    for (&name, (_, command)) in utils {
-        if name == "[" {
-            continue;
-        }
-        let p = format!("docs/src/utils/{}.md", name);
-
-        let markdown = File::open(format!("src/uu/{name}/{name}.md"))
-            .and_then(|mut f: File| {
-                let mut s = String::new();
-                f.read_to_string(&mut s)?;
-                Ok(s)
-            })
-            .ok();
-
-        if let Ok(f) = File::create(&p) {
-            MDWriter {
-                w: Box::new(f),
-                command: command(),
-                name,
-                tldr_zip: &mut tldr_zip,
-                utils_per_platform: &utils_per_platform,
-                markdown,
-            }
-            .markdown()?;
-            println!("Wrote to '{}'", p);
-        } else {
-            println!("Error writing to {}", p);
-        }
-        writeln!(summary, "* [{0}](utils/{0}.md)", name)?;
-    }
-    Ok(())
-}
-
-struct MDWriter<'a, 'b> {
-    w: Box<dyn Write>,
-    command: Command,
-    name: &'a str,
-    tldr_zip: &'b mut Option<ZipArchive<File>>,
-    utils_per_platform: &'b HashMap<&'b str, Vec<String>>,
-    markdown: Option<String>,
-}
-
-impl<'a, 'b> MDWriter<'a, 'b> {
-    fn markdown(&mut self) -> io::Result<()> {
-        write!(self.w, "# {}\n\n", self.name)?;
-        self.additional()?;
-        self.usage()?;
-        self.about()?;
-        self.options()?;
-        self.after_help()?;
-        self.examples()
-    }
-
-    fn additional(&mut self) -> io::Result<()> {
-        writeln!(self.w, "<div class=\"additional\">")?;
-        self.platforms()?;
-        self.version()?;
-        writeln!(self.w, "</div>")
-    }
-
-    fn platforms(&mut self) -> io::Result<()> {
-        writeln!(self.w, "<div class=\"platforms\">")?;
-        for (feature, icon) in [
-            ("linux", "linux"),
-            // freebsd is disabled for now because mdbook does not use font-awesome 5 yet.
-            // ("unix", "freebsd"),
-            ("macos", "apple"),
-            ("windows", "windows"),
-        ] {
-            if self.name.contains("sum")
-                || self.utils_per_platform[feature]
-                    .iter()
-                    .any(|u| u == self.name)
-            {
-                writeln!(self.w, "<i class=\"fa fa-brands fa-{}\"></i>", icon)?;
-            }
-        }
-        writeln!(self.w, "</div>")?;
-
-        Ok(())
-    }
-
-    fn version(&mut self) -> io::Result<()> {
-        writeln!(
-            self.w,
-            "<div class=\"version\">v{}</div>",
-            self.command.render_version().split_once(' ').unwrap().1
-        )
-    }
-
-    fn usage(&mut self) -> io::Result<()> {
-        if let Some(markdown) = &self.markdown {
-            let usage = uuhelp_parser::parse_usage(markdown);
-            let usage = usage.replace("{}", self.name);
-
-            writeln!(self.w, "\n```")?;
-            writeln!(self.w, "{}", usage)?;
-            writeln!(self.w, "```")
-        } else {
-            Ok(())
-        }
-    }
-
-    fn about(&mut self) -> io::Result<()> {
-        if let Some(markdown) = &self.markdown {
-            writeln!(self.w, "{}", uuhelp_parser::parse_about(markdown))
-        } else {
-            Ok(())
-        }
-    }
-
-    fn after_help(&mut self) -> io::Result<()> {
-        if let Some(markdown) = &self.markdown {
-            if let Some(after_help) = uuhelp_parser::parse_section("after help", markdown) {
-                return writeln!(self.w, "\n\n{after_help}");
-            }
-        }
-
-        Ok(())
-    }
-
-    fn examples(&mut self) -> io::Result<()> {
-        if let Some(zip) = self.tldr_zip {
-            let content = if let Some(f) =
-                get_zip_content(zip, &format!("pages/common/{}.md", self.name))
-            {
-                f
-            } else if let Some(f) = get_zip_content(zip, &format!("pages/linux/{}.md", self.name)) {
-                f
-            } else {
-                println!(
-                    "Warning: Could not find tldr examples for page '{}'",
-                    self.name
-                );
-                return Ok(());
-            };
-
-            writeln!(self.w, "## Examples")?;
-            writeln!(self.w)?;
-            for line in content.lines().skip_while(|l| !l.starts_with('-')) {
-                if let Some(l) = line.strip_prefix("- ") {
-                    writeln!(self.w, "{}", l)?;
-                } else if line.starts_with('`') {
-                    writeln!(self.w, "```shell\n{}\n```", line.trim_matches('`'))?;
-                } else if line.is_empty() {
-                    writeln!(self.w)?;
-                } else {
-                    println!("Not sure what to do with this line:");
-                    println!("{}", line);
-                }
-            }
-            writeln!(self.w)?;
-            writeln!(
-                self.w,
-                "> The examples are provided by the [tldr-pages project](https://tldr.sh) under the [CC BY 4.0 License](https://github.com/tldr-pages/tldr/blob/main/LICENSE.md)."
-            )?;
-            writeln!(self.w, ">")?;
-            writeln!(
-                self.w,
-                "> Please note that, as uutils is a work in progress, some examples might fail."
-            )?;
-        }
-        Ok(())
-    }
-
-    fn options(&mut self) -> io::Result<()> {
-        writeln!(self.w, "<h2>Options</h2>")?;
-        write!(self.w, "<dl>")?;
-        for arg in self.command.get_arguments() {
-            write!(self.w, "<dt>")?;
-            let mut first = true;
-            for l in arg.get_long_and_visible_aliases().unwrap_or_default() {
-                if first {
-                    first = false;
-                } else {
-                    write!(self.w, ", ")?;
-                }
-                write!(self.w, "<code>")?;
-                write!(self.w, "--{}", l)?;
-                if let Some(names) = arg.get_value_names() {
-                    write!(
-                        self.w,
-                        "={}",
-                        names
-                            .iter()
-                            .map(|x| format!("&lt;{}&gt;", x))
-                            .collect::<Vec<_>>()
-                            .join(" ")
-                    )?;
-                }
-                write!(self.w, "</code>")?;
-            }
-            for s in arg.get_short_and_visible_aliases().unwrap_or_default() {
-                if first {
-                    first = false;
-                } else {
-                    write!(self.w, ", ")?;
-                }
-                write!(self.w, "<code>")?;
-                write!(self.w, "-{}", s)?;
-                if let Some(names) = arg.get_value_names() {
-                    write!(
-                        self.w,
-                        " {}",
-                        names
-                            .iter()
-                            .map(|x| format!("&lt;{}&gt;", x))
-                            .collect::<Vec<_>>()
-                            .join(" ")
-                    )?;
-                }
-                write!(self.w, "</code>")?;
-            }
-            writeln!(self.w, "</dt>")?;
-            writeln!(
-                self.w,
-                "<dd>\n\n{}\n\n</dd>",
-                arg.get_help()
-                    .unwrap_or_default()
-                    .to_string()
-                    .replace('\n', "<br />")
-            )?;
-        }
-        writeln!(self.w, "</dl>\n")
-    }
-}
-
-fn get_zip_content(archive: &mut ZipArchive<impl Read + Seek>, name: &str) -> Option<String> {
-    let mut s = String::new();
-    archive.by_name(name).ok()?.read_to_string(&mut s).unwrap();
-    Some(s)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/uuhelp_parser/lib.rs.html b/coreutils/dev/src/uuhelp_parser/lib.rs.html deleted file mode 100644 index a479f495b..000000000 --- a/coreutils/dev/src/uuhelp_parser/lib.rs.html +++ /dev/null @@ -1,473 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-
// This file is part of the uutils coreutils package.
-//
-// For the full copyright and license information, please view the LICENSE
-// file that was distributed with this source code.
-
-//! A collection of functions to parse the markdown code of help files.
-//!
-//! The structure of the markdown code is assumed to be:
-//!
-//! # util name
-//!
-//! ```text
-//! usage info
-//! ```
-//!
-//! About text
-//!
-//! ## Section 1
-//!
-//! Some content
-//!
-//! ## Section 2
-//!
-//! Some content
-
-const MARKDOWN_CODE_FENCES: &str = "```";
-
-/// Parses the text between the first markdown code block and the next header, if any,
-/// into an about string.
-pub fn parse_about(content: &str) -> String {
-    content
-        .lines()
-        .skip_while(|l| !l.starts_with(MARKDOWN_CODE_FENCES))
-        .skip(1)
-        .skip_while(|l| !l.starts_with(MARKDOWN_CODE_FENCES))
-        .skip(1)
-        .take_while(|l| !l.starts_with('#'))
-        .collect::<Vec<_>>()
-        .join("\n")
-        .trim()
-        .to_string()
-}
-
-/// Parses the first markdown code block into a usage string
-///
-/// The code fences are removed and the name of the util is replaced
-/// with `{}` so that it can be replaced with the appropriate name
-/// at runtime.
-pub fn parse_usage(content: &str) -> String {
-    content
-        .lines()
-        .skip_while(|l| !l.starts_with(MARKDOWN_CODE_FENCES))
-        .skip(1)
-        .take_while(|l| !l.starts_with(MARKDOWN_CODE_FENCES))
-        .map(|l| {
-            // Replace the util name (assumed to be the first word) with "{}"
-            // to be replaced with the runtime value later.
-            if let Some((_util, args)) = l.split_once(' ') {
-                format!("{{}} {args}\n")
-            } else {
-                "{}\n".to_string()
-            }
-        })
-        .collect::<Vec<_>>()
-        .join("")
-        .trim()
-        .to_string()
-}
-
-/// Get a single section from content
-///
-/// The section must be a second level section (i.e. start with `##`).
-pub fn parse_section(section: &str, content: &str) -> Option<String> {
-    fn is_section_header(line: &str, section: &str) -> bool {
-        line.strip_prefix("##")
-            .map_or(false, |l| l.trim().to_lowercase() == section)
-    }
-
-    let section = &section.to_lowercase();
-
-    // We cannot distinguish between an empty or non-existing section below,
-    // so we do a quick test to check whether the section exists
-    if content.lines().all(|l| !is_section_header(l, section)) {
-        return None;
-    }
-
-    // Prefix includes space to allow processing of section with level 3-6 headers
-    let section_header_prefix = "## ";
-
-    Some(
-        content
-            .lines()
-            .skip_while(|&l| !is_section_header(l, section))
-            .skip(1)
-            .take_while(|l| !l.starts_with(section_header_prefix))
-            .collect::<Vec<_>>()
-            .join("\n")
-            .trim()
-            .to_string(),
-    )
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    fn test_parse_section() {
-        let input = "\
-            # ls\n\
-            ## some section\n\
-            This is some section\n\
-            \n\
-            ## ANOTHER SECTION
-            This is the other section\n\
-            with multiple lines\n";
-
-        assert_eq!(
-            parse_section("some section", input).unwrap(),
-            "This is some section"
-        );
-        assert_eq!(
-            parse_section("SOME SECTION", input).unwrap(),
-            "This is some section"
-        );
-        assert_eq!(
-            parse_section("another section", input).unwrap(),
-            "This is the other section\nwith multiple lines"
-        );
-    }
-
-    #[test]
-    fn test_parse_section_with_sub_headers() {
-        let input = "\
-            # ls\n\
-            ## after section\n\
-            This is some section\n\
-            \n\
-            ### level 3 header\n\
-            \n\
-            Additional text under the section.\n\
-            \n\
-            #### level 4 header\n\
-            \n\
-            Yet another paragraph\n";
-
-        assert_eq!(
-            parse_section("after section", input).unwrap(),
-            "This is some section\n\n\
-            ### level 3 header\n\n\
-            Additional text under the section.\n\n\
-            #### level 4 header\n\n\
-            Yet another paragraph"
-        );
-    }
-
-    #[test]
-    fn test_parse_non_existing_section() {
-        let input = "\
-            # ls\n\
-            ## some section\n\
-            This is some section\n\
-            \n\
-            ## ANOTHER SECTION
-            This is the other section\n\
-            with multiple lines\n";
-
-        assert!(parse_section("non-existing section", input).is_none());
-    }
-
-    #[test]
-    fn test_parse_usage() {
-        let input = "\
-            # ls\n\
-            ```\n\
-            ls -l\n\
-            ```\n\
-            ## some section\n\
-            This is some section\n\
-            \n\
-            ## ANOTHER SECTION
-            This is the other section\n\
-            with multiple lines\n";
-
-        assert_eq!(parse_usage(input), "{} -l");
-    }
-
-    #[test]
-    fn test_parse_multi_line_usage() {
-        let input = "\
-            # ls\n\
-            ```\n\
-            ls -a\n\
-            ls -b\n\
-            ls -c\n\
-            ```\n\
-            ## some section\n\
-            This is some section\n";
-
-        assert_eq!(parse_usage(input), "{} -a\n{} -b\n{} -c");
-    }
-
-    #[test]
-    fn test_parse_about() {
-        let input = "\
-            # ls\n\
-            ```\n\
-            ls -l\n\
-            ```\n\
-            \n\
-            This is the about section\n\
-            \n\
-            ## some section\n\
-            This is some section\n";
-
-        assert_eq!(parse_about(input), "This is the about section");
-    }
-
-    #[test]
-    fn test_parse_multi_line_about() {
-        let input = "\
-            # ls\n\
-            ```\n\
-            ls -l\n\
-            ```\n\
-            \n\
-            about a\n\
-            \n\
-            about b\n\
-            \n\
-            ## some section\n\
-            This is some section\n";
-
-        assert_eq!(parse_about(input), "about a\n\nabout b");
-    }
-}
-
\ No newline at end of file diff --git a/coreutils/dev/src/vdir/main.rs.html b/coreutils/dev/src/vdir/main.rs.html deleted file mode 100644 index f9f7f5d52..000000000 --- a/coreutils/dev/src/vdir/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_vdir);
-
\ No newline at end of file diff --git a/coreutils/dev/src/wc/main.rs.html b/coreutils/dev/src/wc/main.rs.html deleted file mode 100644 index ef1cfd124..000000000 --- a/coreutils/dev/src/wc/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_wc);
-
\ No newline at end of file diff --git a/coreutils/dev/src/who/main.rs.html b/coreutils/dev/src/who/main.rs.html deleted file mode 100644 index 53d113335..000000000 --- a/coreutils/dev/src/who/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_who);
-
\ No newline at end of file diff --git a/coreutils/dev/src/whoami/main.rs.html b/coreutils/dev/src/whoami/main.rs.html deleted file mode 100644 index 361b2dfcd..000000000 --- a/coreutils/dev/src/whoami/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_whoami);
-
\ No newline at end of file diff --git a/coreutils/dev/src/yes/main.rs.html b/coreutils/dev/src/yes/main.rs.html deleted file mode 100644 index 24d69ceef..000000000 --- a/coreutils/dev/src/yes/main.rs.html +++ /dev/null @@ -1,3 +0,0 @@ -main.rs - source
1
-
uucore::bin!(uu_yes);
-
\ No newline at end of file diff --git a/coreutils/dev/stat/all.html b/coreutils/dev/stat/all.html deleted file mode 100644 index 79b3dbc39..000000000 --- a/coreutils/dev/stat/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/stat/fn.main.html b/coreutils/dev/stat/fn.main.html deleted file mode 100644 index 8e3ed97a9..000000000 --- a/coreutils/dev/stat/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in stat - Rust

Function stat::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/stat/index.html b/coreutils/dev/stat/index.html deleted file mode 100644 index fcb55fffd..000000000 --- a/coreutils/dev/stat/index.html +++ /dev/null @@ -1 +0,0 @@ -stat - Rust
\ No newline at end of file diff --git a/coreutils/dev/stat/sidebar-items.js b/coreutils/dev/stat/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/stat/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/coreutils/dev/static.files/COPYRIGHT-23e9bde6c69aea69.txt deleted file mode 100644 index 1447df792..000000000 --- a/coreutils/dev/static.files/COPYRIGHT-23e9bde6c69aea69.txt +++ /dev/null @@ -1,50 +0,0 @@ -# REUSE-IgnoreStart - -These documentation pages include resources by third parties. This copyright -file applies only to those resources. The following third party resources are -included, and carry their own copyright notices and license terms: - -* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): - - Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ - with Reserved Font Name Fira Sans. - - Copyright (c) 2014, Telefonica S.A. - - Licensed under the SIL Open Font License, Version 1.1. - See FiraSans-LICENSE.txt. - -* rustdoc.css, main.js, and playpen.js: - - Copyright 2015 The Rust Developers. - Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or - the MIT license (LICENSE-MIT.txt) at your option. - -* normalize.css: - - Copyright (c) Nicolas Gallagher and Jonathan Neal. - Licensed under the MIT license (see LICENSE-MIT.txt). - -* Source Code Pro (SourceCodePro-Regular.ttf.woff2, - SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): - - Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), - with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark - of Adobe Systems Incorporated in the United States and/or other countries. - - Licensed under the SIL Open Font License, Version 1.1. - See SourceCodePro-LICENSE.txt. - -* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, - SourceSerif4-It.ttf.woff2): - - Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name - 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United - States and/or other countries. - - Licensed under the SIL Open Font License, Version 1.1. - See SourceSerif4-LICENSE.md. - -This copyright file is intended to be distributed with rustdoc output. - -# REUSE-IgnoreEnd diff --git a/coreutils/dev/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/coreutils/dev/static.files/FiraSans-LICENSE-db4b642586e02d97.txt deleted file mode 100644 index d7e9c149b..000000000 --- a/coreutils/dev/static.files/FiraSans-LICENSE-db4b642586e02d97.txt +++ /dev/null @@ -1,98 +0,0 @@ -// REUSE-IgnoreStart - -Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. -with Reserved Font Name < Fira >, - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - -// REUSE-IgnoreEnd diff --git a/coreutils/dev/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/coreutils/dev/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 deleted file mode 100644 index 7a1e5fc54..000000000 Binary files a/coreutils/dev/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 and /dev/null differ diff --git a/coreutils/dev/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/coreutils/dev/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 deleted file mode 100644 index e766e06cc..000000000 Binary files a/coreutils/dev/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 and /dev/null differ diff --git a/coreutils/dev/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/coreutils/dev/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt deleted file mode 100644 index 16fe87b06..000000000 --- a/coreutils/dev/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/coreutils/dev/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/coreutils/dev/static.files/LICENSE-MIT-65090b722b3f6c56.txt deleted file mode 100644 index 31aa79387..000000000 --- a/coreutils/dev/static.files/LICENSE-MIT-65090b722b3f6c56.txt +++ /dev/null @@ -1,23 +0,0 @@ -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/coreutils/dev/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/coreutils/dev/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 deleted file mode 100644 index 1866ad4bc..000000000 Binary files a/coreutils/dev/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 and /dev/null differ diff --git a/coreutils/dev/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/coreutils/dev/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt deleted file mode 100644 index 4b3edc29e..000000000 --- a/coreutils/dev/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt +++ /dev/null @@ -1,103 +0,0 @@ -// REUSE-IgnoreStart - -Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), - -with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, -NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, -Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, -NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, -Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - -// REUSE-IgnoreEnd diff --git a/coreutils/dev/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/coreutils/dev/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 deleted file mode 100644 index 462c34efc..000000000 Binary files a/coreutils/dev/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 and /dev/null differ diff --git a/coreutils/dev/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/coreutils/dev/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt deleted file mode 100644 index 0d2941e14..000000000 --- a/coreutils/dev/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt +++ /dev/null @@ -1,97 +0,0 @@ -// REUSE-IgnoreStart - -Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. - -This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - -// REUSE-IgnoreEnd diff --git a/coreutils/dev/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/coreutils/dev/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 deleted file mode 100644 index 10b558e0b..000000000 Binary files a/coreutils/dev/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 and /dev/null differ diff --git a/coreutils/dev/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/coreutils/dev/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 deleted file mode 100644 index 5ec64eef0..000000000 Binary files a/coreutils/dev/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 and /dev/null differ diff --git a/coreutils/dev/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/coreutils/dev/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 deleted file mode 100644 index 181a07f63..000000000 Binary files a/coreutils/dev/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 and /dev/null differ diff --git a/coreutils/dev/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/coreutils/dev/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 deleted file mode 100644 index 2ae08a7be..000000000 Binary files a/coreutils/dev/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 and /dev/null differ diff --git a/coreutils/dev/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/coreutils/dev/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md deleted file mode 100644 index 175fa4f47..000000000 --- a/coreutils/dev/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md +++ /dev/null @@ -1,98 +0,0 @@ - - -Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. -Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. - -This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - - diff --git a/coreutils/dev/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/coreutils/dev/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 deleted file mode 100644 index 0263fc304..000000000 Binary files a/coreutils/dev/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 and /dev/null differ diff --git a/coreutils/dev/static.files/ayu-614652228113ac93.css b/coreutils/dev/static.files/ayu-614652228113ac93.css deleted file mode 100644 index 8fd09c9e4..000000000 --- a/coreutils/dev/static.files/ayu-614652228113ac93.css +++ /dev/null @@ -1 +0,0 @@ - :root{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--source-sidebar-background-selected:#14191f;--source-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:rgb(91,59,1);--scrape-example-code-line-highlight-focus:rgb(124,75,15);--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);}h1,h2,h3,h4,h1 a,.sidebar h2 a,.sidebar h3 a,#source-sidebar>.title{color:#fff;}h4{border:none;}.docblock code{color:#ffb454;}.docblock a>code{color:#39AFD7 !important;}.code-header,.docblock pre>code,pre,pre>code,.item-info code,.rustdoc.source .example-wrap{color:#e6e1cf;}.sidebar .current,.sidebar a:hover,#source-sidebar div.files>a:hover,details.dir-entry summary:hover,#source-sidebar div.files>a:focus,details.dir-entry summary:focus,#source-sidebar div.files>a.selected{color:#ffb44c;}.sidebar-elems .location{color:#ff7733;}.src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}.search-results a:hover,.search-results a:focus{color:#fff !important;background-color:#3c3c3c;}.search-results a{color:#0096cf;}.search-results a div.desc{color:#c5c5c5;}.result-name .primitive>i,.result-name .keyword>i{color:#788797;}#search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}#search-tabs>button:not(.selected){border:none;background-color:transparent !important;}#search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#settings-menu>a img{filter:invert(100);} \ No newline at end of file diff --git a/coreutils/dev/static.files/clipboard-7571035ce49a181d.svg b/coreutils/dev/static.files/clipboard-7571035ce49a181d.svg deleted file mode 100644 index 8adbd9963..000000000 --- a/coreutils/dev/static.files/clipboard-7571035ce49a181d.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/coreutils/dev/static.files/dark-1097f8e92a01e3cf.css b/coreutils/dev/static.files/dark-1097f8e92a01e3cf.css deleted file mode 100644 index 1e5e7d194..000000000 --- a/coreutils/dev/static.files/dark-1097f8e92a01e3cf.css +++ /dev/null @@ -1 +0,0 @@ -:root{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--source-sidebar-background-selected:#333;--source-sidebar-background-hover:#444;--table-alt-row-background-color:#2A2A2A;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:rgb(91,59,1);--scrape-example-code-line-highlight-focus:rgb(124,75,15);--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);} \ No newline at end of file diff --git a/coreutils/dev/static.files/favicon-16x16-8b506e7a72182f1c.png b/coreutils/dev/static.files/favicon-16x16-8b506e7a72182f1c.png deleted file mode 100644 index ea4b45cae..000000000 Binary files a/coreutils/dev/static.files/favicon-16x16-8b506e7a72182f1c.png and /dev/null differ diff --git a/coreutils/dev/static.files/favicon-2c020d218678b618.svg b/coreutils/dev/static.files/favicon-2c020d218678b618.svg deleted file mode 100644 index 8b34b5119..000000000 --- a/coreutils/dev/static.files/favicon-2c020d218678b618.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/coreutils/dev/static.files/favicon-32x32-422f7d1d52889060.png b/coreutils/dev/static.files/favicon-32x32-422f7d1d52889060.png deleted file mode 100644 index 69b8613ce..000000000 Binary files a/coreutils/dev/static.files/favicon-32x32-422f7d1d52889060.png and /dev/null differ diff --git a/coreutils/dev/static.files/light-0f8c037637f9eb3e.css b/coreutils/dev/static.files/light-0f8c037637f9eb3e.css deleted file mode 100644 index 21c3a859b..000000000 --- a/coreutils/dev/static.files/light-0f8c037637f9eb3e.css +++ /dev/null @@ -1 +0,0 @@ -:root{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#F5F5F5;--sidebar-background-color-hover:#E0E0E0;--code-block-background-color:#F5F5F5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#ffffff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--source-sidebar-background-selected:#fff;--source-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#F5F5F5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);} \ No newline at end of file diff --git a/coreutils/dev/static.files/main-f0540c1d82cde29b.js b/coreutils/dev/static.files/main-f0540c1d82cde29b.js deleted file mode 100644 index 2fa290256..000000000 --- a/coreutils/dev/static.files/main-f0540c1d82cde29b.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict";function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function elemIsInParent(elem,parent){while(elem&&elem!==document.body){if(elem===parent){return true}elem=elem.parentElement}return false}function blurHandler(event,parentElem,hideCallback){if(!elemIsInParent(document.activeElement,parentElem)&&!elemIsInParent(event.relatedTarget,parentElem)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileLocationTitle=document.querySelector(".mobile-topbar h2");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileLocationTitle&&locationTitle){mobileLocationTitle.innerHTML=locationTitle.innerHTML}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function loadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="stylesheet";document.getElementsByTagName("head")[0].appendChild(link)}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadCss(getVar("static-root-path")+getVar("settings-css"));loadScript(getVar("static-root-path")+getVar("settings-js"));preLoadCss(getVar("static-root-path")+getVar("theme-light-css"));preLoadCss(getVar("static-root-path")+getVar("theme-dark-css"));preLoadCss(getVar("static-root-path")+getVar("theme-ayu-css"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},hideResults:()=>{switchDisplayedElement(null);document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=name+"/index.html"}else{path=shortty+"."+name+".html"}const current_page=document.location.href.split("/").pop();const link=document.createElement("a");link.href=path;if(path===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("union","unions","Unions");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Definitions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","));for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";if(window.rootPath!=="./"&&crate===window.currentCrate){link.className="current"}link.textContent=crate;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else if(e.getAttribute("title")!==undefined){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("title")));wrapper.appendChild(titleContent)}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px")}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;wrapper.onpointerleave=function(ev){if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!elemIsInParent(event.relatedTarget,e)){hideTooltip(true)}}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!elemIsInParent(document.activeElement,window.CURRENT_TOOLTIP_ELEMENT)&&!elemIsInParent(event.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT)&&!elemIsInParent(document.activeElement,window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE)&&!elemIsInParent(event.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=function(){this.TOOLTIP_FORCE_VISIBLE=this.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!this.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(this);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=function(ev){if(ev.pointerType!=="mouse"){return}showTooltip(this)};e.onpointerleave=function(ev){if(ev.pointerType!=="mouse"){return}if(!this.TOOLTIP_FORCE_VISIBLE&&!elemIsInParent(ev.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT)){hideTooltip(true)}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");book_info.className="top";book_info.innerHTML="You can find more information in \ - the rustdoc book.";const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=["Prefix searches with a type followed by a colon (e.g., fn:) to \ - restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ - enum, trait, type, macro, \ - and const.","Search functions by type signature (e.g., vec -> usize or \ - -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ - your request: \"string\"","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=function(switchFocus){hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=function(){onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.children[0].style.display="none";let tmp;if(but.childNodes.length<2){tmp=document.createTextNode("✓");but.appendChild(tmp)}else{onEachLazy(but.childNodes,e=>{if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent="✓"}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent="";reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/coreutils/dev/static.files/normalize-76eba96aa4d2e634.css b/coreutils/dev/static.files/normalize-76eba96aa4d2e634.css deleted file mode 100644 index 469959f13..000000000 --- a/coreutils/dev/static.files/normalize-76eba96aa4d2e634.css +++ /dev/null @@ -1,2 +0,0 @@ - /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ -html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/coreutils/dev/static.files/noscript-13285aec31fa243e.css b/coreutils/dev/static.files/noscript-13285aec31fa243e.css deleted file mode 100644 index c32e0cb13..000000000 --- a/coreutils/dev/static.files/noscript-13285aec31fa243e.css +++ /dev/null @@ -1 +0,0 @@ - #main-content .attributes{margin-left:0 !important;}#copy-path{display:none;}nav.sub{display:none;}.source .sidebar{display:none;}.notable-traits{display:none;} \ No newline at end of file diff --git a/coreutils/dev/static.files/rust-logo-151179464ae7ed46.svg b/coreutils/dev/static.files/rust-logo-151179464ae7ed46.svg deleted file mode 100644 index 62424d8ff..000000000 --- a/coreutils/dev/static.files/rust-logo-151179464ae7ed46.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - diff --git a/coreutils/dev/static.files/rustdoc-f3501f0f5ae15dfb.css b/coreutils/dev/static.files/rustdoc-f3501f0f5ae15dfb.css deleted file mode 100644 index 3681b049e..000000000 --- a/coreutils/dev/static.files/rustdoc-f3501f0f5ae15dfb.css +++ /dev/null @@ -1,8 +0,0 @@ - :root{--nav-sub-mobile-padding:8px;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.srclink,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name .primitive>i,.result-name .keyword>i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p{margin:0 0 .75em 0;}p:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.source main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.source .content pre{padding:20px;}.rustdoc.source .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.sub-logo-container,.logo-container{line-height:0;display:block;}.sub-logo-container{margin-right:32px;}.sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 200px;overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;}.rustdoc.source .sidebar{flex-basis:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;z-index:1;}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar-toggle,#source-sidebar{background-color:var(--sidebar-background-color);}#src-sidebar-toggle>button:hover,#src-sidebar-toggle>button:focus{background-color:var(--sidebar-background-color-hover);}.source .sidebar>*:not(#src-sidebar-toggle){visibility:hidden;}.source-sidebar-expanded .source .sidebar{overflow-y:auto;flex-basis:300px;}.source-sidebar-expanded .source .sidebar>*:not(#src-sidebar-toggle){visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.sidebar .logo-container{margin-top:10px;margin-bottom:10px;text-align:center;}.version{overflow-wrap:break-word;}.logo-container>img{height:100px;width:100px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.source) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.source .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}.method .where,.fn .where,.where.fmt-newline{display:block;white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.source nav.sub{margin:0 0 15px 0;}.small-section-header{display:block;position:relative;}.small-section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-15px;padding-right:8px;}h2.small-section-header>.anchor{padding-right:6px;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block a.current{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}@-moz-document url-prefix(){#crate-search{padding-left:0px;padding-right:19px;}}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ - ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div{flex:1;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name span.alias{color:var(--search-results-alias-color);}.search-results .result-name span.grey{color:var(--search-results-grey-color);}.popover{position:absolute;top:100%;right:0;z-index:2;margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{min-height:36px;display:flex;padding:3px;margin-bottom:5px;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;align-items:center;white-space:pre-wrap;border-radius:3px;display:inline-flex;vertical-align:text-bottom;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji{font-size:1.25rem;margin-right:0.3rem;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.source .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar-toggle{position:sticky;top:0;left:0;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:stretch;align-items:stretch;z-index:10;}#source-sidebar{width:100%;overflow:auto;}#source-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid var(--border-color);margin-bottom:6px;}#source-sidebar div.files>a:hover,details.dir-entry summary:hover,#source-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--source-sidebar-background-hover);}#source-sidebar div.files>a.selected{background-color:var(--source-sidebar-background-selected);}#src-sidebar-toggle>button{font-size:inherit;font-weight:bold;background:none;color:inherit;text-align:center;border:none;outline:none;flex:1 1;-webkit-appearance:none;opacity:1;}#settings-menu,#help-button{margin-left:4px;display:flex;}#settings-menu>a,#help-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus{border-color:var(--settings-button-border-focus);}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;margin-left:10px;padding:0;padding-left:2px;border:0;width:33px;}#copy-path>img{filter:var(--copy-path-img-filter);}#copy-path:hover>img{filter:var(--copy-path-img-hover-filter);}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.source main,.rustdoc.source .sidebar{top:0;padding:0;height:100vh;border:0;}.sidebar.shown,.source-sidebar-expanded .source .sidebar,.rustdoc:not(.source) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;}.mobile-topbar h2 a{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;color:var(--main-color);}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#search-tabs .count{display:block;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#src-sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;border:1px solid;border-left:0;}.source-sidebar-expanded #src-sidebar-toggle{left:unset;top:unset;width:unset;border-top-right-radius:unset;border-bottom-right-radius:unset;position:sticky;border:0;border-bottom:1px solid;}#copy-path,#help-button{display:none;}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.source-sidebar-expanded .source .sidebar{max-width:100vw;width:100vw;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.source nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.srclink,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}.sub-logo-container>img{height:35px;width:35px;margin-bottom:var(--nav-sub-mobile-padding);}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;} \ No newline at end of file diff --git a/coreutils/dev/static.files/scrape-examples-ef1e698c1d417c0c.js b/coreutils/dev/static.files/scrape-examples-ef1e698c1d417c0c.js deleted file mode 100644 index ba830e374..000000000 --- a/coreutils/dev/static.files/scrape-examples-ef1e698c1d417c0c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/coreutils/dev/static.files/search-4926e5fc22a5646a.js b/coreutils/dev/static.files/search-4926e5fc22a5646a.js deleted file mode 100644 index df0778881..000000000 --- a/coreutils/dev/static.files/search-4926e5fc22a5646a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(function(){const itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias",];const TY_PRIMITIVE=itemTypes.indexOf("primitive");const TY_KEYWORD=itemTypes.indexOf("keyword");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function hasOwnPropertyRustdoc(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let currentResults;let typeNameIdMap;const ALIASES=new Map();function isWhitespace(c){return" \t\n\r".indexOf(c)!==-1}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return",>-".indexOf(c)!==-1}function isStopCharacter(c){return isWhitespace(c)||isEndCharacter(c)}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||isWhitespaceCharacter(c)}function isWhitespaceCharacter(c){return c===" "||c==="\t"}function createQueryElement(query,parserState,name,generics,isInGenerics){if(name==="*"||(name.length===0&&generics.length===0)){return}if(query.literalSearch&&parserState.totalElems-parserState.genericsElems>0){throw["You cannot have more than one element if you use quotes"]}const pathSegments=name.split("::");if(pathSegments.length>1){for(let i=0,len=pathSegments.length;i=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(start>=end&&generics.length===0){return}elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let start=parserState.pos;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;while(parserState.pos"){extra="<"}else if(endChar===""){extra="->"}else{extra=endChar}throw["Unexpected ",c," after ",extra]}if(!foundStopChar){if(endChar!==""){throw["Expected ",",",", "," "," or ",endChar,", found ",c,]}throw["Expected ",","," or "," ",", found ",c,]}const posBefore=parserState.pos;start=parserState.pos;getNextElem(query,parserState,elems,endChar===">");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ","<"]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ","<"]}parserState.pos+=1;parserState.typeFilter=oldTypeFilter}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery;for(let pos=start;pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}throw["Unexpected ",c]}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"]}if(query.elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["You cannot use quotes on type filter"]}const typeFilterElem=query.elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;foundStopChar=true;continue}if(!foundStopChar){if(parserState.typeFilter!==null){throw["Expected ",",",", "," "," or ","->",", found ",c,]}throw["Expected ",",",", "," ",", ",":"," or ","->",", found ",c,]}const before=query.elems.length;start=parserState.pos;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter)"]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,literalSearch:false,error:null,correction:null,}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}}userQuery=userQuery.trim();const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,searchWords,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id>-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}duplicates.add(obj.fullPath);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){if(results.size===0){return[]}const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.word=searchWords[result.id];result.item=searchIndex[result.id]||{};result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=aaa.item.deprecated;b=bbb.item.deprecated;if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});let nameSplit=null;if(parsedQuery.elems.length===1){const hasPath=typeof parsedQuery.elems[0].path==="undefined";nameSplit=hasPath?null:parsedQuery.elems[0].path}for(const result of result_list){if(result.dontValidate){continue}const name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(!isType&&!validateResult(name,path,nameSplit,parent)){result.id=-1}}return transformResults(result_list)}function checkGenerics(row,elem){if(row.generics.length===0||elem.generics.length===0){return false}if(elem.generics.length>0&&row.generics.length>=elem.generics.length){const elems=new Map();const addEntryToElems=function addEntryToElems(entry){if(entry.id===-1){for(const inner_entry of entry.generics){addEntryToElems(inner_entry)}return}let currentEntryElems;if(elems.has(entry.id)){currentEntryElems=elems.get(entry.id)}else{currentEntryElems=[];elems.set(entry.id,currentEntryElems)}currentEntryElems.push(entry)};for(const entry of row.generics){addEntryToElems(entry)}const handleGeneric=generic=>{if(!elems.has(generic.id)){return false}const matchElems=elems.get(generic.id);const matchIdx=matchElems.findIndex(tmp_elem=>{if(generic.generics.length>0&&!checkGenerics(tmp_elem,generic)){return false}return typePassesFilter(generic.typeFilter,tmp_elem.ty)});if(matchIdx===-1){return false}matchElems.splice(matchIdx,1);if(matchElems.length===0){elems.delete(generic.id)}return true};for(const generic of elem.generics){if(generic.typeFilter!==-1&&!handleGeneric(generic)){return false}}for(const generic of elem.generics){if(generic.typeFilter===-1&&!handleGeneric(generic)){return false}}return true}return false}function checkIfInGenerics(row,elem){for(const entry of row.generics){if(checkType(entry,elem)){return true}}return false}function checkType(row,elem){if(row.id===-1){return row.generics.length>0?checkIfInGenerics(row,elem):false}if(row.id===elem.id&&typePassesFilter(elem.typeFilter,row.ty)){if(elem.generics.length>0){return checkGenerics(row,elem)}return true}return checkIfInGenerics(row,elem)}function findArg(row,elem,skipPositions){if(row&&row.type&&row.type.inputs&&row.type.inputs.length>0){let i=0;for(const input of row.type.inputs){if(skipPositions.indexOf(i)!==-1){i+=1;continue}if(checkType(input,elem)){return i}i+=1}}return-1}function checkReturned(row,elem,skipPositions){if(row&&row.type&&row.type.output.length>0){let i=0;for(const ret_ty of row.type.output){if(skipPositions.indexOf(i)!==-1){i+=1;continue}if(checkType(ret_ty,elem)){return i}i+=1}}return-1}function checkPath(contains,ty,maxEditDistance){if(contains.length===0){return 0}let ret_dist=maxEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;if(clength>length){return maxEditDistance+1}for(let i=0;ilength){break}let dist_total=0;let aborted=false;for(let x=0;xmaxEditDistance){aborted=true;break}dist_total+=dist}if(!aborted){ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}}return ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,deprecated:item.deprecated,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){const inBounds=dist<=maxEditDistance||index!==-1;if(dist===0||(!parsedQuery.literalSearch&&inBounds)){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let index=-1,path_dist=0;const fullId=row.id;const searchWord=searchWords[pos];const in_args=findArg(row,elem,[]);if(in_args!==-1){addIntoResults(results_in_args,fullId,pos,-1,0,0,maxEditDistance)}const returned=checkReturned(row,elem,[]);if(returned!==-1){addIntoResults(results_returned,fullId,pos,-1,0,0,maxEditDistance)}if(!typePassesFilter(elem.typeFilter,row.ty)){return}const row_index=row.normalizedName.indexOf(elem.pathLast);const word_index=searchWord.indexOf(elem.pathLast);if(row_index===-1){index=word_index}else if(word_index===-1){index=row_index}else if(word_index1){path_dist=checkPath(elem.pathWithoutLast,row,maxEditDistance);if(path_dist>maxEditDistance){return}}if(parsedQuery.literalSearch){if(searchWord===elem.name){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(searchWord,elem.pathLast,maxEditDistance);if(index===-1&&dist+path_dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}function checkArgs(elems,callback){const skipPositions=[];for(const elem of elems){const position=callback(row,elem,skipPositions);if(position!==-1){skipPositions.push(position)}else{return false}}return true}if(!checkArgs(parsedQuery.elems,findArg)){return}if(!checkArgs(parsedQuery.returned,checkReturned)){return}addIntoResults(results,row.id,pos,0,0,0,Number.MAX_VALUE)}function innerRunQuery(){let elem,i,nSearchWords,in_returned,row;let queryLen=0;for(const elem of parsedQuery.elems){queryLen+=elem.name.length}for(const elem of parsedQuery.returned){queryLen+=elem.name.length}const maxEditDistance=Math.floor(queryLen/3);function convertNameToId(elem){if(typeNameIdMap.has(elem.name)){elem.id=typeNameIdMap.get(elem.name)}else if(!parsedQuery.literalSearch){let match=-1;let matchDist=maxEditDistance+1;let matchName="";for(const[name,id]of typeNameIdMap){const dist=editDistance(name,elem.name,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==-1){parsedQuery.correction=matchName}elem.id=match}for(const elem2 of elem.generics){convertNameToId(elem2)}}for(const elem of parsedQuery.elems){convertNameToId(elem)}for(const elem of parsedQuery.returned){convertNameToId(elem)}if(parsedQuery.foundElems===1){if(parsedQuery.elems.length===1){elem=parsedQuery.elems[0];for(i=0,nSearchWords=searchWords.length;i0){for(i=0,nSearchWords=searchWords.length;i-1||path.indexOf(key)>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(key)>-1)||editDistance(name,key,maxEditDistance)<=maxEditDistance)){return false}}return true}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor="#"+type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){let extraClass="";if(display===true){extraClass=" active"}const output=document.createElement("div");let length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];length+=1;let extra="";if(type==="primitive"){extra=" (primitive type)"}else if(type==="keyword"){extra=" (keyword)"}const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";if(item.is_alias){const alias=document.createElement("span");alias.className="alias";const bold=document.createElement("b");bold.innerText=item.alias;alias.appendChild(bold);alias.insertAdjacentHTML("beforeend"," - see ");resultName.appendChild(alias)}resultName.insertAdjacentHTML("beforeend",item.displayPath+""+name+extra+"");link.appendChild(resultName);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const ret_others=addTab(results.others,results.query,true);const ret_in_args=addTab(results.in_args,results.query,false);const ret_returned=addTab(results.returned,results.query,false);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";const crates_list=Object.keys(rawSearchIndex);if(crates_list.length>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function search(e,forced){if(e){e.preventDefault()}const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";if(browserSupportsHistoryApi()){const newURL=buildUrl(query.original,filterCrates);if(!history.state&&!params.search){history.pushState(null,"",newURL)}else{history.replaceState(null,"",newURL)}}showResults(execQuery(query,searchWords,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildTypeMapIndex(typeNameIdMap,name){if(name===""||name===null){return-1}if(typeNameIdMap.has(name)){return typeNameIdMap.get(name)}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,id);return id}}function buildItemSearchTypeAll(types,lowercasePaths,typeNameIdMap){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;return types.map(type=>{let pathIndex,generics;if(typeof type==="number"){pathIndex=type;generics=[]}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths,typeNameIdMap)}return{id:pathIndex===0?-1:buildTypeMapIndex(typeNameIdMap,lowercasePaths[pathIndex-1].name),ty:pathIndex===0?null:lowercasePaths[pathIndex-1].ty,generics:generics,}})}function buildFunctionSearchType(functionSearchType,lowercasePaths,typeNameIdMap){const INPUTS_DATA=0;const OUTPUT_DATA=1;if(functionSearchType===0){return null}let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){const pathIndex=functionSearchType[INPUTS_DATA];inputs=[{id:pathIndex===0?-1:buildTypeMapIndex(typeNameIdMap,lowercasePaths[pathIndex-1].name),ty:pathIndex===0?null:lowercasePaths[pathIndex-1].ty,generics:[],}]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths,typeNameIdMap)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){const pathIndex=functionSearchType[OUTPUT_DATA];output=[{id:pathIndex===0?-1:buildTypeMapIndex(typeNameIdMap,lowercasePaths[pathIndex-1].name),ty:pathIndex===0?null:lowercasePaths[pathIndex-1].ty,generics:[],}]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths,typeNameIdMap)}}else{output=[]}return{inputs,output,}}function buildIndex(rawSearchIndex){searchIndex=[];const searchWords=[];typeNameIdMap=new Map();const charA="A".charCodeAt(0);let currentIndex=0;let id=0;for(const crate in rawSearchIndex){if(!hasOwnPropertyRustdoc(rawSearchIndex,crate)){continue}let crateSize=0;const crateCorpus=rawSearchIndex[crate];searchWords.push(crate);const crateRow={crate:crate,ty:1,name:crate,path:"",desc:crateCorpus.doc,parent:undefined,type:null,id:id,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),deprecated:null,};id+=1;searchIndex.push(crateRow);currentIndex+=1;const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemDescs=crateCorpus.d;const itemParentIdxs=crateCorpus.i;const itemFunctionSearchTypes=crateCorpus.f;const deprecatedItems=new Set(crateCorpus.c);const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];let len=paths.length;for(let i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:buildFunctionSearchType(itemFunctionSearchTypes[i],lowercasePaths,typeNameIdMap),id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),deprecated:deprecatedItems.has(i),};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=crateSize}return searchWords}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const params=searchState.getQueryStringParams();const query=searchState.input.value.trim();if(!history.state&&!params.search){history.pushState(null,"",buildUrl(query,null))}else{history.replaceState(null,"",buildUrl(query,null))}}currentResults=null;search(undefined,true)}const searchWords=buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}return searchWords}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch({})}})() \ No newline at end of file diff --git a/coreutils/dev/static.files/settings-8c76f75bfb6bd192.css b/coreutils/dev/static.files/settings-8c76f75bfb6bd192.css deleted file mode 100644 index 5241bb861..000000000 --- a/coreutils/dev/static.files/settings-8c76f75bfb6bd192.css +++ /dev/null @@ -1,3 +0,0 @@ -.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ - \ - ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;} \ No newline at end of file diff --git a/coreutils/dev/static.files/settings-de11bff964e9d4e5.js b/coreutils/dev/static.files/settings-de11bff964e9d4e5.js deleted file mode 100644 index cc508a861..000000000 --- a/coreutils/dev/static.files/settings-de11bff964e9d4e5.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=function(){changeSetting(this.id,this.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`\ -
-
${setting_name}
-
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ - `});output+=`\ -
-
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ -
\ - \ -
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display=""}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=function(event){event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=function(event){if(elemIsInParent(event.target,settingsMenu)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/coreutils/dev/static.files/source-script-11255107d0a65077.js b/coreutils/dev/static.files/source-script-11255107d0a65077.js deleted file mode 100644 index 6afbb5a26..000000000 --- a/coreutils/dev/static.files/source-script-11255107d0a65077.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(function(){const rootPath=document.getElementById("rustdoc-vars").attributes["data-root-path"].value;const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth"){addClass(document.documentElement,"source-sidebar-expanded");child.innerText="<";updateLocalStorage("source-sidebar-show","true")}else{removeClass(document.documentElement,"source-sidebar-expanded");child.innerText=">";updateLocalStorage("source-sidebar-show","false")}}function createSidebarToggle(){const sidebarToggle=document.createElement("div");sidebarToggle.id="src-sidebar-toggle";const inner=document.createElement("button");if(getCurrentValue("source-sidebar-show")==="true"){inner.innerText="<"}else{inner.innerText=">"}inner.onclick=toggleSidebar;sidebarToggle.appendChild(inner);return sidebarToggle}function createSourceSidebar(){const container=document.querySelector("nav.sidebar");const sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);const sidebar=document.createElement("div");sidebar.id="source-sidebar";let hasFoundFile=false;const title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(key=>{sourcesIndex[key][NAME_OFFSET]=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",hasFoundFile)});container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}const lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSourceLines(match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSourceHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",()=>{const match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSourceLines(match)}});onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSourceHighlight)});highlightSourceLines();window.createSourceSidebar=createSourceSidebar})() \ No newline at end of file diff --git a/coreutils/dev/static.files/storage-62ce34ea385b278a.js b/coreutils/dev/static.files/storage-62ce34ea385b278a.js deleted file mode 100644 index 6f4ec2e54..000000000 --- a/coreutils/dev/static.files/storage-62ce34ea385b278a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func,reversed){if(arr&&arr.length>0){if(reversed){for(let i=arr.length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(const elem of arr){if(func(elem)){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.getElementById("rustdoc-vars");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){if(saveTheme){updateLocalStorage("theme",newThemeName)}let newHref;if(newThemeName==="light"||newThemeName==="dark"||newThemeName==="ayu"){newHref=getVar("static-root-path")+getVar("theme-"+newThemeName+"-css")}else{newHref=getVar("root-path")+newThemeName+getVar("resource-suffix")+".css"}if(!window.currentTheme){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"source-sidebar-expanded")}window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0)}}) \ No newline at end of file diff --git a/coreutils/dev/static.files/wheel-7b819b6101059cd0.svg b/coreutils/dev/static.files/wheel-7b819b6101059cd0.svg deleted file mode 100644 index 83c07f63d..000000000 --- a/coreutils/dev/static.files/wheel-7b819b6101059cd0.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/coreutils/dev/stdbuf/all.html b/coreutils/dev/stdbuf/all.html deleted file mode 100644 index 7309ca138..000000000 --- a/coreutils/dev/stdbuf/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/stdbuf/fn.main.html b/coreutils/dev/stdbuf/fn.main.html deleted file mode 100644 index 2206e9017..000000000 --- a/coreutils/dev/stdbuf/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in stdbuf - Rust

Function stdbuf::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/stdbuf/index.html b/coreutils/dev/stdbuf/index.html deleted file mode 100644 index 0d78397bc..000000000 --- a/coreutils/dev/stdbuf/index.html +++ /dev/null @@ -1 +0,0 @@ -stdbuf - Rust
\ No newline at end of file diff --git a/coreutils/dev/stdbuf/sidebar-items.js b/coreutils/dev/stdbuf/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/stdbuf/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/stty/all.html b/coreutils/dev/stty/all.html deleted file mode 100644 index 0ef16091f..000000000 --- a/coreutils/dev/stty/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/stty/fn.main.html b/coreutils/dev/stty/fn.main.html deleted file mode 100644 index 753a5d587..000000000 --- a/coreutils/dev/stty/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in stty - Rust

Function stty::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/stty/index.html b/coreutils/dev/stty/index.html deleted file mode 100644 index 631943acc..000000000 --- a/coreutils/dev/stty/index.html +++ /dev/null @@ -1 +0,0 @@ -stty - Rust
\ No newline at end of file diff --git a/coreutils/dev/stty/sidebar-items.js b/coreutils/dev/stty/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/stty/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/sum/all.html b/coreutils/dev/sum/all.html deleted file mode 100644 index eb272620c..000000000 --- a/coreutils/dev/sum/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/sum/fn.main.html b/coreutils/dev/sum/fn.main.html deleted file mode 100644 index 127ea7cb5..000000000 --- a/coreutils/dev/sum/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in sum - Rust

Function sum::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/sum/index.html b/coreutils/dev/sum/index.html deleted file mode 100644 index 0f3693bb7..000000000 --- a/coreutils/dev/sum/index.html +++ /dev/null @@ -1 +0,0 @@ -sum - Rust
\ No newline at end of file diff --git a/coreutils/dev/sum/sidebar-items.js b/coreutils/dev/sum/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/sum/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/sync/all.html b/coreutils/dev/sync/all.html deleted file mode 100644 index adcc3f4d5..000000000 --- a/coreutils/dev/sync/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/sync/fn.main.html b/coreutils/dev/sync/fn.main.html deleted file mode 100644 index 5d642c3d6..000000000 --- a/coreutils/dev/sync/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in sync - Rust

Function sync::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/sync/index.html b/coreutils/dev/sync/index.html deleted file mode 100644 index ad68c74c8..000000000 --- a/coreutils/dev/sync/index.html +++ /dev/null @@ -1 +0,0 @@ -sync - Rust
\ No newline at end of file diff --git a/coreutils/dev/sync/sidebar-items.js b/coreutils/dev/sync/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/sync/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/tac/all.html b/coreutils/dev/tac/all.html deleted file mode 100644 index e8995f126..000000000 --- a/coreutils/dev/tac/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/tac/fn.main.html b/coreutils/dev/tac/fn.main.html deleted file mode 100644 index bc61932e4..000000000 --- a/coreutils/dev/tac/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in tac - Rust

Function tac::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/tac/index.html b/coreutils/dev/tac/index.html deleted file mode 100644 index ebfc2411d..000000000 --- a/coreutils/dev/tac/index.html +++ /dev/null @@ -1 +0,0 @@ -tac - Rust
\ No newline at end of file diff --git a/coreutils/dev/tac/sidebar-items.js b/coreutils/dev/tac/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/tac/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/tail/all.html b/coreutils/dev/tail/all.html deleted file mode 100644 index cda469b46..000000000 --- a/coreutils/dev/tail/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/tail/fn.main.html b/coreutils/dev/tail/fn.main.html deleted file mode 100644 index ff530fb34..000000000 --- a/coreutils/dev/tail/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in tail - Rust

Function tail::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/tail/index.html b/coreutils/dev/tail/index.html deleted file mode 100644 index 66d37cbfb..000000000 --- a/coreutils/dev/tail/index.html +++ /dev/null @@ -1 +0,0 @@ -tail - Rust
\ No newline at end of file diff --git a/coreutils/dev/tail/sidebar-items.js b/coreutils/dev/tail/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/tail/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/tee/all.html b/coreutils/dev/tee/all.html deleted file mode 100644 index 4d519fe3a..000000000 --- a/coreutils/dev/tee/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/tee/fn.main.html b/coreutils/dev/tee/fn.main.html deleted file mode 100644 index 7685fc944..000000000 --- a/coreutils/dev/tee/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in tee - Rust

Function tee::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/tee/index.html b/coreutils/dev/tee/index.html deleted file mode 100644 index 7302df565..000000000 --- a/coreutils/dev/tee/index.html +++ /dev/null @@ -1 +0,0 @@ -tee - Rust
\ No newline at end of file diff --git a/coreutils/dev/tee/sidebar-items.js b/coreutils/dev/tee/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/tee/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/test/all.html b/coreutils/dev/test/all.html deleted file mode 100644 index 60d44a247..000000000 --- a/coreutils/dev/test/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/test/fn.main.html b/coreutils/dev/test/fn.main.html deleted file mode 100644 index a9de99f91..000000000 --- a/coreutils/dev/test/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in test - Rust

Function test::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/test/index.html b/coreutils/dev/test/index.html deleted file mode 100644 index 4e9d1f1fa..000000000 --- a/coreutils/dev/test/index.html +++ /dev/null @@ -1 +0,0 @@ -test - Rust
\ No newline at end of file diff --git a/coreutils/dev/test/sidebar-items.js b/coreutils/dev/test/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/test/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/timeout/all.html b/coreutils/dev/timeout/all.html deleted file mode 100644 index 1c59209e8..000000000 --- a/coreutils/dev/timeout/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/timeout/fn.main.html b/coreutils/dev/timeout/fn.main.html deleted file mode 100644 index 09ec55036..000000000 --- a/coreutils/dev/timeout/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in timeout - Rust

Function timeout::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/timeout/index.html b/coreutils/dev/timeout/index.html deleted file mode 100644 index 8243eaf1a..000000000 --- a/coreutils/dev/timeout/index.html +++ /dev/null @@ -1 +0,0 @@ -timeout - Rust
\ No newline at end of file diff --git a/coreutils/dev/timeout/sidebar-items.js b/coreutils/dev/timeout/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/timeout/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/touch/all.html b/coreutils/dev/touch/all.html deleted file mode 100644 index 1adb4549b..000000000 --- a/coreutils/dev/touch/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/touch/fn.main.html b/coreutils/dev/touch/fn.main.html deleted file mode 100644 index 5003294a1..000000000 --- a/coreutils/dev/touch/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in touch - Rust

Function touch::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/touch/index.html b/coreutils/dev/touch/index.html deleted file mode 100644 index d283f1213..000000000 --- a/coreutils/dev/touch/index.html +++ /dev/null @@ -1 +0,0 @@ -touch - Rust
\ No newline at end of file diff --git a/coreutils/dev/touch/sidebar-items.js b/coreutils/dev/touch/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/touch/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/tr/all.html b/coreutils/dev/tr/all.html deleted file mode 100644 index fcc30ac5e..000000000 --- a/coreutils/dev/tr/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/tr/fn.main.html b/coreutils/dev/tr/fn.main.html deleted file mode 100644 index be4cc9923..000000000 --- a/coreutils/dev/tr/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in tr - Rust

Function tr::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/tr/index.html b/coreutils/dev/tr/index.html deleted file mode 100644 index e02408b3c..000000000 --- a/coreutils/dev/tr/index.html +++ /dev/null @@ -1 +0,0 @@ -tr - Rust

Crate tr

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/tr/sidebar-items.js b/coreutils/dev/tr/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/tr/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/true/all.html b/coreutils/dev/true/all.html deleted file mode 100644 index 80e98fb9b..000000000 --- a/coreutils/dev/true/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/true/fn.main.html b/coreutils/dev/true/fn.main.html deleted file mode 100644 index c57bf459e..000000000 --- a/coreutils/dev/true/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in true - Rust

Function true::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/true/index.html b/coreutils/dev/true/index.html deleted file mode 100644 index 64d0fb47f..000000000 --- a/coreutils/dev/true/index.html +++ /dev/null @@ -1 +0,0 @@ -true - Rust
\ No newline at end of file diff --git a/coreutils/dev/true/sidebar-items.js b/coreutils/dev/true/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/true/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/truncate/all.html b/coreutils/dev/truncate/all.html deleted file mode 100644 index 166fd18be..000000000 --- a/coreutils/dev/truncate/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/truncate/fn.main.html b/coreutils/dev/truncate/fn.main.html deleted file mode 100644 index c4d698df9..000000000 --- a/coreutils/dev/truncate/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in truncate - Rust

Function truncate::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/truncate/index.html b/coreutils/dev/truncate/index.html deleted file mode 100644 index 1bd0df2cf..000000000 --- a/coreutils/dev/truncate/index.html +++ /dev/null @@ -1 +0,0 @@ -truncate - Rust
\ No newline at end of file diff --git a/coreutils/dev/truncate/sidebar-items.js b/coreutils/dev/truncate/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/truncate/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/tsort/all.html b/coreutils/dev/tsort/all.html deleted file mode 100644 index 2f25f9f2e..000000000 --- a/coreutils/dev/tsort/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/tsort/fn.main.html b/coreutils/dev/tsort/fn.main.html deleted file mode 100644 index 9327079c7..000000000 --- a/coreutils/dev/tsort/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in tsort - Rust

Function tsort::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/tsort/index.html b/coreutils/dev/tsort/index.html deleted file mode 100644 index 15fc9aca3..000000000 --- a/coreutils/dev/tsort/index.html +++ /dev/null @@ -1 +0,0 @@ -tsort - Rust
\ No newline at end of file diff --git a/coreutils/dev/tsort/sidebar-items.js b/coreutils/dev/tsort/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/tsort/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/tty/all.html b/coreutils/dev/tty/all.html deleted file mode 100644 index aeee71367..000000000 --- a/coreutils/dev/tty/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/tty/fn.main.html b/coreutils/dev/tty/fn.main.html deleted file mode 100644 index daa7c3cd0..000000000 --- a/coreutils/dev/tty/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in tty - Rust

Function tty::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/tty/index.html b/coreutils/dev/tty/index.html deleted file mode 100644 index 2f6f95241..000000000 --- a/coreutils/dev/tty/index.html +++ /dev/null @@ -1 +0,0 @@ -tty - Rust
\ No newline at end of file diff --git a/coreutils/dev/tty/sidebar-items.js b/coreutils/dev/tty/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/tty/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/uname/all.html b/coreutils/dev/uname/all.html deleted file mode 100644 index a57080849..000000000 --- a/coreutils/dev/uname/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uname/fn.main.html b/coreutils/dev/uname/fn.main.html deleted file mode 100644 index 3f075851c..000000000 --- a/coreutils/dev/uname/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in uname - Rust

Function uname::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/uname/index.html b/coreutils/dev/uname/index.html deleted file mode 100644 index c37d5acc1..000000000 --- a/coreutils/dev/uname/index.html +++ /dev/null @@ -1 +0,0 @@ -uname - Rust
\ No newline at end of file diff --git a/coreutils/dev/uname/sidebar-items.js b/coreutils/dev/uname/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/uname/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/unexpand/all.html b/coreutils/dev/unexpand/all.html deleted file mode 100644 index 0c10491c3..000000000 --- a/coreutils/dev/unexpand/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/unexpand/fn.main.html b/coreutils/dev/unexpand/fn.main.html deleted file mode 100644 index 610b27d29..000000000 --- a/coreutils/dev/unexpand/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in unexpand - Rust

Function unexpand::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/unexpand/index.html b/coreutils/dev/unexpand/index.html deleted file mode 100644 index b3e5f0e7e..000000000 --- a/coreutils/dev/unexpand/index.html +++ /dev/null @@ -1 +0,0 @@ -unexpand - Rust
\ No newline at end of file diff --git a/coreutils/dev/unexpand/sidebar-items.js b/coreutils/dev/unexpand/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/unexpand/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/uniq/all.html b/coreutils/dev/uniq/all.html deleted file mode 100644 index eff074402..000000000 --- a/coreutils/dev/uniq/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uniq/fn.main.html b/coreutils/dev/uniq/fn.main.html deleted file mode 100644 index a56377434..000000000 --- a/coreutils/dev/uniq/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in uniq - Rust

Function uniq::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/uniq/index.html b/coreutils/dev/uniq/index.html deleted file mode 100644 index 2cd8275f8..000000000 --- a/coreutils/dev/uniq/index.html +++ /dev/null @@ -1 +0,0 @@ -uniq - Rust
\ No newline at end of file diff --git a/coreutils/dev/uniq/sidebar-items.js b/coreutils/dev/uniq/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/uniq/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/unlink/all.html b/coreutils/dev/unlink/all.html deleted file mode 100644 index 782eea7cc..000000000 --- a/coreutils/dev/unlink/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/unlink/fn.main.html b/coreutils/dev/unlink/fn.main.html deleted file mode 100644 index 84665ead0..000000000 --- a/coreutils/dev/unlink/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in unlink - Rust

Function unlink::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/unlink/index.html b/coreutils/dev/unlink/index.html deleted file mode 100644 index 728895c5a..000000000 --- a/coreutils/dev/unlink/index.html +++ /dev/null @@ -1 +0,0 @@ -unlink - Rust
\ No newline at end of file diff --git a/coreutils/dev/unlink/sidebar-items.js b/coreutils/dev/unlink/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/unlink/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/uptime/all.html b/coreutils/dev/uptime/all.html deleted file mode 100644 index 535aea991..000000000 --- a/coreutils/dev/uptime/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uptime/fn.main.html b/coreutils/dev/uptime/fn.main.html deleted file mode 100644 index 2af0edb83..000000000 --- a/coreutils/dev/uptime/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in uptime - Rust

Function uptime::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/uptime/index.html b/coreutils/dev/uptime/index.html deleted file mode 100644 index c49248c6f..000000000 --- a/coreutils/dev/uptime/index.html +++ /dev/null @@ -1 +0,0 @@ -uptime - Rust
\ No newline at end of file diff --git a/coreutils/dev/uptime/sidebar-items.js b/coreutils/dev/uptime/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/uptime/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/users/all.html b/coreutils/dev/users/all.html deleted file mode 100644 index 4fd46ef98..000000000 --- a/coreutils/dev/users/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/users/fn.main.html b/coreutils/dev/users/fn.main.html deleted file mode 100644 index f51e6596a..000000000 --- a/coreutils/dev/users/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in users - Rust

Function users::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/users/index.html b/coreutils/dev/users/index.html deleted file mode 100644 index ec5a86406..000000000 --- a/coreutils/dev/users/index.html +++ /dev/null @@ -1 +0,0 @@ -users - Rust
\ No newline at end of file diff --git a/coreutils/dev/users/sidebar-items.js b/coreutils/dev/users/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/users/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_arch/all.html b/coreutils/dev/uu_arch/all.html deleted file mode 100644 index 88d58052e..000000000 --- a/coreutils/dev/uu_arch/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_arch/fn.uu_app.html b/coreutils/dev/uu_arch/fn.uu_app.html deleted file mode 100644 index f08355247..000000000 --- a/coreutils/dev/uu_arch/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_arch - Rust

Function uu_arch::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_arch/fn.uumain.html b/coreutils/dev/uu_arch/fn.uumain.html deleted file mode 100644 index d125153f8..000000000 --- a/coreutils/dev/uu_arch/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_arch - Rust

Function uu_arch::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_arch/index.html b/coreutils/dev/uu_arch/index.html deleted file mode 100644 index 796d86a28..000000000 --- a/coreutils/dev/uu_arch/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_arch - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_arch/sidebar-items.js b/coreutils/dev/uu_arch/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_arch/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_base32/all.html b/coreutils/dev/uu_base32/all.html deleted file mode 100644 index c33d8c2f4..000000000 --- a/coreutils/dev/uu_base32/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/fn.base_app.html b/coreutils/dev/uu_base32/base_common/fn.base_app.html deleted file mode 100644 index 1a5e60615..000000000 --- a/coreutils/dev/uu_base32/base_common/fn.base_app.html +++ /dev/null @@ -1 +0,0 @@ -base_app in uu_base32::base_common - Rust
pub fn base_app(about: &'static str, usage: &str) -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/fn.get_input.html b/coreutils/dev/uu_base32/base_common/fn.get_input.html deleted file mode 100644 index 5753271a4..000000000 --- a/coreutils/dev/uu_base32/base_common/fn.get_input.html +++ /dev/null @@ -1,4 +0,0 @@ -get_input in uu_base32::base_common - Rust
pub fn get_input<'a>(
-    config: &Config,
-    stdin_ref: &'a Stdin
-) -> UResult<Box<dyn Read + 'a>>
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/fn.handle_input.html b/coreutils/dev/uu_base32/base_common/fn.handle_input.html deleted file mode 100644 index abd6bb393..000000000 --- a/coreutils/dev/uu_base32/base_common/fn.handle_input.html +++ /dev/null @@ -1,7 +0,0 @@ -handle_input in uu_base32::base_common - Rust
pub fn handle_input<R: Read>(
-    input: &mut R,
-    format: Format,
-    line_wrap: Option<usize>,
-    ignore_garbage: bool,
-    decode: bool
-) -> UResult<()>
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/fn.parse_base_cmd_args.html b/coreutils/dev/uu_base32/base_common/fn.parse_base_cmd_args.html deleted file mode 100644 index 755e3522b..000000000 --- a/coreutils/dev/uu_base32/base_common/fn.parse_base_cmd_args.html +++ /dev/null @@ -1,5 +0,0 @@ -parse_base_cmd_args in uu_base32::base_common - Rust
pub fn parse_base_cmd_args(
-    args: impl Args,
-    about: &'static str,
-    usage: &str
-) -> UResult<Config>
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/index.html b/coreutils/dev/uu_base32/base_common/index.html deleted file mode 100644 index eadfc73c5..000000000 --- a/coreutils/dev/uu_base32/base_common/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_base32::base_common - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/options/index.html b/coreutils/dev/uu_base32/base_common/options/index.html deleted file mode 100644 index 77252b291..000000000 --- a/coreutils/dev/uu_base32/base_common/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_base32::base_common::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/options/sidebar-items.js b/coreutils/dev/uu_base32/base_common/options/sidebar-items.js deleted file mode 100644 index 27454f6f2..000000000 --- a/coreutils/dev/uu_base32/base_common/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["DECODE","FILE","IGNORE_GARBAGE","WRAP"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/options/static.DECODE.html b/coreutils/dev/uu_base32/base_common/options/static.DECODE.html deleted file mode 100644 index 138120b8d..000000000 --- a/coreutils/dev/uu_base32/base_common/options/static.DECODE.html +++ /dev/null @@ -1 +0,0 @@ -DECODE in uu_base32::base_common::options - Rust
pub static DECODE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/options/static.FILE.html b/coreutils/dev/uu_base32/base_common/options/static.FILE.html deleted file mode 100644 index 430aa71df..000000000 --- a/coreutils/dev/uu_base32/base_common/options/static.FILE.html +++ /dev/null @@ -1 +0,0 @@ -FILE in uu_base32::base_common::options - Rust
pub static FILE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/options/static.IGNORE_GARBAGE.html b/coreutils/dev/uu_base32/base_common/options/static.IGNORE_GARBAGE.html deleted file mode 100644 index 56ec0aa73..000000000 --- a/coreutils/dev/uu_base32/base_common/options/static.IGNORE_GARBAGE.html +++ /dev/null @@ -1 +0,0 @@ -IGNORE_GARBAGE in uu_base32::base_common::options - Rust
pub static IGNORE_GARBAGE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/options/static.WRAP.html b/coreutils/dev/uu_base32/base_common/options/static.WRAP.html deleted file mode 100644 index d92e46d2b..000000000 --- a/coreutils/dev/uu_base32/base_common/options/static.WRAP.html +++ /dev/null @@ -1 +0,0 @@ -WRAP in uu_base32::base_common::options - Rust
pub static WRAP: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/sidebar-items.js b/coreutils/dev/uu_base32/base_common/sidebar-items.js deleted file mode 100644 index 00d23fb8f..000000000 --- a/coreutils/dev/uu_base32/base_common/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["base_app","get_input","handle_input","parse_base_cmd_args"],"mod":["options"],"static":["BASE_CMD_PARSE_ERROR"],"struct":["Config"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/static.BASE_CMD_PARSE_ERROR.html b/coreutils/dev/uu_base32/base_common/static.BASE_CMD_PARSE_ERROR.html deleted file mode 100644 index cac2dab43..000000000 --- a/coreutils/dev/uu_base32/base_common/static.BASE_CMD_PARSE_ERROR.html +++ /dev/null @@ -1 +0,0 @@ -BASE_CMD_PARSE_ERROR in uu_base32::base_common - Rust
pub static BASE_CMD_PARSE_ERROR: i32
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/base_common/struct.Config.html b/coreutils/dev/uu_base32/base_common/struct.Config.html deleted file mode 100644 index 5bed4c589..000000000 --- a/coreutils/dev/uu_base32/base_common/struct.Config.html +++ /dev/null @@ -1,16 +0,0 @@ -Config in uu_base32::base_common - Rust
pub struct Config {
-    pub decode: bool,
-    pub ignore_garbage: bool,
-    pub wrap_cols: Option<usize>,
-    pub to_read: Option<String>,
-}

Fields§

§decode: bool§ignore_garbage: bool§wrap_cols: Option<usize>§to_read: Option<String>

Implementations§

source§

impl Config

source

pub fn from(options: &ArgMatches) -> UResult<Self>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/fn.uu_app.html b/coreutils/dev/uu_base32/fn.uu_app.html deleted file mode 100644 index 591b70742..000000000 --- a/coreutils/dev/uu_base32/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_base32 - Rust

Function uu_base32::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/fn.uumain.html b/coreutils/dev/uu_base32/fn.uumain.html deleted file mode 100644 index 4cccd812a..000000000 --- a/coreutils/dev/uu_base32/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_base32 - Rust

Function uu_base32::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/index.html b/coreutils/dev/uu_base32/index.html deleted file mode 100644 index 34007b865..000000000 --- a/coreutils/dev/uu_base32/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_base32 - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_base32/sidebar-items.js b/coreutils/dev/uu_base32/sidebar-items.js deleted file mode 100644 index e68f99991..000000000 --- a/coreutils/dev/uu_base32/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["base_common"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_base64/all.html b/coreutils/dev/uu_base64/all.html deleted file mode 100644 index 29dcb3600..000000000 --- a/coreutils/dev/uu_base64/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_base64/fn.uu_app.html b/coreutils/dev/uu_base64/fn.uu_app.html deleted file mode 100644 index 12e7b636b..000000000 --- a/coreutils/dev/uu_base64/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_base64 - Rust

Function uu_base64::uu_app

pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_base64/fn.uumain.html b/coreutils/dev/uu_base64/fn.uumain.html deleted file mode 100644 index 779ccb2a6..000000000 --- a/coreutils/dev/uu_base64/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_base64 - Rust

Function uu_base64::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_base64/index.html b/coreutils/dev/uu_base64/index.html deleted file mode 100644 index 4cfc7ce39..000000000 --- a/coreutils/dev/uu_base64/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_base64 - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_base64/sidebar-items.js b/coreutils/dev/uu_base64/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_base64/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_basename/all.html b/coreutils/dev/uu_basename/all.html deleted file mode 100644 index 698141140..000000000 --- a/coreutils/dev/uu_basename/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_basename/fn.uu_app.html b/coreutils/dev/uu_basename/fn.uu_app.html deleted file mode 100644 index c42f00cad..000000000 --- a/coreutils/dev/uu_basename/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_basename - Rust

Function uu_basename::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_basename/fn.uumain.html b/coreutils/dev/uu_basename/fn.uumain.html deleted file mode 100644 index 79298aecc..000000000 --- a/coreutils/dev/uu_basename/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_basename - Rust

Function uu_basename::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_basename/index.html b/coreutils/dev/uu_basename/index.html deleted file mode 100644 index 96b063009..000000000 --- a/coreutils/dev/uu_basename/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_basename - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_basename/options/index.html b/coreutils/dev/uu_basename/options/index.html deleted file mode 100644 index 1b6689174..000000000 --- a/coreutils/dev/uu_basename/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_basename::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_basename/options/sidebar-items.js b/coreutils/dev/uu_basename/options/sidebar-items.js deleted file mode 100644 index 44726ddf7..000000000 --- a/coreutils/dev/uu_basename/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["MULTIPLE","NAME","SUFFIX","ZERO"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_basename/options/static.MULTIPLE.html b/coreutils/dev/uu_basename/options/static.MULTIPLE.html deleted file mode 100644 index 0fda86112..000000000 --- a/coreutils/dev/uu_basename/options/static.MULTIPLE.html +++ /dev/null @@ -1 +0,0 @@ -MULTIPLE in uu_basename::options - Rust
pub static MULTIPLE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_basename/options/static.NAME.html b/coreutils/dev/uu_basename/options/static.NAME.html deleted file mode 100644 index 5678f66cc..000000000 --- a/coreutils/dev/uu_basename/options/static.NAME.html +++ /dev/null @@ -1 +0,0 @@ -NAME in uu_basename::options - Rust

Static uu_basename::options::NAME

source ·
pub static NAME: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_basename/options/static.SUFFIX.html b/coreutils/dev/uu_basename/options/static.SUFFIX.html deleted file mode 100644 index 72eb398be..000000000 --- a/coreutils/dev/uu_basename/options/static.SUFFIX.html +++ /dev/null @@ -1 +0,0 @@ -SUFFIX in uu_basename::options - Rust

Static uu_basename::options::SUFFIX

source ·
pub static SUFFIX: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_basename/options/static.ZERO.html b/coreutils/dev/uu_basename/options/static.ZERO.html deleted file mode 100644 index ec4424982..000000000 --- a/coreutils/dev/uu_basename/options/static.ZERO.html +++ /dev/null @@ -1 +0,0 @@ -ZERO in uu_basename::options - Rust

Static uu_basename::options::ZERO

source ·
pub static ZERO: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_basename/sidebar-items.js b/coreutils/dev/uu_basename/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_basename/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_basenc/all.html b/coreutils/dev/uu_basenc/all.html deleted file mode 100644 index ece8adfeb..000000000 --- a/coreutils/dev/uu_basenc/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_basenc/fn.uu_app.html b/coreutils/dev/uu_basenc/fn.uu_app.html deleted file mode 100644 index 3b13c1e29..000000000 --- a/coreutils/dev/uu_basenc/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_basenc - Rust

Function uu_basenc::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_basenc/fn.uumain.html b/coreutils/dev/uu_basenc/fn.uumain.html deleted file mode 100644 index 7c26d3e1c..000000000 --- a/coreutils/dev/uu_basenc/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_basenc - Rust

Function uu_basenc::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_basenc/index.html b/coreutils/dev/uu_basenc/index.html deleted file mode 100644 index d8a26596b..000000000 --- a/coreutils/dev/uu_basenc/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_basenc - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_basenc/sidebar-items.js b/coreutils/dev/uu_basenc/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_basenc/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_cat/all.html b/coreutils/dev/uu_cat/all.html deleted file mode 100644 index ea841b233..000000000 --- a/coreutils/dev/uu_cat/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_cat/fn.uu_app.html b/coreutils/dev/uu_cat/fn.uu_app.html deleted file mode 100644 index 1dbc9eb57..000000000 --- a/coreutils/dev/uu_cat/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_cat - Rust

Function uu_cat::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_cat/fn.uumain.html b/coreutils/dev/uu_cat/fn.uumain.html deleted file mode 100644 index ee0c865cb..000000000 --- a/coreutils/dev/uu_cat/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_cat - Rust

Function uu_cat::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_cat/index.html b/coreutils/dev/uu_cat/index.html deleted file mode 100644 index 4ff79110b..000000000 --- a/coreutils/dev/uu_cat/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_cat - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_cat/sidebar-items.js b/coreutils/dev/uu_cat/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_cat/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chcon/all.html b/coreutils/dev/uu_chcon/all.html deleted file mode 100644 index 8505d474f..000000000 --- a/coreutils/dev/uu_chcon/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/fn.uu_app.html b/coreutils/dev/uu_chcon/fn.uu_app.html deleted file mode 100644 index b3093bdc8..000000000 --- a/coreutils/dev/uu_chcon/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_chcon - Rust

Function uu_chcon::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/fn.uumain.html b/coreutils/dev/uu_chcon/fn.uumain.html deleted file mode 100644 index 302ca27cf..000000000 --- a/coreutils/dev/uu_chcon/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_chcon - Rust

Function uu_chcon::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/index.html b/coreutils/dev/uu_chcon/index.html deleted file mode 100644 index d5eb0d9f1..000000000 --- a/coreutils/dev/uu_chcon/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_chcon - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/dereference/index.html b/coreutils/dev/uu_chcon/options/dereference/index.html deleted file mode 100644 index b84f3f3a7..000000000 --- a/coreutils/dev/uu_chcon/options/dereference/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_chcon::options::dereference - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/dereference/sidebar-items.js b/coreutils/dev/uu_chcon/options/dereference/sidebar-items.js deleted file mode 100644 index cce6d2606..000000000 --- a/coreutils/dev/uu_chcon/options/dereference/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["DEREFERENCE","NO_DEREFERENCE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/dereference/static.DEREFERENCE.html b/coreutils/dev/uu_chcon/options/dereference/static.DEREFERENCE.html deleted file mode 100644 index 9d8f5bbac..000000000 --- a/coreutils/dev/uu_chcon/options/dereference/static.DEREFERENCE.html +++ /dev/null @@ -1 +0,0 @@ -DEREFERENCE in uu_chcon::options::dereference - Rust
pub static DEREFERENCE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/dereference/static.NO_DEREFERENCE.html b/coreutils/dev/uu_chcon/options/dereference/static.NO_DEREFERENCE.html deleted file mode 100644 index 2efcab6d2..000000000 --- a/coreutils/dev/uu_chcon/options/dereference/static.NO_DEREFERENCE.html +++ /dev/null @@ -1 +0,0 @@ -NO_DEREFERENCE in uu_chcon::options::dereference - Rust
pub static NO_DEREFERENCE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/index.html b/coreutils/dev/uu_chcon/options/index.html deleted file mode 100644 index ca0733c24..000000000 --- a/coreutils/dev/uu_chcon/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_chcon::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/preserve_root/index.html b/coreutils/dev/uu_chcon/options/preserve_root/index.html deleted file mode 100644 index 05b26cdde..000000000 --- a/coreutils/dev/uu_chcon/options/preserve_root/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_chcon::options::preserve_root - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/preserve_root/sidebar-items.js b/coreutils/dev/uu_chcon/options/preserve_root/sidebar-items.js deleted file mode 100644 index 4c9b35267..000000000 --- a/coreutils/dev/uu_chcon/options/preserve_root/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["NO_PRESERVE_ROOT","PRESERVE_ROOT"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/preserve_root/static.NO_PRESERVE_ROOT.html b/coreutils/dev/uu_chcon/options/preserve_root/static.NO_PRESERVE_ROOT.html deleted file mode 100644 index 02ceaae2b..000000000 --- a/coreutils/dev/uu_chcon/options/preserve_root/static.NO_PRESERVE_ROOT.html +++ /dev/null @@ -1 +0,0 @@ -NO_PRESERVE_ROOT in uu_chcon::options::preserve_root - Rust
pub static NO_PRESERVE_ROOT: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/preserve_root/static.PRESERVE_ROOT.html b/coreutils/dev/uu_chcon/options/preserve_root/static.PRESERVE_ROOT.html deleted file mode 100644 index a99ec1a22..000000000 --- a/coreutils/dev/uu_chcon/options/preserve_root/static.PRESERVE_ROOT.html +++ /dev/null @@ -1 +0,0 @@ -PRESERVE_ROOT in uu_chcon::options::preserve_root - Rust
pub static PRESERVE_ROOT: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/sidebar-items.js b/coreutils/dev/uu_chcon/options/sidebar-items.js deleted file mode 100644 index f62c1804c..000000000 --- a/coreutils/dev/uu_chcon/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"mod":["dereference","preserve_root","sym_links"],"static":["HELP","RANGE","RECURSIVE","REFERENCE","ROLE","TYPE","USER","VERBOSE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/static.HELP.html b/coreutils/dev/uu_chcon/options/static.HELP.html deleted file mode 100644 index a95ecec05..000000000 --- a/coreutils/dev/uu_chcon/options/static.HELP.html +++ /dev/null @@ -1 +0,0 @@ -HELP in uu_chcon::options - Rust

Static uu_chcon::options::HELP

source ·
pub static HELP: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/static.RANGE.html b/coreutils/dev/uu_chcon/options/static.RANGE.html deleted file mode 100644 index 783c60fb6..000000000 --- a/coreutils/dev/uu_chcon/options/static.RANGE.html +++ /dev/null @@ -1 +0,0 @@ -RANGE in uu_chcon::options - Rust

Static uu_chcon::options::RANGE

source ·
pub static RANGE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/static.RECURSIVE.html b/coreutils/dev/uu_chcon/options/static.RECURSIVE.html deleted file mode 100644 index 3480d385e..000000000 --- a/coreutils/dev/uu_chcon/options/static.RECURSIVE.html +++ /dev/null @@ -1 +0,0 @@ -RECURSIVE in uu_chcon::options - Rust

Static uu_chcon::options::RECURSIVE

source ·
pub static RECURSIVE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/static.REFERENCE.html b/coreutils/dev/uu_chcon/options/static.REFERENCE.html deleted file mode 100644 index 514fdd457..000000000 --- a/coreutils/dev/uu_chcon/options/static.REFERENCE.html +++ /dev/null @@ -1 +0,0 @@ -REFERENCE in uu_chcon::options - Rust

Static uu_chcon::options::REFERENCE

source ·
pub static REFERENCE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/static.ROLE.html b/coreutils/dev/uu_chcon/options/static.ROLE.html deleted file mode 100644 index b04447c82..000000000 --- a/coreutils/dev/uu_chcon/options/static.ROLE.html +++ /dev/null @@ -1 +0,0 @@ -ROLE in uu_chcon::options - Rust

Static uu_chcon::options::ROLE

source ·
pub static ROLE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/static.TYPE.html b/coreutils/dev/uu_chcon/options/static.TYPE.html deleted file mode 100644 index 1dfe41071..000000000 --- a/coreutils/dev/uu_chcon/options/static.TYPE.html +++ /dev/null @@ -1 +0,0 @@ -TYPE in uu_chcon::options - Rust

Static uu_chcon::options::TYPE

source ·
pub static TYPE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/static.USER.html b/coreutils/dev/uu_chcon/options/static.USER.html deleted file mode 100644 index a99a846c5..000000000 --- a/coreutils/dev/uu_chcon/options/static.USER.html +++ /dev/null @@ -1 +0,0 @@ -USER in uu_chcon::options - Rust

Static uu_chcon::options::USER

source ·
pub static USER: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/static.VERBOSE.html b/coreutils/dev/uu_chcon/options/static.VERBOSE.html deleted file mode 100644 index aee784c75..000000000 --- a/coreutils/dev/uu_chcon/options/static.VERBOSE.html +++ /dev/null @@ -1 +0,0 @@ -VERBOSE in uu_chcon::options - Rust

Static uu_chcon::options::VERBOSE

source ·
pub static VERBOSE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/sym_links/index.html b/coreutils/dev/uu_chcon/options/sym_links/index.html deleted file mode 100644 index ea351e696..000000000 --- a/coreutils/dev/uu_chcon/options/sym_links/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_chcon::options::sym_links - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/sym_links/sidebar-items.js b/coreutils/dev/uu_chcon/options/sym_links/sidebar-items.js deleted file mode 100644 index 92ccd4156..000000000 --- a/coreutils/dev/uu_chcon/options/sym_links/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["FOLLOW_ARG_DIR_SYM_LINK","FOLLOW_DIR_SYM_LINKS","NO_FOLLOW_SYM_LINKS"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/sym_links/static.FOLLOW_ARG_DIR_SYM_LINK.html b/coreutils/dev/uu_chcon/options/sym_links/static.FOLLOW_ARG_DIR_SYM_LINK.html deleted file mode 100644 index 41b50b231..000000000 --- a/coreutils/dev/uu_chcon/options/sym_links/static.FOLLOW_ARG_DIR_SYM_LINK.html +++ /dev/null @@ -1 +0,0 @@ -FOLLOW_ARG_DIR_SYM_LINK in uu_chcon::options::sym_links - Rust
pub static FOLLOW_ARG_DIR_SYM_LINK: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/sym_links/static.FOLLOW_DIR_SYM_LINKS.html b/coreutils/dev/uu_chcon/options/sym_links/static.FOLLOW_DIR_SYM_LINKS.html deleted file mode 100644 index 2fbdaeeec..000000000 --- a/coreutils/dev/uu_chcon/options/sym_links/static.FOLLOW_DIR_SYM_LINKS.html +++ /dev/null @@ -1 +0,0 @@ -FOLLOW_DIR_SYM_LINKS in uu_chcon::options::sym_links - Rust
pub static FOLLOW_DIR_SYM_LINKS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/options/sym_links/static.NO_FOLLOW_SYM_LINKS.html b/coreutils/dev/uu_chcon/options/sym_links/static.NO_FOLLOW_SYM_LINKS.html deleted file mode 100644 index 7d068b047..000000000 --- a/coreutils/dev/uu_chcon/options/sym_links/static.NO_FOLLOW_SYM_LINKS.html +++ /dev/null @@ -1 +0,0 @@ -NO_FOLLOW_SYM_LINKS in uu_chcon::options::sym_links - Rust
pub static NO_FOLLOW_SYM_LINKS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_chcon/sidebar-items.js b/coreutils/dev/uu_chcon/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_chcon/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/all.html b/coreutils/dev/uu_chgrp/all.html deleted file mode 100644 index 44a35ef13..000000000 --- a/coreutils/dev/uu_chgrp/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/fn.get_groups.html b/coreutils/dev/uu_chgrp/entries/fn.get_groups.html deleted file mode 100644 index 434b6dc23..000000000 --- a/coreutils/dev/uu_chgrp/entries/fn.get_groups.html +++ /dev/null @@ -1,10 +0,0 @@ -get_groups in uu_chgrp::entries - Rust

Function uu_chgrp::entries::get_groups

pub fn get_groups() -> Result<Vec<u32, Global>, Error>
Expand description

From: <https://man7.org/linux/man-pages/man2/getgroups.2.html>

-
-

getgroups() returns the supplementary group IDs of the calling -process in list. -If size is zero, list is not modified, but the total number of -supplementary group IDs for the process is returned. This allows -the caller to determine the size of a dynamically allocated list -to be used in a further call to getgroups().

-
-
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/fn.get_groups_gnu.html b/coreutils/dev/uu_chgrp/entries/fn.get_groups_gnu.html deleted file mode 100644 index c3a408d80..000000000 --- a/coreutils/dev/uu_chgrp/entries/fn.get_groups_gnu.html +++ /dev/null @@ -1,23 +0,0 @@ -get_groups_gnu in uu_chgrp::entries - Rust
pub fn get_groups_gnu(arg_id: Option<u32>) -> Result<Vec<u32, Global>, Error>
Expand description

The list of group IDs returned from GNU’s groups and GNU’s id --groups -starts with the effective group ID (egid). -This is a wrapper for get_groups() to mimic this behavior.

-

If arg_id is None (default), get_groups_gnu moves the effective -group id (egid) to the first entry in the returned Vector. -If arg_id is Some(x), get_groups_gnu moves the id with value x -to the first entry in the returned Vector. This might be necessary -for id --groups --real if gid and egid are not equal.

-

From: <https://www.man7.org/linux/man-pages/man3/getgroups.3p.html>

-
-

As implied by the definition of supplementary groups, the -effective group ID may appear in the array returned by -getgroups() or it may be returned only by getegid(). Duplication -may exist, but the application needs to call getegid() to be sure -of getting all of the information. Various implementation -variations and administrative sequences cause the set of groups -appearing in the result of getgroups() to vary in order and as to -whether the effective group ID is included, even when the set of -groups is the same (in the mathematical sense of ``set’’). (The -history of a process and its parents could affect the details of -the result.)

-
-
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/fn.gid2grp.html b/coreutils/dev/uu_chgrp/entries/fn.gid2grp.html deleted file mode 100644 index a021238af..000000000 --- a/coreutils/dev/uu_chgrp/entries/fn.gid2grp.html +++ /dev/null @@ -1 +0,0 @@ -gid2grp in uu_chgrp::entries - Rust

Function uu_chgrp::entries::gid2grp

pub fn gid2grp(id: u32) -> Result<String, Error>
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/fn.grp2gid.html b/coreutils/dev/uu_chgrp/entries/fn.grp2gid.html deleted file mode 100644 index 5a10d7dd8..000000000 --- a/coreutils/dev/uu_chgrp/entries/fn.grp2gid.html +++ /dev/null @@ -1 +0,0 @@ -grp2gid in uu_chgrp::entries - Rust

Function uu_chgrp::entries::grp2gid

pub fn grp2gid(name: &str) -> Result<u32, Error>
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/fn.uid2usr.html b/coreutils/dev/uu_chgrp/entries/fn.uid2usr.html deleted file mode 100644 index b53e0030c..000000000 --- a/coreutils/dev/uu_chgrp/entries/fn.uid2usr.html +++ /dev/null @@ -1 +0,0 @@ -uid2usr in uu_chgrp::entries - Rust

Function uu_chgrp::entries::uid2usr

pub fn uid2usr(id: u32) -> Result<String, Error>
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/fn.usr2uid.html b/coreutils/dev/uu_chgrp/entries/fn.usr2uid.html deleted file mode 100644 index be081fc8b..000000000 --- a/coreutils/dev/uu_chgrp/entries/fn.usr2uid.html +++ /dev/null @@ -1 +0,0 @@ -usr2uid in uu_chgrp::entries - Rust

Function uu_chgrp::entries::usr2uid

pub fn usr2uid(name: &str) -> Result<u32, Error>
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/index.html b/coreutils/dev/uu_chgrp/entries/index.html deleted file mode 100644 index 044b6a168..000000000 --- a/coreutils/dev/uu_chgrp/entries/index.html +++ /dev/null @@ -1,25 +0,0 @@ -uu_chgrp::entries - Rust

Module uu_chgrp::entries

Expand description

Get password/group file entry

-

Examples:

-
use uucore::entries::{self, Locate};
-
-let root_group = if cfg!(any(target_os = "linux", target_os = "android")) {
-    "root"
-} else {
-    "wheel"
-};
-
-assert_eq!("root", entries::uid2usr(0).unwrap());
-assert_eq!(0, entries::usr2uid("root").unwrap());
-assert!(entries::gid2grp(0).is_ok());
-assert!(entries::grp2gid(root_group).is_ok());
-
-assert!(entries::Passwd::locate(0).is_ok());
-assert!(entries::Passwd::locate("0").is_ok());
-assert!(entries::Passwd::locate("root").is_ok());
-
-assert!(entries::Group::locate(0).is_ok());
-assert!(entries::Group::locate("0").is_ok());
-assert!(entries::Group::locate(root_group).is_ok());
-

Structs

Traits

Functions

  • From: <https://man7.org/linux/man-pages/man2/getgroups.2.html>
  • The list of group IDs returned from GNU’s groups and GNU’s id --groups -starts with the effective group ID (egid). -This is a wrapper for get_groups() to mimic this behavior.
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/sidebar-items.js b/coreutils/dev/uu_chgrp/entries/sidebar-items.js deleted file mode 100644 index f3f8ce800..000000000 --- a/coreutils/dev/uu_chgrp/entries/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["get_groups","get_groups_gnu","gid2grp","grp2gid","uid2usr","usr2uid"],"struct":["Group","Passwd"],"trait":["Locate"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/struct.Group.html b/coreutils/dev/uu_chgrp/entries/struct.Group.html deleted file mode 100644 index c988c2fc3..000000000 --- a/coreutils/dev/uu_chgrp/entries/struct.Group.html +++ /dev/null @@ -1,17 +0,0 @@ -Group in uu_chgrp::entries - Rust

Struct uu_chgrp::entries::Group

pub struct Group {
-    pub name: String,
-    pub gid: u32,
-}

Fields§

§name: String

AKA group.gr_name

-
§gid: u32

AKA group.gr_gid

-

Trait Implementations§

§

impl Clone for Group

§

fn clone(&self) -> Group

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Group

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a> Locate<&'a str> for Group

§

fn locate(k: &'a str) -> Result<Group, Error>

§

impl Locate<u32> for Group

Auto Trait Implementations§

§

impl RefUnwindSafe for Group

§

impl Send for Group

§

impl Sync for Group

§

impl Unpin for Group

§

impl UnwindSafe for Group

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/struct.Passwd.html b/coreutils/dev/uu_chgrp/entries/struct.Passwd.html deleted file mode 100644 index 7b1a90142..000000000 --- a/coreutils/dev/uu_chgrp/entries/struct.Passwd.html +++ /dev/null @@ -1,41 +0,0 @@ -Passwd in uu_chgrp::entries - Rust

Struct uu_chgrp::entries::Passwd

pub struct Passwd {
-    pub name: String,
-    pub uid: u32,
-    pub gid: u32,
-    pub user_info: Option<String>,
-    pub user_shell: Option<String>,
-    pub user_dir: Option<String>,
-    pub user_passwd: Option<String>,
-}

Fields§

§name: String

AKA passwd.pw_name

-
§uid: u32

AKA passwd.pw_uid

-
§gid: u32

AKA passwd.pw_gid

-
§user_info: Option<String>

AKA passwd.pw_gecos

-
§user_shell: Option<String>

AKA passwd.pw_shell

-
§user_dir: Option<String>

AKA passwd.pw_dir

-
§user_passwd: Option<String>

AKA passwd.pw_passwd

-

Implementations§

§

impl Passwd

pub fn belongs_to(&self) -> Vec<u32, Global>

This is a wrapper function for libc::getgrouplist.

-

From: <https://man7.org/linux/man-pages/man3/getgrouplist.3.html>

-
-

If the number of groups of which user is a member is less than or -equal to *ngroups, then the value *ngroups is returned. -If the user is a member of more than *ngroups groups, then -getgrouplist() returns -1. In this case, the value returned in -*ngroups can be used to resize the buffer passed to a further -call getgrouplist().

-
-

However, on macOS/darwin (and maybe others?) getgrouplist does -not update ngroups if ngroups is too small. Therefore, if not -updated by getgrouplist, ngroups needs to be increased in a -loop until getgrouplist stops returning -1.

-

Trait Implementations§

§

impl Clone for Passwd

§

fn clone(&self) -> Passwd

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Passwd

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a> Locate<&'a str> for Passwd

§

fn locate(k: &'a str) -> Result<Passwd, Error>

§

impl Locate<u32> for Passwd

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/entries/trait.Locate.html b/coreutils/dev/uu_chgrp/entries/trait.Locate.html deleted file mode 100644 index 097e73215..000000000 --- a/coreutils/dev/uu_chgrp/entries/trait.Locate.html +++ /dev/null @@ -1,7 +0,0 @@ -Locate in uu_chgrp::entries - Rust

Trait uu_chgrp::entries::Locate

pub trait Locate<K> {
-    // Required method
-    fn locate(key: K) -> Result<Self, Error>
-       where Self: Sized;
-}
Expand description

Fetch desired entry.

-

Required Methods§

fn locate(key: K) -> Result<Self, Error>where - Self: Sized,

Implementors§

§

impl Locate<u32> for Group

§

impl Locate<u32> for Passwd

§

impl<'a> Locate<&'a str> for Group

§

impl<'a> Locate<&'a str> for Passwd

\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/fn.uu_app.html b/coreutils/dev/uu_chgrp/fn.uu_app.html deleted file mode 100644 index 07597307b..000000000 --- a/coreutils/dev/uu_chgrp/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_chgrp - Rust

Function uu_chgrp::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/fn.uumain.html b/coreutils/dev/uu_chgrp/fn.uumain.html deleted file mode 100644 index 42d480480..000000000 --- a/coreutils/dev/uu_chgrp/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_chgrp - Rust

Function uu_chgrp::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/index.html b/coreutils/dev/uu_chgrp/index.html deleted file mode 100644 index 53d592c46..000000000 --- a/coreutils/dev/uu_chgrp/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_chgrp - Rust

Crate uu_chgrp

source ·

Modules

  • Get password/group file entry

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_chgrp/sidebar-items.js b/coreutils/dev/uu_chgrp/sidebar-items.js deleted file mode 100644 index ba5a83d21..000000000 --- a/coreutils/dev/uu_chgrp/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["entries"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chmod/all.html b/coreutils/dev/uu_chmod/all.html deleted file mode 100644 index b22ff5880..000000000 --- a/coreutils/dev/uu_chmod/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_chmod/fn.uu_app.html b/coreutils/dev/uu_chmod/fn.uu_app.html deleted file mode 100644 index de70922d4..000000000 --- a/coreutils/dev/uu_chmod/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_chmod - Rust

Function uu_chmod::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_chmod/fn.uumain.html b/coreutils/dev/uu_chmod/fn.uumain.html deleted file mode 100644 index 6b59bf78b..000000000 --- a/coreutils/dev/uu_chmod/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_chmod - Rust

Function uu_chmod::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_chmod/index.html b/coreutils/dev/uu_chmod/index.html deleted file mode 100644 index 0d1045929..000000000 --- a/coreutils/dev/uu_chmod/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_chmod - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_chmod/sidebar-items.js b/coreutils/dev/uu_chmod/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_chmod/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chown/all.html b/coreutils/dev/uu_chown/all.html deleted file mode 100644 index ca46e954d..000000000 --- a/coreutils/dev/uu_chown/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/fn.get_groups.html b/coreutils/dev/uu_chown/entries/fn.get_groups.html deleted file mode 100644 index 67904bfed..000000000 --- a/coreutils/dev/uu_chown/entries/fn.get_groups.html +++ /dev/null @@ -1,10 +0,0 @@ -get_groups in uu_chown::entries - Rust

Function uu_chown::entries::get_groups

pub fn get_groups() -> Result<Vec<u32, Global>, Error>
Expand description

From: <https://man7.org/linux/man-pages/man2/getgroups.2.html>

-
-

getgroups() returns the supplementary group IDs of the calling -process in list. -If size is zero, list is not modified, but the total number of -supplementary group IDs for the process is returned. This allows -the caller to determine the size of a dynamically allocated list -to be used in a further call to getgroups().

-
-
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/fn.get_groups_gnu.html b/coreutils/dev/uu_chown/entries/fn.get_groups_gnu.html deleted file mode 100644 index 0564e7e64..000000000 --- a/coreutils/dev/uu_chown/entries/fn.get_groups_gnu.html +++ /dev/null @@ -1,23 +0,0 @@ -get_groups_gnu in uu_chown::entries - Rust
pub fn get_groups_gnu(arg_id: Option<u32>) -> Result<Vec<u32, Global>, Error>
Expand description

The list of group IDs returned from GNU’s groups and GNU’s id --groups -starts with the effective group ID (egid). -This is a wrapper for get_groups() to mimic this behavior.

-

If arg_id is None (default), get_groups_gnu moves the effective -group id (egid) to the first entry in the returned Vector. -If arg_id is Some(x), get_groups_gnu moves the id with value x -to the first entry in the returned Vector. This might be necessary -for id --groups --real if gid and egid are not equal.

-

From: <https://www.man7.org/linux/man-pages/man3/getgroups.3p.html>

-
-

As implied by the definition of supplementary groups, the -effective group ID may appear in the array returned by -getgroups() or it may be returned only by getegid(). Duplication -may exist, but the application needs to call getegid() to be sure -of getting all of the information. Various implementation -variations and administrative sequences cause the set of groups -appearing in the result of getgroups() to vary in order and as to -whether the effective group ID is included, even when the set of -groups is the same (in the mathematical sense of ``set’’). (The -history of a process and its parents could affect the details of -the result.)

-
-
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/fn.gid2grp.html b/coreutils/dev/uu_chown/entries/fn.gid2grp.html deleted file mode 100644 index 1f9c4b00f..000000000 --- a/coreutils/dev/uu_chown/entries/fn.gid2grp.html +++ /dev/null @@ -1 +0,0 @@ -gid2grp in uu_chown::entries - Rust

Function uu_chown::entries::gid2grp

pub fn gid2grp(id: u32) -> Result<String, Error>
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/fn.grp2gid.html b/coreutils/dev/uu_chown/entries/fn.grp2gid.html deleted file mode 100644 index d3303460e..000000000 --- a/coreutils/dev/uu_chown/entries/fn.grp2gid.html +++ /dev/null @@ -1 +0,0 @@ -grp2gid in uu_chown::entries - Rust

Function uu_chown::entries::grp2gid

pub fn grp2gid(name: &str) -> Result<u32, Error>
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/fn.uid2usr.html b/coreutils/dev/uu_chown/entries/fn.uid2usr.html deleted file mode 100644 index 2805154c1..000000000 --- a/coreutils/dev/uu_chown/entries/fn.uid2usr.html +++ /dev/null @@ -1 +0,0 @@ -uid2usr in uu_chown::entries - Rust

Function uu_chown::entries::uid2usr

pub fn uid2usr(id: u32) -> Result<String, Error>
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/fn.usr2uid.html b/coreutils/dev/uu_chown/entries/fn.usr2uid.html deleted file mode 100644 index 1fb299e3a..000000000 --- a/coreutils/dev/uu_chown/entries/fn.usr2uid.html +++ /dev/null @@ -1 +0,0 @@ -usr2uid in uu_chown::entries - Rust

Function uu_chown::entries::usr2uid

pub fn usr2uid(name: &str) -> Result<u32, Error>
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/index.html b/coreutils/dev/uu_chown/entries/index.html deleted file mode 100644 index f083efb65..000000000 --- a/coreutils/dev/uu_chown/entries/index.html +++ /dev/null @@ -1,25 +0,0 @@ -uu_chown::entries - Rust

Module uu_chown::entries

Expand description

Get password/group file entry

-

Examples:

-
use uucore::entries::{self, Locate};
-
-let root_group = if cfg!(any(target_os = "linux", target_os = "android")) {
-    "root"
-} else {
-    "wheel"
-};
-
-assert_eq!("root", entries::uid2usr(0).unwrap());
-assert_eq!(0, entries::usr2uid("root").unwrap());
-assert!(entries::gid2grp(0).is_ok());
-assert!(entries::grp2gid(root_group).is_ok());
-
-assert!(entries::Passwd::locate(0).is_ok());
-assert!(entries::Passwd::locate("0").is_ok());
-assert!(entries::Passwd::locate("root").is_ok());
-
-assert!(entries::Group::locate(0).is_ok());
-assert!(entries::Group::locate("0").is_ok());
-assert!(entries::Group::locate(root_group).is_ok());
-

Structs

Traits

Functions

  • From: <https://man7.org/linux/man-pages/man2/getgroups.2.html>
  • The list of group IDs returned from GNU’s groups and GNU’s id --groups -starts with the effective group ID (egid). -This is a wrapper for get_groups() to mimic this behavior.
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/sidebar-items.js b/coreutils/dev/uu_chown/entries/sidebar-items.js deleted file mode 100644 index f3f8ce800..000000000 --- a/coreutils/dev/uu_chown/entries/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["get_groups","get_groups_gnu","gid2grp","grp2gid","uid2usr","usr2uid"],"struct":["Group","Passwd"],"trait":["Locate"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/struct.Group.html b/coreutils/dev/uu_chown/entries/struct.Group.html deleted file mode 100644 index 4e6a2d98a..000000000 --- a/coreutils/dev/uu_chown/entries/struct.Group.html +++ /dev/null @@ -1,17 +0,0 @@ -Group in uu_chown::entries - Rust

Struct uu_chown::entries::Group

pub struct Group {
-    pub name: String,
-    pub gid: u32,
-}

Fields§

§name: String

AKA group.gr_name

-
§gid: u32

AKA group.gr_gid

-

Trait Implementations§

§

impl Clone for Group

§

fn clone(&self) -> Group

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Group

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a> Locate<&'a str> for Group

§

fn locate(k: &'a str) -> Result<Group, Error>

§

impl Locate<u32> for Group

Auto Trait Implementations§

§

impl RefUnwindSafe for Group

§

impl Send for Group

§

impl Sync for Group

§

impl Unpin for Group

§

impl UnwindSafe for Group

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/struct.Passwd.html b/coreutils/dev/uu_chown/entries/struct.Passwd.html deleted file mode 100644 index d1c043d8c..000000000 --- a/coreutils/dev/uu_chown/entries/struct.Passwd.html +++ /dev/null @@ -1,41 +0,0 @@ -Passwd in uu_chown::entries - Rust

Struct uu_chown::entries::Passwd

pub struct Passwd {
-    pub name: String,
-    pub uid: u32,
-    pub gid: u32,
-    pub user_info: Option<String>,
-    pub user_shell: Option<String>,
-    pub user_dir: Option<String>,
-    pub user_passwd: Option<String>,
-}

Fields§

§name: String

AKA passwd.pw_name

-
§uid: u32

AKA passwd.pw_uid

-
§gid: u32

AKA passwd.pw_gid

-
§user_info: Option<String>

AKA passwd.pw_gecos

-
§user_shell: Option<String>

AKA passwd.pw_shell

-
§user_dir: Option<String>

AKA passwd.pw_dir

-
§user_passwd: Option<String>

AKA passwd.pw_passwd

-

Implementations§

§

impl Passwd

pub fn belongs_to(&self) -> Vec<u32, Global>

This is a wrapper function for libc::getgrouplist.

-

From: <https://man7.org/linux/man-pages/man3/getgrouplist.3.html>

-
-

If the number of groups of which user is a member is less than or -equal to *ngroups, then the value *ngroups is returned. -If the user is a member of more than *ngroups groups, then -getgrouplist() returns -1. In this case, the value returned in -*ngroups can be used to resize the buffer passed to a further -call getgrouplist().

-
-

However, on macOS/darwin (and maybe others?) getgrouplist does -not update ngroups if ngroups is too small. Therefore, if not -updated by getgrouplist, ngroups needs to be increased in a -loop until getgrouplist stops returning -1.

-

Trait Implementations§

§

impl Clone for Passwd

§

fn clone(&self) -> Passwd

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Passwd

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a> Locate<&'a str> for Passwd

§

fn locate(k: &'a str) -> Result<Passwd, Error>

§

impl Locate<u32> for Passwd

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/entries/trait.Locate.html b/coreutils/dev/uu_chown/entries/trait.Locate.html deleted file mode 100644 index 1f9b31d73..000000000 --- a/coreutils/dev/uu_chown/entries/trait.Locate.html +++ /dev/null @@ -1,7 +0,0 @@ -Locate in uu_chown::entries - Rust

Trait uu_chown::entries::Locate

pub trait Locate<K> {
-    // Required method
-    fn locate(key: K) -> Result<Self, Error>
-       where Self: Sized;
-}
Expand description

Fetch desired entry.

-

Required Methods§

fn locate(key: K) -> Result<Self, Error>where - Self: Sized,

Implementors§

§

impl Locate<u32> for Group

§

impl Locate<u32> for Passwd

§

impl<'a> Locate<&'a str> for Group

§

impl<'a> Locate<&'a str> for Passwd

\ No newline at end of file diff --git a/coreutils/dev/uu_chown/fn.uu_app.html b/coreutils/dev/uu_chown/fn.uu_app.html deleted file mode 100644 index 1b5b2b0f9..000000000 --- a/coreutils/dev/uu_chown/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_chown - Rust

Function uu_chown::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/fn.uumain.html b/coreutils/dev/uu_chown/fn.uumain.html deleted file mode 100644 index 0327837e5..000000000 --- a/coreutils/dev/uu_chown/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_chown - Rust

Function uu_chown::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/index.html b/coreutils/dev/uu_chown/index.html deleted file mode 100644 index 0d3850a19..000000000 --- a/coreutils/dev/uu_chown/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_chown - Rust

Crate uu_chown

source ·

Modules

  • Get password/group file entry

Structs

Traits

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_chown/sidebar-items.js b/coreutils/dev/uu_chown/sidebar-items.js deleted file mode 100644 index d76d47f74..000000000 --- a/coreutils/dev/uu_chown/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["entries"],"struct":["Group","Passwd"],"trait":["Locate"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_chown/struct.Group.html b/coreutils/dev/uu_chown/struct.Group.html deleted file mode 100644 index 679d58e57..000000000 --- a/coreutils/dev/uu_chown/struct.Group.html +++ /dev/null @@ -1,17 +0,0 @@ -Group in uu_chown - Rust

Struct uu_chown::Group

pub struct Group {
-    pub name: String,
-    pub gid: u32,
-}

Fields§

§name: String

AKA group.gr_name

-
§gid: u32

AKA group.gr_gid

-

Trait Implementations§

§

impl Clone for Group

§

fn clone(&self) -> Group

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Group

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a> Locate<&'a str> for Group

§

fn locate(k: &'a str) -> Result<Group, Error>

§

impl Locate<u32> for Group

Auto Trait Implementations§

§

impl RefUnwindSafe for Group

§

impl Send for Group

§

impl Sync for Group

§

impl Unpin for Group

§

impl UnwindSafe for Group

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/struct.Passwd.html b/coreutils/dev/uu_chown/struct.Passwd.html deleted file mode 100644 index aba6e3d2d..000000000 --- a/coreutils/dev/uu_chown/struct.Passwd.html +++ /dev/null @@ -1,41 +0,0 @@ -Passwd in uu_chown - Rust

Struct uu_chown::Passwd

pub struct Passwd {
-    pub name: String,
-    pub uid: u32,
-    pub gid: u32,
-    pub user_info: Option<String>,
-    pub user_shell: Option<String>,
-    pub user_dir: Option<String>,
-    pub user_passwd: Option<String>,
-}

Fields§

§name: String

AKA passwd.pw_name

-
§uid: u32

AKA passwd.pw_uid

-
§gid: u32

AKA passwd.pw_gid

-
§user_info: Option<String>

AKA passwd.pw_gecos

-
§user_shell: Option<String>

AKA passwd.pw_shell

-
§user_dir: Option<String>

AKA passwd.pw_dir

-
§user_passwd: Option<String>

AKA passwd.pw_passwd

-

Implementations§

§

impl Passwd

pub fn belongs_to(&self) -> Vec<u32, Global>

This is a wrapper function for libc::getgrouplist.

-

From: <https://man7.org/linux/man-pages/man3/getgrouplist.3.html>

-
-

If the number of groups of which user is a member is less than or -equal to *ngroups, then the value *ngroups is returned. -If the user is a member of more than *ngroups groups, then -getgrouplist() returns -1. In this case, the value returned in -*ngroups can be used to resize the buffer passed to a further -call getgrouplist().

-
-

However, on macOS/darwin (and maybe others?) getgrouplist does -not update ngroups if ngroups is too small. Therefore, if not -updated by getgrouplist, ngroups needs to be increased in a -loop until getgrouplist stops returning -1.

-

Trait Implementations§

§

impl Clone for Passwd

§

fn clone(&self) -> Passwd

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Passwd

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a> Locate<&'a str> for Passwd

§

fn locate(k: &'a str) -> Result<Passwd, Error>

§

impl Locate<u32> for Passwd

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_chown/trait.Locate.html b/coreutils/dev/uu_chown/trait.Locate.html deleted file mode 100644 index 248c22bf0..000000000 --- a/coreutils/dev/uu_chown/trait.Locate.html +++ /dev/null @@ -1,7 +0,0 @@ -Locate in uu_chown - Rust

Trait uu_chown::Locate

pub trait Locate<K> {
-    // Required method
-    fn locate(key: K) -> Result<Self, Error>
-       where Self: Sized;
-}
Expand description

Fetch desired entry.

-

Required Methods§

fn locate(key: K) -> Result<Self, Error>where - Self: Sized,

Implementors§

§

impl Locate<u32> for Group

§

impl Locate<u32> for Passwd

§

impl<'a> Locate<&'a str> for Group

§

impl<'a> Locate<&'a str> for Passwd

\ No newline at end of file diff --git a/coreutils/dev/uu_chroot/all.html b/coreutils/dev/uu_chroot/all.html deleted file mode 100644 index 3b4a1347d..000000000 --- a/coreutils/dev/uu_chroot/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_chroot/fn.uu_app.html b/coreutils/dev/uu_chroot/fn.uu_app.html deleted file mode 100644 index 6632c5489..000000000 --- a/coreutils/dev/uu_chroot/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_chroot - Rust

Function uu_chroot::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_chroot/fn.uumain.html b/coreutils/dev/uu_chroot/fn.uumain.html deleted file mode 100644 index 6f534244f..000000000 --- a/coreutils/dev/uu_chroot/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_chroot - Rust

Function uu_chroot::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_chroot/index.html b/coreutils/dev/uu_chroot/index.html deleted file mode 100644 index 4c362e64a..000000000 --- a/coreutils/dev/uu_chroot/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_chroot - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_chroot/sidebar-items.js b/coreutils/dev/uu_chroot/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_chroot/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_cksum/all.html b/coreutils/dev/uu_cksum/all.html deleted file mode 100644 index 41a5758db..000000000 --- a/coreutils/dev/uu_cksum/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_cksum/fn.uu_app.html b/coreutils/dev/uu_cksum/fn.uu_app.html deleted file mode 100644 index 726159576..000000000 --- a/coreutils/dev/uu_cksum/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_cksum - Rust

Function uu_cksum::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_cksum/fn.uumain.html b/coreutils/dev/uu_cksum/fn.uumain.html deleted file mode 100644 index 9bc75382c..000000000 --- a/coreutils/dev/uu_cksum/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_cksum - Rust

Function uu_cksum::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_cksum/index.html b/coreutils/dev/uu_cksum/index.html deleted file mode 100644 index 4fa73bd08..000000000 --- a/coreutils/dev/uu_cksum/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_cksum - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_cksum/sidebar-items.js b/coreutils/dev/uu_cksum/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_cksum/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_comm/all.html b/coreutils/dev/uu_comm/all.html deleted file mode 100644 index f73b58953..000000000 --- a/coreutils/dev/uu_comm/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_comm/fn.uu_app.html b/coreutils/dev/uu_comm/fn.uu_app.html deleted file mode 100644 index 164fcc86d..000000000 --- a/coreutils/dev/uu_comm/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_comm - Rust

Function uu_comm::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_comm/fn.uumain.html b/coreutils/dev/uu_comm/fn.uumain.html deleted file mode 100644 index 977dd0e9d..000000000 --- a/coreutils/dev/uu_comm/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_comm - Rust

Function uu_comm::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_comm/index.html b/coreutils/dev/uu_comm/index.html deleted file mode 100644 index d0a3e10c6..000000000 --- a/coreutils/dev/uu_comm/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_comm - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_comm/sidebar-items.js b/coreutils/dev/uu_comm/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_comm/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_cp/all.html b/coreutils/dev/uu_cp/all.html deleted file mode 100644 index d4e6dd4ed..000000000 --- a/coreutils/dev/uu_cp/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/enum.ClobberMode.html b/coreutils/dev/uu_cp/enum.ClobberMode.html deleted file mode 100644 index 62ea472e3..000000000 --- a/coreutils/dev/uu_cp/enum.ClobberMode.html +++ /dev/null @@ -1,19 +0,0 @@ -ClobberMode in uu_cp - Rust

Enum uu_cp::ClobberMode

source ·
pub enum ClobberMode {
-    Force,
-    RemoveDestination,
-    Standard,
-}
Expand description

Specifies how to overwrite files.

-

Variants§

§

Force

§

RemoveDestination

§

Standard

Trait Implementations§

source§

impl Clone for ClobberMode

source§

fn clone(&self) -> ClobberMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq<ClobberMode> for ClobberMode

source§

fn eq(&self, other: &ClobberMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for ClobberMode

source§

impl Eq for ClobberMode

source§

impl StructuralEq for ClobberMode

source§

impl StructuralPartialEq for ClobberMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/enum.CopyMode.html b/coreutils/dev/uu_cp/enum.CopyMode.html deleted file mode 100644 index 14b996a36..000000000 --- a/coreutils/dev/uu_cp/enum.CopyMode.html +++ /dev/null @@ -1,18 +0,0 @@ -CopyMode in uu_cp - Rust

Enum uu_cp::CopyMode

source ·
pub enum CopyMode {
-    Link,
-    SymLink,
-    Copy,
-    Update,
-    AttrOnly,
-}
Expand description

Copy action to perform

-

Variants§

§

Copy

§

Update

§

AttrOnly

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/enum.Error.html b/coreutils/dev/uu_cp/enum.Error.html deleted file mode 100644 index cdcd57f3a..000000000 --- a/coreutils/dev/uu_cp/enum.Error.html +++ /dev/null @@ -1,40 +0,0 @@ -Error in uu_cp - Rust

Enum uu_cp::Error

source ·
pub enum Error {
-    IoErr(Error),
-    IoErrContext(Error, String),
-    Error(String),
-    NotAllFilesCopied,
-    WalkDirErr(Error),
-    StripPrefixError(StripPrefixError),
-    Skipped,
-    InvalidArgument(String),
-    NotImplemented(String),
-    Backup(String),
-    NotADirectory(PathBuf),
-}

Variants§

§

IoErr(Error)

Simple io::Error wrapper

-
§

IoErrContext(Error, String)

Wrapper for io::Error with path context

-
§

Error(String)

General copy error

-
§

NotAllFilesCopied

Represents the state when a non-fatal error has occurred -and not all files were copied.

-
§

WalkDirErr(Error)

Simple walkdir::Error wrapper

-
§

StripPrefixError(StripPrefixError)

Simple std::path::StripPrefixError wrapper

-
§

Skipped

Result of a skipped file -Currently happens when “no” is selected in interactive mode

-
§

InvalidArgument(String)

Result of a skipped file

-
§

NotImplemented(String)

All standard options are included as an an implementation -path, but those that are not implemented yet should return -a NotImplemented error.

-
§

Backup(String)

Invalid arguments to backup

-
§

NotADirectory(PathBuf)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<&'static str> for Error

source§

fn from(err: &'static str) -> Error

Converts to this type from the input type.
source§

impl<'a> From<Context<&'a str, Error>> for Error

source§

fn from($crate::Context: Context<&'a str, Error>) -> Error

Converts to this type from the input type.
source§

impl<'a> From<Context<String, Error>> for Error

source§

fn from($crate::Context: Context<String, Error>) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(err: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(err: Error) -> Error

Converts to this type from the input type.
source§

impl From<String> for Error

source§

fn from(err: String) -> Error

Converts to this type from the input type.
source§

impl From<StripPrefixError> for Error

source§

fn from(err: StripPrefixError) -> Error

Converts to this type from the input type.
source§

impl UError for Error

source§

fn code(&self) -> i32

Error code of a custom error. Read more
§

fn usage(&self) -> bool

Print usage help to a custom error. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/enum.OverwriteMode.html b/coreutils/dev/uu_cp/enum.OverwriteMode.html deleted file mode 100644 index a3b130042..000000000 --- a/coreutils/dev/uu_cp/enum.OverwriteMode.html +++ /dev/null @@ -1,22 +0,0 @@ -OverwriteMode in uu_cp - Rust

Enum uu_cp::OverwriteMode

source ·
pub enum OverwriteMode {
-    Clobber(ClobberMode),
-    Interactive(ClobberMode),
-    NoClobber,
-}
Expand description

Specifies whether files should be overwritten.

-

Variants§

§

Clobber(ClobberMode)

Default Always overwrite existing files

-
§

Interactive(ClobberMode)

Prompt before overwriting a file

-
§

NoClobber

Never overwrite a file

-

Trait Implementations§

source§

impl Clone for OverwriteMode

source§

fn clone(&self) -> OverwriteMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq<OverwriteMode> for OverwriteMode

source§

fn eq(&self, other: &OverwriteMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for OverwriteMode

source§

impl Eq for OverwriteMode

source§

impl StructuralEq for OverwriteMode

source§

impl StructuralPartialEq for OverwriteMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/enum.Preserve.html b/coreutils/dev/uu_cp/enum.Preserve.html deleted file mode 100644 index 510b4f22f..000000000 --- a/coreutils/dev/uu_cp/enum.Preserve.html +++ /dev/null @@ -1,24 +0,0 @@ -Preserve in uu_cp - Rust

Enum uu_cp::Preserve

source ·
pub enum Preserve {
-    No,
-    Yes {
-        required: bool,
-    },
-}

Variants§

§

No

§

Yes

Fields

§required: bool

Trait Implementations§

source§

impl Clone for Preserve

source§

fn clone(&self) -> Preserve

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Preserve

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for Preserve

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Preserve> for Preserve

source§

fn eq(&self, other: &Preserve) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Preserve> for Preserve

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for Preserve

source§

impl Eq for Preserve

source§

impl StructuralEq for Preserve

source§

impl StructuralPartialEq for Preserve

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/enum.ReflinkMode.html b/coreutils/dev/uu_cp/enum.ReflinkMode.html deleted file mode 100644 index 138cb4077..000000000 --- a/coreutils/dev/uu_cp/enum.ReflinkMode.html +++ /dev/null @@ -1,19 +0,0 @@ -ReflinkMode in uu_cp - Rust

Enum uu_cp::ReflinkMode

source ·
pub enum ReflinkMode {
-    Always,
-    Auto,
-    Never,
-}
Expand description

Possible arguments for --reflink.

-

Variants§

§

Always

§

Auto

§

Never

Trait Implementations§

source§

impl Clone for ReflinkMode

source§

fn clone(&self) -> ReflinkMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq<ReflinkMode> for ReflinkMode

source§

fn eq(&self, other: &ReflinkMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for ReflinkMode

source§

impl Eq for ReflinkMode

source§

impl StructuralEq for ReflinkMode

source§

impl StructuralPartialEq for ReflinkMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/enum.SparseMode.html b/coreutils/dev/uu_cp/enum.SparseMode.html deleted file mode 100644 index 459fe6818..000000000 --- a/coreutils/dev/uu_cp/enum.SparseMode.html +++ /dev/null @@ -1,19 +0,0 @@ -SparseMode in uu_cp - Rust

Enum uu_cp::SparseMode

source ·
pub enum SparseMode {
-    Always,
-    Auto,
-    Never,
-}
Expand description

Possible arguments for --sparse.

-

Variants§

§

Always

§

Auto

§

Never

Trait Implementations§

source§

impl Clone for SparseMode

source§

fn clone(&self) -> SparseMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq<SparseMode> for SparseMode

source§

fn eq(&self, other: &SparseMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for SparseMode

source§

impl Eq for SparseMode

source§

impl StructuralEq for SparseMode

source§

impl StructuralPartialEq for SparseMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/enum.TargetType.html b/coreutils/dev/uu_cp/enum.TargetType.html deleted file mode 100644 index 9cc7703e5..000000000 --- a/coreutils/dev/uu_cp/enum.TargetType.html +++ /dev/null @@ -1,15 +0,0 @@ -TargetType in uu_cp - Rust

Enum uu_cp::TargetType

source ·
pub enum TargetType {
-    Directory,
-    File,
-}
Expand description

The expected file type of copy target

-

Variants§

§

Directory

§

File

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/fn.copy.html b/coreutils/dev/uu_cp/fn.copy.html deleted file mode 100644 index 8222a7950..000000000 --- a/coreutils/dev/uu_cp/fn.copy.html +++ /dev/null @@ -1,9 +0,0 @@ -copy in uu_cp - Rust

Function uu_cp::copy

source ·
pub fn copy(
-    sources: &[PathBuf],
-    target: &Path,
-    options: &Options
-) -> CopyResult<()>
Expand description

Copy all sources to target.

-

Returns an Err(Error::NotAllFilesCopied) if at least one non-fatal error -was encountered.

-

Behavior is determined by the options parameter, see Options for details.

-
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/fn.localize_to_target.html b/coreutils/dev/uu_cp/fn.localize_to_target.html deleted file mode 100644 index 0c6c32d88..000000000 --- a/coreutils/dev/uu_cp/fn.localize_to_target.html +++ /dev/null @@ -1,13 +0,0 @@ -localize_to_target in uu_cp - Rust

Function uu_cp::localize_to_target

source ·
pub fn localize_to_target(
-    root: &Path,
-    source: &Path,
-    target: &Path
-) -> CopyResult<PathBuf>
Expand description

Remove the root prefix from source and prefix it with target -to create a file that is local to target

-

Examples

-
assert!(uu_cp::localize_to_target(
-    &Path::new("a/source/"),
-    &Path::new("a/source/c.txt"),
-    &Path::new("target/"),
-).unwrap() == Path::new("target/c.txt"))
-
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/fn.uu_app.html b/coreutils/dev/uu_cp/fn.uu_app.html deleted file mode 100644 index 4fa5653a5..000000000 --- a/coreutils/dev/uu_cp/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_cp - Rust

Function uu_cp::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/fn.uumain.html b/coreutils/dev/uu_cp/fn.uumain.html deleted file mode 100644 index 9da7e1165..000000000 --- a/coreutils/dev/uu_cp/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_cp - Rust

Function uu_cp::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/fn.verify_target_type.html b/coreutils/dev/uu_cp/fn.verify_target_type.html deleted file mode 100644 index f3e0d6f06..000000000 --- a/coreutils/dev/uu_cp/fn.verify_target_type.html +++ /dev/null @@ -1,5 +0,0 @@ -verify_target_type in uu_cp - Rust

Function uu_cp::verify_target_type

source ·
pub fn verify_target_type(
-    target: &Path,
-    target_type: &TargetType
-) -> CopyResult<()>
Expand description

Generate an error message if target is not the correct target_type

-
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/index.html b/coreutils/dev/uu_cp/index.html deleted file mode 100644 index 73d07e351..000000000 --- a/coreutils/dev/uu_cp/index.html +++ /dev/null @@ -1,2 +0,0 @@ -uu_cp - Rust

Crate uu_cp

source ·

Structs

  • Preservation settings for various attributes
  • Options for the cp command

Enums

Functions

Type Definitions

\ No newline at end of file diff --git a/coreutils/dev/uu_cp/sidebar-items.js b/coreutils/dev/uu_cp/sidebar-items.js deleted file mode 100644 index 235906b65..000000000 --- a/coreutils/dev/uu_cp/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["ClobberMode","CopyMode","Error","OverwriteMode","Preserve","ReflinkMode","SparseMode","TargetType"],"fn":["copy","localize_to_target","uu_app","uumain","verify_target_type"],"struct":["Attributes","Options"],"type":["CopyResult"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_cp/struct.Attributes.html b/coreutils/dev/uu_cp/struct.Attributes.html deleted file mode 100644 index 5703cc286..000000000 --- a/coreutils/dev/uu_cp/struct.Attributes.html +++ /dev/null @@ -1,31 +0,0 @@ -Attributes in uu_cp - Rust

Struct uu_cp::Attributes

source ·
pub struct Attributes {
-    pub ownership: Preserve,
-    pub mode: Preserve,
-    pub timestamps: Preserve,
-    pub context: Preserve,
-    pub links: Preserve,
-    pub xattr: Preserve,
-}
Expand description

Preservation settings for various attributes

-

It should be derived from options as follows:

- -

For full compatibility with GNU, these options should also combine. We -currently only do a best effort imitation of that behavior, because it is -difficult to achieve in clap, especially with --no-preserve.

-

Fields§

§ownership: Preserve§mode: Preserve§timestamps: Preserve§context: Preserve§links: Preserve§xattr: Preserve

Implementations§

source§

impl Attributes

source

pub const ALL: Self = _

source

pub const NONE: Self = _

source

pub const DEFAULT: Self = _

source

pub fn union(self, other: &Self) -> Self

source

pub fn parse_iter<T>(values: impl Iterator<Item = T>) -> Result<Self, Error>where - T: AsRef<str>,

Trait Implementations§

source§

impl Debug for Attributes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/struct.Options.html b/coreutils/dev/uu_cp/struct.Options.html deleted file mode 100644 index 74a9ba9d5..000000000 --- a/coreutils/dev/uu_cp/struct.Options.html +++ /dev/null @@ -1,81 +0,0 @@ -Options in uu_cp - Rust

Struct uu_cp::Options

source ·
pub struct Options {
Show 21 fields - pub attributes_only: bool, - pub backup: BackupMode, - pub copy_contents: bool, - pub cli_dereference: bool, - pub copy_mode: CopyMode, - pub dereference: bool, - pub no_target_dir: bool, - pub one_file_system: bool, - pub overwrite: OverwriteMode, - pub parents: bool, - pub sparse_mode: SparseMode, - pub strip_trailing_slashes: bool, - pub reflink_mode: ReflinkMode, - pub attributes: Attributes, - pub recursive: bool, - pub backup_suffix: String, - pub target_dir: Option<PathBuf>, - pub update: UpdateMode, - pub debug: bool, - pub verbose: bool, - pub progress_bar: bool, -
}
Expand description

Options for the cp command

-

All options are public so that the options can be programmatically -constructed by other crates, such as nushell. That means that this struct -is part of our public API. It should therefore not be changed without good -reason.

-

The fields are documented with the arguments that determine their value.

-

Fields§

§attributes_only: bool

--attributes-only

-
§backup: BackupMode

--backup[=CONTROL], -b

-
§copy_contents: bool

--copy-contents

-
§cli_dereference: bool

-H

-
§copy_mode: CopyMode

Determines the type of copying that should be done

-

Set by the following arguments:

- -
§dereference: bool

-L, --dereference

-
§no_target_dir: bool

-T, --no-target-dir

-
§one_file_system: bool

-x, --one-file-system

-
§overwrite: OverwriteMode

Specifies what to do with an existing destination

-

Set by the following arguments:

- -

The Interactive and Clobber variants have a ClobberMode argument, -set by the following arguments:

- -
§parents: bool

--parents

-
§sparse_mode: SparseMode

--sparse[=WHEN]

-
§strip_trailing_slashes: bool

--strip-trailing-slashes

-
§reflink_mode: ReflinkMode

--reflink[=WHEN]

-
§attributes: Attributes

--preserve=[=ATTRIBUTE_LIST] and --no-preserve=ATTRIBUTE_LIST

-
§recursive: bool

-R, -r, --recursive

-
§backup_suffix: String

-S, --suffix

-
§target_dir: Option<PathBuf>

-t, --target-directory

-
§update: UpdateMode

--update[=UPDATE]

-
§debug: bool

--debug

-
§verbose: bool

-v, --verbose

-
§progress_bar: bool

-g, --progress

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cp/type.CopyResult.html b/coreutils/dev/uu_cp/type.CopyResult.html deleted file mode 100644 index f4bf8dea8..000000000 --- a/coreutils/dev/uu_cp/type.CopyResult.html +++ /dev/null @@ -1 +0,0 @@ -CopyResult in uu_cp - Rust

Type Definition uu_cp::CopyResult

source ·
pub type CopyResult<T> = Result<T, Error>;
\ No newline at end of file diff --git a/coreutils/dev/uu_csplit/all.html b/coreutils/dev/uu_csplit/all.html deleted file mode 100644 index 140c557dd..000000000 --- a/coreutils/dev/uu_csplit/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_csplit/fn.csplit.html b/coreutils/dev/uu_csplit/fn.csplit.html deleted file mode 100644 index 5953cc719..000000000 --- a/coreutils/dev/uu_csplit/fn.csplit.html +++ /dev/null @@ -1,18 +0,0 @@ -csplit in uu_csplit - Rust

Function uu_csplit::csplit

source ·
pub fn csplit<T>(
-    options: &CsplitOptions,
-    patterns: Vec<Pattern>,
-    input: T
-) -> Result<(), CsplitError>where
-    T: BufRead,
Expand description

Splits a file into severals according to the command line patterns.

-

Errors

-
    -
  • io::Error if there is some problem reading/writing from/to a file.
  • -
  • [CsplitError::LineOutOfRange] if the line number pattern is larger than the number of input -lines.
  • -
  • [CsplitError::LineOutOfRangeOnRepetition], like previous but after applying the pattern -more than once.
  • -
  • [CsplitError::MatchNotFound] if no line matched a regular expression.
  • -
  • [CsplitError::MatchNotFoundOnRepetition], like previous but after applying the pattern -more than once.
  • -
-
\ No newline at end of file diff --git a/coreutils/dev/uu_csplit/fn.uu_app.html b/coreutils/dev/uu_csplit/fn.uu_app.html deleted file mode 100644 index 09548ef9b..000000000 --- a/coreutils/dev/uu_csplit/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_csplit - Rust

Function uu_csplit::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_csplit/fn.uumain.html b/coreutils/dev/uu_csplit/fn.uumain.html deleted file mode 100644 index ef3d6371c..000000000 --- a/coreutils/dev/uu_csplit/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_csplit - Rust

Function uu_csplit::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_csplit/index.html b/coreutils/dev/uu_csplit/index.html deleted file mode 100644 index 352bd7e15..000000000 --- a/coreutils/dev/uu_csplit/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_csplit - Rust

Crate uu_csplit

source ·

Structs

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_csplit/sidebar-items.js b/coreutils/dev/uu_csplit/sidebar-items.js deleted file mode 100644 index 6f38b5c0b..000000000 --- a/coreutils/dev/uu_csplit/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["csplit","uu_app","uumain"],"struct":["CsplitOptions"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_csplit/struct.CsplitOptions.html b/coreutils/dev/uu_csplit/struct.CsplitOptions.html deleted file mode 100644 index 266331352..000000000 --- a/coreutils/dev/uu_csplit/struct.CsplitOptions.html +++ /dev/null @@ -1,12 +0,0 @@ -CsplitOptions in uu_csplit - Rust
pub struct CsplitOptions { /* private fields */ }
Expand description

Command line options for csplit.

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_cut/all.html b/coreutils/dev/uu_cut/all.html deleted file mode 100644 index 43e98a589..000000000 --- a/coreutils/dev/uu_cut/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_cut/fn.uu_app.html b/coreutils/dev/uu_cut/fn.uu_app.html deleted file mode 100644 index 7ed5d7f1a..000000000 --- a/coreutils/dev/uu_cut/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_cut - Rust

Function uu_cut::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_cut/fn.uumain.html b/coreutils/dev/uu_cut/fn.uumain.html deleted file mode 100644 index 8312af458..000000000 --- a/coreutils/dev/uu_cut/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_cut - Rust

Function uu_cut::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_cut/index.html b/coreutils/dev/uu_cut/index.html deleted file mode 100644 index 9b2b75df8..000000000 --- a/coreutils/dev/uu_cut/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_cut - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_cut/sidebar-items.js b/coreutils/dev/uu_cut/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_cut/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_date/all.html b/coreutils/dev/uu_date/all.html deleted file mode 100644 index f51aa8918..000000000 --- a/coreutils/dev/uu_date/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_date/fn.uu_app.html b/coreutils/dev/uu_date/fn.uu_app.html deleted file mode 100644 index 660a1ef70..000000000 --- a/coreutils/dev/uu_date/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_date - Rust

Function uu_date::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_date/fn.uumain.html b/coreutils/dev/uu_date/fn.uumain.html deleted file mode 100644 index 5df4384ed..000000000 --- a/coreutils/dev/uu_date/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_date - Rust

Function uu_date::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_date/index.html b/coreutils/dev/uu_date/index.html deleted file mode 100644 index 097ae2a1c..000000000 --- a/coreutils/dev/uu_date/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_date - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_date/sidebar-items.js b/coreutils/dev/uu_date/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_date/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_dd/all.html b/coreutils/dev/uu_dd/all.html deleted file mode 100644 index 7f4b8a825..000000000 --- a/coreutils/dev/uu_dd/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_dd/fn.uu_app.html b/coreutils/dev/uu_dd/fn.uu_app.html deleted file mode 100644 index 3a428e170..000000000 --- a/coreutils/dev/uu_dd/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_dd - Rust

Function uu_dd::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_dd/fn.uumain.html b/coreutils/dev/uu_dd/fn.uumain.html deleted file mode 100644 index 11321456a..000000000 --- a/coreutils/dev/uu_dd/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_dd - Rust

Function uu_dd::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_dd/index.html b/coreutils/dev/uu_dd/index.html deleted file mode 100644 index 5a5e05abd..000000000 --- a/coreutils/dev/uu_dd/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_dd - Rust

Crate uu_dd

source ·

Structs

  • A timer which triggers on a given interval

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_dd/sidebar-items.js b/coreutils/dev/uu_dd/sidebar-items.js deleted file mode 100644 index 83a987837..000000000 --- a/coreutils/dev/uu_dd/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"struct":["Alarm"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_dd/struct.Alarm.html b/coreutils/dev/uu_dd/struct.Alarm.html deleted file mode 100644 index 9dc11a849..000000000 --- a/coreutils/dev/uu_dd/struct.Alarm.html +++ /dev/null @@ -1,18 +0,0 @@ -Alarm in uu_dd - Rust

Struct uu_dd::Alarm

source ·
pub struct Alarm { /* private fields */ }
Expand description

A timer which triggers on a given interval

-

After being constructed with Alarm::with_interval, Alarm::is_triggered -will return true once per the given Duration.

-

Can be cloned, but the trigger status is shared across all instances so only -the first caller each interval will yield true.

-

When all instances are dropped the background thread will exit on the next interval.

-

Implementations§

source§

impl Alarm

source

pub fn with_interval(interval: Duration) -> Self

source

pub fn is_triggered(&self) -> bool

source

pub fn get_interval(&self) -> Duration

Trait Implementations§

source§

impl Clone for Alarm

source§

fn clone(&self) -> Alarm

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Alarm

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Alarm

§

impl Send for Alarm

§

impl Sync for Alarm

§

impl Unpin for Alarm

§

impl UnwindSafe for Alarm

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_df/all.html b/coreutils/dev/uu_df/all.html deleted file mode 100644 index eea1317ba..000000000 --- a/coreutils/dev/uu_df/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_df/fn.uu_app.html b/coreutils/dev/uu_df/fn.uu_app.html deleted file mode 100644 index 2cd242f20..000000000 --- a/coreutils/dev/uu_df/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_df - Rust

Function uu_df::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_df/fn.uumain.html b/coreutils/dev/uu_df/fn.uumain.html deleted file mode 100644 index 18b9cd719..000000000 --- a/coreutils/dev/uu_df/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_df - Rust

Function uu_df::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_df/index.html b/coreutils/dev/uu_df/index.html deleted file mode 100644 index 37b8e85d6..000000000 --- a/coreutils/dev/uu_df/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_df - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_df/sidebar-items.js b/coreutils/dev/uu_df/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_df/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_dir/all.html b/coreutils/dev/uu_dir/all.html deleted file mode 100644 index 3e603b25b..000000000 --- a/coreutils/dev/uu_dir/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_dir/fn.uu_app.html b/coreutils/dev/uu_dir/fn.uu_app.html deleted file mode 100644 index e37b51e38..000000000 --- a/coreutils/dev/uu_dir/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_dir - Rust

Function uu_dir::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_dir/fn.uumain.html b/coreutils/dev/uu_dir/fn.uumain.html deleted file mode 100644 index d1aaaf215..000000000 --- a/coreutils/dev/uu_dir/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_dir - Rust

Function uu_dir::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_dir/index.html b/coreutils/dev/uu_dir/index.html deleted file mode 100644 index 4a1480d9c..000000000 --- a/coreutils/dev/uu_dir/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_dir - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_dir/sidebar-items.js b/coreutils/dev/uu_dir/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_dir/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_dircolors/all.html b/coreutils/dev/uu_dircolors/all.html deleted file mode 100644 index 223f9c7bd..000000000 --- a/coreutils/dev/uu_dircolors/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Enums

Traits

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_dircolors/enum.OutputFmt.html b/coreutils/dev/uu_dircolors/enum.OutputFmt.html deleted file mode 100644 index 23895a4f9..000000000 --- a/coreutils/dev/uu_dircolors/enum.OutputFmt.html +++ /dev/null @@ -1,18 +0,0 @@ -OutputFmt in uu_dircolors - Rust
pub enum OutputFmt {
-    Shell,
-    CShell,
-    Display,
-    Unknown,
-}

Variants§

§

Shell

§

CShell

§

Display

§

Unknown

Trait Implementations§

source§

impl Debug for OutputFmt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<OutputFmt> for OutputFmt

source§

fn eq(&self, other: &OutputFmt) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for OutputFmt

source§

impl StructuralEq for OutputFmt

source§

impl StructuralPartialEq for OutputFmt

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_dircolors/fn.guess_syntax.html b/coreutils/dev/uu_dircolors/fn.guess_syntax.html deleted file mode 100644 index 0029e9024..000000000 --- a/coreutils/dev/uu_dircolors/fn.guess_syntax.html +++ /dev/null @@ -1 +0,0 @@ -guess_syntax in uu_dircolors - Rust

Function uu_dircolors::guess_syntax

source ·
pub fn guess_syntax() -> OutputFmt
\ No newline at end of file diff --git a/coreutils/dev/uu_dircolors/fn.uu_app.html b/coreutils/dev/uu_dircolors/fn.uu_app.html deleted file mode 100644 index e5b2b51fd..000000000 --- a/coreutils/dev/uu_dircolors/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_dircolors - Rust

Function uu_dircolors::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_dircolors/fn.uumain.html b/coreutils/dev/uu_dircolors/fn.uumain.html deleted file mode 100644 index 2ec34a0d2..000000000 --- a/coreutils/dev/uu_dircolors/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_dircolors - Rust

Function uu_dircolors::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_dircolors/index.html b/coreutils/dev/uu_dircolors/index.html deleted file mode 100644 index d282e32e8..000000000 --- a/coreutils/dev/uu_dircolors/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_dircolors - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_dircolors/sidebar-items.js b/coreutils/dev/uu_dircolors/sidebar-items.js deleted file mode 100644 index 5e758b1cf..000000000 --- a/coreutils/dev/uu_dircolors/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["OutputFmt"],"fn":["guess_syntax","uu_app","uumain"],"trait":["StrUtils"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_dircolors/trait.StrUtils.html b/coreutils/dev/uu_dircolors/trait.StrUtils.html deleted file mode 100644 index a3aba0999..000000000 --- a/coreutils/dev/uu_dircolors/trait.StrUtils.html +++ /dev/null @@ -1,8 +0,0 @@ -StrUtils in uu_dircolors - Rust
pub trait StrUtils {
-    // Required methods
-    fn purify(&self) -> &Self;
-    fn split_two(&self) -> (&str, &str);
-    fn fnmatch(&self, pattern: &str) -> bool;
-}

Required Methods§

source

fn purify(&self) -> &Self

Remove comments and trim whitespace

-
source

fn split_two(&self) -> (&str, &str)

Like split_whitespace() but only produce 2 components

-
source

fn fnmatch(&self, pattern: &str) -> bool

Implementations on Foreign Types§

source§

impl StrUtils for str

source§

fn purify(&self) -> &Self

source§

fn split_two(&self) -> (&str, &str)

source§

fn fnmatch(&self, pat: &str) -> bool

Implementors§

\ No newline at end of file diff --git a/coreutils/dev/uu_dirname/all.html b/coreutils/dev/uu_dirname/all.html deleted file mode 100644 index babb4f49a..000000000 --- a/coreutils/dev/uu_dirname/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_dirname/fn.uu_app.html b/coreutils/dev/uu_dirname/fn.uu_app.html deleted file mode 100644 index 32a674c28..000000000 --- a/coreutils/dev/uu_dirname/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_dirname - Rust

Function uu_dirname::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_dirname/fn.uumain.html b/coreutils/dev/uu_dirname/fn.uumain.html deleted file mode 100644 index 4ba807ed8..000000000 --- a/coreutils/dev/uu_dirname/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_dirname - Rust

Function uu_dirname::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_dirname/index.html b/coreutils/dev/uu_dirname/index.html deleted file mode 100644 index ea332104a..000000000 --- a/coreutils/dev/uu_dirname/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_dirname - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_dirname/sidebar-items.js b/coreutils/dev/uu_dirname/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_dirname/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_du/all.html b/coreutils/dev/uu_du/all.html deleted file mode 100644 index 9ed8ed540..000000000 --- a/coreutils/dev/uu_du/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_du/fn.uu_app.html b/coreutils/dev/uu_du/fn.uu_app.html deleted file mode 100644 index adb7452b4..000000000 --- a/coreutils/dev/uu_du/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_du - Rust

Function uu_du::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_du/fn.uumain.html b/coreutils/dev/uu_du/fn.uumain.html deleted file mode 100644 index ace45a519..000000000 --- a/coreutils/dev/uu_du/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_du - Rust

Function uu_du::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_du/index.html b/coreutils/dev/uu_du/index.html deleted file mode 100644 index ec78a4e4f..000000000 --- a/coreutils/dev/uu_du/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_du - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_du/sidebar-items.js b/coreutils/dev/uu_du/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_du/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_echo/all.html b/coreutils/dev/uu_echo/all.html deleted file mode 100644 index 3dbe11872..000000000 --- a/coreutils/dev/uu_echo/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_echo/fn.uu_app.html b/coreutils/dev/uu_echo/fn.uu_app.html deleted file mode 100644 index 7b857a01c..000000000 --- a/coreutils/dev/uu_echo/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_echo - Rust

Function uu_echo::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_echo/fn.uumain.html b/coreutils/dev/uu_echo/fn.uumain.html deleted file mode 100644 index 700a65ffa..000000000 --- a/coreutils/dev/uu_echo/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_echo - Rust

Function uu_echo::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_echo/index.html b/coreutils/dev/uu_echo/index.html deleted file mode 100644 index 6a5c2d765..000000000 --- a/coreutils/dev/uu_echo/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_echo - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_echo/sidebar-items.js b/coreutils/dev/uu_echo/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_echo/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_env/all.html b/coreutils/dev/uu_env/all.html deleted file mode 100644 index b44b139fd..000000000 --- a/coreutils/dev/uu_env/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_env/fn.uu_app.html b/coreutils/dev/uu_env/fn.uu_app.html deleted file mode 100644 index 5d7476cd2..000000000 --- a/coreutils/dev/uu_env/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_env - Rust

Function uu_env::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_env/fn.uumain.html b/coreutils/dev/uu_env/fn.uumain.html deleted file mode 100644 index 6823a037e..000000000 --- a/coreutils/dev/uu_env/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_env - Rust

Function uu_env::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_env/index.html b/coreutils/dev/uu_env/index.html deleted file mode 100644 index e51b0e163..000000000 --- a/coreutils/dev/uu_env/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_env - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_env/sidebar-items.js b/coreutils/dev/uu_env/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_env/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_expand/all.html b/coreutils/dev/uu_expand/all.html deleted file mode 100644 index a323be70f..000000000 --- a/coreutils/dev/uu_expand/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_expand/fn.uu_app.html b/coreutils/dev/uu_expand/fn.uu_app.html deleted file mode 100644 index 41ca0a9ea..000000000 --- a/coreutils/dev/uu_expand/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_expand - Rust

Function uu_expand::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_expand/fn.uumain.html b/coreutils/dev/uu_expand/fn.uumain.html deleted file mode 100644 index bf232121c..000000000 --- a/coreutils/dev/uu_expand/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_expand - Rust

Function uu_expand::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_expand/index.html b/coreutils/dev/uu_expand/index.html deleted file mode 100644 index 1079e1241..000000000 --- a/coreutils/dev/uu_expand/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_expand - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_expand/options/index.html b/coreutils/dev/uu_expand/options/index.html deleted file mode 100644 index be1c9fc18..000000000 --- a/coreutils/dev/uu_expand/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_expand::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_expand/options/sidebar-items.js b/coreutils/dev/uu_expand/options/sidebar-items.js deleted file mode 100644 index d79ef3139..000000000 --- a/coreutils/dev/uu_expand/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["FILES","INITIAL","NO_UTF8","TABS"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_expand/options/static.FILES.html b/coreutils/dev/uu_expand/options/static.FILES.html deleted file mode 100644 index 4bef5e64b..000000000 --- a/coreutils/dev/uu_expand/options/static.FILES.html +++ /dev/null @@ -1 +0,0 @@ -FILES in uu_expand::options - Rust

Static uu_expand::options::FILES

source ·
pub static FILES: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_expand/options/static.INITIAL.html b/coreutils/dev/uu_expand/options/static.INITIAL.html deleted file mode 100644 index 7a3cfc8bb..000000000 --- a/coreutils/dev/uu_expand/options/static.INITIAL.html +++ /dev/null @@ -1 +0,0 @@ -INITIAL in uu_expand::options - Rust

Static uu_expand::options::INITIAL

source ·
pub static INITIAL: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_expand/options/static.NO_UTF8.html b/coreutils/dev/uu_expand/options/static.NO_UTF8.html deleted file mode 100644 index 6616d8a6a..000000000 --- a/coreutils/dev/uu_expand/options/static.NO_UTF8.html +++ /dev/null @@ -1 +0,0 @@ -NO_UTF8 in uu_expand::options - Rust

Static uu_expand::options::NO_UTF8

source ·
pub static NO_UTF8: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_expand/options/static.TABS.html b/coreutils/dev/uu_expand/options/static.TABS.html deleted file mode 100644 index c75c0f461..000000000 --- a/coreutils/dev/uu_expand/options/static.TABS.html +++ /dev/null @@ -1 +0,0 @@ -TABS in uu_expand::options - Rust

Static uu_expand::options::TABS

source ·
pub static TABS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_expand/sidebar-items.js b/coreutils/dev/uu_expand/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_expand/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_expr/all.html b/coreutils/dev/uu_expr/all.html deleted file mode 100644 index 644c3de0c..000000000 --- a/coreutils/dev/uu_expr/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_expr/fn.uu_app.html b/coreutils/dev/uu_expr/fn.uu_app.html deleted file mode 100644 index e2dd15844..000000000 --- a/coreutils/dev/uu_expr/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_expr - Rust

Function uu_expr::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_expr/fn.uumain.html b/coreutils/dev/uu_expr/fn.uumain.html deleted file mode 100644 index 699158ff8..000000000 --- a/coreutils/dev/uu_expr/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_expr - Rust

Function uu_expr::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_expr/index.html b/coreutils/dev/uu_expr/index.html deleted file mode 100644 index e8c6c5b43..000000000 --- a/coreutils/dev/uu_expr/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_expr - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_expr/sidebar-items.js b/coreutils/dev/uu_expr/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_expr/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_factor/all.html b/coreutils/dev/uu_factor/all.html deleted file mode 100644 index d9006f48d..000000000 --- a/coreutils/dev/uu_factor/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/factor/fn.factor.html b/coreutils/dev/uu_factor/factor/fn.factor.html deleted file mode 100644 index 758e9df31..000000000 --- a/coreutils/dev/uu_factor/factor/fn.factor.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../uu_factor/fn.factor.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uu_factor/factor/struct.Factors.html b/coreutils/dev/uu_factor/factor/struct.Factors.html deleted file mode 100644 index 0ef90f8a7..000000000 --- a/coreutils/dev/uu_factor/factor/struct.Factors.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../uu_factor/struct.Factors.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uu_factor/fn.factor.html b/coreutils/dev/uu_factor/fn.factor.html deleted file mode 100644 index 38e95a8f4..000000000 --- a/coreutils/dev/uu_factor/fn.factor.html +++ /dev/null @@ -1 +0,0 @@ -factor in uu_factor - Rust

Function uu_factor::factor

source ·
pub fn factor(n: u64) -> Factors
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/fn.uu_app.html b/coreutils/dev/uu_factor/fn.uu_app.html deleted file mode 100644 index ac94b3905..000000000 --- a/coreutils/dev/uu_factor/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_factor - Rust

Function uu_factor::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/fn.uumain.html b/coreutils/dev/uu_factor/fn.uumain.html deleted file mode 100644 index 4a066891e..000000000 --- a/coreutils/dev/uu_factor/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_factor - Rust

Function uu_factor::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/index.html b/coreutils/dev/uu_factor/index.html deleted file mode 100644 index fd46dae84..000000000 --- a/coreutils/dev/uu_factor/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_factor - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/numeric/fn.gcd.html b/coreutils/dev/uu_factor/numeric/fn.gcd.html deleted file mode 100644 index cda6c490a..000000000 --- a/coreutils/dev/uu_factor/numeric/fn.gcd.html +++ /dev/null @@ -1 +0,0 @@ -gcd in uu_factor::numeric - Rust

Function uu_factor::numeric::gcd

source ·
pub fn gcd(u: u64, v: u64) -> u64
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/numeric/gcd/fn.gcd.html b/coreutils/dev/uu_factor/numeric/gcd/fn.gcd.html deleted file mode 100644 index d45cf6d22..000000000 --- a/coreutils/dev/uu_factor/numeric/gcd/fn.gcd.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uu_factor/numeric/fn.gcd.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uu_factor/numeric/index.html b/coreutils/dev/uu_factor/numeric/index.html deleted file mode 100644 index 838d39879..000000000 --- a/coreutils/dev/uu_factor/numeric/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_factor::numeric - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/numeric/sidebar-items.js b/coreutils/dev/uu_factor/numeric/sidebar-items.js deleted file mode 100644 index 77183d491..000000000 --- a/coreutils/dev/uu_factor/numeric/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["gcd"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_factor/sidebar-items.js b/coreutils/dev/uu_factor/sidebar-items.js deleted file mode 100644 index b24a012fd..000000000 --- a/coreutils/dev/uu_factor/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["factor","uu_app","uumain"],"mod":["numeric","table"],"struct":["Factors"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_factor/struct.Factors.html b/coreutils/dev/uu_factor/struct.Factors.html deleted file mode 100644 index fab9da95f..000000000 --- a/coreutils/dev/uu_factor/struct.Factors.html +++ /dev/null @@ -1,16 +0,0 @@ -Factors in uu_factor - Rust

Struct uu_factor::Factors

source ·
pub struct Factors(_);

Implementations§

source§

impl Factors

source

pub fn one() -> Self

source

pub fn add(&mut self, prime: u64, exp: u8)

source

pub fn push(&mut self, prime: u64)

Trait Implementations§

source§

impl Clone for Factors

source§

fn clone(&self) -> Factors

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Factors

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Factors

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Factors> for Factors

source§

fn eq(&self, other: &Factors) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for Factors

source§

impl StructuralEq for Factors

source§

impl StructuralPartialEq for Factors

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere - V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/coreutils/dev/uu_factor/table/constant.CHUNK_SIZE.html b/coreutils/dev/uu_factor/table/constant.CHUNK_SIZE.html deleted file mode 100644 index 10327925c..000000000 --- a/coreutils/dev/uu_factor/table/constant.CHUNK_SIZE.html +++ /dev/null @@ -1 +0,0 @@ -CHUNK_SIZE in uu_factor::table - Rust

Constant uu_factor::table::CHUNK_SIZE

source ·
pub const CHUNK_SIZE: usize = 8;
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/table/constant.NEXT_PRIME.html b/coreutils/dev/uu_factor/table/constant.NEXT_PRIME.html deleted file mode 100644 index a6b616e2f..000000000 --- a/coreutils/dev/uu_factor/table/constant.NEXT_PRIME.html +++ /dev/null @@ -1 +0,0 @@ -NEXT_PRIME in uu_factor::table - Rust

Constant uu_factor::table::NEXT_PRIME

source ·
pub const NEXT_PRIME: u64 = 2137;
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/table/constant.PRIME_INVERSIONS_U64.html b/coreutils/dev/uu_factor/table/constant.PRIME_INVERSIONS_U64.html deleted file mode 100644 index 2385111a7..000000000 --- a/coreutils/dev/uu_factor/table/constant.PRIME_INVERSIONS_U64.html +++ /dev/null @@ -1 +0,0 @@ -PRIME_INVERSIONS_U64 in uu_factor::table - Rust
pub const PRIME_INVERSIONS_U64: &[(u64, u64, u64)];
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/table/fn.factor.html b/coreutils/dev/uu_factor/table/fn.factor.html deleted file mode 100644 index 380c1be56..000000000 --- a/coreutils/dev/uu_factor/table/fn.factor.html +++ /dev/null @@ -1 +0,0 @@ -factor in uu_factor::table - Rust

Function uu_factor::table::factor

source ·
pub fn factor(num: &mut u64, factors: &mut Factors)
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/table/fn.factor_chunk.html b/coreutils/dev/uu_factor/table/fn.factor_chunk.html deleted file mode 100644 index ac45fb0af..000000000 --- a/coreutils/dev/uu_factor/table/fn.factor_chunk.html +++ /dev/null @@ -1 +0,0 @@ -factor_chunk in uu_factor::table - Rust

Function uu_factor::table::factor_chunk

source ·
pub fn factor_chunk(n_s: &mut [u64; 8], f_s: &mut [Factors; 8])
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/table/index.html b/coreutils/dev/uu_factor/table/index.html deleted file mode 100644 index 9f9ff2e87..000000000 --- a/coreutils/dev/uu_factor/table/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_factor::table - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_factor/table/sidebar-items.js b/coreutils/dev/uu_factor/table/sidebar-items.js deleted file mode 100644 index 9b6c175fe..000000000 --- a/coreutils/dev/uu_factor/table/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["CHUNK_SIZE","NEXT_PRIME","PRIME_INVERSIONS_U64"],"fn":["factor","factor_chunk"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_false/all.html b/coreutils/dev/uu_false/all.html deleted file mode 100644 index 9343ce95a..000000000 --- a/coreutils/dev/uu_false/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_false/fn.uu_app.html b/coreutils/dev/uu_false/fn.uu_app.html deleted file mode 100644 index 9703b5fb4..000000000 --- a/coreutils/dev/uu_false/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_false - Rust

Function uu_false::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_false/fn.uumain.html b/coreutils/dev/uu_false/fn.uumain.html deleted file mode 100644 index 03dc1f1da..000000000 --- a/coreutils/dev/uu_false/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_false - Rust

Function uu_false::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_false/index.html b/coreutils/dev/uu_false/index.html deleted file mode 100644 index 2e2ee84dc..000000000 --- a/coreutils/dev/uu_false/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_false - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_false/sidebar-items.js b/coreutils/dev/uu_false/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_false/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_fmt/all.html b/coreutils/dev/uu_fmt/all.html deleted file mode 100644 index 0997369e5..000000000 --- a/coreutils/dev/uu_fmt/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Functions

Type Definitions

\ No newline at end of file diff --git a/coreutils/dev/uu_fmt/fn.uu_app.html b/coreutils/dev/uu_fmt/fn.uu_app.html deleted file mode 100644 index deb6e5065..000000000 --- a/coreutils/dev/uu_fmt/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_fmt - Rust

Function uu_fmt::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_fmt/fn.uumain.html b/coreutils/dev/uu_fmt/fn.uumain.html deleted file mode 100644 index 5a8aa3a06..000000000 --- a/coreutils/dev/uu_fmt/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_fmt - Rust

Function uu_fmt::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_fmt/index.html b/coreutils/dev/uu_fmt/index.html deleted file mode 100644 index 44447b307..000000000 --- a/coreutils/dev/uu_fmt/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_fmt - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_fmt/sidebar-items.js b/coreutils/dev/uu_fmt/sidebar-items.js deleted file mode 100644 index 52b33dda4..000000000 --- a/coreutils/dev/uu_fmt/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"struct":["FmtOptions"],"type":["FileOrStdReader"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_fmt/struct.FmtOptions.html b/coreutils/dev/uu_fmt/struct.FmtOptions.html deleted file mode 100644 index df70db62e..000000000 --- a/coreutils/dev/uu_fmt/struct.FmtOptions.html +++ /dev/null @@ -1,11 +0,0 @@ -FmtOptions in uu_fmt - Rust

Struct uu_fmt::FmtOptions

source ·
pub struct FmtOptions { /* private fields */ }

Trait Implementations§

source§

impl Default for FmtOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_fmt/type.FileOrStdReader.html b/coreutils/dev/uu_fmt/type.FileOrStdReader.html deleted file mode 100644 index ce17ebaf4..000000000 --- a/coreutils/dev/uu_fmt/type.FileOrStdReader.html +++ /dev/null @@ -1 +0,0 @@ -FileOrStdReader in uu_fmt - Rust

Type Definition uu_fmt::FileOrStdReader

source ·
pub type FileOrStdReader = BufReader<Box<dyn Read + 'static>>;
\ No newline at end of file diff --git a/coreutils/dev/uu_fold/all.html b/coreutils/dev/uu_fold/all.html deleted file mode 100644 index e9ffeb3c3..000000000 --- a/coreutils/dev/uu_fold/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_fold/fn.uu_app.html b/coreutils/dev/uu_fold/fn.uu_app.html deleted file mode 100644 index 3a420f9f4..000000000 --- a/coreutils/dev/uu_fold/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_fold - Rust

Function uu_fold::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_fold/fn.uumain.html b/coreutils/dev/uu_fold/fn.uumain.html deleted file mode 100644 index 9155e4da8..000000000 --- a/coreutils/dev/uu_fold/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_fold - Rust

Function uu_fold::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_fold/index.html b/coreutils/dev/uu_fold/index.html deleted file mode 100644 index 6ca502f60..000000000 --- a/coreutils/dev/uu_fold/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_fold - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_fold/sidebar-items.js b/coreutils/dev/uu_fold/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_fold/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_groups/all.html b/coreutils/dev/uu_groups/all.html deleted file mode 100644 index 327020b8f..000000000 --- a/coreutils/dev/uu_groups/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_groups/fn.uu_app.html b/coreutils/dev/uu_groups/fn.uu_app.html deleted file mode 100644 index f4e245429..000000000 --- a/coreutils/dev/uu_groups/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_groups - Rust

Function uu_groups::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_groups/fn.uumain.html b/coreutils/dev/uu_groups/fn.uumain.html deleted file mode 100644 index 9e3555d01..000000000 --- a/coreutils/dev/uu_groups/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_groups - Rust

Function uu_groups::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_groups/index.html b/coreutils/dev/uu_groups/index.html deleted file mode 100644 index 0a2086bbb..000000000 --- a/coreutils/dev/uu_groups/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_groups - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_groups/sidebar-items.js b/coreutils/dev/uu_groups/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_groups/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_hashsum/all.html b/coreutils/dev/uu_hashsum/all.html deleted file mode 100644 index 87e110c69..000000000 --- a/coreutils/dev/uu_hashsum/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_hashsum/fn.uu_app_b3sum.html b/coreutils/dev/uu_hashsum/fn.uu_app_b3sum.html deleted file mode 100644 index 121c4ed62..000000000 --- a/coreutils/dev/uu_hashsum/fn.uu_app_b3sum.html +++ /dev/null @@ -1 +0,0 @@ -uu_app_b3sum in uu_hashsum - Rust

Function uu_hashsum::uu_app_b3sum

source ·
pub fn uu_app_b3sum() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_hashsum/fn.uu_app_bits.html b/coreutils/dev/uu_hashsum/fn.uu_app_bits.html deleted file mode 100644 index 15a4f59c7..000000000 --- a/coreutils/dev/uu_hashsum/fn.uu_app_bits.html +++ /dev/null @@ -1 +0,0 @@ -uu_app_bits in uu_hashsum - Rust

Function uu_hashsum::uu_app_bits

source ·
pub fn uu_app_bits() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_hashsum/fn.uu_app_common.html b/coreutils/dev/uu_hashsum/fn.uu_app_common.html deleted file mode 100644 index aefd1b250..000000000 --- a/coreutils/dev/uu_hashsum/fn.uu_app_common.html +++ /dev/null @@ -1 +0,0 @@ -uu_app_common in uu_hashsum - Rust

Function uu_hashsum::uu_app_common

source ·
pub fn uu_app_common() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_hashsum/fn.uu_app_custom.html b/coreutils/dev/uu_hashsum/fn.uu_app_custom.html deleted file mode 100644 index e2f6b6baa..000000000 --- a/coreutils/dev/uu_hashsum/fn.uu_app_custom.html +++ /dev/null @@ -1 +0,0 @@ -uu_app_custom in uu_hashsum - Rust

Function uu_hashsum::uu_app_custom

source ·
pub fn uu_app_custom() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_hashsum/fn.uu_app_length.html b/coreutils/dev/uu_hashsum/fn.uu_app_length.html deleted file mode 100644 index 404409277..000000000 --- a/coreutils/dev/uu_hashsum/fn.uu_app_length.html +++ /dev/null @@ -1 +0,0 @@ -uu_app_length in uu_hashsum - Rust

Function uu_hashsum::uu_app_length

source ·
pub fn uu_app_length() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_hashsum/fn.uumain.html b/coreutils/dev/uu_hashsum/fn.uumain.html deleted file mode 100644 index 0a871feb1..000000000 --- a/coreutils/dev/uu_hashsum/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_hashsum - Rust

Function uu_hashsum::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_hashsum/index.html b/coreutils/dev/uu_hashsum/index.html deleted file mode 100644 index 1f7c6dd3c..000000000 --- a/coreutils/dev/uu_hashsum/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_hashsum - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_hashsum/sidebar-items.js b/coreutils/dev/uu_hashsum/sidebar-items.js deleted file mode 100644 index fb97b74c1..000000000 --- a/coreutils/dev/uu_hashsum/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app_b3sum","uu_app_bits","uu_app_common","uu_app_custom","uu_app_length","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_head/all.html b/coreutils/dev/uu_head/all.html deleted file mode 100644 index a7da9777d..000000000 --- a/coreutils/dev/uu_head/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_head/fn.uu_app.html b/coreutils/dev/uu_head/fn.uu_app.html deleted file mode 100644 index 3d69d5c85..000000000 --- a/coreutils/dev/uu_head/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_head - Rust

Function uu_head::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_head/fn.uumain.html b/coreutils/dev/uu_head/fn.uumain.html deleted file mode 100644 index 7b543e90a..000000000 --- a/coreutils/dev/uu_head/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_head - Rust

Function uu_head::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_head/index.html b/coreutils/dev/uu_head/index.html deleted file mode 100644 index da03dc41c..000000000 --- a/coreutils/dev/uu_head/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_head - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_head/sidebar-items.js b/coreutils/dev/uu_head/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_head/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_hostid/all.html b/coreutils/dev/uu_hostid/all.html deleted file mode 100644 index eb5f27054..000000000 --- a/coreutils/dev/uu_hostid/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_hostid/fn.gethostid.html b/coreutils/dev/uu_hostid/fn.gethostid.html deleted file mode 100644 index 643749a2c..000000000 --- a/coreutils/dev/uu_hostid/fn.gethostid.html +++ /dev/null @@ -1 +0,0 @@ -gethostid in uu_hostid - Rust

Function uu_hostid::gethostid

source ·
pub unsafe extern "C" fn gethostid() -> c_long
\ No newline at end of file diff --git a/coreutils/dev/uu_hostid/fn.uu_app.html b/coreutils/dev/uu_hostid/fn.uu_app.html deleted file mode 100644 index f2f626f45..000000000 --- a/coreutils/dev/uu_hostid/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_hostid - Rust

Function uu_hostid::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_hostid/fn.uumain.html b/coreutils/dev/uu_hostid/fn.uumain.html deleted file mode 100644 index 1d0a783fe..000000000 --- a/coreutils/dev/uu_hostid/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_hostid - Rust

Function uu_hostid::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_hostid/index.html b/coreutils/dev/uu_hostid/index.html deleted file mode 100644 index 4ad0c6ab7..000000000 --- a/coreutils/dev/uu_hostid/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_hostid - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_hostid/sidebar-items.js b/coreutils/dev/uu_hostid/sidebar-items.js deleted file mode 100644 index 0715b6010..000000000 --- a/coreutils/dev/uu_hostid/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["gethostid","uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_hostname/all.html b/coreutils/dev/uu_hostname/all.html deleted file mode 100644 index 39b5f82d0..000000000 --- a/coreutils/dev/uu_hostname/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_hostname/fn.uu_app.html b/coreutils/dev/uu_hostname/fn.uu_app.html deleted file mode 100644 index 077f47c39..000000000 --- a/coreutils/dev/uu_hostname/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_hostname - Rust

Function uu_hostname::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_hostname/fn.uumain.html b/coreutils/dev/uu_hostname/fn.uumain.html deleted file mode 100644 index 3c8773f13..000000000 --- a/coreutils/dev/uu_hostname/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_hostname - Rust

Function uu_hostname::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_hostname/index.html b/coreutils/dev/uu_hostname/index.html deleted file mode 100644 index 21145ecc4..000000000 --- a/coreutils/dev/uu_hostname/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_hostname - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_hostname/sidebar-items.js b/coreutils/dev/uu_hostname/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_hostname/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_id/all.html b/coreutils/dev/uu_id/all.html deleted file mode 100644 index 0402ec44a..000000000 --- a/coreutils/dev/uu_id/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_id/fn.uu_app.html b/coreutils/dev/uu_id/fn.uu_app.html deleted file mode 100644 index 080ed9a39..000000000 --- a/coreutils/dev/uu_id/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_id - Rust

Function uu_id::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_id/fn.uumain.html b/coreutils/dev/uu_id/fn.uumain.html deleted file mode 100644 index f466bfd36..000000000 --- a/coreutils/dev/uu_id/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_id - Rust

Function uu_id::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_id/index.html b/coreutils/dev/uu_id/index.html deleted file mode 100644 index 38dc90345..000000000 --- a/coreutils/dev/uu_id/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_id - Rust

Crate uu_id

source ·

Re-exports

  • pub use uucore::libc;

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_id/sidebar-items.js b/coreutils/dev/uu_id/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_id/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_install/all.html b/coreutils/dev/uu_install/all.html deleted file mode 100644 index 8483b06f6..000000000 --- a/coreutils/dev/uu_install/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_install/enum.MainFunction.html b/coreutils/dev/uu_install/enum.MainFunction.html deleted file mode 100644 index 8403d2d42..000000000 --- a/coreutils/dev/uu_install/enum.MainFunction.html +++ /dev/null @@ -1,19 +0,0 @@ -MainFunction in uu_install - Rust
pub enum MainFunction {
-    Directory,
-    Standard,
-}

Variants§

§

Directory

Create directories

-
§

Standard

Install files to locations (primary functionality)

-

Trait Implementations§

source§

impl Clone for MainFunction

source§

fn clone(&self) -> MainFunction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq<MainFunction> for MainFunction

source§

fn eq(&self, other: &MainFunction) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for MainFunction

source§

impl StructuralEq for MainFunction

source§

impl StructuralPartialEq for MainFunction

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_install/fn.uu_app.html b/coreutils/dev/uu_install/fn.uu_app.html deleted file mode 100644 index 896f42d80..000000000 --- a/coreutils/dev/uu_install/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_install - Rust

Function uu_install::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_install/fn.uumain.html b/coreutils/dev/uu_install/fn.uumain.html deleted file mode 100644 index cd0a6b168..000000000 --- a/coreutils/dev/uu_install/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_install - Rust

Function uu_install::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_install/index.html b/coreutils/dev/uu_install/index.html deleted file mode 100644 index da2e9474f..000000000 --- a/coreutils/dev/uu_install/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_install - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_install/sidebar-items.js b/coreutils/dev/uu_install/sidebar-items.js deleted file mode 100644 index a38b92d57..000000000 --- a/coreutils/dev/uu_install/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["MainFunction"],"fn":["uu_app","uumain"],"struct":["Behavior"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_install/struct.Behavior.html b/coreutils/dev/uu_install/struct.Behavior.html deleted file mode 100644 index 8f0106e6a..000000000 --- a/coreutils/dev/uu_install/struct.Behavior.html +++ /dev/null @@ -1,12 +0,0 @@ -Behavior in uu_install - Rust

Struct uu_install::Behavior

source ·
pub struct Behavior { /* private fields */ }

Implementations§

source§

impl Behavior

source

pub fn mode(&self) -> u32

Determine the mode for chmod after copy.

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_join/all.html b/coreutils/dev/uu_join/all.html deleted file mode 100644 index b4264ab57..000000000 --- a/coreutils/dev/uu_join/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_join/fn.uu_app.html b/coreutils/dev/uu_join/fn.uu_app.html deleted file mode 100644 index d4d29e175..000000000 --- a/coreutils/dev/uu_join/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_join - Rust

Function uu_join::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_join/fn.uumain.html b/coreutils/dev/uu_join/fn.uumain.html deleted file mode 100644 index 6f57c35ec..000000000 --- a/coreutils/dev/uu_join/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_join - Rust

Function uu_join::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_join/index.html b/coreutils/dev/uu_join/index.html deleted file mode 100644 index 6cd4fa53e..000000000 --- a/coreutils/dev/uu_join/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_join - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_join/sidebar-items.js b/coreutils/dev/uu_join/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_join/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_kill/all.html b/coreutils/dev/uu_kill/all.html deleted file mode 100644 index 65ff59810..000000000 --- a/coreutils/dev/uu_kill/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/enum.Mode.html b/coreutils/dev/uu_kill/enum.Mode.html deleted file mode 100644 index c4582c54b..000000000 --- a/coreutils/dev/uu_kill/enum.Mode.html +++ /dev/null @@ -1,16 +0,0 @@ -Mode in uu_kill - Rust

Enum uu_kill::Mode

source ·
pub enum Mode {
-    Kill,
-    Table,
-    List,
-}

Variants§

§

Kill

§

Table

§

List

Trait Implementations§

source§

impl Clone for Mode

source§

fn clone(&self) -> Mode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for Mode

Auto Trait Implementations§

§

impl RefUnwindSafe for Mode

§

impl Send for Mode

§

impl Sync for Mode

§

impl Unpin for Mode

§

impl UnwindSafe for Mode

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/fn.uu_app.html b/coreutils/dev/uu_kill/fn.uu_app.html deleted file mode 100644 index 087c2f040..000000000 --- a/coreutils/dev/uu_kill/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_kill - Rust

Function uu_kill::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/fn.uumain.html b/coreutils/dev/uu_kill/fn.uumain.html deleted file mode 100644 index 90178cb58..000000000 --- a/coreutils/dev/uu_kill/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_kill - Rust

Function uu_kill::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/index.html b/coreutils/dev/uu_kill/index.html deleted file mode 100644 index 8ee9e327c..000000000 --- a/coreutils/dev/uu_kill/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_kill - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/options/index.html b/coreutils/dev/uu_kill/options/index.html deleted file mode 100644 index b4a5726be..000000000 --- a/coreutils/dev/uu_kill/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_kill::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/options/sidebar-items.js b/coreutils/dev/uu_kill/options/sidebar-items.js deleted file mode 100644 index 18212a03e..000000000 --- a/coreutils/dev/uu_kill/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["LIST","PIDS_OR_SIGNALS","SIGNAL","TABLE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_kill/options/static.LIST.html b/coreutils/dev/uu_kill/options/static.LIST.html deleted file mode 100644 index 8a1eff3ce..000000000 --- a/coreutils/dev/uu_kill/options/static.LIST.html +++ /dev/null @@ -1 +0,0 @@ -LIST in uu_kill::options - Rust

Static uu_kill::options::LIST

source ·
pub static LIST: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/options/static.PIDS_OR_SIGNALS.html b/coreutils/dev/uu_kill/options/static.PIDS_OR_SIGNALS.html deleted file mode 100644 index fe44a9077..000000000 --- a/coreutils/dev/uu_kill/options/static.PIDS_OR_SIGNALS.html +++ /dev/null @@ -1 +0,0 @@ -PIDS_OR_SIGNALS in uu_kill::options - Rust
pub static PIDS_OR_SIGNALS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/options/static.SIGNAL.html b/coreutils/dev/uu_kill/options/static.SIGNAL.html deleted file mode 100644 index 9155e77ef..000000000 --- a/coreutils/dev/uu_kill/options/static.SIGNAL.html +++ /dev/null @@ -1 +0,0 @@ -SIGNAL in uu_kill::options - Rust

Static uu_kill::options::SIGNAL

source ·
pub static SIGNAL: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/options/static.TABLE.html b/coreutils/dev/uu_kill/options/static.TABLE.html deleted file mode 100644 index c12f15bab..000000000 --- a/coreutils/dev/uu_kill/options/static.TABLE.html +++ /dev/null @@ -1 +0,0 @@ -TABLE in uu_kill::options - Rust

Static uu_kill::options::TABLE

source ·
pub static TABLE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_kill/sidebar-items.js b/coreutils/dev/uu_kill/sidebar-items.js deleted file mode 100644 index 295e2f8ca..000000000 --- a/coreutils/dev/uu_kill/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["Mode"],"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_link/all.html b/coreutils/dev/uu_link/all.html deleted file mode 100644 index 995b806b2..000000000 --- a/coreutils/dev/uu_link/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

Statics

\ No newline at end of file diff --git a/coreutils/dev/uu_link/fn.uu_app.html b/coreutils/dev/uu_link/fn.uu_app.html deleted file mode 100644 index 7db5c7c6e..000000000 --- a/coreutils/dev/uu_link/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_link - Rust

Function uu_link::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_link/fn.uumain.html b/coreutils/dev/uu_link/fn.uumain.html deleted file mode 100644 index 103b4443a..000000000 --- a/coreutils/dev/uu_link/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_link - Rust

Function uu_link::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_link/index.html b/coreutils/dev/uu_link/index.html deleted file mode 100644 index 24cfaff79..000000000 --- a/coreutils/dev/uu_link/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_link - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_link/options/index.html b/coreutils/dev/uu_link/options/index.html deleted file mode 100644 index 3e903d868..000000000 --- a/coreutils/dev/uu_link/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_link::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_link/options/sidebar-items.js b/coreutils/dev/uu_link/options/sidebar-items.js deleted file mode 100644 index 88b56af93..000000000 --- a/coreutils/dev/uu_link/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["FILES"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_link/options/static.FILES.html b/coreutils/dev/uu_link/options/static.FILES.html deleted file mode 100644 index eca839c99..000000000 --- a/coreutils/dev/uu_link/options/static.FILES.html +++ /dev/null @@ -1 +0,0 @@ -FILES in uu_link::options - Rust

Static uu_link::options::FILES

source ·
pub static FILES: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_link/sidebar-items.js b/coreutils/dev/uu_link/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_link/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ln/all.html b/coreutils/dev/uu_ln/all.html deleted file mode 100644 index 04b38ad52..000000000 --- a/coreutils/dev/uu_ln/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_ln/enum.OverwriteMode.html b/coreutils/dev/uu_ln/enum.OverwriteMode.html deleted file mode 100644 index 23f05c366..000000000 --- a/coreutils/dev/uu_ln/enum.OverwriteMode.html +++ /dev/null @@ -1,18 +0,0 @@ -OverwriteMode in uu_ln - Rust

Enum uu_ln::OverwriteMode

source ·
pub enum OverwriteMode {
-    NoClobber,
-    Interactive,
-    Force,
-}

Variants§

§

NoClobber

§

Interactive

§

Force

Trait Implementations§

source§

impl Clone for OverwriteMode

source§

fn clone(&self) -> OverwriteMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for OverwriteMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<OverwriteMode> for OverwriteMode

source§

fn eq(&self, other: &OverwriteMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for OverwriteMode

source§

impl StructuralEq for OverwriteMode

source§

impl StructuralPartialEq for OverwriteMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_ln/fn.uu_app.html b/coreutils/dev/uu_ln/fn.uu_app.html deleted file mode 100644 index b9a3e66a0..000000000 --- a/coreutils/dev/uu_ln/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_ln - Rust

Function uu_ln::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_ln/fn.uumain.html b/coreutils/dev/uu_ln/fn.uumain.html deleted file mode 100644 index 38fbc6c6d..000000000 --- a/coreutils/dev/uu_ln/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_ln - Rust

Function uu_ln::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_ln/index.html b/coreutils/dev/uu_ln/index.html deleted file mode 100644 index a58c3d0e8..000000000 --- a/coreutils/dev/uu_ln/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ln - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ln/sidebar-items.js b/coreutils/dev/uu_ln/sidebar-items.js deleted file mode 100644 index 5c8a75f06..000000000 --- a/coreutils/dev/uu_ln/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["OverwriteMode"],"fn":["uu_app","uumain"],"struct":["Settings"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ln/struct.Settings.html b/coreutils/dev/uu_ln/struct.Settings.html deleted file mode 100644 index e1312eec1..000000000 --- a/coreutils/dev/uu_ln/struct.Settings.html +++ /dev/null @@ -1,11 +0,0 @@ -Settings in uu_ln - Rust

Struct uu_ln::Settings

source ·
pub struct Settings { /* private fields */ }

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_logname/all.html b/coreutils/dev/uu_logname/all.html deleted file mode 100644 index ddc93131e..000000000 --- a/coreutils/dev/uu_logname/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_logname/fn.getlogin.html b/coreutils/dev/uu_logname/fn.getlogin.html deleted file mode 100644 index 776ae275e..000000000 --- a/coreutils/dev/uu_logname/fn.getlogin.html +++ /dev/null @@ -1 +0,0 @@ -getlogin in uu_logname - Rust

Function uu_logname::getlogin

source ·
pub unsafe extern "C" fn getlogin() -> *const c_char
\ No newline at end of file diff --git a/coreutils/dev/uu_logname/fn.uu_app.html b/coreutils/dev/uu_logname/fn.uu_app.html deleted file mode 100644 index 0005a58e9..000000000 --- a/coreutils/dev/uu_logname/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_logname - Rust

Function uu_logname::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_logname/fn.uumain.html b/coreutils/dev/uu_logname/fn.uumain.html deleted file mode 100644 index 07effce0b..000000000 --- a/coreutils/dev/uu_logname/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_logname - Rust

Function uu_logname::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_logname/index.html b/coreutils/dev/uu_logname/index.html deleted file mode 100644 index ac640d815..000000000 --- a/coreutils/dev/uu_logname/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_logname - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_logname/sidebar-items.js b/coreutils/dev/uu_logname/sidebar-items.js deleted file mode 100644 index 681529436..000000000 --- a/coreutils/dev/uu_logname/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["getlogin","uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/all.html b/coreutils/dev/uu_ls/all.html deleted file mode 100644 index af52bdec3..000000000 --- a/coreutils/dev/uu_ls/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/enum.Format.html b/coreutils/dev/uu_ls/enum.Format.html deleted file mode 100644 index b6d59c0f8..000000000 --- a/coreutils/dev/uu_ls/enum.Format.html +++ /dev/null @@ -1,19 +0,0 @@ -Format in uu_ls - Rust

Enum uu_ls::Format

source ·
pub enum Format {
-    Columns,
-    Long,
-    OneLine,
-    Across,
-    Commas,
-}

Variants§

§

Columns

§

Long

§

OneLine

§

Across

§

Commas

Trait Implementations§

source§

impl Debug for Format

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Format> for Format

source§

fn eq(&self, other: &Format) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for Format

source§

impl StructuralEq for Format

source§

impl StructuralPartialEq for Format

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/fn.list.html b/coreutils/dev/uu_ls/fn.list.html deleted file mode 100644 index 56d16e425..000000000 --- a/coreutils/dev/uu_ls/fn.list.html +++ /dev/null @@ -1 +0,0 @@ -list in uu_ls - Rust

Function uu_ls::list

source ·
pub fn list(locs: Vec<&Path>, config: &Config) -> UResult<()>
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/fn.uu_app.html b/coreutils/dev/uu_ls/fn.uu_app.html deleted file mode 100644 index 477ff0ffa..000000000 --- a/coreutils/dev/uu_ls/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_ls - Rust

Function uu_ls::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/fn.uumain.html b/coreutils/dev/uu_ls/fn.uumain.html deleted file mode 100644 index d4c11a6cc..000000000 --- a/coreutils/dev/uu_ls/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_ls - Rust

Function uu_ls::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/index.html b/coreutils/dev/uu_ls/index.html deleted file mode 100644 index 533efec1a..000000000 --- a/coreutils/dev/uu_ls/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/dereference/index.html b/coreutils/dev/uu_ls/options/dereference/index.html deleted file mode 100644 index 2f75139b2..000000000 --- a/coreutils/dev/uu_ls/options/dereference/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls::options::dereference - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/dereference/sidebar-items.js b/coreutils/dev/uu_ls/options/dereference/sidebar-items.js deleted file mode 100644 index 8e54543d5..000000000 --- a/coreutils/dev/uu_ls/options/dereference/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["ALL","ARGS","DIR_ARGS"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/dereference/static.ALL.html b/coreutils/dev/uu_ls/options/dereference/static.ALL.html deleted file mode 100644 index df3239f9e..000000000 --- a/coreutils/dev/uu_ls/options/dereference/static.ALL.html +++ /dev/null @@ -1 +0,0 @@ -ALL in uu_ls::options::dereference - Rust

Static uu_ls::options::dereference::ALL

source ·
pub static ALL: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/dereference/static.ARGS.html b/coreutils/dev/uu_ls/options/dereference/static.ARGS.html deleted file mode 100644 index bc363181c..000000000 --- a/coreutils/dev/uu_ls/options/dereference/static.ARGS.html +++ /dev/null @@ -1 +0,0 @@ -ARGS in uu_ls::options::dereference - Rust

Static uu_ls::options::dereference::ARGS

source ·
pub static ARGS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/dereference/static.DIR_ARGS.html b/coreutils/dev/uu_ls/options/dereference/static.DIR_ARGS.html deleted file mode 100644 index 69c8e343c..000000000 --- a/coreutils/dev/uu_ls/options/dereference/static.DIR_ARGS.html +++ /dev/null @@ -1 +0,0 @@ -DIR_ARGS in uu_ls::options::dereference - Rust
pub static DIR_ARGS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/files/index.html b/coreutils/dev/uu_ls/options/files/index.html deleted file mode 100644 index 28c00afcd..000000000 --- a/coreutils/dev/uu_ls/options/files/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls::options::files - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/files/sidebar-items.js b/coreutils/dev/uu_ls/options/files/sidebar-items.js deleted file mode 100644 index 58c554a04..000000000 --- a/coreutils/dev/uu_ls/options/files/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["ALL","ALMOST_ALL"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/files/static.ALL.html b/coreutils/dev/uu_ls/options/files/static.ALL.html deleted file mode 100644 index 7b2b7ef94..000000000 --- a/coreutils/dev/uu_ls/options/files/static.ALL.html +++ /dev/null @@ -1 +0,0 @@ -ALL in uu_ls::options::files - Rust

Static uu_ls::options::files::ALL

source ·
pub static ALL: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/files/static.ALMOST_ALL.html b/coreutils/dev/uu_ls/options/files/static.ALMOST_ALL.html deleted file mode 100644 index c3ef068fc..000000000 --- a/coreutils/dev/uu_ls/options/files/static.ALMOST_ALL.html +++ /dev/null @@ -1 +0,0 @@ -ALMOST_ALL in uu_ls::options::files - Rust

Static uu_ls::options::files::ALMOST_ALL

source ·
pub static ALMOST_ALL: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/index.html b/coreutils/dev/uu_ls/options/format/index.html deleted file mode 100644 index 0afa5ee77..000000000 --- a/coreutils/dev/uu_ls/options/format/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls::options::format - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/sidebar-items.js b/coreutils/dev/uu_ls/options/format/sidebar-items.js deleted file mode 100644 index eb6601aa9..000000000 --- a/coreutils/dev/uu_ls/options/format/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["ACROSS","COLUMNS","COMMAS","LONG","LONG_NO_GROUP","LONG_NO_OWNER","LONG_NUMERIC_UID_GID","ONE_LINE","TAB_SIZE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/static.ACROSS.html b/coreutils/dev/uu_ls/options/format/static.ACROSS.html deleted file mode 100644 index 84b2f2e86..000000000 --- a/coreutils/dev/uu_ls/options/format/static.ACROSS.html +++ /dev/null @@ -1 +0,0 @@ -ACROSS in uu_ls::options::format - Rust

Static uu_ls::options::format::ACROSS

source ·
pub static ACROSS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/static.COLUMNS.html b/coreutils/dev/uu_ls/options/format/static.COLUMNS.html deleted file mode 100644 index 5e2514cac..000000000 --- a/coreutils/dev/uu_ls/options/format/static.COLUMNS.html +++ /dev/null @@ -1 +0,0 @@ -COLUMNS in uu_ls::options::format - Rust

Static uu_ls::options::format::COLUMNS

source ·
pub static COLUMNS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/static.COMMAS.html b/coreutils/dev/uu_ls/options/format/static.COMMAS.html deleted file mode 100644 index 3f9ede753..000000000 --- a/coreutils/dev/uu_ls/options/format/static.COMMAS.html +++ /dev/null @@ -1 +0,0 @@ -COMMAS in uu_ls::options::format - Rust

Static uu_ls::options::format::COMMAS

source ·
pub static COMMAS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/static.LONG.html b/coreutils/dev/uu_ls/options/format/static.LONG.html deleted file mode 100644 index e194f4d08..000000000 --- a/coreutils/dev/uu_ls/options/format/static.LONG.html +++ /dev/null @@ -1 +0,0 @@ -LONG in uu_ls::options::format - Rust

Static uu_ls::options::format::LONG

source ·
pub static LONG: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/static.LONG_NO_GROUP.html b/coreutils/dev/uu_ls/options/format/static.LONG_NO_GROUP.html deleted file mode 100644 index 8ea41c8f2..000000000 --- a/coreutils/dev/uu_ls/options/format/static.LONG_NO_GROUP.html +++ /dev/null @@ -1 +0,0 @@ -LONG_NO_GROUP in uu_ls::options::format - Rust
pub static LONG_NO_GROUP: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/static.LONG_NO_OWNER.html b/coreutils/dev/uu_ls/options/format/static.LONG_NO_OWNER.html deleted file mode 100644 index ffdd0f8a4..000000000 --- a/coreutils/dev/uu_ls/options/format/static.LONG_NO_OWNER.html +++ /dev/null @@ -1 +0,0 @@ -LONG_NO_OWNER in uu_ls::options::format - Rust
pub static LONG_NO_OWNER: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/static.LONG_NUMERIC_UID_GID.html b/coreutils/dev/uu_ls/options/format/static.LONG_NUMERIC_UID_GID.html deleted file mode 100644 index 1c50678cd..000000000 --- a/coreutils/dev/uu_ls/options/format/static.LONG_NUMERIC_UID_GID.html +++ /dev/null @@ -1 +0,0 @@ -LONG_NUMERIC_UID_GID in uu_ls::options::format - Rust
pub static LONG_NUMERIC_UID_GID: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/static.ONE_LINE.html b/coreutils/dev/uu_ls/options/format/static.ONE_LINE.html deleted file mode 100644 index 75659cdbc..000000000 --- a/coreutils/dev/uu_ls/options/format/static.ONE_LINE.html +++ /dev/null @@ -1 +0,0 @@ -ONE_LINE in uu_ls::options::format - Rust

Static uu_ls::options::format::ONE_LINE

source ·
pub static ONE_LINE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/format/static.TAB_SIZE.html b/coreutils/dev/uu_ls/options/format/static.TAB_SIZE.html deleted file mode 100644 index 8cbcebd09..000000000 --- a/coreutils/dev/uu_ls/options/format/static.TAB_SIZE.html +++ /dev/null @@ -1 +0,0 @@ -TAB_SIZE in uu_ls::options::format - Rust

Static uu_ls::options::format::TAB_SIZE

source ·
pub static TAB_SIZE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/index.html b/coreutils/dev/uu_ls/options/index.html deleted file mode 100644 index c246cb97c..000000000 --- a/coreutils/dev/uu_ls/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/indicator_style/index.html b/coreutils/dev/uu_ls/options/indicator_style/index.html deleted file mode 100644 index e1c1f7637..000000000 --- a/coreutils/dev/uu_ls/options/indicator_style/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls::options::indicator_style - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/indicator_style/sidebar-items.js b/coreutils/dev/uu_ls/options/indicator_style/sidebar-items.js deleted file mode 100644 index a5032a578..000000000 --- a/coreutils/dev/uu_ls/options/indicator_style/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["CLASSIFY","FILE_TYPE","SLASH"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/indicator_style/static.CLASSIFY.html b/coreutils/dev/uu_ls/options/indicator_style/static.CLASSIFY.html deleted file mode 100644 index 71b16a394..000000000 --- a/coreutils/dev/uu_ls/options/indicator_style/static.CLASSIFY.html +++ /dev/null @@ -1 +0,0 @@ -CLASSIFY in uu_ls::options::indicator_style - Rust
pub static CLASSIFY: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/indicator_style/static.FILE_TYPE.html b/coreutils/dev/uu_ls/options/indicator_style/static.FILE_TYPE.html deleted file mode 100644 index 75ebb76f7..000000000 --- a/coreutils/dev/uu_ls/options/indicator_style/static.FILE_TYPE.html +++ /dev/null @@ -1 +0,0 @@ -FILE_TYPE in uu_ls::options::indicator_style - Rust
pub static FILE_TYPE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/indicator_style/static.SLASH.html b/coreutils/dev/uu_ls/options/indicator_style/static.SLASH.html deleted file mode 100644 index 94f5b0b76..000000000 --- a/coreutils/dev/uu_ls/options/indicator_style/static.SLASH.html +++ /dev/null @@ -1 +0,0 @@ -SLASH in uu_ls::options::indicator_style - Rust
pub static SLASH: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/quoting/index.html b/coreutils/dev/uu_ls/options/quoting/index.html deleted file mode 100644 index 52063554d..000000000 --- a/coreutils/dev/uu_ls/options/quoting/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls::options::quoting - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/quoting/sidebar-items.js b/coreutils/dev/uu_ls/options/quoting/sidebar-items.js deleted file mode 100644 index 16d8fc529..000000000 --- a/coreutils/dev/uu_ls/options/quoting/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["C","ESCAPE","LITERAL"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/quoting/static.C.html b/coreutils/dev/uu_ls/options/quoting/static.C.html deleted file mode 100644 index 5abd48bfd..000000000 --- a/coreutils/dev/uu_ls/options/quoting/static.C.html +++ /dev/null @@ -1 +0,0 @@ -C in uu_ls::options::quoting - Rust

Static uu_ls::options::quoting::C

source ·
pub static C: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/quoting/static.ESCAPE.html b/coreutils/dev/uu_ls/options/quoting/static.ESCAPE.html deleted file mode 100644 index a6e86fc4d..000000000 --- a/coreutils/dev/uu_ls/options/quoting/static.ESCAPE.html +++ /dev/null @@ -1 +0,0 @@ -ESCAPE in uu_ls::options::quoting - Rust

Static uu_ls::options::quoting::ESCAPE

source ·
pub static ESCAPE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/quoting/static.LITERAL.html b/coreutils/dev/uu_ls/options/quoting/static.LITERAL.html deleted file mode 100644 index f4850a639..000000000 --- a/coreutils/dev/uu_ls/options/quoting/static.LITERAL.html +++ /dev/null @@ -1 +0,0 @@ -LITERAL in uu_ls::options::quoting - Rust

Static uu_ls::options::quoting::LITERAL

source ·
pub static LITERAL: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/sidebar-items.js b/coreutils/dev/uu_ls/options/sidebar-items.js deleted file mode 100644 index 6fd9ac0a6..000000000 --- a/coreutils/dev/uu_ls/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"mod":["dereference","files","format","indicator_style","quoting","size","sort","time"],"static":["AUTHOR","COLOR","CONTEXT","DIRECTORY","DIRED","FORMAT","FULL_TIME","GROUP_DIRECTORIES_FIRST","HELP","HIDE","HIDE_CONTROL_CHARS","IGNORE","IGNORE_BACKUPS","INDICATOR_STYLE","INODE","NO_GROUP","PATHS","QUOTING_STYLE","RECURSIVE","REVERSE","SHOW_CONTROL_CHARS","SORT","TIME","TIME_STYLE","WIDTH","ZERO"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/size/index.html b/coreutils/dev/uu_ls/options/size/index.html deleted file mode 100644 index f0f37e99a..000000000 --- a/coreutils/dev/uu_ls/options/size/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls::options::size - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/size/sidebar-items.js b/coreutils/dev/uu_ls/options/size/sidebar-items.js deleted file mode 100644 index cb4f1c442..000000000 --- a/coreutils/dev/uu_ls/options/size/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["ALLOCATION_SIZE","BLOCK_SIZE","HUMAN_READABLE","KIBIBYTES","SI"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/size/static.ALLOCATION_SIZE.html b/coreutils/dev/uu_ls/options/size/static.ALLOCATION_SIZE.html deleted file mode 100644 index a62ac34e2..000000000 --- a/coreutils/dev/uu_ls/options/size/static.ALLOCATION_SIZE.html +++ /dev/null @@ -1 +0,0 @@ -ALLOCATION_SIZE in uu_ls::options::size - Rust
pub static ALLOCATION_SIZE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/size/static.BLOCK_SIZE.html b/coreutils/dev/uu_ls/options/size/static.BLOCK_SIZE.html deleted file mode 100644 index 45ab18a58..000000000 --- a/coreutils/dev/uu_ls/options/size/static.BLOCK_SIZE.html +++ /dev/null @@ -1 +0,0 @@ -BLOCK_SIZE in uu_ls::options::size - Rust

Static uu_ls::options::size::BLOCK_SIZE

source ·
pub static BLOCK_SIZE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/size/static.HUMAN_READABLE.html b/coreutils/dev/uu_ls/options/size/static.HUMAN_READABLE.html deleted file mode 100644 index f5cd3c86e..000000000 --- a/coreutils/dev/uu_ls/options/size/static.HUMAN_READABLE.html +++ /dev/null @@ -1 +0,0 @@ -HUMAN_READABLE in uu_ls::options::size - Rust
pub static HUMAN_READABLE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/size/static.KIBIBYTES.html b/coreutils/dev/uu_ls/options/size/static.KIBIBYTES.html deleted file mode 100644 index 22317675c..000000000 --- a/coreutils/dev/uu_ls/options/size/static.KIBIBYTES.html +++ /dev/null @@ -1 +0,0 @@ -KIBIBYTES in uu_ls::options::size - Rust

Static uu_ls::options::size::KIBIBYTES

source ·
pub static KIBIBYTES: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/size/static.SI.html b/coreutils/dev/uu_ls/options/size/static.SI.html deleted file mode 100644 index eaf7cc8ef..000000000 --- a/coreutils/dev/uu_ls/options/size/static.SI.html +++ /dev/null @@ -1 +0,0 @@ -SI in uu_ls::options::size - Rust

Static uu_ls::options::size::SI

source ·
pub static SI: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/sort/index.html b/coreutils/dev/uu_ls/options/sort/index.html deleted file mode 100644 index 92cb67744..000000000 --- a/coreutils/dev/uu_ls/options/sort/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls::options::sort - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/sort/sidebar-items.js b/coreutils/dev/uu_ls/options/sort/sidebar-items.js deleted file mode 100644 index e59f43567..000000000 --- a/coreutils/dev/uu_ls/options/sort/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["EXTENSION","NONE","SIZE","TIME","VERSION"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/sort/static.EXTENSION.html b/coreutils/dev/uu_ls/options/sort/static.EXTENSION.html deleted file mode 100644 index 5e146c029..000000000 --- a/coreutils/dev/uu_ls/options/sort/static.EXTENSION.html +++ /dev/null @@ -1 +0,0 @@ -EXTENSION in uu_ls::options::sort - Rust

Static uu_ls::options::sort::EXTENSION

source ·
pub static EXTENSION: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/sort/static.NONE.html b/coreutils/dev/uu_ls/options/sort/static.NONE.html deleted file mode 100644 index 558ba5295..000000000 --- a/coreutils/dev/uu_ls/options/sort/static.NONE.html +++ /dev/null @@ -1 +0,0 @@ -NONE in uu_ls::options::sort - Rust

Static uu_ls::options::sort::NONE

source ·
pub static NONE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/sort/static.SIZE.html b/coreutils/dev/uu_ls/options/sort/static.SIZE.html deleted file mode 100644 index 99ce2fc88..000000000 --- a/coreutils/dev/uu_ls/options/sort/static.SIZE.html +++ /dev/null @@ -1 +0,0 @@ -SIZE in uu_ls::options::sort - Rust

Static uu_ls::options::sort::SIZE

source ·
pub static SIZE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/sort/static.TIME.html b/coreutils/dev/uu_ls/options/sort/static.TIME.html deleted file mode 100644 index d96a63142..000000000 --- a/coreutils/dev/uu_ls/options/sort/static.TIME.html +++ /dev/null @@ -1 +0,0 @@ -TIME in uu_ls::options::sort - Rust

Static uu_ls::options::sort::TIME

source ·
pub static TIME: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/sort/static.VERSION.html b/coreutils/dev/uu_ls/options/sort/static.VERSION.html deleted file mode 100644 index 0a344de85..000000000 --- a/coreutils/dev/uu_ls/options/sort/static.VERSION.html +++ /dev/null @@ -1 +0,0 @@ -VERSION in uu_ls::options::sort - Rust

Static uu_ls::options::sort::VERSION

source ·
pub static VERSION: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.AUTHOR.html b/coreutils/dev/uu_ls/options/static.AUTHOR.html deleted file mode 100644 index 9a02de91b..000000000 --- a/coreutils/dev/uu_ls/options/static.AUTHOR.html +++ /dev/null @@ -1 +0,0 @@ -AUTHOR in uu_ls::options - Rust

Static uu_ls::options::AUTHOR

source ·
pub static AUTHOR: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.COLOR.html b/coreutils/dev/uu_ls/options/static.COLOR.html deleted file mode 100644 index 22328523a..000000000 --- a/coreutils/dev/uu_ls/options/static.COLOR.html +++ /dev/null @@ -1 +0,0 @@ -COLOR in uu_ls::options - Rust

Static uu_ls::options::COLOR

source ·
pub static COLOR: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.CONTEXT.html b/coreutils/dev/uu_ls/options/static.CONTEXT.html deleted file mode 100644 index 3de84953c..000000000 --- a/coreutils/dev/uu_ls/options/static.CONTEXT.html +++ /dev/null @@ -1 +0,0 @@ -CONTEXT in uu_ls::options - Rust

Static uu_ls::options::CONTEXT

source ·
pub static CONTEXT: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.DIRECTORY.html b/coreutils/dev/uu_ls/options/static.DIRECTORY.html deleted file mode 100644 index caa9476ad..000000000 --- a/coreutils/dev/uu_ls/options/static.DIRECTORY.html +++ /dev/null @@ -1 +0,0 @@ -DIRECTORY in uu_ls::options - Rust

Static uu_ls::options::DIRECTORY

source ·
pub static DIRECTORY: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.DIRED.html b/coreutils/dev/uu_ls/options/static.DIRED.html deleted file mode 100644 index 1cae64a37..000000000 --- a/coreutils/dev/uu_ls/options/static.DIRED.html +++ /dev/null @@ -1 +0,0 @@ -DIRED in uu_ls::options - Rust

Static uu_ls::options::DIRED

source ·
pub static DIRED: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.FORMAT.html b/coreutils/dev/uu_ls/options/static.FORMAT.html deleted file mode 100644 index d18ae6e10..000000000 --- a/coreutils/dev/uu_ls/options/static.FORMAT.html +++ /dev/null @@ -1 +0,0 @@ -FORMAT in uu_ls::options - Rust

Static uu_ls::options::FORMAT

source ·
pub static FORMAT: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.FULL_TIME.html b/coreutils/dev/uu_ls/options/static.FULL_TIME.html deleted file mode 100644 index c400ddcb5..000000000 --- a/coreutils/dev/uu_ls/options/static.FULL_TIME.html +++ /dev/null @@ -1 +0,0 @@ -FULL_TIME in uu_ls::options - Rust

Static uu_ls::options::FULL_TIME

source ·
pub static FULL_TIME: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.GROUP_DIRECTORIES_FIRST.html b/coreutils/dev/uu_ls/options/static.GROUP_DIRECTORIES_FIRST.html deleted file mode 100644 index c4b4ce717..000000000 --- a/coreutils/dev/uu_ls/options/static.GROUP_DIRECTORIES_FIRST.html +++ /dev/null @@ -1 +0,0 @@ -GROUP_DIRECTORIES_FIRST in uu_ls::options - Rust
pub static GROUP_DIRECTORIES_FIRST: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.HELP.html b/coreutils/dev/uu_ls/options/static.HELP.html deleted file mode 100644 index f60d77440..000000000 --- a/coreutils/dev/uu_ls/options/static.HELP.html +++ /dev/null @@ -1 +0,0 @@ -HELP in uu_ls::options - Rust

Static uu_ls::options::HELP

source ·
pub static HELP: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.HIDE.html b/coreutils/dev/uu_ls/options/static.HIDE.html deleted file mode 100644 index 89dc1e2c8..000000000 --- a/coreutils/dev/uu_ls/options/static.HIDE.html +++ /dev/null @@ -1 +0,0 @@ -HIDE in uu_ls::options - Rust

Static uu_ls::options::HIDE

source ·
pub static HIDE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.HIDE_CONTROL_CHARS.html b/coreutils/dev/uu_ls/options/static.HIDE_CONTROL_CHARS.html deleted file mode 100644 index 68a69cc37..000000000 --- a/coreutils/dev/uu_ls/options/static.HIDE_CONTROL_CHARS.html +++ /dev/null @@ -1 +0,0 @@ -HIDE_CONTROL_CHARS in uu_ls::options - Rust
pub static HIDE_CONTROL_CHARS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.IGNORE.html b/coreutils/dev/uu_ls/options/static.IGNORE.html deleted file mode 100644 index 6940358ce..000000000 --- a/coreutils/dev/uu_ls/options/static.IGNORE.html +++ /dev/null @@ -1 +0,0 @@ -IGNORE in uu_ls::options - Rust

Static uu_ls::options::IGNORE

source ·
pub static IGNORE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.IGNORE_BACKUPS.html b/coreutils/dev/uu_ls/options/static.IGNORE_BACKUPS.html deleted file mode 100644 index 061a7e5a8..000000000 --- a/coreutils/dev/uu_ls/options/static.IGNORE_BACKUPS.html +++ /dev/null @@ -1 +0,0 @@ -IGNORE_BACKUPS in uu_ls::options - Rust
pub static IGNORE_BACKUPS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.INDICATOR_STYLE.html b/coreutils/dev/uu_ls/options/static.INDICATOR_STYLE.html deleted file mode 100644 index 877006590..000000000 --- a/coreutils/dev/uu_ls/options/static.INDICATOR_STYLE.html +++ /dev/null @@ -1 +0,0 @@ -INDICATOR_STYLE in uu_ls::options - Rust
pub static INDICATOR_STYLE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.INODE.html b/coreutils/dev/uu_ls/options/static.INODE.html deleted file mode 100644 index bb2cc920a..000000000 --- a/coreutils/dev/uu_ls/options/static.INODE.html +++ /dev/null @@ -1 +0,0 @@ -INODE in uu_ls::options - Rust

Static uu_ls::options::INODE

source ·
pub static INODE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.NO_GROUP.html b/coreutils/dev/uu_ls/options/static.NO_GROUP.html deleted file mode 100644 index 30d58ca53..000000000 --- a/coreutils/dev/uu_ls/options/static.NO_GROUP.html +++ /dev/null @@ -1 +0,0 @@ -NO_GROUP in uu_ls::options - Rust

Static uu_ls::options::NO_GROUP

source ·
pub static NO_GROUP: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.PATHS.html b/coreutils/dev/uu_ls/options/static.PATHS.html deleted file mode 100644 index 814a1cf80..000000000 --- a/coreutils/dev/uu_ls/options/static.PATHS.html +++ /dev/null @@ -1 +0,0 @@ -PATHS in uu_ls::options - Rust

Static uu_ls::options::PATHS

source ·
pub static PATHS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.QUOTING_STYLE.html b/coreutils/dev/uu_ls/options/static.QUOTING_STYLE.html deleted file mode 100644 index daa7ea336..000000000 --- a/coreutils/dev/uu_ls/options/static.QUOTING_STYLE.html +++ /dev/null @@ -1 +0,0 @@ -QUOTING_STYLE in uu_ls::options - Rust
pub static QUOTING_STYLE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.RECURSIVE.html b/coreutils/dev/uu_ls/options/static.RECURSIVE.html deleted file mode 100644 index dd9ec5099..000000000 --- a/coreutils/dev/uu_ls/options/static.RECURSIVE.html +++ /dev/null @@ -1 +0,0 @@ -RECURSIVE in uu_ls::options - Rust

Static uu_ls::options::RECURSIVE

source ·
pub static RECURSIVE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.REVERSE.html b/coreutils/dev/uu_ls/options/static.REVERSE.html deleted file mode 100644 index 238de77f3..000000000 --- a/coreutils/dev/uu_ls/options/static.REVERSE.html +++ /dev/null @@ -1 +0,0 @@ -REVERSE in uu_ls::options - Rust

Static uu_ls::options::REVERSE

source ·
pub static REVERSE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.SHOW_CONTROL_CHARS.html b/coreutils/dev/uu_ls/options/static.SHOW_CONTROL_CHARS.html deleted file mode 100644 index 585fc4f71..000000000 --- a/coreutils/dev/uu_ls/options/static.SHOW_CONTROL_CHARS.html +++ /dev/null @@ -1 +0,0 @@ -SHOW_CONTROL_CHARS in uu_ls::options - Rust
pub static SHOW_CONTROL_CHARS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.SORT.html b/coreutils/dev/uu_ls/options/static.SORT.html deleted file mode 100644 index ae2c7b3a0..000000000 --- a/coreutils/dev/uu_ls/options/static.SORT.html +++ /dev/null @@ -1 +0,0 @@ -SORT in uu_ls::options - Rust

Static uu_ls::options::SORT

source ·
pub static SORT: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.TIME.html b/coreutils/dev/uu_ls/options/static.TIME.html deleted file mode 100644 index 588e534b0..000000000 --- a/coreutils/dev/uu_ls/options/static.TIME.html +++ /dev/null @@ -1 +0,0 @@ -TIME in uu_ls::options - Rust

Static uu_ls::options::TIME

source ·
pub static TIME: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.TIME_STYLE.html b/coreutils/dev/uu_ls/options/static.TIME_STYLE.html deleted file mode 100644 index f3892e4bd..000000000 --- a/coreutils/dev/uu_ls/options/static.TIME_STYLE.html +++ /dev/null @@ -1 +0,0 @@ -TIME_STYLE in uu_ls::options - Rust

Static uu_ls::options::TIME_STYLE

source ·
pub static TIME_STYLE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.WIDTH.html b/coreutils/dev/uu_ls/options/static.WIDTH.html deleted file mode 100644 index d241019ed..000000000 --- a/coreutils/dev/uu_ls/options/static.WIDTH.html +++ /dev/null @@ -1 +0,0 @@ -WIDTH in uu_ls::options - Rust

Static uu_ls::options::WIDTH

source ·
pub static WIDTH: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/static.ZERO.html b/coreutils/dev/uu_ls/options/static.ZERO.html deleted file mode 100644 index 6ae168890..000000000 --- a/coreutils/dev/uu_ls/options/static.ZERO.html +++ /dev/null @@ -1 +0,0 @@ -ZERO in uu_ls::options - Rust

Static uu_ls::options::ZERO

source ·
pub static ZERO: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/time/index.html b/coreutils/dev/uu_ls/options/time/index.html deleted file mode 100644 index c16116cfa..000000000 --- a/coreutils/dev/uu_ls/options/time/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ls::options::time - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/time/sidebar-items.js b/coreutils/dev/uu_ls/options/time/sidebar-items.js deleted file mode 100644 index 28b08d566..000000000 --- a/coreutils/dev/uu_ls/options/time/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["ACCESS","CHANGE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/time/static.ACCESS.html b/coreutils/dev/uu_ls/options/time/static.ACCESS.html deleted file mode 100644 index e1662bcdc..000000000 --- a/coreutils/dev/uu_ls/options/time/static.ACCESS.html +++ /dev/null @@ -1 +0,0 @@ -ACCESS in uu_ls::options::time - Rust

Static uu_ls::options::time::ACCESS

source ·
pub static ACCESS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/options/time/static.CHANGE.html b/coreutils/dev/uu_ls/options/time/static.CHANGE.html deleted file mode 100644 index 17894367c..000000000 --- a/coreutils/dev/uu_ls/options/time/static.CHANGE.html +++ /dev/null @@ -1 +0,0 @@ -CHANGE in uu_ls::options::time - Rust

Static uu_ls::options::time::CHANGE

source ·
pub static CHANGE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_ls/sidebar-items.js b/coreutils/dev/uu_ls/sidebar-items.js deleted file mode 100644 index 5e543f71d..000000000 --- a/coreutils/dev/uu_ls/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["Format"],"fn":["list","uu_app","uumain"],"mod":["options"],"struct":["Config"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ls/struct.Config.html b/coreutils/dev/uu_ls/struct.Config.html deleted file mode 100644 index 7021d4426..000000000 --- a/coreutils/dev/uu_ls/struct.Config.html +++ /dev/null @@ -1,15 +0,0 @@ -Config in uu_ls - Rust

Struct uu_ls::Config

source ·
pub struct Config {
-    pub format: Format,
-    pub quoting_style: QuotingStyle,
-    /* private fields */
-}

Fields§

§format: Format§quoting_style: QuotingStyle

Implementations§

source§

impl Config

source

pub fn from(options: &ArgMatches) -> UResult<Self>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_mkdir/all.html b/coreutils/dev/uu_mkdir/all.html deleted file mode 100644 index 4335c953d..000000000 --- a/coreutils/dev/uu_mkdir/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_mkdir/fn.uu_app.html b/coreutils/dev/uu_mkdir/fn.uu_app.html deleted file mode 100644 index 945ff2a17..000000000 --- a/coreutils/dev/uu_mkdir/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_mkdir - Rust

Function uu_mkdir::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_mkdir/fn.uumain.html b/coreutils/dev/uu_mkdir/fn.uumain.html deleted file mode 100644 index 87f5ac961..000000000 --- a/coreutils/dev/uu_mkdir/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_mkdir - Rust

Function uu_mkdir::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_mkdir/index.html b/coreutils/dev/uu_mkdir/index.html deleted file mode 100644 index d295fdb25..000000000 --- a/coreutils/dev/uu_mkdir/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_mkdir - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_mkdir/sidebar-items.js b/coreutils/dev/uu_mkdir/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_mkdir/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_mkfifo/all.html b/coreutils/dev/uu_mkfifo/all.html deleted file mode 100644 index 16cc965dc..000000000 --- a/coreutils/dev/uu_mkfifo/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_mkfifo/fn.uu_app.html b/coreutils/dev/uu_mkfifo/fn.uu_app.html deleted file mode 100644 index 3ef4ac604..000000000 --- a/coreutils/dev/uu_mkfifo/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_mkfifo - Rust

Function uu_mkfifo::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_mkfifo/fn.uumain.html b/coreutils/dev/uu_mkfifo/fn.uumain.html deleted file mode 100644 index 178f65e5a..000000000 --- a/coreutils/dev/uu_mkfifo/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_mkfifo - Rust

Function uu_mkfifo::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_mkfifo/index.html b/coreutils/dev/uu_mkfifo/index.html deleted file mode 100644 index e5672df08..000000000 --- a/coreutils/dev/uu_mkfifo/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_mkfifo - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_mkfifo/sidebar-items.js b/coreutils/dev/uu_mkfifo/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_mkfifo/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_mknod/all.html b/coreutils/dev/uu_mknod/all.html deleted file mode 100644 index 1374ccf24..000000000 --- a/coreutils/dev/uu_mknod/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_mknod/fn.uu_app.html b/coreutils/dev/uu_mknod/fn.uu_app.html deleted file mode 100644 index 48ed078f9..000000000 --- a/coreutils/dev/uu_mknod/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_mknod - Rust

Function uu_mknod::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_mknod/fn.uumain.html b/coreutils/dev/uu_mknod/fn.uumain.html deleted file mode 100644 index 337014b4a..000000000 --- a/coreutils/dev/uu_mknod/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_mknod - Rust

Function uu_mknod::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_mknod/index.html b/coreutils/dev/uu_mknod/index.html deleted file mode 100644 index 6984258e4..000000000 --- a/coreutils/dev/uu_mknod/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_mknod - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_mknod/sidebar-items.js b/coreutils/dev/uu_mknod/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_mknod/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_mktemp/all.html b/coreutils/dev/uu_mktemp/all.html deleted file mode 100644 index 13b2f77f3..000000000 --- a/coreutils/dev/uu_mktemp/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_mktemp/fn.dry_exec.html b/coreutils/dev/uu_mktemp/fn.dry_exec.html deleted file mode 100644 index 03911a114..000000000 --- a/coreutils/dev/uu_mktemp/fn.dry_exec.html +++ /dev/null @@ -1,6 +0,0 @@ -dry_exec in uu_mktemp - Rust

Function uu_mktemp::dry_exec

source ·
pub fn dry_exec(
-    tmpdir: &str,
-    prefix: &str,
-    rand: usize,
-    suffix: &str
-) -> UResult<()>
\ No newline at end of file diff --git a/coreutils/dev/uu_mktemp/fn.uu_app.html b/coreutils/dev/uu_mktemp/fn.uu_app.html deleted file mode 100644 index 4bbaacceb..000000000 --- a/coreutils/dev/uu_mktemp/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_mktemp - Rust

Function uu_mktemp::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_mktemp/fn.uumain.html b/coreutils/dev/uu_mktemp/fn.uumain.html deleted file mode 100644 index 4db8d7581..000000000 --- a/coreutils/dev/uu_mktemp/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_mktemp - Rust

Function uu_mktemp::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_mktemp/index.html b/coreutils/dev/uu_mktemp/index.html deleted file mode 100644 index 9482142f7..000000000 --- a/coreutils/dev/uu_mktemp/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_mktemp - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_mktemp/sidebar-items.js b/coreutils/dev/uu_mktemp/sidebar-items.js deleted file mode 100644 index 49aa4ccd4..000000000 --- a/coreutils/dev/uu_mktemp/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["dry_exec","uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_more/all.html b/coreutils/dev/uu_more/all.html deleted file mode 100644 index d6f3e3294..000000000 --- a/coreutils/dev/uu_more/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_more/fn.uu_app.html b/coreutils/dev/uu_more/fn.uu_app.html deleted file mode 100644 index 1df21bb06..000000000 --- a/coreutils/dev/uu_more/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_more - Rust

Function uu_more::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_more/fn.uumain.html b/coreutils/dev/uu_more/fn.uumain.html deleted file mode 100644 index eedae8c5d..000000000 --- a/coreutils/dev/uu_more/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_more - Rust

Function uu_more::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_more/index.html b/coreutils/dev/uu_more/index.html deleted file mode 100644 index a7ee3b686..000000000 --- a/coreutils/dev/uu_more/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_more - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.CLEAN_PRINT.html b/coreutils/dev/uu_more/options/constant.CLEAN_PRINT.html deleted file mode 100644 index 37513211c..000000000 --- a/coreutils/dev/uu_more/options/constant.CLEAN_PRINT.html +++ /dev/null @@ -1 +0,0 @@ -CLEAN_PRINT in uu_more::options - Rust

Constant uu_more::options::CLEAN_PRINT

source ·
pub const CLEAN_PRINT: &str = "clean-print";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.FILES.html b/coreutils/dev/uu_more/options/constant.FILES.html deleted file mode 100644 index 01617ec1c..000000000 --- a/coreutils/dev/uu_more/options/constant.FILES.html +++ /dev/null @@ -1 +0,0 @@ -FILES in uu_more::options - Rust

Constant uu_more::options::FILES

source ·
pub const FILES: &str = "files";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.FROM_LINE.html b/coreutils/dev/uu_more/options/constant.FROM_LINE.html deleted file mode 100644 index a833d3d6f..000000000 --- a/coreutils/dev/uu_more/options/constant.FROM_LINE.html +++ /dev/null @@ -1 +0,0 @@ -FROM_LINE in uu_more::options - Rust

Constant uu_more::options::FROM_LINE

source ·
pub const FROM_LINE: &str = "from-line";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.LINES.html b/coreutils/dev/uu_more/options/constant.LINES.html deleted file mode 100644 index ff4b098ae..000000000 --- a/coreutils/dev/uu_more/options/constant.LINES.html +++ /dev/null @@ -1 +0,0 @@ -LINES in uu_more::options - Rust

Constant uu_more::options::LINES

source ·
pub const LINES: &str = "lines";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.LOGICAL.html b/coreutils/dev/uu_more/options/constant.LOGICAL.html deleted file mode 100644 index e2598522a..000000000 --- a/coreutils/dev/uu_more/options/constant.LOGICAL.html +++ /dev/null @@ -1 +0,0 @@ -LOGICAL in uu_more::options - Rust

Constant uu_more::options::LOGICAL

source ·
pub const LOGICAL: &str = "logical";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.NO_PAUSE.html b/coreutils/dev/uu_more/options/constant.NO_PAUSE.html deleted file mode 100644 index c3aba4779..000000000 --- a/coreutils/dev/uu_more/options/constant.NO_PAUSE.html +++ /dev/null @@ -1 +0,0 @@ -NO_PAUSE in uu_more::options - Rust

Constant uu_more::options::NO_PAUSE

source ·
pub const NO_PAUSE: &str = "no-pause";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.NUMBER.html b/coreutils/dev/uu_more/options/constant.NUMBER.html deleted file mode 100644 index bb901b90a..000000000 --- a/coreutils/dev/uu_more/options/constant.NUMBER.html +++ /dev/null @@ -1 +0,0 @@ -NUMBER in uu_more::options - Rust

Constant uu_more::options::NUMBER

source ·
pub const NUMBER: &str = "number";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.PATTERN.html b/coreutils/dev/uu_more/options/constant.PATTERN.html deleted file mode 100644 index 435394924..000000000 --- a/coreutils/dev/uu_more/options/constant.PATTERN.html +++ /dev/null @@ -1 +0,0 @@ -PATTERN in uu_more::options - Rust

Constant uu_more::options::PATTERN

source ·
pub const PATTERN: &str = "pattern";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.PLAIN.html b/coreutils/dev/uu_more/options/constant.PLAIN.html deleted file mode 100644 index e27adb729..000000000 --- a/coreutils/dev/uu_more/options/constant.PLAIN.html +++ /dev/null @@ -1 +0,0 @@ -PLAIN in uu_more::options - Rust

Constant uu_more::options::PLAIN

source ·
pub const PLAIN: &str = "plain";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.PRINT_OVER.html b/coreutils/dev/uu_more/options/constant.PRINT_OVER.html deleted file mode 100644 index 3903a28e1..000000000 --- a/coreutils/dev/uu_more/options/constant.PRINT_OVER.html +++ /dev/null @@ -1 +0,0 @@ -PRINT_OVER in uu_more::options - Rust

Constant uu_more::options::PRINT_OVER

source ·
pub const PRINT_OVER: &str = "print-over";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.SILENT.html b/coreutils/dev/uu_more/options/constant.SILENT.html deleted file mode 100644 index 5e895cb40..000000000 --- a/coreutils/dev/uu_more/options/constant.SILENT.html +++ /dev/null @@ -1 +0,0 @@ -SILENT in uu_more::options - Rust

Constant uu_more::options::SILENT

source ·
pub const SILENT: &str = "silent";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/constant.SQUEEZE.html b/coreutils/dev/uu_more/options/constant.SQUEEZE.html deleted file mode 100644 index da7463b22..000000000 --- a/coreutils/dev/uu_more/options/constant.SQUEEZE.html +++ /dev/null @@ -1 +0,0 @@ -SQUEEZE in uu_more::options - Rust

Constant uu_more::options::SQUEEZE

source ·
pub const SQUEEZE: &str = "squeeze";
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/index.html b/coreutils/dev/uu_more/options/index.html deleted file mode 100644 index 3834fafc8..000000000 --- a/coreutils/dev/uu_more/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_more::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_more/options/sidebar-items.js b/coreutils/dev/uu_more/options/sidebar-items.js deleted file mode 100644 index 1c6ded723..000000000 --- a/coreutils/dev/uu_more/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["CLEAN_PRINT","FILES","FROM_LINE","LINES","LOGICAL","NO_PAUSE","NUMBER","PATTERN","PLAIN","PRINT_OVER","SILENT","SQUEEZE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_more/sidebar-items.js b/coreutils/dev/uu_more/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_more/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_mv/all.html b/coreutils/dev/uu_mv/all.html deleted file mode 100644 index 06e4e86da..000000000 --- a/coreutils/dev/uu_mv/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_mv/enum.OverwriteMode.html b/coreutils/dev/uu_mv/enum.OverwriteMode.html deleted file mode 100644 index 0930e1703..000000000 --- a/coreutils/dev/uu_mv/enum.OverwriteMode.html +++ /dev/null @@ -1,18 +0,0 @@ -OverwriteMode in uu_mv - Rust

Enum uu_mv::OverwriteMode

source ·
pub enum OverwriteMode {
-    NoClobber,
-    Interactive,
-    Force,
-}

Variants§

§

NoClobber

§

Interactive

§

Force

Trait Implementations§

source§

impl Clone for OverwriteMode

source§

fn clone(&self) -> OverwriteMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq<OverwriteMode> for OverwriteMode

source§

fn eq(&self, other: &OverwriteMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for OverwriteMode

source§

impl StructuralEq for OverwriteMode

source§

impl StructuralPartialEq for OverwriteMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_mv/fn.uu_app.html b/coreutils/dev/uu_mv/fn.uu_app.html deleted file mode 100644 index d4e98d5c6..000000000 --- a/coreutils/dev/uu_mv/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_mv - Rust

Function uu_mv::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_mv/fn.uumain.html b/coreutils/dev/uu_mv/fn.uumain.html deleted file mode 100644 index beb5e272e..000000000 --- a/coreutils/dev/uu_mv/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_mv - Rust

Function uu_mv::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_mv/index.html b/coreutils/dev/uu_mv/index.html deleted file mode 100644 index 3ceb62f81..000000000 --- a/coreutils/dev/uu_mv/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_mv - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_mv/sidebar-items.js b/coreutils/dev/uu_mv/sidebar-items.js deleted file mode 100644 index 54afe5898..000000000 --- a/coreutils/dev/uu_mv/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["OverwriteMode"],"fn":["uu_app","uumain"],"struct":["Behavior"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_mv/struct.Behavior.html b/coreutils/dev/uu_mv/struct.Behavior.html deleted file mode 100644 index a90a68229..000000000 --- a/coreutils/dev/uu_mv/struct.Behavior.html +++ /dev/null @@ -1,11 +0,0 @@ -Behavior in uu_mv - Rust

Struct uu_mv::Behavior

source ·
pub struct Behavior { /* private fields */ }

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_nice/all.html b/coreutils/dev/uu_nice/all.html deleted file mode 100644 index 03828ee2f..000000000 --- a/coreutils/dev/uu_nice/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

Statics

\ No newline at end of file diff --git a/coreutils/dev/uu_nice/fn.uu_app.html b/coreutils/dev/uu_nice/fn.uu_app.html deleted file mode 100644 index 39be7740a..000000000 --- a/coreutils/dev/uu_nice/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_nice - Rust

Function uu_nice::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_nice/fn.uumain.html b/coreutils/dev/uu_nice/fn.uumain.html deleted file mode 100644 index 60fd121f4..000000000 --- a/coreutils/dev/uu_nice/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_nice - Rust

Function uu_nice::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_nice/index.html b/coreutils/dev/uu_nice/index.html deleted file mode 100644 index 955c2220c..000000000 --- a/coreutils/dev/uu_nice/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_nice - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_nice/options/index.html b/coreutils/dev/uu_nice/options/index.html deleted file mode 100644 index 6f095a1ce..000000000 --- a/coreutils/dev/uu_nice/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_nice::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_nice/options/sidebar-items.js b/coreutils/dev/uu_nice/options/sidebar-items.js deleted file mode 100644 index 12d2ae1ca..000000000 --- a/coreutils/dev/uu_nice/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["ADJUSTMENT","COMMAND"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_nice/options/static.ADJUSTMENT.html b/coreutils/dev/uu_nice/options/static.ADJUSTMENT.html deleted file mode 100644 index bbfbc3265..000000000 --- a/coreutils/dev/uu_nice/options/static.ADJUSTMENT.html +++ /dev/null @@ -1 +0,0 @@ -ADJUSTMENT in uu_nice::options - Rust

Static uu_nice::options::ADJUSTMENT

source ·
pub static ADJUSTMENT: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_nice/options/static.COMMAND.html b/coreutils/dev/uu_nice/options/static.COMMAND.html deleted file mode 100644 index fcc476a17..000000000 --- a/coreutils/dev/uu_nice/options/static.COMMAND.html +++ /dev/null @@ -1 +0,0 @@ -COMMAND in uu_nice::options - Rust

Static uu_nice::options::COMMAND

source ·
pub static COMMAND: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_nice/sidebar-items.js b/coreutils/dev/uu_nice/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_nice/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_nl/all.html b/coreutils/dev/uu_nl/all.html deleted file mode 100644 index c7aedba73..000000000 --- a/coreutils/dev/uu_nl/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/fn.uu_app.html b/coreutils/dev/uu_nl/fn.uu_app.html deleted file mode 100644 index d17f6af5c..000000000 --- a/coreutils/dev/uu_nl/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_nl - Rust

Function uu_nl::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/fn.uumain.html b/coreutils/dev/uu_nl/fn.uumain.html deleted file mode 100644 index b8f61513a..000000000 --- a/coreutils/dev/uu_nl/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_nl - Rust

Function uu_nl::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/index.html b/coreutils/dev/uu_nl/index.html deleted file mode 100644 index 95864f3bb..000000000 --- a/coreutils/dev/uu_nl/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_nl - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.BODY_NUMBERING.html b/coreutils/dev/uu_nl/options/constant.BODY_NUMBERING.html deleted file mode 100644 index 51e82a6b4..000000000 --- a/coreutils/dev/uu_nl/options/constant.BODY_NUMBERING.html +++ /dev/null @@ -1 +0,0 @@ -BODY_NUMBERING in uu_nl::options - Rust

Constant uu_nl::options::BODY_NUMBERING

source ·
pub const BODY_NUMBERING: &str = "body-numbering";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.FILE.html b/coreutils/dev/uu_nl/options/constant.FILE.html deleted file mode 100644 index b64a66d44..000000000 --- a/coreutils/dev/uu_nl/options/constant.FILE.html +++ /dev/null @@ -1 +0,0 @@ -FILE in uu_nl::options - Rust

Constant uu_nl::options::FILE

source ·
pub const FILE: &str = "file";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.FOOTER_NUMBERING.html b/coreutils/dev/uu_nl/options/constant.FOOTER_NUMBERING.html deleted file mode 100644 index 4108205c2..000000000 --- a/coreutils/dev/uu_nl/options/constant.FOOTER_NUMBERING.html +++ /dev/null @@ -1 +0,0 @@ -FOOTER_NUMBERING in uu_nl::options - Rust
pub const FOOTER_NUMBERING: &str = "footer-numbering";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.HEADER_NUMBERING.html b/coreutils/dev/uu_nl/options/constant.HEADER_NUMBERING.html deleted file mode 100644 index 780b5859c..000000000 --- a/coreutils/dev/uu_nl/options/constant.HEADER_NUMBERING.html +++ /dev/null @@ -1 +0,0 @@ -HEADER_NUMBERING in uu_nl::options - Rust
pub const HEADER_NUMBERING: &str = "header-numbering";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.HELP.html b/coreutils/dev/uu_nl/options/constant.HELP.html deleted file mode 100644 index 91c6cb275..000000000 --- a/coreutils/dev/uu_nl/options/constant.HELP.html +++ /dev/null @@ -1 +0,0 @@ -HELP in uu_nl::options - Rust

Constant uu_nl::options::HELP

source ·
pub const HELP: &str = "help";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.JOIN_BLANK_LINES.html b/coreutils/dev/uu_nl/options/constant.JOIN_BLANK_LINES.html deleted file mode 100644 index fb02e62e8..000000000 --- a/coreutils/dev/uu_nl/options/constant.JOIN_BLANK_LINES.html +++ /dev/null @@ -1 +0,0 @@ -JOIN_BLANK_LINES in uu_nl::options - Rust
pub const JOIN_BLANK_LINES: &str = "join-blank-lines";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.LINE_INCREMENT.html b/coreutils/dev/uu_nl/options/constant.LINE_INCREMENT.html deleted file mode 100644 index 583e484bf..000000000 --- a/coreutils/dev/uu_nl/options/constant.LINE_INCREMENT.html +++ /dev/null @@ -1 +0,0 @@ -LINE_INCREMENT in uu_nl::options - Rust

Constant uu_nl::options::LINE_INCREMENT

source ·
pub const LINE_INCREMENT: &str = "line-increment";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.NO_RENUMBER.html b/coreutils/dev/uu_nl/options/constant.NO_RENUMBER.html deleted file mode 100644 index aad0c29db..000000000 --- a/coreutils/dev/uu_nl/options/constant.NO_RENUMBER.html +++ /dev/null @@ -1 +0,0 @@ -NO_RENUMBER in uu_nl::options - Rust

Constant uu_nl::options::NO_RENUMBER

source ·
pub const NO_RENUMBER: &str = "no-renumber";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.NUMBER_FORMAT.html b/coreutils/dev/uu_nl/options/constant.NUMBER_FORMAT.html deleted file mode 100644 index 0bcc6f65b..000000000 --- a/coreutils/dev/uu_nl/options/constant.NUMBER_FORMAT.html +++ /dev/null @@ -1 +0,0 @@ -NUMBER_FORMAT in uu_nl::options - Rust

Constant uu_nl::options::NUMBER_FORMAT

source ·
pub const NUMBER_FORMAT: &str = "number-format";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.NUMBER_SEPARATOR.html b/coreutils/dev/uu_nl/options/constant.NUMBER_SEPARATOR.html deleted file mode 100644 index 2b7da298e..000000000 --- a/coreutils/dev/uu_nl/options/constant.NUMBER_SEPARATOR.html +++ /dev/null @@ -1 +0,0 @@ -NUMBER_SEPARATOR in uu_nl::options - Rust
pub const NUMBER_SEPARATOR: &str = "number-separator";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.NUMBER_WIDTH.html b/coreutils/dev/uu_nl/options/constant.NUMBER_WIDTH.html deleted file mode 100644 index d7daac4f9..000000000 --- a/coreutils/dev/uu_nl/options/constant.NUMBER_WIDTH.html +++ /dev/null @@ -1 +0,0 @@ -NUMBER_WIDTH in uu_nl::options - Rust

Constant uu_nl::options::NUMBER_WIDTH

source ·
pub const NUMBER_WIDTH: &str = "number-width";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.SECTION_DELIMITER.html b/coreutils/dev/uu_nl/options/constant.SECTION_DELIMITER.html deleted file mode 100644 index 9f069ada5..000000000 --- a/coreutils/dev/uu_nl/options/constant.SECTION_DELIMITER.html +++ /dev/null @@ -1 +0,0 @@ -SECTION_DELIMITER in uu_nl::options - Rust
pub const SECTION_DELIMITER: &str = "section-delimiter";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/constant.STARTING_LINE_NUMBER.html b/coreutils/dev/uu_nl/options/constant.STARTING_LINE_NUMBER.html deleted file mode 100644 index 68e825d64..000000000 --- a/coreutils/dev/uu_nl/options/constant.STARTING_LINE_NUMBER.html +++ /dev/null @@ -1 +0,0 @@ -STARTING_LINE_NUMBER in uu_nl::options - Rust
pub const STARTING_LINE_NUMBER: &str = "starting-line-number";
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/index.html b/coreutils/dev/uu_nl/options/index.html deleted file mode 100644 index f7dc4ee13..000000000 --- a/coreutils/dev/uu_nl/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_nl::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_nl/options/sidebar-items.js b/coreutils/dev/uu_nl/options/sidebar-items.js deleted file mode 100644 index 7ecbcfef0..000000000 --- a/coreutils/dev/uu_nl/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["BODY_NUMBERING","FILE","FOOTER_NUMBERING","HEADER_NUMBERING","HELP","JOIN_BLANK_LINES","LINE_INCREMENT","NO_RENUMBER","NUMBER_FORMAT","NUMBER_SEPARATOR","NUMBER_WIDTH","SECTION_DELIMITER","STARTING_LINE_NUMBER"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_nl/sidebar-items.js b/coreutils/dev/uu_nl/sidebar-items.js deleted file mode 100644 index 62c3927e7..000000000 --- a/coreutils/dev/uu_nl/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"],"struct":["Settings"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_nl/struct.Settings.html b/coreutils/dev/uu_nl/struct.Settings.html deleted file mode 100644 index 275f40a8f..000000000 --- a/coreutils/dev/uu_nl/struct.Settings.html +++ /dev/null @@ -1,11 +0,0 @@ -Settings in uu_nl - Rust

Struct uu_nl::Settings

source ·
pub struct Settings { /* private fields */ }

Trait Implementations§

source§

impl Default for Settings

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_nohup/all.html b/coreutils/dev/uu_nohup/all.html deleted file mode 100644 index c5b12ae09..000000000 --- a/coreutils/dev/uu_nohup/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_nohup/fn.uu_app.html b/coreutils/dev/uu_nohup/fn.uu_app.html deleted file mode 100644 index e868765aa..000000000 --- a/coreutils/dev/uu_nohup/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_nohup - Rust

Function uu_nohup::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_nohup/fn.uumain.html b/coreutils/dev/uu_nohup/fn.uumain.html deleted file mode 100644 index 7bbe7ccff..000000000 --- a/coreutils/dev/uu_nohup/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_nohup - Rust

Function uu_nohup::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_nohup/index.html b/coreutils/dev/uu_nohup/index.html deleted file mode 100644 index cf80cd087..000000000 --- a/coreutils/dev/uu_nohup/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_nohup - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_nohup/sidebar-items.js b/coreutils/dev/uu_nohup/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_nohup/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_nproc/all.html b/coreutils/dev/uu_nproc/all.html deleted file mode 100644 index c9780c492..000000000 --- a/coreutils/dev/uu_nproc/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

Constants

\ No newline at end of file diff --git a/coreutils/dev/uu_nproc/constant._SC_NPROCESSORS_CONF.html b/coreutils/dev/uu_nproc/constant._SC_NPROCESSORS_CONF.html deleted file mode 100644 index 2063d65f1..000000000 --- a/coreutils/dev/uu_nproc/constant._SC_NPROCESSORS_CONF.html +++ /dev/null @@ -1 +0,0 @@ -_SC_NPROCESSORS_CONF in uu_nproc - Rust
pub const _SC_NPROCESSORS_CONF: c_int = 83;
\ No newline at end of file diff --git a/coreutils/dev/uu_nproc/fn.uu_app.html b/coreutils/dev/uu_nproc/fn.uu_app.html deleted file mode 100644 index 3a4f10545..000000000 --- a/coreutils/dev/uu_nproc/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_nproc - Rust

Function uu_nproc::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_nproc/fn.uumain.html b/coreutils/dev/uu_nproc/fn.uumain.html deleted file mode 100644 index 049abb349..000000000 --- a/coreutils/dev/uu_nproc/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_nproc - Rust

Function uu_nproc::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_nproc/index.html b/coreutils/dev/uu_nproc/index.html deleted file mode 100644 index 54af460a2..000000000 --- a/coreutils/dev/uu_nproc/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_nproc - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_nproc/sidebar-items.js b/coreutils/dev/uu_nproc/sidebar-items.js deleted file mode 100644 index ef799b267..000000000 --- a/coreutils/dev/uu_nproc/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["_SC_NPROCESSORS_CONF"],"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/all.html b/coreutils/dev/uu_numfmt/all.html deleted file mode 100644 index 70d7d284c..000000000 --- a/coreutils/dev/uu_numfmt/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/errors/enum.NumfmtError.html b/coreutils/dev/uu_numfmt/errors/enum.NumfmtError.html deleted file mode 100644 index dc30edc7c..000000000 --- a/coreutils/dev/uu_numfmt/errors/enum.NumfmtError.html +++ /dev/null @@ -1,18 +0,0 @@ -NumfmtError in uu_numfmt::errors - Rust
pub enum NumfmtError {
-    IoError(String),
-    IllegalArgument(String),
-    FormattingError(String),
-}

Variants§

§

IoError(String)

§

IllegalArgument(String)

§

FormattingError(String)

Trait Implementations§

source§

impl Debug for NumfmtError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for NumfmtError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for NumfmtError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl UError for NumfmtError

source§

fn code(&self) -> i32

Error code of a custom error. Read more
§

fn usage(&self) -> bool

Print usage help to a custom error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/errors/index.html b/coreutils/dev/uu_numfmt/errors/index.html deleted file mode 100644 index 99d5b8f30..000000000 --- a/coreutils/dev/uu_numfmt/errors/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_numfmt::errors - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/errors/sidebar-items.js b/coreutils/dev/uu_numfmt/errors/sidebar-items.js deleted file mode 100644 index 84618504c..000000000 --- a/coreutils/dev/uu_numfmt/errors/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["NumfmtError"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/fn.uu_app.html b/coreutils/dev/uu_numfmt/fn.uu_app.html deleted file mode 100644 index 66ad08387..000000000 --- a/coreutils/dev/uu_numfmt/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_numfmt - Rust

Function uu_numfmt::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/fn.uumain.html b/coreutils/dev/uu_numfmt/fn.uumain.html deleted file mode 100644 index 451f17083..000000000 --- a/coreutils/dev/uu_numfmt/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_numfmt - Rust

Function uu_numfmt::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/format/fn.div_round.html b/coreutils/dev/uu_numfmt/format/fn.div_round.html deleted file mode 100644 index b3e8425f6..000000000 --- a/coreutils/dev/uu_numfmt/format/fn.div_round.html +++ /dev/null @@ -1,22 +0,0 @@ -div_round in uu_numfmt::format - Rust

Function uu_numfmt::format::div_round

source ·
pub fn div_round(n: f64, d: f64, method: RoundMethod) -> f64
Expand description

Divide numerator by denominator, with rounding.

-

If the result of the division is less than 10.0, round to one decimal point.

-

Otherwise, round to an integer.

-

Examples:

-
use uu_numfmt::format::div_round;
-use uu_numfmt::options::RoundMethod;
-
-// Rounding methods:
-assert_eq!(div_round(1.01, 1.0, RoundMethod::FromZero), 1.1);
-assert_eq!(div_round(1.01, 1.0, RoundMethod::TowardsZero), 1.0);
-assert_eq!(div_round(1.01, 1.0, RoundMethod::Up), 1.1);
-assert_eq!(div_round(1.01, 1.0, RoundMethod::Down), 1.0);
-assert_eq!(div_round(1.01, 1.0, RoundMethod::Nearest), 1.0);
-
-// Division:
-assert_eq!(div_round(999.1, 1000.0, RoundMethod::FromZero), 1.0);
-assert_eq!(div_round(1001., 10., RoundMethod::FromZero), 101.);
-assert_eq!(div_round(9991., 10., RoundMethod::FromZero), 1000.);
-assert_eq!(div_round(-12.34, 1.0, RoundMethod::FromZero), -13.0);
-assert_eq!(div_round(1000.0, -3.14, RoundMethod::FromZero), -319.0);
-assert_eq!(div_round(-271828.0, -271.0, RoundMethod::FromZero), 1004.0);
-
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/format/fn.format_and_print.html b/coreutils/dev/uu_numfmt/format/fn.format_and_print.html deleted file mode 100644 index 9dcc11ec4..000000000 --- a/coreutils/dev/uu_numfmt/format/fn.format_and_print.html +++ /dev/null @@ -1,5 +0,0 @@ -format_and_print in uu_numfmt::format - Rust
pub fn format_and_print(s: &str, options: &NumfmtOptions) -> Result<(), String>
Expand description

Format a line of text according to the selected options.

-

Given a line of text s, split the line into fields, transform and format -any selected numeric fields, and print the result to stdout. Fields not -selected for conversion are passed through unmodified.

-
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/format/index.html b/coreutils/dev/uu_numfmt/format/index.html deleted file mode 100644 index 108cff624..000000000 --- a/coreutils/dev/uu_numfmt/format/index.html +++ /dev/null @@ -1,3 +0,0 @@ -uu_numfmt::format - Rust

Module uu_numfmt::format

source ·

Structs

  • Iterate over a line’s fields, where each field is a contiguous sequence of -non-whitespace, optionally prefixed with one or more characters of leading -whitespace. Fields are returned as tuples of (prefix, field).

Functions

  • Divide numerator by denominator, with rounding.
  • Format a line of text according to the selected options.
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/format/sidebar-items.js b/coreutils/dev/uu_numfmt/format/sidebar-items.js deleted file mode 100644 index 7ac585ca0..000000000 --- a/coreutils/dev/uu_numfmt/format/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["div_round","format_and_print"],"struct":["WhitespaceSplitter"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/format/struct.WhitespaceSplitter.html b/coreutils/dev/uu_numfmt/format/struct.WhitespaceSplitter.html deleted file mode 100644 index 43c944a5a..000000000 --- a/coreutils/dev/uu_numfmt/format/struct.WhitespaceSplitter.html +++ /dev/null @@ -1,617 +0,0 @@ -WhitespaceSplitter in uu_numfmt::format - Rust
pub struct WhitespaceSplitter<'a> {
-    pub s: Option<&'a str>,
-}
Expand description

Iterate over a line’s fields, where each field is a contiguous sequence of -non-whitespace, optionally prefixed with one or more characters of leading -whitespace. Fields are returned as tuples of (prefix, field).

-

Examples:

-
let mut fields = uu_numfmt::format::WhitespaceSplitter { s: Some("    1234 5") };
-
-assert_eq!(Some(("    ", "1234")), fields.next());
-assert_eq!(Some((" ", "5")), fields.next());
-assert_eq!(None, fields.next());
-

Delimiters are included in the results; prefix will be empty only for -the first field of the line (including the case where the input line is -empty):

- -
let mut fields = uu_numfmt::format::WhitespaceSplitter { s: Some("first second") };
-
-assert_eq!(Some(("", "first")), fields.next());
-assert_eq!(Some((" ", "second")), fields.next());
-
-let mut fields = uu_numfmt::format::WhitespaceSplitter { s: Some("") };
-
-assert_eq!(Some(("", "")), fields.next());
-

Fields§

§s: Option<&'a str>

Trait Implementations§

source§

impl<'a> Iterator for WhitespaceSplitter<'a>

source§

fn next(&mut self) -> Option<Self::Item>

Yield the next field in the input string as a tuple (prefix, field).

-
§

type Item = (&'a str, &'a str)

The type of the elements being iterated over.
source§

fn next_chunk<const N: usize>( - &mut self -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0 · source§

fn count(self) -> usizewhere - Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>where - Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>where - Self: Sized,

Creates an iterator starting at the same point, but stepping by -the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>where - Self: Sized, - G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator -between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each -element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)where - Self: Sized, - F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element -should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>where - Self: Sized,

Creates an iterator which gives the current iteration count as well as -the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>where - Self: Sized,

Creates an iterator which can use the peek and peek_mut methods -to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>where - Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>where - Self: Sized,

Creates an iterator that yields the first n elements, or fewer -if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where - Self: Sized, - F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but -unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where - Self: Sized, - U: IntoIterator, - F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>where - Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where - Self: Sized, - F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere - Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> Bwhere - B: FromIterator<Self::Item>, - Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere - E: Extend<Self::Item>, - Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)where - Self: Sized, - B: Default + Extend<Self::Item>, - F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> boolwhere - Self: Sized, - P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, -such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere - Self: Sized, - F: FnMut(B, Self::Item) -> R, - R: Try<Output = B>,

An iterator method that applies a function as long as it returns -successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> Rwhere - Self: Sized, - F: FnMut(Self::Item) -> R, - R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the -iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> Bwhere - Self: Sized, - F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, -returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing -operation. Read more
source§

fn try_reduce<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> R, - R: Try<Output = Self::Item>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the -closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns -the first non-none result. Read more
source§

fn try_find<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere - Self: Sized, - F: FnMut(&Self::Item) -> R, - R: Try<Output = bool>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns -the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the -specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the -specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the -specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the -specified comparison function. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where - FromA: Default + Extend<A>, - FromB: Default + Extend<B>, - Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>where - T: 'a + Copy, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>where - T: 'a + Clone, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> Swhere - Self: Sized, - S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> Pwhere - Self: Sized, - P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Lexicographically compares the PartialOrd elements of -this Iterator with those of another. The comparison works like short-circuit -evaluation, returning a result without comparing the remaining elements. -As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are equal to those of -another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of -another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are not equal to those of -another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> boolwhere - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction -function. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<I> IntoIterator for Iwhere - I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T> Itertools for Twhere - T: Iterator + ?Sized,

source§

fn interleave<J>( - self, - other: J -) -> Interleave<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator<Item = Self::Item>, - Self: Sized,

Alternate elements from two iterators until both have run out. Read more
source§

fn interleave_shortest<J>( - self, - other: J -) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator<Item = Self::Item>, - Self: Sized,

Alternate elements from two iterators until at least one of them has run -out. Read more
source§

fn intersperse( - self, - element: Self::Item -) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>>where - Self: Sized, - Self::Item: Clone,

An iterator adaptor to insert a particular value -between each element of the adapted iterator. Read more
source§

fn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F>where - Self: Sized, - F: FnMut() -> Self::Item,

An iterator adaptor to insert a particular value created by a function -between each element of the adapted iterator. Read more
source§

fn zip_longest<J>( - self, - other: J -) -> ZipLongest<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator, - Self: Sized,

Create an iterator which iterates over both this and the specified -iterator simultaneously, yielding pairs of two optional elements. Read more
source§

fn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator, - Self: Sized,

Create an iterator which iterates over both this and the specified -iterator simultaneously, yielding pairs of elements. Read more
source§

fn batching<B, F>(self, f: F) -> Batching<Self, F>where - F: FnMut(&mut Self) -> Option<B>, - Self: Sized,

A “meta iterator adaptor”. Its closure receives a reference to the -iterator and may pick off as many elements as it likes, to produce the -next iterator element. Read more
source§

fn group_by<K, F>(self, key: F) -> GroupBy<K, Self, F>where - Self: Sized, - F: FnMut(&Self::Item) -> K, - K: PartialEq<K>,

Return an iterable that can group iterator elements. -Consecutive elements that map to the same key (“runs”), are assigned -to the same group. Read more
source§

fn chunks(self, size: usize) -> IntoChunks<Self>where - Self: Sized,

Return an iterable that can chunk the iterator. Read more
source§

fn tuple_windows<T>(self) -> TupleWindows<Self, T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple, - <T as TupleCollect>::Item: Clone,

Return an iterator over all contiguous windows producing tuples of -a specific size (up to 12). Read more
source§

fn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T>where - Self: Sized + Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator, - T: TupleCollect + Clone, - <T as TupleCollect>::Item: Clone,

Return an iterator over all windows, wrapping back to the first -elements when the window would otherwise exceed the length of the -iterator, producing tuples of a specific size (up to 12). Read more
source§

fn tuples<T>(self) -> Tuples<Self, T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Return an iterator that groups the items in tuples of a specific size -(up to 12). Read more
source§

fn tee(self) -> (Tee<Self>, Tee<Self>)where - Self: Sized, - Self::Item: Clone,

Split into an iterator pair that both yield all elements from -the original iterator. Read more
source§

fn step(self, n: usize) -> Step<Self>where - Self: Sized,

👎Deprecated since 0.8.0: Use std .step_by() instead
Return an iterator adaptor that steps n elements in the base iterator -for each iteration. Read more
source§

fn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>>where - Self: Sized, - Self::Item: Into<R>,

Convert each item of the iterator using the Into trait. Read more
source§

fn map_results<F, T, U, E>( - self, - f: F -) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> U,

👎Deprecated since 0.10.0: Use .map_ok() instead
source§

fn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> U,

Return an iterator adaptor that applies the provided closure -to every Result::Ok value. Result::Err values are -unchanged. Read more
source§

fn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(&T) -> bool,

Return an iterator adaptor that filters every Result::Ok -value with the provided closure. Result::Err values are -unchanged. Read more
source§

fn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> Option<U>,

Return an iterator adaptor that filters and transforms every -Result::Ok value with the provided closure. Result::Err -values are unchanged. Read more
source§

fn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E>where - Self: Iterator<Item = Result<T, E>> + Sized, - T: IntoIterator,

Return an iterator adaptor that flattens every Result::Ok value into -a series of Result::Ok values. Result::Err values are unchanged. Read more
source§

fn process_results<F, T, E, R>(self, processor: F) -> Result<R, E>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnOnce(ProcessResults<'_, Self, E>) -> R,

“Lift” a function of the values of the current iterator so as to process -an iterator of Result values instead. Read more
source§

fn merge<J>( - self, - other: J -) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>, - J: IntoIterator<Item = Self::Item>,

Return an iterator adaptor that merges the two base iterators in -ascending order. If both base iterators are sorted (ascending), the -result is sorted. Read more
source§

fn merge_by<J, F>( - self, - other: J, - is_first: F -) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F>where - Self: Sized, - J: IntoIterator<Item = Self::Item>, - F: FnMut(&Self::Item, &Self::Item) -> bool,

Return an iterator adaptor that merges the two base iterators in order. -This is much like .merge() but allows for a custom ordering. Read more
source§

fn merge_join_by<J, F, T>( - self, - other: J, - cmp_fn: F -) -> MergeJoinBy<Self, <J as IntoIterator>::IntoIter, F>where - J: IntoIterator, - F: FnMut(&Self::Item, &<J as IntoIterator>::Item) -> T, - T: OrderingOrBool<Self::Item, <J as IntoIterator>::Item>, - Self: Sized,

Create an iterator that merges items from both this and the specified -iterator in ascending order. Read more
source§

fn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt>where - Self: Sized, - Self::Item: IntoIterator, - <Self::Item as IntoIterator>::Item: PartialOrd<<Self::Item as IntoIterator>::Item>,

Return an iterator adaptor that flattens an iterator of iterators by -merging them in ascending order. Read more
source§

fn kmerge_by<F>( - self, - first: F -) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F>where - Self: Sized, - Self::Item: IntoIterator, - F: FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,

Return an iterator adaptor that flattens an iterator of iterators by -merging them according to the given closure. Read more
source§

fn cartesian_product<J>( - self, - other: J -) -> Product<Self, <J as IntoIterator>::IntoIter>where - Self: Sized, - Self::Item: Clone, - J: IntoIterator, - <J as IntoIterator>::IntoIter: Clone,

Return an iterator adaptor that iterates over the cartesian product of -the element sets of two iterators self and J. Read more
source§

fn multi_cartesian_product( - self -) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter>where - Self: Sized, - Self::Item: IntoIterator, - <Self::Item as IntoIterator>::IntoIter: Clone, - <Self::Item as IntoIterator>::Item: Clone,

Return an iterator adaptor that iterates over the cartesian product of -all subiterators returned by meta-iterator self. Read more
source§

fn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Result<Self::Item, (Self::Item, Self::Item)>,

Return an iterator adaptor that uses the passed-in closure to -optionally merge together consecutive elements. Read more
source§

fn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, Self::Item>where - Self: Sized, - Self::Item: PartialEq<Self::Item>,

Remove duplicates from sections of consecutive identical elements. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_by<Cmp>( - self, - cmp: Cmp -) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, Self::Item>where - Self: Sized, - Cmp: FnMut(&Self::Item, &Self::Item) -> bool,

Remove duplicates from sections of consecutive identical elements, -determining equality using a comparison function. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_with_count( - self -) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, (usize, Self::Item)>where - Self: Sized,

Remove duplicates from sections of consecutive identical elements, while keeping a count of -how many repeated elements were present. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_by_with_count<Cmp>( - self, - cmp: Cmp -) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, (usize, Self::Item)>where - Self: Sized, - Cmp: FnMut(&Self::Item, &Self::Item) -> bool,

Remove duplicates from sections of consecutive identical elements, while keeping a count of -how many repeated elements were present. -This will determine equality using a comparison function. -If the iterator is sorted, all elements will be unique. Read more
source§

fn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById>where - Self: Sized, - Self::Item: Eq + Hash,

Return an iterator adaptor that produces elements that appear more than once during the -iteration. Duplicates are detected using hash and equality. Read more
source§

fn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>>where - Self: Sized, - V: Eq + Hash, - F: FnMut(&Self::Item) -> V,

Return an iterator adaptor that produces elements that appear more than once during the -iteration. Duplicates are detected using hash and equality. Read more
source§

fn unique(self) -> Unique<Self>where - Self: Sized, - Self::Item: Clone + Eq + Hash,

Return an iterator adaptor that filters out elements that have -already been produced once during the iteration. Duplicates -are detected using hash and equality. Read more
source§

fn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F>where - Self: Sized, - V: Eq + Hash, - F: FnMut(&Self::Item) -> V,

Return an iterator adaptor that filters out elements that have -already been produced once during the iteration. Read more
source§

fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F>where - Self: Sized + PeekingNext, - F: FnMut(&Self::Item) -> bool,

Return an iterator adaptor that borrows from this iterator and -takes items while the closure accept returns true. Read more
source§

fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F>where - Self: Clone, - F: FnMut(&Self::Item) -> bool,

Return an iterator adaptor that borrows from a Clone-able iterator -to only pick off elements while the predicate accept returns true. Read more
source§

fn take_while_inclusive<F>( - &mut self, - accept: F -) -> TakeWhileInclusive<'_, Self, F>where - Self: Sized, - F: FnMut(&Self::Item) -> bool,

Returns an iterator adaptor that consumes elements while the given -predicate is true, including the element for which the predicate -first returned false. Read more
source§

fn while_some<A>(self) -> WhileSome<Self>where - Self: Sized + Iterator<Item = Option<A>>,

Return an iterator adaptor that filters Option<A> iterator elements -and produces A. Stops on the first None encountered. Read more
source§

fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>where - Self: Sized + Clone, - Self::Item: Clone, - T: HasCombination<Self>,

Return an iterator adaptor that iterates over the combinations of the -elements from an iterator. Read more
source§

fn combinations(self, k: usize) -> Combinations<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator adaptor that iterates over the k-length combinations of -the elements from an iterator. Read more
source§

fn combinations_with_replacement( - self, - k: usize -) -> CombinationsWithReplacement<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator that iterates over the k-length combinations of -the elements from an iterator, with replacement. Read more
source§

fn permutations(self, k: usize) -> Permutations<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator adaptor that iterates over all k-permutations of the -elements from an iterator. Read more
source§

fn powerset(self) -> Powerset<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator that iterates through the powerset of the elements from an -iterator. Read more
source§

fn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F>where - Self: Sized, - F: FnMut(usize) -> Self::Item,

Return an iterator adaptor that pads the sequence to a minimum length of -min by filling missing elements using a closure f. Read more
source§

fn with_position(self) -> WithPosition<Self>where - Self: Sized,

Return an iterator adaptor that combines each element with a Position to -ease special-case handling of the first or last elements. Read more
source§

fn positions<P>(self, predicate: P) -> Positions<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Return an iterator adaptor that yields the indices of all elements -satisfying a predicate, counted from the start of the iterator. Read more
source§

fn update<F>(self, updater: F) -> Update<Self, F>where - Self: Sized, - F: FnMut(&mut Self::Item),

Return an iterator adaptor that applies a mutating function -to each element before yielding it. Read more
source§

fn next_tuple<T>(&mut self) -> Option<T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Advances the iterator and returns the next items grouped in a tuple of -a specific size (up to 12). Read more
source§

fn collect_tuple<T>(self) -> Option<T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Collects all items from the iterator into a tuple of a specific size -(up to 12). Read more
source§

fn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)>where - P: FnMut(&Self::Item) -> bool,

Find the position and value of the first element satisfying a predicate. Read more
source§

fn find_or_last<P>(self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Find the value of the first element satisfying a predicate or return the last element, if any. Read more
source§

fn find_or_first<P>(self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Find the value of the first element satisfying a predicate or return the first element, if any. Read more
source§

fn contains<Q>(&mut self, query: &Q) -> boolwhere - Self: Sized, - Self::Item: Borrow<Q>, - Q: PartialEq<Q>,

Returns true if the given item is present in this iterator. Read more
source§

fn all_equal(&mut self) -> boolwhere - Self: Sized, - Self::Item: PartialEq<Self::Item>,

Check whether all elements compare equal. Read more
source§

fn all_equal_value( - &mut self -) -> Result<Self::Item, Option<(Self::Item, Self::Item)>>where - Self: Sized, - Self::Item: PartialEq<Self::Item>,

If there are elements and they are all equal, return a single copy of that element. -If there are no elements, return an Error containing None. -If there are elements and they are not all equal, return a tuple containing the first -two non-equal elements found. Read more
source§

fn all_unique(&mut self) -> boolwhere - Self: Sized, - Self::Item: Eq + Hash,

Check whether all elements are unique (non equal). Read more
source§

fn dropping(self, n: usize) -> Selfwhere - Self: Sized,

Consume the first n elements from the iterator eagerly, -and return the same iterator again. Read more
source§

fn dropping_back(self, n: usize) -> Selfwhere - Self: Sized + DoubleEndedIterator,

Consume the last n elements from the iterator eagerly, -and return the same iterator again. Read more
source§

fn foreach<F>(self, f: F)where - F: FnMut(Self::Item), - Self: Sized,

👎Deprecated since 0.8.0: Use .for_each() instead
Run the closure f eagerly on each element of the iterator. Read more
source§

fn concat(self) -> Self::Itemwhere - Self: Sized, - Self::Item: Extend<<Self::Item as IntoIterator>::Item> + IntoIterator + Default,

Combine all an iterator’s elements into one element by using Extend. Read more
source§

fn collect_vec(self) -> Vec<Self::Item, Global>where - Self: Sized,

.collect_vec() is simply a type specialization of Iterator::collect, -for convenience.
source§

fn try_collect<T, U, E>(self) -> Result<U, E>where - Self: Sized + Iterator<Item = Result<T, E>>, - Result<U, E>: FromIterator<Result<T, E>>,

.try_collect() is more convenient way of writing -.collect::<Result<_, _>>() Read more
source§

fn set_from<'a, A, J>(&mut self, from: J) -> usizewhere - A: 'a, - Self: Iterator<Item = &'a mut A>, - J: IntoIterator<Item = A>,

Assign to each reference in self from the from iterator, -stopping at the shortest of the two iterators. Read more
source§

fn join(&mut self, sep: &str) -> Stringwhere - Self::Item: Display,

Combine all iterator elements into one String, separated by sep. Read more
source§

fn format(self, sep: &str) -> Format<'_, Self>where - Self: Sized,

Format all iterator elements, separated by sep. Read more
source§

fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F>where - Self: Sized, - F: FnMut(Self::Item, &mut dyn FnMut(&dyn Display) -> Result<(), Error>) -> Result<(), Error>,

Format all iterator elements, separated by sep. Read more
source§

fn fold_results<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>where - Self: Iterator<Item = Result<A, E>>, - F: FnMut(B, A) -> B,

👎Deprecated since 0.10.0: Use .fold_ok() instead
source§

fn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>where - Self: Iterator<Item = Result<A, E>>, - F: FnMut(B, A) -> B,

Fold Result values from an iterator. Read more
source§

fn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B>where - Self: Iterator<Item = Option<A>>, - F: FnMut(B, A) -> B,

Fold Option values from an iterator. Read more
source§

fn fold1<F>(self, f: F) -> Option<Self::Item>where - F: FnMut(Self::Item, Self::Item) -> Self::Item, - Self: Sized,

👎Deprecated since 0.10.2: Use Iterator::reduce instead
Accumulator of the elements in the iterator. Read more
source§

fn tree_fold1<F>(self, f: F) -> Option<Self::Item>where - F: FnMut(Self::Item, Self::Item) -> Self::Item, - Self: Sized,

Accumulate the elements in the iterator in a tree-like manner. Read more
source§

fn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B>where - Self: Sized, - F: FnMut(B, Self::Item) -> FoldWhile<B>,

An iterator method that applies a function, producing a single, final value. Read more
source§

fn sum1<S>(self) -> Option<S>where - Self: Sized, - S: Sum<Self::Item>,

Iterate over the entire iterator and add all the elements. Read more
source§

fn product1<P>(self) -> Option<P>where - Self: Sized, - P: Product<Self::Item>,

Iterate over the entire iterator and multiply all the elements. Read more
source§

fn sorted_unstable(self) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted(self) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. The key function is -called exactly once per key. Read more
source§

fn k_smallest(self, k: usize) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort the k smallest elements into a new iterator, in ascending order. Read more
source§

fn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B)where - Self: Sized, - F: FnMut(Self::Item) -> Either<L, R>, - A: Default + Extend<L>, - B: Default + Extend<R>,

Collect all iterator elements into one of two -partitions. Unlike Iterator::partition, each partition may -have a distinct type. Read more
source§

fn partition_result<A, B, T, E>(self) -> (A, B)where - Self: Iterator<Item = Result<T, E>> + Sized, - A: Default + Extend<T>, - B: Default + Extend<E>,

Partition a sequence of Results into one list of all the Ok elements -and another list of all the Err elements. Read more
source§

fn into_group_map<K, V>(self) -> HashMap<K, Vec<V, Global>, RandomState>where - Self: Iterator<Item = (K, V)> + Sized, - K: Hash + Eq,

Return a HashMap of keys mapped to Vecs of values. Keys and values -are taken from (Key, Value) tuple pairs yielded by the input iterator. Read more
source§

fn into_group_map_by<K, V, F>( - self, - f: F -) -> HashMap<K, Vec<V, Global>, RandomState>where - Self: Iterator<Item = V> + Sized, - K: Hash + Eq, - F: Fn(&V) -> K,

Return an Iterator on a HashMap. Keys mapped to Vecs of values. The key is specified -in the closure. Read more
source§

fn into_grouping_map<K, V>(self) -> GroupingMap<Self>where - Self: Iterator<Item = (K, V)> + Sized, - K: Hash + Eq,

Constructs a GroupingMap to be used later with one of the efficient -group-and-fold operations it allows to perform. Read more
source§

fn into_grouping_map_by<K, V, F>( - self, - key_mapper: F -) -> GroupingMap<MapForGrouping<Self, F>>where - Self: Iterator<Item = V> + Sized, - K: Hash + Eq, - F: FnMut(&V) -> K,

Constructs a GroupingMap to be used later with one of the efficient -group-and-fold operations it allows to perform. Read more
source§

fn min_set(self) -> Vec<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Return all minimum elements of an iterator. Read more
source§

fn min_set_by<F>(self, compare: F) -> Vec<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return all minimum elements of an iterator, as determined by -the specified function. Read more
source§

fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return all minimum elements of an iterator, as determined by -the specified function. Read more
source§

fn max_set(self) -> Vec<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Return all maximum elements of an iterator. Read more
source§

fn max_set_by<F>(self, compare: F) -> Vec<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return all maximum elements of an iterator, as determined by -the specified function. Read more
source§

fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return all maximum elements of an iterator, as determined by -the specified function. Read more
source§

fn minmax(self) -> MinMaxResult<Self::Item>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>,

Return the minimum and maximum elements in the iterator. Read more
source§

fn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item>where - Self: Sized, - K: PartialOrd<K>, - F: FnMut(&Self::Item) -> K,

Return the minimum and maximum element of an iterator, as determined by -the specified function. Read more
source§

fn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the minimum and maximum element of an iterator, as determined by -the specified comparison function. Read more
source§

fn position_max(self) -> Option<usize>where - Self: Sized, - Self::Item: Ord,

Return the position of the maximum element in the iterator. Read more
source§

fn position_max_by_key<K, F>(self, key: F) -> Option<usize>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return the position of the maximum element in the iterator, as -determined by the specified function. Read more
source§

fn position_max_by<F>(self, compare: F) -> Option<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the position of the maximum element in the iterator, as -determined by the specified comparison function. Read more
source§

fn position_min(self) -> Option<usize>where - Self: Sized, - Self::Item: Ord,

Return the position of the minimum element in the iterator. Read more
source§

fn position_min_by_key<K, F>(self, key: F) -> Option<usize>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return the position of the minimum element in the iterator, as -determined by the specified function. Read more
source§

fn position_min_by<F>(self, compare: F) -> Option<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the position of the minimum element in the iterator, as -determined by the specified comparison function. Read more
source§

fn position_minmax(self) -> MinMaxResult<usize>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>,

Return the positions of the minimum and maximum elements in -the iterator. Read more
source§

fn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize>where - Self: Sized, - K: PartialOrd<K>, - F: FnMut(&Self::Item) -> K,

Return the postions of the minimum and maximum elements of an -iterator, as determined by the specified function. Read more
source§

fn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the postions of the minimum and maximum elements of an -iterator, as determined by the specified comparison function. Read more
source§

fn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>where - Self: Sized,

If the iterator yields exactly one element, that element will be returned, otherwise -an error will be returned containing an iterator that has the same output as the input -iterator. Read more
source§

fn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>where - Self: Sized,

If the iterator yields no elements, Ok(None) will be returned. If the iterator yields -exactly one element, that element will be returned, otherwise an error will be returned -containing an iterator that has the same output as the input iterator. Read more
source§

fn multipeek(self) -> MultiPeek<Self>where - Self: Sized,

An iterator adaptor that allows the user to peek at multiple .next() -values without advancing the base iterator. Read more
source§

fn counts(self) -> HashMap<Self::Item, usize, RandomState>where - Self: Sized, - Self::Item: Eq + Hash,

Collect the items in this iterator and return a HashMap which -contains each item that appears in the iterator and the number -of times it appears. Read more
source§

fn counts_by<K, F>(self, f: F) -> HashMap<K, usize, RandomState>where - Self: Sized, - K: Eq + Hash, - F: FnMut(Self::Item) -> K,

Collect the items in this iterator and return a HashMap which -contains each item that appears in the iterator and the number -of times it appears, -determining identity using a keying function. Read more
source§

fn multiunzip<FromI>(self) -> FromIwhere - Self: Sized + MultiUnzip<FromI>,

Converts an iterator of tuples into a tuple of containers. Read more
source§

impl<IT, A, FromA, B, FromB> MultiUnzip<(FromA, FromB)> for ITwhere - IT: Iterator<Item = (A, B)>, - FromA: Default + Extend<A>, - FromB: Default + Extend<B>,

source§

fn multiunzip(self) -> (FromA, FromB)

Unzip this iterator into multiple collections.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/index.html b/coreutils/dev/uu_numfmt/index.html deleted file mode 100644 index ddef3250f..000000000 --- a/coreutils/dev/uu_numfmt/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_numfmt - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.DELIMITER.html b/coreutils/dev/uu_numfmt/options/constant.DELIMITER.html deleted file mode 100644 index c71566e05..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.DELIMITER.html +++ /dev/null @@ -1 +0,0 @@ -DELIMITER in uu_numfmt::options - Rust

Constant uu_numfmt::options::DELIMITER

source ·
pub const DELIMITER: &str = "delimiter";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.FIELD.html b/coreutils/dev/uu_numfmt/options/constant.FIELD.html deleted file mode 100644 index 72be3cbc7..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.FIELD.html +++ /dev/null @@ -1 +0,0 @@ -FIELD in uu_numfmt::options - Rust

Constant uu_numfmt::options::FIELD

source ·
pub const FIELD: &str = "field";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.FIELD_DEFAULT.html b/coreutils/dev/uu_numfmt/options/constant.FIELD_DEFAULT.html deleted file mode 100644 index eae687d62..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.FIELD_DEFAULT.html +++ /dev/null @@ -1 +0,0 @@ -FIELD_DEFAULT in uu_numfmt::options - Rust
pub const FIELD_DEFAULT: &str = "1";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.FORMAT.html b/coreutils/dev/uu_numfmt/options/constant.FORMAT.html deleted file mode 100644 index d556fb491..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.FORMAT.html +++ /dev/null @@ -1 +0,0 @@ -FORMAT in uu_numfmt::options - Rust

Constant uu_numfmt::options::FORMAT

source ·
pub const FORMAT: &str = "format";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.FROM.html b/coreutils/dev/uu_numfmt/options/constant.FROM.html deleted file mode 100644 index c14829664..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.FROM.html +++ /dev/null @@ -1 +0,0 @@ -FROM in uu_numfmt::options - Rust

Constant uu_numfmt::options::FROM

source ·
pub const FROM: &str = "from";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.FROM_DEFAULT.html b/coreutils/dev/uu_numfmt/options/constant.FROM_DEFAULT.html deleted file mode 100644 index ff0b0baf7..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.FROM_DEFAULT.html +++ /dev/null @@ -1 +0,0 @@ -FROM_DEFAULT in uu_numfmt::options - Rust
pub const FROM_DEFAULT: &str = "none";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.FROM_UNIT.html b/coreutils/dev/uu_numfmt/options/constant.FROM_UNIT.html deleted file mode 100644 index 14ed24777..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.FROM_UNIT.html +++ /dev/null @@ -1 +0,0 @@ -FROM_UNIT in uu_numfmt::options - Rust

Constant uu_numfmt::options::FROM_UNIT

source ·
pub const FROM_UNIT: &str = "from-unit";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.FROM_UNIT_DEFAULT.html b/coreutils/dev/uu_numfmt/options/constant.FROM_UNIT_DEFAULT.html deleted file mode 100644 index 81751fad3..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.FROM_UNIT_DEFAULT.html +++ /dev/null @@ -1 +0,0 @@ -FROM_UNIT_DEFAULT in uu_numfmt::options - Rust
pub const FROM_UNIT_DEFAULT: &str = "1";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.HEADER.html b/coreutils/dev/uu_numfmt/options/constant.HEADER.html deleted file mode 100644 index 24f78d217..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.HEADER.html +++ /dev/null @@ -1 +0,0 @@ -HEADER in uu_numfmt::options - Rust

Constant uu_numfmt::options::HEADER

source ·
pub const HEADER: &str = "header";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.HEADER_DEFAULT.html b/coreutils/dev/uu_numfmt/options/constant.HEADER_DEFAULT.html deleted file mode 100644 index 9ad470f2a..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.HEADER_DEFAULT.html +++ /dev/null @@ -1 +0,0 @@ -HEADER_DEFAULT in uu_numfmt::options - Rust
pub const HEADER_DEFAULT: &str = "1";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.INVALID.html b/coreutils/dev/uu_numfmt/options/constant.INVALID.html deleted file mode 100644 index 321fb2949..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.INVALID.html +++ /dev/null @@ -1 +0,0 @@ -INVALID in uu_numfmt::options - Rust

Constant uu_numfmt::options::INVALID

source ·
pub const INVALID: &str = "invalid";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.NUMBER.html b/coreutils/dev/uu_numfmt/options/constant.NUMBER.html deleted file mode 100644 index ab8f1d9a9..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.NUMBER.html +++ /dev/null @@ -1 +0,0 @@ -NUMBER in uu_numfmt::options - Rust

Constant uu_numfmt::options::NUMBER

source ·
pub const NUMBER: &str = "NUMBER";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.PADDING.html b/coreutils/dev/uu_numfmt/options/constant.PADDING.html deleted file mode 100644 index 9ea3480b1..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.PADDING.html +++ /dev/null @@ -1 +0,0 @@ -PADDING in uu_numfmt::options - Rust

Constant uu_numfmt::options::PADDING

source ·
pub const PADDING: &str = "padding";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.ROUND.html b/coreutils/dev/uu_numfmt/options/constant.ROUND.html deleted file mode 100644 index 1e27097e2..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.ROUND.html +++ /dev/null @@ -1 +0,0 @@ -ROUND in uu_numfmt::options - Rust

Constant uu_numfmt::options::ROUND

source ·
pub const ROUND: &str = "round";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.SUFFIX.html b/coreutils/dev/uu_numfmt/options/constant.SUFFIX.html deleted file mode 100644 index 90776ce9d..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.SUFFIX.html +++ /dev/null @@ -1 +0,0 @@ -SUFFIX in uu_numfmt::options - Rust

Constant uu_numfmt::options::SUFFIX

source ·
pub const SUFFIX: &str = "suffix";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.TO.html b/coreutils/dev/uu_numfmt/options/constant.TO.html deleted file mode 100644 index e0861e77b..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.TO.html +++ /dev/null @@ -1 +0,0 @@ -TO in uu_numfmt::options - Rust

Constant uu_numfmt::options::TO

source ·
pub const TO: &str = "to";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.TO_DEFAULT.html b/coreutils/dev/uu_numfmt/options/constant.TO_DEFAULT.html deleted file mode 100644 index 204a81cf6..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.TO_DEFAULT.html +++ /dev/null @@ -1 +0,0 @@ -TO_DEFAULT in uu_numfmt::options - Rust

Constant uu_numfmt::options::TO_DEFAULT

source ·
pub const TO_DEFAULT: &str = "none";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.TO_UNIT.html b/coreutils/dev/uu_numfmt/options/constant.TO_UNIT.html deleted file mode 100644 index f0cff1146..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.TO_UNIT.html +++ /dev/null @@ -1 +0,0 @@ -TO_UNIT in uu_numfmt::options - Rust

Constant uu_numfmt::options::TO_UNIT

source ·
pub const TO_UNIT: &str = "to-unit";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/constant.TO_UNIT_DEFAULT.html b/coreutils/dev/uu_numfmt/options/constant.TO_UNIT_DEFAULT.html deleted file mode 100644 index c19f47dc9..000000000 --- a/coreutils/dev/uu_numfmt/options/constant.TO_UNIT_DEFAULT.html +++ /dev/null @@ -1 +0,0 @@ -TO_UNIT_DEFAULT in uu_numfmt::options - Rust
pub const TO_UNIT_DEFAULT: &str = "1";
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/enum.InvalidModes.html b/coreutils/dev/uu_numfmt/options/enum.InvalidModes.html deleted file mode 100644 index 68d6e871b..000000000 --- a/coreutils/dev/uu_numfmt/options/enum.InvalidModes.html +++ /dev/null @@ -1,18 +0,0 @@ -InvalidModes in uu_numfmt::options - Rust
pub enum InvalidModes {
-    Abort,
-    Fail,
-    Warn,
-    Ignore,
-}

Variants§

§

Abort

§

Fail

§

Warn

§

Ignore

Trait Implementations§

source§

impl Debug for InvalidModes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for InvalidModes

§

type Err = String

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq<InvalidModes> for InvalidModes

source§

fn eq(&self, other: &InvalidModes) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for InvalidModes

source§

impl StructuralEq for InvalidModes

source§

impl StructuralPartialEq for InvalidModes

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/enum.RoundMethod.html b/coreutils/dev/uu_numfmt/options/enum.RoundMethod.html deleted file mode 100644 index 6e3c55bd6..000000000 --- a/coreutils/dev/uu_numfmt/options/enum.RoundMethod.html +++ /dev/null @@ -1,18 +0,0 @@ -RoundMethod in uu_numfmt::options - Rust
pub enum RoundMethod {
-    Up,
-    Down,
-    FromZero,
-    TowardsZero,
-    Nearest,
-}

Variants§

§

Up

§

Down

§

FromZero

§

TowardsZero

§

Nearest

Implementations§

source§

impl RoundMethod

source

pub fn round(&self, f: f64) -> f64

Trait Implementations§

source§

impl Clone for RoundMethod

source§

fn clone(&self) -> RoundMethod

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for RoundMethod

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/index.html b/coreutils/dev/uu_numfmt/options/index.html deleted file mode 100644 index 30a484b77..000000000 --- a/coreutils/dev/uu_numfmt/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_numfmt::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/sidebar-items.js b/coreutils/dev/uu_numfmt/options/sidebar-items.js deleted file mode 100644 index fdf3a4496..000000000 --- a/coreutils/dev/uu_numfmt/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["DELIMITER","FIELD","FIELD_DEFAULT","FORMAT","FROM","FROM_DEFAULT","FROM_UNIT","FROM_UNIT_DEFAULT","HEADER","HEADER_DEFAULT","INVALID","NUMBER","PADDING","ROUND","SUFFIX","TO","TO_DEFAULT","TO_UNIT","TO_UNIT_DEFAULT"],"enum":["InvalidModes","RoundMethod"],"struct":["FormatOptions","NumfmtOptions","TransformOptions"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/struct.FormatOptions.html b/coreutils/dev/uu_numfmt/options/struct.FormatOptions.html deleted file mode 100644 index b73494755..000000000 --- a/coreutils/dev/uu_numfmt/options/struct.FormatOptions.html +++ /dev/null @@ -1,20 +0,0 @@ -FormatOptions in uu_numfmt::options - Rust
pub struct FormatOptions {
-    pub grouping: bool,
-    pub padding: Option<isize>,
-    pub precision: Option<usize>,
-    pub prefix: String,
-    pub suffix: String,
-    pub zero_padding: bool,
-}

Fields§

§grouping: bool§padding: Option<isize>§precision: Option<usize>§prefix: String§suffix: String§zero_padding: bool

Trait Implementations§

source§

impl Debug for FormatOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for FormatOptions

source§

fn default() -> FormatOptions

Returns the “default value” for a type. Read more
source§

impl FromStr for FormatOptions

§

type Err = String

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq<FormatOptions> for FormatOptions

source§

fn eq(&self, other: &FormatOptions) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for FormatOptions

source§

impl StructuralEq for FormatOptions

source§

impl StructuralPartialEq for FormatOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/struct.NumfmtOptions.html b/coreutils/dev/uu_numfmt/options/struct.NumfmtOptions.html deleted file mode 100644 index 4274785c2..000000000 --- a/coreutils/dev/uu_numfmt/options/struct.NumfmtOptions.html +++ /dev/null @@ -1,21 +0,0 @@ -NumfmtOptions in uu_numfmt::options - Rust
pub struct NumfmtOptions {
-    pub transform: TransformOptions,
-    pub padding: isize,
-    pub header: usize,
-    pub fields: Vec<Range>,
-    pub delimiter: Option<String>,
-    pub round: RoundMethod,
-    pub suffix: Option<String>,
-    pub format: FormatOptions,
-    pub invalid: InvalidModes,
-}

Fields§

§transform: TransformOptions§padding: isize§header: usize§fields: Vec<Range>§delimiter: Option<String>§round: RoundMethod§suffix: Option<String>§format: FormatOptions§invalid: InvalidModes

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/options/struct.TransformOptions.html b/coreutils/dev/uu_numfmt/options/struct.TransformOptions.html deleted file mode 100644 index 07a9f190b..000000000 --- a/coreutils/dev/uu_numfmt/options/struct.TransformOptions.html +++ /dev/null @@ -1,16 +0,0 @@ -TransformOptions in uu_numfmt::options - Rust
pub struct TransformOptions {
-    pub from: Unit,
-    pub from_unit: usize,
-    pub to: Unit,
-    pub to_unit: usize,
-}

Fields§

§from: Unit§from_unit: usize§to: Unit§to_unit: usize

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_numfmt/sidebar-items.js b/coreutils/dev/uu_numfmt/sidebar-items.js deleted file mode 100644 index 1e034ad73..000000000 --- a/coreutils/dev/uu_numfmt/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["errors","format","options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_od/all.html b/coreutils/dev/uu_od/all.html deleted file mode 100644 index e587f8ebc..000000000 --- a/coreutils/dev/uu_od/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_od/fn.uu_app.html b/coreutils/dev/uu_od/fn.uu_app.html deleted file mode 100644 index 4859f0cec..000000000 --- a/coreutils/dev/uu_od/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_od - Rust

Function uu_od::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_od/fn.uumain.html b/coreutils/dev/uu_od/fn.uumain.html deleted file mode 100644 index f952bf235..000000000 --- a/coreutils/dev/uu_od/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_od - Rust

Function uu_od::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_od/index.html b/coreutils/dev/uu_od/index.html deleted file mode 100644 index 6b5f377b9..000000000 --- a/coreutils/dev/uu_od/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_od - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_od/sidebar-items.js b/coreutils/dev/uu_od/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_od/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_paste/all.html b/coreutils/dev/uu_paste/all.html deleted file mode 100644 index 7791cd7f2..000000000 --- a/coreutils/dev/uu_paste/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_paste/fn.uu_app.html b/coreutils/dev/uu_paste/fn.uu_app.html deleted file mode 100644 index 72f5d37f7..000000000 --- a/coreutils/dev/uu_paste/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_paste - Rust

Function uu_paste::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_paste/fn.uumain.html b/coreutils/dev/uu_paste/fn.uumain.html deleted file mode 100644 index 7c5fb8d0f..000000000 --- a/coreutils/dev/uu_paste/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_paste - Rust

Function uu_paste::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_paste/index.html b/coreutils/dev/uu_paste/index.html deleted file mode 100644 index 5ab2fb470..000000000 --- a/coreutils/dev/uu_paste/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_paste - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_paste/sidebar-items.js b/coreutils/dev/uu_paste/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_paste/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_pathchk/all.html b/coreutils/dev/uu_pathchk/all.html deleted file mode 100644 index 57c946947..000000000 --- a/coreutils/dev/uu_pathchk/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_pathchk/fn.uu_app.html b/coreutils/dev/uu_pathchk/fn.uu_app.html deleted file mode 100644 index 7b56a0955..000000000 --- a/coreutils/dev/uu_pathchk/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_pathchk - Rust

Function uu_pathchk::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_pathchk/fn.uumain.html b/coreutils/dev/uu_pathchk/fn.uumain.html deleted file mode 100644 index 4376c1679..000000000 --- a/coreutils/dev/uu_pathchk/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_pathchk - Rust

Function uu_pathchk::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_pathchk/index.html b/coreutils/dev/uu_pathchk/index.html deleted file mode 100644 index 63b2e9ea4..000000000 --- a/coreutils/dev/uu_pathchk/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_pathchk - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_pathchk/sidebar-items.js b/coreutils/dev/uu_pathchk/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_pathchk/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_pinky/all.html b/coreutils/dev/uu_pinky/all.html deleted file mode 100644 index bb87f40b5..000000000 --- a/coreutils/dev/uu_pinky/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Traits

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_pinky/fn.uu_app.html b/coreutils/dev/uu_pinky/fn.uu_app.html deleted file mode 100644 index 6d43c5823..000000000 --- a/coreutils/dev/uu_pinky/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_pinky - Rust

Function uu_pinky::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_pinky/fn.uumain.html b/coreutils/dev/uu_pinky/fn.uumain.html deleted file mode 100644 index 8a89442fb..000000000 --- a/coreutils/dev/uu_pinky/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_pinky - Rust

Function uu_pinky::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_pinky/index.html b/coreutils/dev/uu_pinky/index.html deleted file mode 100644 index b567059aa..000000000 --- a/coreutils/dev/uu_pinky/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_pinky - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_pinky/sidebar-items.js b/coreutils/dev/uu_pinky/sidebar-items.js deleted file mode 100644 index d404bfabc..000000000 --- a/coreutils/dev/uu_pinky/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"trait":["Capitalize"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_pinky/trait.Capitalize.html b/coreutils/dev/uu_pinky/trait.Capitalize.html deleted file mode 100644 index 7760624d5..000000000 --- a/coreutils/dev/uu_pinky/trait.Capitalize.html +++ /dev/null @@ -1,4 +0,0 @@ -Capitalize in uu_pinky - Rust

Trait uu_pinky::Capitalize

source ·
pub trait Capitalize {
-    // Required method
-    fn capitalize(&self) -> String;
-}

Required Methods§

Implementations on Foreign Types§

source§

impl Capitalize for str

Implementors§

\ No newline at end of file diff --git a/coreutils/dev/uu_pr/all.html b/coreutils/dev/uu_pr/all.html deleted file mode 100644 index 9d6635f55..000000000 --- a/coreutils/dev/uu_pr/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_pr/fn.uu_app.html b/coreutils/dev/uu_pr/fn.uu_app.html deleted file mode 100644 index 77649a848..000000000 --- a/coreutils/dev/uu_pr/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_pr - Rust

Function uu_pr::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_pr/fn.uumain.html b/coreutils/dev/uu_pr/fn.uumain.html deleted file mode 100644 index 4c26980bc..000000000 --- a/coreutils/dev/uu_pr/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_pr - Rust

Function uu_pr::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_pr/index.html b/coreutils/dev/uu_pr/index.html deleted file mode 100644 index 97203c512..000000000 --- a/coreutils/dev/uu_pr/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_pr - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_pr/sidebar-items.js b/coreutils/dev/uu_pr/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_pr/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_printenv/all.html b/coreutils/dev/uu_printenv/all.html deleted file mode 100644 index d72212949..000000000 --- a/coreutils/dev/uu_printenv/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_printenv/fn.uu_app.html b/coreutils/dev/uu_printenv/fn.uu_app.html deleted file mode 100644 index 1b5326451..000000000 --- a/coreutils/dev/uu_printenv/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_printenv - Rust

Function uu_printenv::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_printenv/fn.uumain.html b/coreutils/dev/uu_printenv/fn.uumain.html deleted file mode 100644 index b63148687..000000000 --- a/coreutils/dev/uu_printenv/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_printenv - Rust

Function uu_printenv::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_printenv/index.html b/coreutils/dev/uu_printenv/index.html deleted file mode 100644 index 95202d161..000000000 --- a/coreutils/dev/uu_printenv/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_printenv - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_printenv/sidebar-items.js b/coreutils/dev/uu_printenv/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_printenv/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_printf/all.html b/coreutils/dev/uu_printf/all.html deleted file mode 100644 index ce76e0c86..000000000 --- a/coreutils/dev/uu_printf/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_printf/fn.uu_app.html b/coreutils/dev/uu_printf/fn.uu_app.html deleted file mode 100644 index 927ce7587..000000000 --- a/coreutils/dev/uu_printf/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_printf - Rust

Function uu_printf::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_printf/fn.uumain.html b/coreutils/dev/uu_printf/fn.uumain.html deleted file mode 100644 index cea6aa666..000000000 --- a/coreutils/dev/uu_printf/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_printf - Rust

Function uu_printf::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_printf/index.html b/coreutils/dev/uu_printf/index.html deleted file mode 100644 index baf417069..000000000 --- a/coreutils/dev/uu_printf/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_printf - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_printf/sidebar-items.js b/coreutils/dev/uu_printf/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_printf/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_ptx/all.html b/coreutils/dev/uu_ptx/all.html deleted file mode 100644 index 86026a99b..000000000 --- a/coreutils/dev/uu_ptx/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_ptx/fn.uu_app.html b/coreutils/dev/uu_ptx/fn.uu_app.html deleted file mode 100644 index a2c1160e0..000000000 --- a/coreutils/dev/uu_ptx/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_ptx - Rust

Function uu_ptx::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_ptx/fn.uumain.html b/coreutils/dev/uu_ptx/fn.uumain.html deleted file mode 100644 index 6bb312f55..000000000 --- a/coreutils/dev/uu_ptx/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_ptx - Rust

Function uu_ptx::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_ptx/index.html b/coreutils/dev/uu_ptx/index.html deleted file mode 100644 index a531cb1d4..000000000 --- a/coreutils/dev/uu_ptx/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_ptx - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_ptx/sidebar-items.js b/coreutils/dev/uu_ptx/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_ptx/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_pwd/all.html b/coreutils/dev/uu_pwd/all.html deleted file mode 100644 index f39473d79..000000000 --- a/coreutils/dev/uu_pwd/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_pwd/fn.uu_app.html b/coreutils/dev/uu_pwd/fn.uu_app.html deleted file mode 100644 index fd61be522..000000000 --- a/coreutils/dev/uu_pwd/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_pwd - Rust

Function uu_pwd::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_pwd/fn.uumain.html b/coreutils/dev/uu_pwd/fn.uumain.html deleted file mode 100644 index 07418c73b..000000000 --- a/coreutils/dev/uu_pwd/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_pwd - Rust

Function uu_pwd::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_pwd/index.html b/coreutils/dev/uu_pwd/index.html deleted file mode 100644 index aeca59026..000000000 --- a/coreutils/dev/uu_pwd/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_pwd - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_pwd/sidebar-items.js b/coreutils/dev/uu_pwd/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_pwd/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_readlink/all.html b/coreutils/dev/uu_readlink/all.html deleted file mode 100644 index c6d72651c..000000000 --- a/coreutils/dev/uu_readlink/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_readlink/fn.uu_app.html b/coreutils/dev/uu_readlink/fn.uu_app.html deleted file mode 100644 index 744feea78..000000000 --- a/coreutils/dev/uu_readlink/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_readlink - Rust

Function uu_readlink::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_readlink/fn.uumain.html b/coreutils/dev/uu_readlink/fn.uumain.html deleted file mode 100644 index b550c0a24..000000000 --- a/coreutils/dev/uu_readlink/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_readlink - Rust

Function uu_readlink::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_readlink/index.html b/coreutils/dev/uu_readlink/index.html deleted file mode 100644 index 3ff5fd605..000000000 --- a/coreutils/dev/uu_readlink/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_readlink - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_readlink/sidebar-items.js b/coreutils/dev/uu_readlink/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_readlink/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_realpath/all.html b/coreutils/dev/uu_realpath/all.html deleted file mode 100644 index 853c2f8a3..000000000 --- a/coreutils/dev/uu_realpath/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_realpath/fn.uu_app.html b/coreutils/dev/uu_realpath/fn.uu_app.html deleted file mode 100644 index 81caad489..000000000 --- a/coreutils/dev/uu_realpath/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_realpath - Rust

Function uu_realpath::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_realpath/fn.uumain.html b/coreutils/dev/uu_realpath/fn.uumain.html deleted file mode 100644 index 77542de76..000000000 --- a/coreutils/dev/uu_realpath/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_realpath - Rust

Function uu_realpath::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_realpath/index.html b/coreutils/dev/uu_realpath/index.html deleted file mode 100644 index f21065066..000000000 --- a/coreutils/dev/uu_realpath/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_realpath - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_realpath/sidebar-items.js b/coreutils/dev/uu_realpath/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_realpath/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_relpath/all.html b/coreutils/dev/uu_relpath/all.html deleted file mode 100644 index dea1d35f5..000000000 --- a/coreutils/dev/uu_relpath/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_relpath/fn.uu_app.html b/coreutils/dev/uu_relpath/fn.uu_app.html deleted file mode 100644 index e4458b731..000000000 --- a/coreutils/dev/uu_relpath/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_relpath - Rust

Function uu_relpath::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_relpath/fn.uumain.html b/coreutils/dev/uu_relpath/fn.uumain.html deleted file mode 100644 index 66a8a2677..000000000 --- a/coreutils/dev/uu_relpath/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_relpath - Rust

Function uu_relpath::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_relpath/index.html b/coreutils/dev/uu_relpath/index.html deleted file mode 100644 index 3be320428..000000000 --- a/coreutils/dev/uu_relpath/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_relpath - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_relpath/sidebar-items.js b/coreutils/dev/uu_relpath/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_relpath/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_rm/all.html b/coreutils/dev/uu_rm/all.html deleted file mode 100644 index d7e3c51ce..000000000 --- a/coreutils/dev/uu_rm/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_rm/fn.uu_app.html b/coreutils/dev/uu_rm/fn.uu_app.html deleted file mode 100644 index 2f443cbeb..000000000 --- a/coreutils/dev/uu_rm/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_rm - Rust

Function uu_rm::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_rm/fn.uumain.html b/coreutils/dev/uu_rm/fn.uumain.html deleted file mode 100644 index 2ba2e4dbd..000000000 --- a/coreutils/dev/uu_rm/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_rm - Rust

Function uu_rm::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_rm/index.html b/coreutils/dev/uu_rm/index.html deleted file mode 100644 index 1c488795e..000000000 --- a/coreutils/dev/uu_rm/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_rm - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_rm/sidebar-items.js b/coreutils/dev/uu_rm/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_rm/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_rmdir/all.html b/coreutils/dev/uu_rmdir/all.html deleted file mode 100644 index 35d53b813..000000000 --- a/coreutils/dev/uu_rmdir/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_rmdir/fn.uu_app.html b/coreutils/dev/uu_rmdir/fn.uu_app.html deleted file mode 100644 index 535e82ae7..000000000 --- a/coreutils/dev/uu_rmdir/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_rmdir - Rust

Function uu_rmdir::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_rmdir/fn.uumain.html b/coreutils/dev/uu_rmdir/fn.uumain.html deleted file mode 100644 index e4f68d530..000000000 --- a/coreutils/dev/uu_rmdir/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_rmdir - Rust

Function uu_rmdir::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_rmdir/index.html b/coreutils/dev/uu_rmdir/index.html deleted file mode 100644 index f812c1c21..000000000 --- a/coreutils/dev/uu_rmdir/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_rmdir - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_rmdir/sidebar-items.js b/coreutils/dev/uu_rmdir/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_rmdir/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_runcon/all.html b/coreutils/dev/uu_runcon/all.html deleted file mode 100644 index d997cd5f9..000000000 --- a/coreutils/dev/uu_runcon/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/fn.uu_app.html b/coreutils/dev/uu_runcon/fn.uu_app.html deleted file mode 100644 index d11012844..000000000 --- a/coreutils/dev/uu_runcon/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_runcon - Rust

Function uu_runcon::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/fn.uumain.html b/coreutils/dev/uu_runcon/fn.uumain.html deleted file mode 100644 index d965d3a31..000000000 --- a/coreutils/dev/uu_runcon/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_runcon - Rust

Function uu_runcon::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/index.html b/coreutils/dev/uu_runcon/index.html deleted file mode 100644 index 1b86c9909..000000000 --- a/coreutils/dev/uu_runcon/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_runcon - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/options/constant.COMPUTE.html b/coreutils/dev/uu_runcon/options/constant.COMPUTE.html deleted file mode 100644 index c3d87863b..000000000 --- a/coreutils/dev/uu_runcon/options/constant.COMPUTE.html +++ /dev/null @@ -1 +0,0 @@ -COMPUTE in uu_runcon::options - Rust

Constant uu_runcon::options::COMPUTE

source ·
pub const COMPUTE: &str = "compute";
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/options/constant.RANGE.html b/coreutils/dev/uu_runcon/options/constant.RANGE.html deleted file mode 100644 index 8257998ea..000000000 --- a/coreutils/dev/uu_runcon/options/constant.RANGE.html +++ /dev/null @@ -1 +0,0 @@ -RANGE in uu_runcon::options - Rust

Constant uu_runcon::options::RANGE

source ·
pub const RANGE: &str = "range";
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/options/constant.ROLE.html b/coreutils/dev/uu_runcon/options/constant.ROLE.html deleted file mode 100644 index 3d6a54aae..000000000 --- a/coreutils/dev/uu_runcon/options/constant.ROLE.html +++ /dev/null @@ -1 +0,0 @@ -ROLE in uu_runcon::options - Rust

Constant uu_runcon::options::ROLE

source ·
pub const ROLE: &str = "role";
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/options/constant.TYPE.html b/coreutils/dev/uu_runcon/options/constant.TYPE.html deleted file mode 100644 index 8c5db2a8f..000000000 --- a/coreutils/dev/uu_runcon/options/constant.TYPE.html +++ /dev/null @@ -1 +0,0 @@ -TYPE in uu_runcon::options - Rust

Constant uu_runcon::options::TYPE

source ·
pub const TYPE: &str = "type";
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/options/constant.USER.html b/coreutils/dev/uu_runcon/options/constant.USER.html deleted file mode 100644 index 10ef52316..000000000 --- a/coreutils/dev/uu_runcon/options/constant.USER.html +++ /dev/null @@ -1 +0,0 @@ -USER in uu_runcon::options - Rust

Constant uu_runcon::options::USER

source ·
pub const USER: &str = "user";
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/options/index.html b/coreutils/dev/uu_runcon/options/index.html deleted file mode 100644 index e99ddeef7..000000000 --- a/coreutils/dev/uu_runcon/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_runcon::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_runcon/options/sidebar-items.js b/coreutils/dev/uu_runcon/options/sidebar-items.js deleted file mode 100644 index 05a1ecd64..000000000 --- a/coreutils/dev/uu_runcon/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["COMPUTE","RANGE","ROLE","TYPE","USER"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_runcon/sidebar-items.js b/coreutils/dev/uu_runcon/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_runcon/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_seq/all.html b/coreutils/dev/uu_seq/all.html deleted file mode 100644 index 11ad18da8..000000000 --- a/coreutils/dev/uu_seq/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_seq/fn.uu_app.html b/coreutils/dev/uu_seq/fn.uu_app.html deleted file mode 100644 index 05749a893..000000000 --- a/coreutils/dev/uu_seq/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_seq - Rust

Function uu_seq::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_seq/fn.uumain.html b/coreutils/dev/uu_seq/fn.uumain.html deleted file mode 100644 index ae07bf828..000000000 --- a/coreutils/dev/uu_seq/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_seq - Rust

Function uu_seq::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_seq/index.html b/coreutils/dev/uu_seq/index.html deleted file mode 100644 index bcb062f60..000000000 --- a/coreutils/dev/uu_seq/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_seq - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_seq/sidebar-items.js b/coreutils/dev/uu_seq/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_seq/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_shred/all.html b/coreutils/dev/uu_shred/all.html deleted file mode 100644 index 72b03fae6..000000000 --- a/coreutils/dev/uu_shred/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/fn.uu_app.html b/coreutils/dev/uu_shred/fn.uu_app.html deleted file mode 100644 index 0a29c9442..000000000 --- a/coreutils/dev/uu_shred/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_shred - Rust

Function uu_shred::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/fn.uumain.html b/coreutils/dev/uu_shred/fn.uumain.html deleted file mode 100644 index f99337e8d..000000000 --- a/coreutils/dev/uu_shred/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_shred - Rust

Function uu_shred::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/index.html b/coreutils/dev/uu_shred/index.html deleted file mode 100644 index d98fbcdab..000000000 --- a/coreutils/dev/uu_shred/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_shred - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/constant.EXACT.html b/coreutils/dev/uu_shred/options/constant.EXACT.html deleted file mode 100644 index 03635a843..000000000 --- a/coreutils/dev/uu_shred/options/constant.EXACT.html +++ /dev/null @@ -1 +0,0 @@ -EXACT in uu_shred::options - Rust

Constant uu_shred::options::EXACT

source ·
pub const EXACT: &str = "exact";
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/constant.FILE.html b/coreutils/dev/uu_shred/options/constant.FILE.html deleted file mode 100644 index ab2e66923..000000000 --- a/coreutils/dev/uu_shred/options/constant.FILE.html +++ /dev/null @@ -1 +0,0 @@ -FILE in uu_shred::options - Rust

Constant uu_shred::options::FILE

source ·
pub const FILE: &str = "file";
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/constant.FORCE.html b/coreutils/dev/uu_shred/options/constant.FORCE.html deleted file mode 100644 index c7c0500a1..000000000 --- a/coreutils/dev/uu_shred/options/constant.FORCE.html +++ /dev/null @@ -1 +0,0 @@ -FORCE in uu_shred::options - Rust

Constant uu_shred::options::FORCE

source ·
pub const FORCE: &str = "force";
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/constant.ITERATIONS.html b/coreutils/dev/uu_shred/options/constant.ITERATIONS.html deleted file mode 100644 index fab0bfb7d..000000000 --- a/coreutils/dev/uu_shred/options/constant.ITERATIONS.html +++ /dev/null @@ -1 +0,0 @@ -ITERATIONS in uu_shred::options - Rust

Constant uu_shred::options::ITERATIONS

source ·
pub const ITERATIONS: &str = "iterations";
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/constant.REMOVE.html b/coreutils/dev/uu_shred/options/constant.REMOVE.html deleted file mode 100644 index be5f3161e..000000000 --- a/coreutils/dev/uu_shred/options/constant.REMOVE.html +++ /dev/null @@ -1 +0,0 @@ -REMOVE in uu_shred::options - Rust

Constant uu_shred::options::REMOVE

source ·
pub const REMOVE: &str = "remove";
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/constant.SIZE.html b/coreutils/dev/uu_shred/options/constant.SIZE.html deleted file mode 100644 index ed9e82bd2..000000000 --- a/coreutils/dev/uu_shred/options/constant.SIZE.html +++ /dev/null @@ -1 +0,0 @@ -SIZE in uu_shred::options - Rust

Constant uu_shred::options::SIZE

source ·
pub const SIZE: &str = "size";
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/constant.VERBOSE.html b/coreutils/dev/uu_shred/options/constant.VERBOSE.html deleted file mode 100644 index 88b465918..000000000 --- a/coreutils/dev/uu_shred/options/constant.VERBOSE.html +++ /dev/null @@ -1 +0,0 @@ -VERBOSE in uu_shred::options - Rust

Constant uu_shred::options::VERBOSE

source ·
pub const VERBOSE: &str = "verbose";
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/constant.ZERO.html b/coreutils/dev/uu_shred/options/constant.ZERO.html deleted file mode 100644 index 323ba8ff9..000000000 --- a/coreutils/dev/uu_shred/options/constant.ZERO.html +++ /dev/null @@ -1 +0,0 @@ -ZERO in uu_shred::options - Rust

Constant uu_shred::options::ZERO

source ·
pub const ZERO: &str = "zero";
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/index.html b/coreutils/dev/uu_shred/options/index.html deleted file mode 100644 index 848aee37e..000000000 --- a/coreutils/dev/uu_shred/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_shred::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_shred/options/sidebar-items.js b/coreutils/dev/uu_shred/options/sidebar-items.js deleted file mode 100644 index 38a4fe5c1..000000000 --- a/coreutils/dev/uu_shred/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["EXACT","FILE","FORCE","ITERATIONS","REMOVE","SIZE","VERBOSE","ZERO"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_shred/sidebar-items.js b/coreutils/dev/uu_shred/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_shred/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_shuf/all.html b/coreutils/dev/uu_shuf/all.html deleted file mode 100644 index 4edef59c1..000000000 --- a/coreutils/dev/uu_shuf/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_shuf/fn.uu_app.html b/coreutils/dev/uu_shuf/fn.uu_app.html deleted file mode 100644 index ff9175e4e..000000000 --- a/coreutils/dev/uu_shuf/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_shuf - Rust

Function uu_shuf::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_shuf/fn.uumain.html b/coreutils/dev/uu_shuf/fn.uumain.html deleted file mode 100644 index 3f609b73a..000000000 --- a/coreutils/dev/uu_shuf/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_shuf - Rust

Function uu_shuf::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_shuf/index.html b/coreutils/dev/uu_shuf/index.html deleted file mode 100644 index 17e4274b2..000000000 --- a/coreutils/dev/uu_shuf/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_shuf - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_shuf/sidebar-items.js b/coreutils/dev/uu_shuf/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_shuf/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_sleep/all.html b/coreutils/dev/uu_sleep/all.html deleted file mode 100644 index 992cce5d7..000000000 --- a/coreutils/dev/uu_sleep/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_sleep/fn.uu_app.html b/coreutils/dev/uu_sleep/fn.uu_app.html deleted file mode 100644 index b1e52a440..000000000 --- a/coreutils/dev/uu_sleep/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_sleep - Rust

Function uu_sleep::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_sleep/fn.uumain.html b/coreutils/dev/uu_sleep/fn.uumain.html deleted file mode 100644 index 23aca60d0..000000000 --- a/coreutils/dev/uu_sleep/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_sleep - Rust

Function uu_sleep::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_sleep/index.html b/coreutils/dev/uu_sleep/index.html deleted file mode 100644 index 9f4e72f22..000000000 --- a/coreutils/dev/uu_sleep/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_sleep - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_sleep/sidebar-items.js b/coreutils/dev/uu_sleep/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_sleep/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_sort/all.html b/coreutils/dev/uu_sort/all.html deleted file mode 100644 index f3b8fd1c0..000000000 --- a/coreutils/dev/uu_sort/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_sort/enum.GeneralF64ParseResult.html b/coreutils/dev/uu_sort/enum.GeneralF64ParseResult.html deleted file mode 100644 index 1770d5692..000000000 --- a/coreutils/dev/uu_sort/enum.GeneralF64ParseResult.html +++ /dev/null @@ -1,23 +0,0 @@ -GeneralF64ParseResult in uu_sort - Rust
pub enum GeneralF64ParseResult {
-    Invalid,
-    NaN,
-    NegInfinity,
-    Number(f64),
-    Infinity,
-}

Variants§

§

Invalid

§

NaN

§

NegInfinity

§

Number(f64)

§

Infinity

Trait Implementations§

source§

impl Clone for GeneralF64ParseResult

source§

fn clone(&self) -> GeneralF64ParseResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GeneralF64ParseResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<GeneralF64ParseResult> for GeneralF64ParseResult

source§

fn eq(&self, other: &GeneralF64ParseResult) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<GeneralF64ParseResult> for GeneralF64ParseResult

source§

fn partial_cmp(&self, other: &GeneralF64ParseResult) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for GeneralF64ParseResult

source§

impl StructuralPartialEq for GeneralF64ParseResult

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere - V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/coreutils/dev/uu_sort/fn.uu_app.html b/coreutils/dev/uu_sort/fn.uu_app.html deleted file mode 100644 index 98e73b152..000000000 --- a/coreutils/dev/uu_sort/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_sort - Rust

Function uu_sort::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_sort/fn.uumain.html b/coreutils/dev/uu_sort/fn.uumain.html deleted file mode 100644 index a28cb9a8e..000000000 --- a/coreutils/dev/uu_sort/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_sort - Rust

Function uu_sort::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_sort/index.html b/coreutils/dev/uu_sort/index.html deleted file mode 100644 index 341a89113..000000000 --- a/coreutils/dev/uu_sort/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_sort - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_sort/sidebar-items.js b/coreutils/dev/uu_sort/sidebar-items.js deleted file mode 100644 index 1461910f6..000000000 --- a/coreutils/dev/uu_sort/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["GeneralF64ParseResult"],"fn":["uu_app","uumain"],"struct":["GlobalSettings","Line","Output"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_sort/struct.GlobalSettings.html b/coreutils/dev/uu_sort/struct.GlobalSettings.html deleted file mode 100644 index 247fae5fc..000000000 --- a/coreutils/dev/uu_sort/struct.GlobalSettings.html +++ /dev/null @@ -1,13 +0,0 @@ -GlobalSettings in uu_sort - Rust

Struct uu_sort::GlobalSettings

source ·
pub struct GlobalSettings { /* private fields */ }

Trait Implementations§

source§

impl Clone for GlobalSettings

source§

fn clone(&self) -> GlobalSettings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for GlobalSettings

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere - V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/coreutils/dev/uu_sort/struct.Line.html b/coreutils/dev/uu_sort/struct.Line.html deleted file mode 100644 index e916e6f81..000000000 --- a/coreutils/dev/uu_sort/struct.Line.html +++ /dev/null @@ -1,13 +0,0 @@ -Line in uu_sort - Rust

Struct uu_sort::Line

source ·
pub struct Line<'a> { /* private fields */ }

Trait Implementations§

source§

impl<'a> Clone for Line<'a>

source§

fn clone(&self) -> Line<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for Line<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Line<'a>

§

impl<'a> Send for Line<'a>

§

impl<'a> Sync for Line<'a>

§

impl<'a> Unpin for Line<'a>

§

impl<'a> UnwindSafe for Line<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere - V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/coreutils/dev/uu_sort/struct.Output.html b/coreutils/dev/uu_sort/struct.Output.html deleted file mode 100644 index 5f4234ed8..000000000 --- a/coreutils/dev/uu_sort/struct.Output.html +++ /dev/null @@ -1,12 +0,0 @@ -Output in uu_sort - Rust

Struct uu_sort::Output

source ·
pub struct Output { /* private fields */ }

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere - V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/coreutils/dev/uu_split/all.html b/coreutils/dev/uu_split/all.html deleted file mode 100644 index c6a735998..000000000 --- a/coreutils/dev/uu_split/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_split/fn.uu_app.html b/coreutils/dev/uu_split/fn.uu_app.html deleted file mode 100644 index 209119401..000000000 --- a/coreutils/dev/uu_split/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_split - Rust

Function uu_split::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_split/fn.uumain.html b/coreutils/dev/uu_split/fn.uumain.html deleted file mode 100644 index ca62c8e08..000000000 --- a/coreutils/dev/uu_split/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_split - Rust

Function uu_split::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_split/index.html b/coreutils/dev/uu_split/index.html deleted file mode 100644 index d753dd9a4..000000000 --- a/coreutils/dev/uu_split/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_split - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_split/sidebar-items.js b/coreutils/dev/uu_split/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_split/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_stat/all.html b/coreutils/dev/uu_stat/all.html deleted file mode 100644 index ebed4dc16..000000000 --- a/coreutils/dev/uu_stat/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Enums

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_stat/enum.OutputType.html b/coreutils/dev/uu_stat/enum.OutputType.html deleted file mode 100644 index f37424006..000000000 --- a/coreutils/dev/uu_stat/enum.OutputType.html +++ /dev/null @@ -1,18 +0,0 @@ -OutputType in uu_stat - Rust

Enum uu_stat::OutputType

source ·
pub enum OutputType {
-    Str(String),
-    Integer(i64),
-    Unsigned(u64),
-    UnsignedHex(u64),
-    UnsignedOct(u32),
-    Unknown,
-}

Variants§

§

Str(String)

§

Integer(i64)

§

Unsigned(u64)

§

UnsignedHex(u64)

§

UnsignedOct(u32)

§

Unknown

Trait Implementations§

source§

impl Debug for OutputType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_stat/fn.uu_app.html b/coreutils/dev/uu_stat/fn.uu_app.html deleted file mode 100644 index a94df6de1..000000000 --- a/coreutils/dev/uu_stat/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_stat - Rust

Function uu_stat::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_stat/fn.uumain.html b/coreutils/dev/uu_stat/fn.uumain.html deleted file mode 100644 index 54216526e..000000000 --- a/coreutils/dev/uu_stat/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_stat - Rust

Function uu_stat::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_stat/index.html b/coreutils/dev/uu_stat/index.html deleted file mode 100644 index 235b67ce9..000000000 --- a/coreutils/dev/uu_stat/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_stat - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_stat/sidebar-items.js b/coreutils/dev/uu_stat/sidebar-items.js deleted file mode 100644 index 2a5e68235..000000000 --- a/coreutils/dev/uu_stat/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["OutputType"],"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_stdbuf/all.html b/coreutils/dev/uu_stdbuf/all.html deleted file mode 100644 index bef42770f..000000000 --- a/coreutils/dev/uu_stdbuf/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_stdbuf/fn.uu_app.html b/coreutils/dev/uu_stdbuf/fn.uu_app.html deleted file mode 100644 index efd3edf2a..000000000 --- a/coreutils/dev/uu_stdbuf/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_stdbuf - Rust

Function uu_stdbuf::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_stdbuf/fn.uumain.html b/coreutils/dev/uu_stdbuf/fn.uumain.html deleted file mode 100644 index 5bd439b28..000000000 --- a/coreutils/dev/uu_stdbuf/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_stdbuf - Rust

Function uu_stdbuf::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_stdbuf/index.html b/coreutils/dev/uu_stdbuf/index.html deleted file mode 100644 index 8cc600d05..000000000 --- a/coreutils/dev/uu_stdbuf/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_stdbuf - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_stdbuf/sidebar-items.js b/coreutils/dev/uu_stdbuf/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_stdbuf/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_stty/all.html b/coreutils/dev/uu_stty/all.html deleted file mode 100644 index 85bad1460..000000000 --- a/coreutils/dev/uu_stty/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_stty/fn.tiocgwinsz.html b/coreutils/dev/uu_stty/fn.tiocgwinsz.html deleted file mode 100644 index b240d61a9..000000000 --- a/coreutils/dev/uu_stty/fn.tiocgwinsz.html +++ /dev/null @@ -1,2 +0,0 @@ -tiocgwinsz in uu_stty - Rust

Function uu_stty::tiocgwinsz

source ·
pub unsafe fn tiocgwinsz(fd: c_int, data: *mut TermSize) -> Result<c_int>
Expand description

Get terminal window size

-
\ No newline at end of file diff --git a/coreutils/dev/uu_stty/fn.tiocswinsz.html b/coreutils/dev/uu_stty/fn.tiocswinsz.html deleted file mode 100644 index a30794bea..000000000 --- a/coreutils/dev/uu_stty/fn.tiocswinsz.html +++ /dev/null @@ -1,2 +0,0 @@ -tiocswinsz in uu_stty - Rust

Function uu_stty::tiocswinsz

source ·
pub unsafe fn tiocswinsz(fd: c_int, data: *const TermSize) -> Result<c_int>
Expand description

Set terminal window size

-
\ No newline at end of file diff --git a/coreutils/dev/uu_stty/fn.uu_app.html b/coreutils/dev/uu_stty/fn.uu_app.html deleted file mode 100644 index 311388d91..000000000 --- a/coreutils/dev/uu_stty/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_stty - Rust

Function uu_stty::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_stty/fn.uumain.html b/coreutils/dev/uu_stty/fn.uumain.html deleted file mode 100644 index 9ae202269..000000000 --- a/coreutils/dev/uu_stty/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_stty - Rust

Function uu_stty::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_stty/index.html b/coreutils/dev/uu_stty/index.html deleted file mode 100644 index c620689ee..000000000 --- a/coreutils/dev/uu_stty/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_stty - Rust

Crate uu_stty

source ·

Structs

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_stty/sidebar-items.js b/coreutils/dev/uu_stty/sidebar-items.js deleted file mode 100644 index cc0a9a784..000000000 --- a/coreutils/dev/uu_stty/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["tiocgwinsz","tiocswinsz","uu_app","uumain"],"struct":["Flag","TermSize"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_stty/struct.Flag.html b/coreutils/dev/uu_stty/struct.Flag.html deleted file mode 100644 index 9cd75a5b5..000000000 --- a/coreutils/dev/uu_stty/struct.Flag.html +++ /dev/null @@ -1,17 +0,0 @@ -Flag in uu_stty - Rust

Struct uu_stty::Flag

source ·
pub struct Flag<T> { /* private fields */ }

Implementations§

source§

impl<T> Flag<T>

source

pub const fn new(name: &'static str, flag: T) -> Self

source

pub const fn new_grouped(name: &'static str, flag: T, group: T) -> Self

source

pub const fn hidden(self) -> Self

source

pub const fn sane(self) -> Self

Trait Implementations§

source§

impl<T: Clone> Clone for Flag<T>

source§

fn clone(&self) -> Flag<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Flag<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Copy> Copy for Flag<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Flag<T>where - T: RefUnwindSafe,

§

impl<T> Send for Flag<T>where - T: Send,

§

impl<T> Sync for Flag<T>where - T: Sync,

§

impl<T> Unpin for Flag<T>where - T: Unpin,

§

impl<T> UnwindSafe for Flag<T>where - T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_stty/struct.TermSize.html b/coreutils/dev/uu_stty/struct.TermSize.html deleted file mode 100644 index 2ee67e6a1..000000000 --- a/coreutils/dev/uu_stty/struct.TermSize.html +++ /dev/null @@ -1,11 +0,0 @@ -TermSize in uu_stty - Rust

Struct uu_stty::TermSize

source ·
#[repr(C)]
pub struct TermSize { /* private fields */ }

Trait Implementations§

source§

impl Debug for TermSize

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TermSize

source§

fn default() -> TermSize

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_sum/all.html b/coreutils/dev/uu_sum/all.html deleted file mode 100644 index a0f68d119..000000000 --- a/coreutils/dev/uu_sum/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_sum/fn.uu_app.html b/coreutils/dev/uu_sum/fn.uu_app.html deleted file mode 100644 index 4791dd18b..000000000 --- a/coreutils/dev/uu_sum/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_sum - Rust

Function uu_sum::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_sum/fn.uumain.html b/coreutils/dev/uu_sum/fn.uumain.html deleted file mode 100644 index 5328bdaad..000000000 --- a/coreutils/dev/uu_sum/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_sum - Rust

Function uu_sum::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_sum/index.html b/coreutils/dev/uu_sum/index.html deleted file mode 100644 index 2139831d3..000000000 --- a/coreutils/dev/uu_sum/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_sum - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_sum/sidebar-items.js b/coreutils/dev/uu_sum/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_sum/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_sync/all.html b/coreutils/dev/uu_sync/all.html deleted file mode 100644 index a3fa66fa7..000000000 --- a/coreutils/dev/uu_sync/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

Statics

\ No newline at end of file diff --git a/coreutils/dev/uu_sync/fn.uu_app.html b/coreutils/dev/uu_sync/fn.uu_app.html deleted file mode 100644 index 82ec857c0..000000000 --- a/coreutils/dev/uu_sync/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_sync - Rust

Function uu_sync::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_sync/fn.uumain.html b/coreutils/dev/uu_sync/fn.uumain.html deleted file mode 100644 index 5d031a7e8..000000000 --- a/coreutils/dev/uu_sync/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_sync - Rust

Function uu_sync::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_sync/index.html b/coreutils/dev/uu_sync/index.html deleted file mode 100644 index dc43c78c6..000000000 --- a/coreutils/dev/uu_sync/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_sync - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_sync/options/index.html b/coreutils/dev/uu_sync/options/index.html deleted file mode 100644 index 60a3c8b6c..000000000 --- a/coreutils/dev/uu_sync/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_sync::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_sync/options/sidebar-items.js b/coreutils/dev/uu_sync/options/sidebar-items.js deleted file mode 100644 index 9254b7bb9..000000000 --- a/coreutils/dev/uu_sync/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["DATA","FILE_SYSTEM"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_sync/options/static.DATA.html b/coreutils/dev/uu_sync/options/static.DATA.html deleted file mode 100644 index c54d8bfef..000000000 --- a/coreutils/dev/uu_sync/options/static.DATA.html +++ /dev/null @@ -1 +0,0 @@ -DATA in uu_sync::options - Rust

Static uu_sync::options::DATA

source ·
pub static DATA: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_sync/options/static.FILE_SYSTEM.html b/coreutils/dev/uu_sync/options/static.FILE_SYSTEM.html deleted file mode 100644 index 2eb824f84..000000000 --- a/coreutils/dev/uu_sync/options/static.FILE_SYSTEM.html +++ /dev/null @@ -1 +0,0 @@ -FILE_SYSTEM in uu_sync::options - Rust
pub static FILE_SYSTEM: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_sync/sidebar-items.js b/coreutils/dev/uu_sync/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_sync/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tac/all.html b/coreutils/dev/uu_tac/all.html deleted file mode 100644 index 73ff5509b..000000000 --- a/coreutils/dev/uu_tac/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_tac/fn.uu_app.html b/coreutils/dev/uu_tac/fn.uu_app.html deleted file mode 100644 index e18adf3e9..000000000 --- a/coreutils/dev/uu_tac/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_tac - Rust

Function uu_tac::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_tac/fn.uumain.html b/coreutils/dev/uu_tac/fn.uumain.html deleted file mode 100644 index 8d9b20cd2..000000000 --- a/coreutils/dev/uu_tac/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_tac - Rust

Function uu_tac::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_tac/index.html b/coreutils/dev/uu_tac/index.html deleted file mode 100644 index 8787f26cf..000000000 --- a/coreutils/dev/uu_tac/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_tac - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_tac/sidebar-items.js b/coreutils/dev/uu_tac/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_tac/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tail/all.html b/coreutils/dev/uu_tail/all.html deleted file mode 100644 index 39a64438f..000000000 --- a/coreutils/dev/uu_tail/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/enum.FilterMode.html b/coreutils/dev/uu_tail/args/enum.FilterMode.html deleted file mode 100644 index 1be5dd264..000000000 --- a/coreutils/dev/uu_tail/args/enum.FilterMode.html +++ /dev/null @@ -1,17 +0,0 @@ -FilterMode in uu_tail::args - Rust

Enum uu_tail::args::FilterMode

source ·
pub enum FilterMode {
-    Bytes(Signum),
-    Lines(Signum, u8),
-}

Variants§

§

Bytes(Signum)

§

Lines(Signum, u8)

Mode for lines delimited by delimiter as u8

-

Trait Implementations§

source§

impl Debug for FilterMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for FilterMode

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq<FilterMode> for FilterMode

source§

fn eq(&self, other: &FilterMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for FilterMode

source§

impl StructuralEq for FilterMode

source§

impl StructuralPartialEq for FilterMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/enum.FollowMode.html b/coreutils/dev/uu_tail/args/enum.FollowMode.html deleted file mode 100644 index 27e21cc46..000000000 --- a/coreutils/dev/uu_tail/args/enum.FollowMode.html +++ /dev/null @@ -1,17 +0,0 @@ -FollowMode in uu_tail::args - Rust

Enum uu_tail::args::FollowMode

source ·
pub enum FollowMode {
-    Descriptor,
-    Name,
-}

Variants§

§

Descriptor

§

Name

Trait Implementations§

source§

impl Clone for FollowMode

source§

fn clone(&self) -> FollowMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FollowMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<FollowMode> for FollowMode

source§

fn eq(&self, other: &FollowMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for FollowMode

source§

impl Eq for FollowMode

source§

impl StructuralEq for FollowMode

source§

impl StructuralPartialEq for FollowMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/enum.Signum.html b/coreutils/dev/uu_tail/args/enum.Signum.html deleted file mode 100644 index ba7c902ea..000000000 --- a/coreutils/dev/uu_tail/args/enum.Signum.html +++ /dev/null @@ -1,19 +0,0 @@ -Signum in uu_tail::args - Rust

Enum uu_tail::args::Signum

source ·
pub enum Signum {
-    Negative(u64),
-    Positive(u64),
-    PlusZero,
-    MinusZero,
-}

Variants§

§

Negative(u64)

§

Positive(u64)

§

PlusZero

§

MinusZero

Trait Implementations§

source§

impl Clone for Signum

source§

fn clone(&self) -> Signum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Signum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Signum> for Signum

source§

fn eq(&self, other: &Signum) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for Signum

source§

impl Eq for Signum

source§

impl StructuralEq for Signum

source§

impl StructuralPartialEq for Signum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/enum.VerificationResult.html b/coreutils/dev/uu_tail/args/enum.VerificationResult.html deleted file mode 100644 index 69314e6a5..000000000 --- a/coreutils/dev/uu_tail/args/enum.VerificationResult.html +++ /dev/null @@ -1,15 +0,0 @@ -VerificationResult in uu_tail::args - Rust
pub enum VerificationResult {
-    Ok,
-    CannotFollowStdinByName,
-    NoOutput,
-}

Variants§

§

Ok

§

CannotFollowStdinByName

§

NoOutput

Trait Implementations§

source§

impl Debug for VerificationResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/fn.parse_args.html b/coreutils/dev/uu_tail/args/fn.parse_args.html deleted file mode 100644 index 942cc15ba..000000000 --- a/coreutils/dev/uu_tail/args/fn.parse_args.html +++ /dev/null @@ -1 +0,0 @@ -parse_args in uu_tail::args - Rust

Function uu_tail::args::parse_args

source ·
pub fn parse_args(args: impl Args) -> UResult<Settings>
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/fn.parse_obsolete.html b/coreutils/dev/uu_tail/args/fn.parse_obsolete.html deleted file mode 100644 index 504fab0a6..000000000 --- a/coreutils/dev/uu_tail/args/fn.parse_obsolete.html +++ /dev/null @@ -1,4 +0,0 @@ -parse_obsolete in uu_tail::args - Rust

Function uu_tail::args::parse_obsolete

source ·
pub fn parse_obsolete(
-    arg: &OsString,
-    input: Option<&OsString>
-) -> UResult<Option<Settings>>
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/fn.uu_app.html b/coreutils/dev/uu_tail/args/fn.uu_app.html deleted file mode 100644 index 7e6f2a7b6..000000000 --- a/coreutils/dev/uu_tail/args/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_tail::args - Rust

Function uu_tail::args::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/index.html b/coreutils/dev/uu_tail/args/index.html deleted file mode 100644 index 31346e65d..000000000 --- a/coreutils/dev/uu_tail/args/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_tail::args - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.ARG_FILES.html b/coreutils/dev/uu_tail/args/options/constant.ARG_FILES.html deleted file mode 100644 index b5b4b605a..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.ARG_FILES.html +++ /dev/null @@ -1 +0,0 @@ -ARG_FILES in uu_tail::args::options - Rust

Constant uu_tail::args::options::ARG_FILES

source ·
pub const ARG_FILES: &str = "files";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.BYTES.html b/coreutils/dev/uu_tail/args/options/constant.BYTES.html deleted file mode 100644 index 9451d9bcb..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.BYTES.html +++ /dev/null @@ -1 +0,0 @@ -BYTES in uu_tail::args::options - Rust

Constant uu_tail::args::options::BYTES

source ·
pub const BYTES: &str = "bytes";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.DISABLE_INOTIFY_TERM.html b/coreutils/dev/uu_tail/args/options/constant.DISABLE_INOTIFY_TERM.html deleted file mode 100644 index dab690809..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.DISABLE_INOTIFY_TERM.html +++ /dev/null @@ -1 +0,0 @@ -DISABLE_INOTIFY_TERM in uu_tail::args::options - Rust
pub const DISABLE_INOTIFY_TERM: &str = "-disable-inotify";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.FOLLOW.html b/coreutils/dev/uu_tail/args/options/constant.FOLLOW.html deleted file mode 100644 index 59055676e..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.FOLLOW.html +++ /dev/null @@ -1 +0,0 @@ -FOLLOW in uu_tail::args::options - Rust

Constant uu_tail::args::options::FOLLOW

source ·
pub const FOLLOW: &str = "follow";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.FOLLOW_RETRY.html b/coreutils/dev/uu_tail/args/options/constant.FOLLOW_RETRY.html deleted file mode 100644 index 305bd6a7c..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.FOLLOW_RETRY.html +++ /dev/null @@ -1 +0,0 @@ -FOLLOW_RETRY in uu_tail::args::options - Rust

Constant uu_tail::args::options::FOLLOW_RETRY

source ·
pub const FOLLOW_RETRY: &str = "F";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.LINES.html b/coreutils/dev/uu_tail/args/options/constant.LINES.html deleted file mode 100644 index 9c1d9d63d..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.LINES.html +++ /dev/null @@ -1 +0,0 @@ -LINES in uu_tail::args::options - Rust

Constant uu_tail::args::options::LINES

source ·
pub const LINES: &str = "lines";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.MAX_UNCHANGED_STATS.html b/coreutils/dev/uu_tail/args/options/constant.MAX_UNCHANGED_STATS.html deleted file mode 100644 index b2dfcfc77..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.MAX_UNCHANGED_STATS.html +++ /dev/null @@ -1 +0,0 @@ -MAX_UNCHANGED_STATS in uu_tail::args::options - Rust
pub const MAX_UNCHANGED_STATS: &str = "max-unchanged-stats";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.PID.html b/coreutils/dev/uu_tail/args/options/constant.PID.html deleted file mode 100644 index 68f4e3de5..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.PID.html +++ /dev/null @@ -1 +0,0 @@ -PID in uu_tail::args::options - Rust

Constant uu_tail::args::options::PID

source ·
pub const PID: &str = "pid";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.PRESUME_INPUT_PIPE.html b/coreutils/dev/uu_tail/args/options/constant.PRESUME_INPUT_PIPE.html deleted file mode 100644 index 1c65688af..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.PRESUME_INPUT_PIPE.html +++ /dev/null @@ -1 +0,0 @@ -PRESUME_INPUT_PIPE in uu_tail::args::options - Rust
pub const PRESUME_INPUT_PIPE: &str = "-presume-input-pipe";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.RETRY.html b/coreutils/dev/uu_tail/args/options/constant.RETRY.html deleted file mode 100644 index f743693c1..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.RETRY.html +++ /dev/null @@ -1 +0,0 @@ -RETRY in uu_tail::args::options - Rust

Constant uu_tail::args::options::RETRY

source ·
pub const RETRY: &str = "retry";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.SLEEP_INT.html b/coreutils/dev/uu_tail/args/options/constant.SLEEP_INT.html deleted file mode 100644 index 840577d45..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.SLEEP_INT.html +++ /dev/null @@ -1 +0,0 @@ -SLEEP_INT in uu_tail::args::options - Rust

Constant uu_tail::args::options::SLEEP_INT

source ·
pub const SLEEP_INT: &str = "sleep-interval";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.USE_POLLING.html b/coreutils/dev/uu_tail/args/options/constant.USE_POLLING.html deleted file mode 100644 index 37696776e..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.USE_POLLING.html +++ /dev/null @@ -1 +0,0 @@ -USE_POLLING in uu_tail::args::options - Rust

Constant uu_tail::args::options::USE_POLLING

source ·
pub const USE_POLLING: &str = "use-polling";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/constant.ZERO_TERM.html b/coreutils/dev/uu_tail/args/options/constant.ZERO_TERM.html deleted file mode 100644 index 33d6e49d5..000000000 --- a/coreutils/dev/uu_tail/args/options/constant.ZERO_TERM.html +++ /dev/null @@ -1 +0,0 @@ -ZERO_TERM in uu_tail::args::options - Rust

Constant uu_tail::args::options::ZERO_TERM

source ·
pub const ZERO_TERM: &str = "zero-terminated";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/index.html b/coreutils/dev/uu_tail/args/options/index.html deleted file mode 100644 index 4e620483a..000000000 --- a/coreutils/dev/uu_tail/args/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_tail::args::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/sidebar-items.js b/coreutils/dev/uu_tail/args/options/sidebar-items.js deleted file mode 100644 index eb3d1a91b..000000000 --- a/coreutils/dev/uu_tail/args/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["ARG_FILES","BYTES","DISABLE_INOTIFY_TERM","FOLLOW","FOLLOW_RETRY","LINES","MAX_UNCHANGED_STATS","PID","PRESUME_INPUT_PIPE","RETRY","SLEEP_INT","USE_POLLING","ZERO_TERM"],"mod":["verbosity"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/verbosity/constant.QUIET.html b/coreutils/dev/uu_tail/args/options/verbosity/constant.QUIET.html deleted file mode 100644 index 5bba7c14e..000000000 --- a/coreutils/dev/uu_tail/args/options/verbosity/constant.QUIET.html +++ /dev/null @@ -1 +0,0 @@ -QUIET in uu_tail::args::options::verbosity - Rust

Constant uu_tail::args::options::verbosity::QUIET

source ·
pub const QUIET: &str = "quiet";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/verbosity/constant.VERBOSE.html b/coreutils/dev/uu_tail/args/options/verbosity/constant.VERBOSE.html deleted file mode 100644 index f52789924..000000000 --- a/coreutils/dev/uu_tail/args/options/verbosity/constant.VERBOSE.html +++ /dev/null @@ -1 +0,0 @@ -VERBOSE in uu_tail::args::options::verbosity - Rust
pub const VERBOSE: &str = "verbose";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/verbosity/index.html b/coreutils/dev/uu_tail/args/options/verbosity/index.html deleted file mode 100644 index 248b41c2c..000000000 --- a/coreutils/dev/uu_tail/args/options/verbosity/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_tail::args::options::verbosity - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/options/verbosity/sidebar-items.js b/coreutils/dev/uu_tail/args/options/verbosity/sidebar-items.js deleted file mode 100644 index fb1a1f62a..000000000 --- a/coreutils/dev/uu_tail/args/options/verbosity/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["QUIET","VERBOSE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/sidebar-items.js b/coreutils/dev/uu_tail/args/sidebar-items.js deleted file mode 100644 index 66378ec80..000000000 --- a/coreutils/dev/uu_tail/args/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["FilterMode","FollowMode","Signum","VerificationResult"],"fn":["parse_args","parse_obsolete","uu_app"],"mod":["options"],"struct":["Settings"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tail/args/struct.Settings.html b/coreutils/dev/uu_tail/args/struct.Settings.html deleted file mode 100644 index 4bf02ca34..000000000 --- a/coreutils/dev/uu_tail/args/struct.Settings.html +++ /dev/null @@ -1,29 +0,0 @@ -Settings in uu_tail::args - Rust

Struct uu_tail::args::Settings

source ·
pub struct Settings {
-    pub follow: Option<FollowMode>,
-    pub max_unchanged_stats: u32,
-    pub mode: FilterMode,
-    pub pid: pid_t,
-    pub retry: bool,
-    pub sleep_sec: Duration,
-    pub use_polling: bool,
-    pub verbose: bool,
-    pub presume_input_pipe: bool,
-    pub inputs: Vec<Input>,
-}

Fields§

§follow: Option<FollowMode>§max_unchanged_stats: u32§mode: FilterMode§pid: pid_t§retry: bool§sleep_sec: Duration§use_polling: bool§verbose: bool§presume_input_pipe: bool§inputs: Vec<Input>

FILE(s) positional arguments

-

Implementations§

source§

impl Settings

source

pub fn from_obsolete_args(args: &ObsoleteArgs, name: Option<&OsString>) -> Self

source

pub fn from(matches: &ArgMatches) -> UResult<Self>

source

pub fn has_only_stdin(&self) -> bool

source

pub fn has_stdin(&self) -> bool

source

pub fn num_inputs(&self) -> usize

source

pub fn check_warnings(&self)

Check Settings for problematic configurations of tail originating from user provided -command line arguments and print appropriate warnings.

-
source

pub fn verify(&self) -> VerificationResult

Verify Settings and try to find unsolvable misconfigurations of tail originating from -user provided command line arguments. In contrast to Settings::check_warnings these -misconfigurations usually lead to the immediate exit or abortion of the running tail -process.

-

Trait Implementations§

source§

impl Debug for Settings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Settings

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/chunks/constant.BLOCK_SIZE.html b/coreutils/dev/uu_tail/chunks/constant.BLOCK_SIZE.html deleted file mode 100644 index 7b4151bb8..000000000 --- a/coreutils/dev/uu_tail/chunks/constant.BLOCK_SIZE.html +++ /dev/null @@ -1,3 +0,0 @@ -BLOCK_SIZE in uu_tail::chunks - Rust

Constant uu_tail::chunks::BLOCK_SIZE

source ·
pub const BLOCK_SIZE: u64 = _; // 65_536u64
Expand description

When reading files in reverse in bounded_tail, this is the size of each -block read at a time.

-
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/chunks/constant.BUFFER_SIZE.html b/coreutils/dev/uu_tail/chunks/constant.BUFFER_SIZE.html deleted file mode 100644 index 1848141b9..000000000 --- a/coreutils/dev/uu_tail/chunks/constant.BUFFER_SIZE.html +++ /dev/null @@ -1,6 +0,0 @@ -BUFFER_SIZE in uu_tail::chunks - Rust

Constant uu_tail::chunks::BUFFER_SIZE

source ·
pub const BUFFER_SIZE: usize = 8192;
Expand description

The size of the backing buffer of a LinesChunk or BytesChunk in bytes. The value of BUFFER_SIZE -originates from the BUFSIZ constant in stdio.h and the libc crate to make stream IO efficient. -In the latter the value is constantly set to 8192 on all platforms, where the value in stdio.h -is determined on each platform differently. Since libc chose 8192 as a reasonable default the -value here is set to this value, too.

-
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/chunks/index.html b/coreutils/dev/uu_tail/chunks/index.html deleted file mode 100644 index 586fc4288..000000000 --- a/coreutils/dev/uu_tail/chunks/index.html +++ /dev/null @@ -1,13 +0,0 @@ -uu_tail::chunks - Rust

Module uu_tail::chunks

source ·
Expand description

Iterating over a file by chunks, either starting at the end of the file with ReverseChunks -or at the end of piped stdin with LinesChunk or BytesChunk.

-

Use ReverseChunks::new to create a new iterator over chunks of bytes from the file.

-

Structs

  • A BytesChunk storing a fixed size number of bytes in a buffer.
  • An abstraction layer on top of BytesChunk mainly to simplify filling only the needed amount -of chunks. See also Self::fill.
  • Works similar to a BytesChunk but also stores the number of lines encountered in the current -buffer. The size of the buffer is limited to a fixed size number of bytes.
  • An abstraction layer on top of LinesChunk mainly to simplify filling only the needed amount -of chunks. See also Self::fill. Works similar like BytesChunkBuffer, but works on top -of lines delimited by self.delimiter instead of bytes.
  • An iterator over a file in non-overlapping chunks from the end of the file.

Constants

  • When reading files in reverse in bounded_tail, this is the size of each -block read at a time.
  • The size of the backing buffer of a LinesChunk or BytesChunk in bytes. The value of BUFFER_SIZE -originates from the BUFSIZ constant in stdio.h and the libc crate to make stream IO efficient. -In the latter the value is constantly set to 8192 on all platforms, where the value in stdio.h -is determined on each platform differently. Since libc chose 8192 as a reasonable default the -value here is set to this value, too.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/chunks/sidebar-items.js b/coreutils/dev/uu_tail/chunks/sidebar-items.js deleted file mode 100644 index 0fc96656e..000000000 --- a/coreutils/dev/uu_tail/chunks/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["BLOCK_SIZE","BUFFER_SIZE"],"struct":["BytesChunk","BytesChunkBuffer","LinesChunk","LinesChunkBuffer","ReverseChunks"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tail/chunks/struct.BytesChunk.html b/coreutils/dev/uu_tail/chunks/struct.BytesChunk.html deleted file mode 100644 index 5312c2398..000000000 --- a/coreutils/dev/uu_tail/chunks/struct.BytesChunk.html +++ /dev/null @@ -1,32 +0,0 @@ -BytesChunk in uu_tail::chunks - Rust

Struct uu_tail::chunks::BytesChunk

source ·
pub struct BytesChunk { /* private fields */ }
Expand description

A BytesChunk storing a fixed size number of bytes in a buffer.

-

Implementations§

source§

impl BytesChunk

source

pub fn new() -> Self

source

pub fn get_buffer(&self) -> &[u8]

Receive the internal buffer safely, so it returns a slice only containing as many bytes as -large the self.bytes value is.

-

returns: a slice containing the bytes of the internal buffer from [0..self.bytes]

-
Examples
-
let mut chunk = BytesChunk::new();
-chunk.bytes = 1;
-assert_eq!(&[0], chunk.get_buffer());
-
source

pub fn get_buffer_with(&self, offset: usize) -> &[u8]

Like BytesChunk::get_buffer, but returning a slice from [offset.self.bytes].

-

returns: a slice containing the bytes of the internal buffer from [offset..self.bytes]

-
Examples
-
let mut chunk = BytesChunk::new();
-chunk.bytes = 2;
-assert_eq!(&[0], chunk.get_buffer_with(1));
-
source

pub fn has_data(&self) -> bool

source

pub fn fill(&mut self, filehandle: &mut impl BufRead) -> UResult<Option<usize>>

Fills self.buffer with maximal BUFFER_SIZE number of bytes, draining the reader by -that number of bytes. If EOF is reached (so 0 bytes are read), then returns -[UResult<None>] or else the result with [Some(bytes)] where bytes is the number of bytes -read from the source.

-

Trait Implementations§

source§

impl Clone for BytesChunk

source§

fn clone(&self) -> BytesChunk

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BytesChunk

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<BytesChunk> for BytesChunk

source§

fn eq(&self, other: &BytesChunk) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for BytesChunk

source§

impl StructuralEq for BytesChunk

source§

impl StructuralPartialEq for BytesChunk

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/chunks/struct.BytesChunkBuffer.html b/coreutils/dev/uu_tail/chunks/struct.BytesChunkBuffer.html deleted file mode 100644 index 4196bc33d..000000000 --- a/coreutils/dev/uu_tail/chunks/struct.BytesChunkBuffer.html +++ /dev/null @@ -1,47 +0,0 @@ -BytesChunkBuffer in uu_tail::chunks - Rust
pub struct BytesChunkBuffer { /* private fields */ }
Expand description

An abstraction layer on top of BytesChunk mainly to simplify filling only the needed amount -of chunks. See also Self::fill.

-

Implementations§

source§

impl BytesChunkBuffer

source

pub fn new(num_print: u64) -> Self

Creates a new BytesChunkBuffer.

-
Arguments
-
    -
  • num_print: The number of bytes to print
  • -
-
Examples
-
let mut chunk = BytesChunk::new();
-chunk.buffer[1] = 1;
-chunk.bytes = 2;
-let new_chunk = BytesChunk::from_chunk(&chunk, 0);
-assert_eq!(2, new_chunk.get_buffer().len());
-assert_eq!(&[0, 1], new_chunk.get_buffer());
-
-let new_chunk = BytesChunk::from_chunk(&chunk, 1);
-assert_eq!(1, new_chunk.get_buffer().len());
-assert_eq!(&[1], new_chunk.get_buffer());
-
source

pub fn fill(&mut self, reader: &mut impl BufRead) -> UResult<()>

Fills this buffer with chunks and consumes the reader completely. This method ensures that -there are exactly as many chunks as needed to match self.num_print bytes, so there are -in sum exactly self.num_print bytes stored in all chunks. The method returns an iterator -over these chunks. If there are no chunks, for example because the piped stdin contained no -bytes, or num_print = 0 then iterator.next returns None.

-
Examples
-
use crate::chunks::BytesChunkBuffer;
-use std::io::{BufReader, Cursor};
-
-let mut reader = BufReader::new(Cursor::new(""));
-let num_print = 0;
-let mut chunks = BytesChunkBuffer::new(num_print);
-chunks.fill(&mut reader).unwrap();
-
-let mut reader = BufReader::new(Cursor::new("a"));
-let num_print = 1;
-let mut chunks = BytesChunkBuffer::new(num_print);
-chunks.fill(&mut reader).unwrap();
-
source

pub fn print(&self, writer: impl Write) -> UResult<()>

source

pub fn has_data(&self) -> bool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/chunks/struct.LinesChunk.html b/coreutils/dev/uu_tail/chunks/struct.LinesChunk.html deleted file mode 100644 index 125b78d49..000000000 --- a/coreutils/dev/uu_tail/chunks/struct.LinesChunk.html +++ /dev/null @@ -1,47 +0,0 @@ -LinesChunk in uu_tail::chunks - Rust

Struct uu_tail::chunks::LinesChunk

source ·
pub struct LinesChunk { /* private fields */ }
Expand description

Works similar to a BytesChunk but also stores the number of lines encountered in the current -buffer. The size of the buffer is limited to a fixed size number of bytes.

-

Implementations§

source§

impl LinesChunk

source

pub fn new(delimiter: u8) -> Self

source

pub fn has_data(&self) -> bool

Returns true if this buffer has stored any bytes.

-
Examples
-
let mut chunk = LinesChunk::new(b'\n');
-assert!(!chunk.has_data());
-
-chunk.buffer[0] = 1;
-assert!(!chunk.has_data());
-
-chunk.bytes = 1;
-assert!(chunk.has_data());
-
source

pub fn get_buffer(&self) -> &[u8]

Returns this buffer safely. See BytesChunk::get_buffer

-

returns: &u8 with length self.bytes

-
source

pub fn get_buffer_with(&self, offset: usize) -> &[u8]

Returns this buffer safely with an offset applied. See BytesChunk::get_buffer_with.

-

returns: &u8 with length self.bytes - offset

-
source

pub fn get_lines(&self) -> usize

Return the number of lines the buffer contains. self.lines needs to be set before the call -to this function returns the correct value. If the calculation of lines is needed then -use self.count_lines.

-
source

pub fn fill(&mut self, filehandle: &mut impl BufRead) -> UResult<Option<usize>>

Fills self.buffer with maximal BUFFER_SIZE number of bytes, draining the reader by -that number of bytes. This function works like the BytesChunk::fill function besides -that this function also counts and stores the number of lines encountered while reading from -the filehandle.

-
source

pub fn print_lines(&self, writer: &mut impl Write, offset: usize) -> UResult<()>

Print the bytes contained in this buffer calculated with the given offset in number of -lines.

-
Arguments
-
    -
  • writer: must implement Write
  • -
  • offset: An offset in number of lines.
  • -
-
source

pub fn print_bytes(&self, writer: &mut impl Write, offset: usize) -> UResult<()>

Print the bytes contained in this buffer beginning from the given offset in number of bytes.

-
Arguments
-
    -
  • writer: must implement Write
  • -
  • offset: An offset in number of bytes.
  • -
-

Trait Implementations§

source§

impl Debug for LinesChunk

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/chunks/struct.LinesChunkBuffer.html b/coreutils/dev/uu_tail/chunks/struct.LinesChunkBuffer.html deleted file mode 100644 index f8c7a6923..000000000 --- a/coreutils/dev/uu_tail/chunks/struct.LinesChunkBuffer.html +++ /dev/null @@ -1,20 +0,0 @@ -LinesChunkBuffer in uu_tail::chunks - Rust
pub struct LinesChunkBuffer { /* private fields */ }
Expand description

An abstraction layer on top of LinesChunk mainly to simplify filling only the needed amount -of chunks. See also Self::fill. Works similar like BytesChunkBuffer, but works on top -of lines delimited by self.delimiter instead of bytes.

-

Implementations§

source§

impl LinesChunkBuffer

source

pub fn new(delimiter: u8, num_print: u64) -> Self

Create a new LinesChunkBuffer

-
source

pub fn fill(&mut self, reader: &mut impl BufRead) -> UResult<()>

Fills this buffer with chunks and consumes the reader completely. This method ensures that -there are exactly as many chunks as needed to match self.num_print lines, so there are -in sum exactly self.num_print lines stored in all chunks. The method returns an iterator -over these chunks. If there are no chunks, for example because the piped stdin contained no -lines, or num_print = 0 then iterator.next will return None.

-
source

pub fn print(&self, writer: impl Write) -> UResult<()>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/chunks/struct.ReverseChunks.html b/coreutils/dev/uu_tail/chunks/struct.ReverseChunks.html deleted file mode 100644 index 70fd07853..000000000 --- a/coreutils/dev/uu_tail/chunks/struct.ReverseChunks.html +++ /dev/null @@ -1,594 +0,0 @@ -ReverseChunks in uu_tail::chunks - Rust
pub struct ReverseChunks<'a> { /* private fields */ }
Expand description

An iterator over a file in non-overlapping chunks from the end of the file.

-

Each chunk is a Vec<u8> of size BLOCK_SIZE (except -possibly the last chunk, which might be smaller). Each call to -ReverseChunks::next will seek backwards through the given file.

-

Implementations§

source§

impl<'a> ReverseChunks<'a>

source

pub fn new(file: &'a mut File) -> ReverseChunks<'a>

Trait Implementations§

source§

impl<'a> Iterator for ReverseChunks<'a>

§

type Item = Vec<u8, Global>

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn next_chunk<const N: usize>( - &mut self -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0 · source§

fn count(self) -> usizewhere - Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>where - Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>where - Self: Sized,

Creates an iterator starting at the same point, but stepping by -the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>where - Self: Sized, - G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator -between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each -element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)where - Self: Sized, - F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element -should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>where - Self: Sized,

Creates an iterator which gives the current iteration count as well as -the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>where - Self: Sized,

Creates an iterator which can use the peek and peek_mut methods -to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>where - Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>where - Self: Sized,

Creates an iterator that yields the first n elements, or fewer -if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where - Self: Sized, - F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but -unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where - Self: Sized, - U: IntoIterator, - F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>where - Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where - Self: Sized, - F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere - Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> Bwhere - B: FromIterator<Self::Item>, - Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere - E: Extend<Self::Item>, - Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)where - Self: Sized, - B: Default + Extend<Self::Item>, - F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> boolwhere - Self: Sized, - P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, -such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere - Self: Sized, - F: FnMut(B, Self::Item) -> R, - R: Try<Output = B>,

An iterator method that applies a function as long as it returns -successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> Rwhere - Self: Sized, - F: FnMut(Self::Item) -> R, - R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the -iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> Bwhere - Self: Sized, - F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, -returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing -operation. Read more
source§

fn try_reduce<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> R, - R: Try<Output = Self::Item>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the -closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns -the first non-none result. Read more
source§

fn try_find<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere - Self: Sized, - F: FnMut(&Self::Item) -> R, - R: Try<Output = bool>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns -the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the -specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the -specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the -specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the -specified comparison function. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where - FromA: Default + Extend<A>, - FromB: Default + Extend<B>, - Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>where - T: 'a + Copy, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>where - T: 'a + Clone, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> Swhere - Self: Sized, - S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> Pwhere - Self: Sized, - P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Lexicographically compares the PartialOrd elements of -this Iterator with those of another. The comparison works like short-circuit -evaluation, returning a result without comparing the remaining elements. -As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are equal to those of -another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of -another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are not equal to those of -another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> boolwhere - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction -function. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for ReverseChunks<'a>

§

impl<'a> Send for ReverseChunks<'a>

§

impl<'a> Sync for ReverseChunks<'a>

§

impl<'a> Unpin for ReverseChunks<'a>

§

impl<'a> UnwindSafe for ReverseChunks<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<I> IntoIterator for Iwhere - I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T> Itertools for Twhere - T: Iterator + ?Sized,

source§

fn interleave<J>( - self, - other: J -) -> Interleave<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator<Item = Self::Item>, - Self: Sized,

Alternate elements from two iterators until both have run out. Read more
source§

fn interleave_shortest<J>( - self, - other: J -) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator<Item = Self::Item>, - Self: Sized,

Alternate elements from two iterators until at least one of them has run -out. Read more
source§

fn intersperse( - self, - element: Self::Item -) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>>where - Self: Sized, - Self::Item: Clone,

An iterator adaptor to insert a particular value -between each element of the adapted iterator. Read more
source§

fn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F>where - Self: Sized, - F: FnMut() -> Self::Item,

An iterator adaptor to insert a particular value created by a function -between each element of the adapted iterator. Read more
source§

fn zip_longest<J>( - self, - other: J -) -> ZipLongest<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator, - Self: Sized,

Create an iterator which iterates over both this and the specified -iterator simultaneously, yielding pairs of two optional elements. Read more
source§

fn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator, - Self: Sized,

Create an iterator which iterates over both this and the specified -iterator simultaneously, yielding pairs of elements. Read more
source§

fn batching<B, F>(self, f: F) -> Batching<Self, F>where - F: FnMut(&mut Self) -> Option<B>, - Self: Sized,

A “meta iterator adaptor”. Its closure receives a reference to the -iterator and may pick off as many elements as it likes, to produce the -next iterator element. Read more
source§

fn group_by<K, F>(self, key: F) -> GroupBy<K, Self, F>where - Self: Sized, - F: FnMut(&Self::Item) -> K, - K: PartialEq<K>,

Return an iterable that can group iterator elements. -Consecutive elements that map to the same key (“runs”), are assigned -to the same group. Read more
source§

fn chunks(self, size: usize) -> IntoChunks<Self>where - Self: Sized,

Return an iterable that can chunk the iterator. Read more
source§

fn tuple_windows<T>(self) -> TupleWindows<Self, T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple, - <T as TupleCollect>::Item: Clone,

Return an iterator over all contiguous windows producing tuples of -a specific size (up to 12). Read more
source§

fn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T>where - Self: Sized + Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator, - T: TupleCollect + Clone, - <T as TupleCollect>::Item: Clone,

Return an iterator over all windows, wrapping back to the first -elements when the window would otherwise exceed the length of the -iterator, producing tuples of a specific size (up to 12). Read more
source§

fn tuples<T>(self) -> Tuples<Self, T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Return an iterator that groups the items in tuples of a specific size -(up to 12). Read more
source§

fn tee(self) -> (Tee<Self>, Tee<Self>)where - Self: Sized, - Self::Item: Clone,

Split into an iterator pair that both yield all elements from -the original iterator. Read more
source§

fn step(self, n: usize) -> Step<Self>where - Self: Sized,

👎Deprecated since 0.8.0: Use std .step_by() instead
Return an iterator adaptor that steps n elements in the base iterator -for each iteration. Read more
source§

fn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>>where - Self: Sized, - Self::Item: Into<R>,

Convert each item of the iterator using the Into trait. Read more
source§

fn map_results<F, T, U, E>( - self, - f: F -) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> U,

👎Deprecated since 0.10.0: Use .map_ok() instead
source§

fn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> U,

Return an iterator adaptor that applies the provided closure -to every Result::Ok value. Result::Err values are -unchanged. Read more
source§

fn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(&T) -> bool,

Return an iterator adaptor that filters every Result::Ok -value with the provided closure. Result::Err values are -unchanged. Read more
source§

fn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> Option<U>,

Return an iterator adaptor that filters and transforms every -Result::Ok value with the provided closure. Result::Err -values are unchanged. Read more
source§

fn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E>where - Self: Iterator<Item = Result<T, E>> + Sized, - T: IntoIterator,

Return an iterator adaptor that flattens every Result::Ok value into -a series of Result::Ok values. Result::Err values are unchanged. Read more
source§

fn process_results<F, T, E, R>(self, processor: F) -> Result<R, E>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnOnce(ProcessResults<'_, Self, E>) -> R,

“Lift” a function of the values of the current iterator so as to process -an iterator of Result values instead. Read more
source§

fn merge<J>( - self, - other: J -) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>, - J: IntoIterator<Item = Self::Item>,

Return an iterator adaptor that merges the two base iterators in -ascending order. If both base iterators are sorted (ascending), the -result is sorted. Read more
source§

fn merge_by<J, F>( - self, - other: J, - is_first: F -) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F>where - Self: Sized, - J: IntoIterator<Item = Self::Item>, - F: FnMut(&Self::Item, &Self::Item) -> bool,

Return an iterator adaptor that merges the two base iterators in order. -This is much like .merge() but allows for a custom ordering. Read more
source§

fn merge_join_by<J, F, T>( - self, - other: J, - cmp_fn: F -) -> MergeJoinBy<Self, <J as IntoIterator>::IntoIter, F>where - J: IntoIterator, - F: FnMut(&Self::Item, &<J as IntoIterator>::Item) -> T, - T: OrderingOrBool<Self::Item, <J as IntoIterator>::Item>, - Self: Sized,

Create an iterator that merges items from both this and the specified -iterator in ascending order. Read more
source§

fn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt>where - Self: Sized, - Self::Item: IntoIterator, - <Self::Item as IntoIterator>::Item: PartialOrd<<Self::Item as IntoIterator>::Item>,

Return an iterator adaptor that flattens an iterator of iterators by -merging them in ascending order. Read more
source§

fn kmerge_by<F>( - self, - first: F -) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F>where - Self: Sized, - Self::Item: IntoIterator, - F: FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,

Return an iterator adaptor that flattens an iterator of iterators by -merging them according to the given closure. Read more
source§

fn cartesian_product<J>( - self, - other: J -) -> Product<Self, <J as IntoIterator>::IntoIter>where - Self: Sized, - Self::Item: Clone, - J: IntoIterator, - <J as IntoIterator>::IntoIter: Clone,

Return an iterator adaptor that iterates over the cartesian product of -the element sets of two iterators self and J. Read more
source§

fn multi_cartesian_product( - self -) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter>where - Self: Sized, - Self::Item: IntoIterator, - <Self::Item as IntoIterator>::IntoIter: Clone, - <Self::Item as IntoIterator>::Item: Clone,

Return an iterator adaptor that iterates over the cartesian product of -all subiterators returned by meta-iterator self. Read more
source§

fn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Result<Self::Item, (Self::Item, Self::Item)>,

Return an iterator adaptor that uses the passed-in closure to -optionally merge together consecutive elements. Read more
source§

fn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, Self::Item>where - Self: Sized, - Self::Item: PartialEq<Self::Item>,

Remove duplicates from sections of consecutive identical elements. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_by<Cmp>( - self, - cmp: Cmp -) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, Self::Item>where - Self: Sized, - Cmp: FnMut(&Self::Item, &Self::Item) -> bool,

Remove duplicates from sections of consecutive identical elements, -determining equality using a comparison function. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_with_count( - self -) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, (usize, Self::Item)>where - Self: Sized,

Remove duplicates from sections of consecutive identical elements, while keeping a count of -how many repeated elements were present. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_by_with_count<Cmp>( - self, - cmp: Cmp -) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, (usize, Self::Item)>where - Self: Sized, - Cmp: FnMut(&Self::Item, &Self::Item) -> bool,

Remove duplicates from sections of consecutive identical elements, while keeping a count of -how many repeated elements were present. -This will determine equality using a comparison function. -If the iterator is sorted, all elements will be unique. Read more
source§

fn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById>where - Self: Sized, - Self::Item: Eq + Hash,

Return an iterator adaptor that produces elements that appear more than once during the -iteration. Duplicates are detected using hash and equality. Read more
source§

fn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>>where - Self: Sized, - V: Eq + Hash, - F: FnMut(&Self::Item) -> V,

Return an iterator adaptor that produces elements that appear more than once during the -iteration. Duplicates are detected using hash and equality. Read more
source§

fn unique(self) -> Unique<Self>where - Self: Sized, - Self::Item: Clone + Eq + Hash,

Return an iterator adaptor that filters out elements that have -already been produced once during the iteration. Duplicates -are detected using hash and equality. Read more
source§

fn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F>where - Self: Sized, - V: Eq + Hash, - F: FnMut(&Self::Item) -> V,

Return an iterator adaptor that filters out elements that have -already been produced once during the iteration. Read more
source§

fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F>where - Self: Sized + PeekingNext, - F: FnMut(&Self::Item) -> bool,

Return an iterator adaptor that borrows from this iterator and -takes items while the closure accept returns true. Read more
source§

fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F>where - Self: Clone, - F: FnMut(&Self::Item) -> bool,

Return an iterator adaptor that borrows from a Clone-able iterator -to only pick off elements while the predicate accept returns true. Read more
source§

fn take_while_inclusive<F>( - &mut self, - accept: F -) -> TakeWhileInclusive<'_, Self, F>where - Self: Sized, - F: FnMut(&Self::Item) -> bool,

Returns an iterator adaptor that consumes elements while the given -predicate is true, including the element for which the predicate -first returned false. Read more
source§

fn while_some<A>(self) -> WhileSome<Self>where - Self: Sized + Iterator<Item = Option<A>>,

Return an iterator adaptor that filters Option<A> iterator elements -and produces A. Stops on the first None encountered. Read more
source§

fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>where - Self: Sized + Clone, - Self::Item: Clone, - T: HasCombination<Self>,

Return an iterator adaptor that iterates over the combinations of the -elements from an iterator. Read more
source§

fn combinations(self, k: usize) -> Combinations<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator adaptor that iterates over the k-length combinations of -the elements from an iterator. Read more
source§

fn combinations_with_replacement( - self, - k: usize -) -> CombinationsWithReplacement<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator that iterates over the k-length combinations of -the elements from an iterator, with replacement. Read more
source§

fn permutations(self, k: usize) -> Permutations<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator adaptor that iterates over all k-permutations of the -elements from an iterator. Read more
source§

fn powerset(self) -> Powerset<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator that iterates through the powerset of the elements from an -iterator. Read more
source§

fn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F>where - Self: Sized, - F: FnMut(usize) -> Self::Item,

Return an iterator adaptor that pads the sequence to a minimum length of -min by filling missing elements using a closure f. Read more
source§

fn with_position(self) -> WithPosition<Self>where - Self: Sized,

Return an iterator adaptor that combines each element with a Position to -ease special-case handling of the first or last elements. Read more
source§

fn positions<P>(self, predicate: P) -> Positions<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Return an iterator adaptor that yields the indices of all elements -satisfying a predicate, counted from the start of the iterator. Read more
source§

fn update<F>(self, updater: F) -> Update<Self, F>where - Self: Sized, - F: FnMut(&mut Self::Item),

Return an iterator adaptor that applies a mutating function -to each element before yielding it. Read more
source§

fn next_tuple<T>(&mut self) -> Option<T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Advances the iterator and returns the next items grouped in a tuple of -a specific size (up to 12). Read more
source§

fn collect_tuple<T>(self) -> Option<T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Collects all items from the iterator into a tuple of a specific size -(up to 12). Read more
source§

fn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)>where - P: FnMut(&Self::Item) -> bool,

Find the position and value of the first element satisfying a predicate. Read more
source§

fn find_or_last<P>(self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Find the value of the first element satisfying a predicate or return the last element, if any. Read more
source§

fn find_or_first<P>(self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Find the value of the first element satisfying a predicate or return the first element, if any. Read more
source§

fn contains<Q>(&mut self, query: &Q) -> boolwhere - Self: Sized, - Self::Item: Borrow<Q>, - Q: PartialEq<Q>,

Returns true if the given item is present in this iterator. Read more
source§

fn all_equal(&mut self) -> boolwhere - Self: Sized, - Self::Item: PartialEq<Self::Item>,

Check whether all elements compare equal. Read more
source§

fn all_equal_value( - &mut self -) -> Result<Self::Item, Option<(Self::Item, Self::Item)>>where - Self: Sized, - Self::Item: PartialEq<Self::Item>,

If there are elements and they are all equal, return a single copy of that element. -If there are no elements, return an Error containing None. -If there are elements and they are not all equal, return a tuple containing the first -two non-equal elements found. Read more
source§

fn all_unique(&mut self) -> boolwhere - Self: Sized, - Self::Item: Eq + Hash,

Check whether all elements are unique (non equal). Read more
source§

fn dropping(self, n: usize) -> Selfwhere - Self: Sized,

Consume the first n elements from the iterator eagerly, -and return the same iterator again. Read more
source§

fn dropping_back(self, n: usize) -> Selfwhere - Self: Sized + DoubleEndedIterator,

Consume the last n elements from the iterator eagerly, -and return the same iterator again. Read more
source§

fn foreach<F>(self, f: F)where - F: FnMut(Self::Item), - Self: Sized,

👎Deprecated since 0.8.0: Use .for_each() instead
Run the closure f eagerly on each element of the iterator. Read more
source§

fn concat(self) -> Self::Itemwhere - Self: Sized, - Self::Item: Extend<<Self::Item as IntoIterator>::Item> + IntoIterator + Default,

Combine all an iterator’s elements into one element by using Extend. Read more
source§

fn collect_vec(self) -> Vec<Self::Item, Global>where - Self: Sized,

.collect_vec() is simply a type specialization of Iterator::collect, -for convenience.
source§

fn try_collect<T, U, E>(self) -> Result<U, E>where - Self: Sized + Iterator<Item = Result<T, E>>, - Result<U, E>: FromIterator<Result<T, E>>,

.try_collect() is more convenient way of writing -.collect::<Result<_, _>>() Read more
source§

fn set_from<'a, A, J>(&mut self, from: J) -> usizewhere - A: 'a, - Self: Iterator<Item = &'a mut A>, - J: IntoIterator<Item = A>,

Assign to each reference in self from the from iterator, -stopping at the shortest of the two iterators. Read more
source§

fn join(&mut self, sep: &str) -> Stringwhere - Self::Item: Display,

Combine all iterator elements into one String, separated by sep. Read more
source§

fn format(self, sep: &str) -> Format<'_, Self>where - Self: Sized,

Format all iterator elements, separated by sep. Read more
source§

fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F>where - Self: Sized, - F: FnMut(Self::Item, &mut dyn FnMut(&dyn Display) -> Result<(), Error>) -> Result<(), Error>,

Format all iterator elements, separated by sep. Read more
source§

fn fold_results<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>where - Self: Iterator<Item = Result<A, E>>, - F: FnMut(B, A) -> B,

👎Deprecated since 0.10.0: Use .fold_ok() instead
source§

fn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>where - Self: Iterator<Item = Result<A, E>>, - F: FnMut(B, A) -> B,

Fold Result values from an iterator. Read more
source§

fn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B>where - Self: Iterator<Item = Option<A>>, - F: FnMut(B, A) -> B,

Fold Option values from an iterator. Read more
source§

fn fold1<F>(self, f: F) -> Option<Self::Item>where - F: FnMut(Self::Item, Self::Item) -> Self::Item, - Self: Sized,

👎Deprecated since 0.10.2: Use Iterator::reduce instead
Accumulator of the elements in the iterator. Read more
source§

fn tree_fold1<F>(self, f: F) -> Option<Self::Item>where - F: FnMut(Self::Item, Self::Item) -> Self::Item, - Self: Sized,

Accumulate the elements in the iterator in a tree-like manner. Read more
source§

fn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B>where - Self: Sized, - F: FnMut(B, Self::Item) -> FoldWhile<B>,

An iterator method that applies a function, producing a single, final value. Read more
source§

fn sum1<S>(self) -> Option<S>where - Self: Sized, - S: Sum<Self::Item>,

Iterate over the entire iterator and add all the elements. Read more
source§

fn product1<P>(self) -> Option<P>where - Self: Sized, - P: Product<Self::Item>,

Iterate over the entire iterator and multiply all the elements. Read more
source§

fn sorted_unstable(self) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted(self) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. The key function is -called exactly once per key. Read more
source§

fn k_smallest(self, k: usize) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort the k smallest elements into a new iterator, in ascending order. Read more
source§

fn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B)where - Self: Sized, - F: FnMut(Self::Item) -> Either<L, R>, - A: Default + Extend<L>, - B: Default + Extend<R>,

Collect all iterator elements into one of two -partitions. Unlike Iterator::partition, each partition may -have a distinct type. Read more
source§

fn partition_result<A, B, T, E>(self) -> (A, B)where - Self: Iterator<Item = Result<T, E>> + Sized, - A: Default + Extend<T>, - B: Default + Extend<E>,

Partition a sequence of Results into one list of all the Ok elements -and another list of all the Err elements. Read more
source§

fn into_group_map<K, V>(self) -> HashMap<K, Vec<V, Global>, RandomState>where - Self: Iterator<Item = (K, V)> + Sized, - K: Hash + Eq,

Return a HashMap of keys mapped to Vecs of values. Keys and values -are taken from (Key, Value) tuple pairs yielded by the input iterator. Read more
source§

fn into_group_map_by<K, V, F>( - self, - f: F -) -> HashMap<K, Vec<V, Global>, RandomState>where - Self: Iterator<Item = V> + Sized, - K: Hash + Eq, - F: Fn(&V) -> K,

Return an Iterator on a HashMap. Keys mapped to Vecs of values. The key is specified -in the closure. Read more
source§

fn into_grouping_map<K, V>(self) -> GroupingMap<Self>where - Self: Iterator<Item = (K, V)> + Sized, - K: Hash + Eq,

Constructs a GroupingMap to be used later with one of the efficient -group-and-fold operations it allows to perform. Read more
source§

fn into_grouping_map_by<K, V, F>( - self, - key_mapper: F -) -> GroupingMap<MapForGrouping<Self, F>>where - Self: Iterator<Item = V> + Sized, - K: Hash + Eq, - F: FnMut(&V) -> K,

Constructs a GroupingMap to be used later with one of the efficient -group-and-fold operations it allows to perform. Read more
source§

fn min_set(self) -> Vec<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Return all minimum elements of an iterator. Read more
source§

fn min_set_by<F>(self, compare: F) -> Vec<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return all minimum elements of an iterator, as determined by -the specified function. Read more
source§

fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return all minimum elements of an iterator, as determined by -the specified function. Read more
source§

fn max_set(self) -> Vec<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Return all maximum elements of an iterator. Read more
source§

fn max_set_by<F>(self, compare: F) -> Vec<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return all maximum elements of an iterator, as determined by -the specified function. Read more
source§

fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return all maximum elements of an iterator, as determined by -the specified function. Read more
source§

fn minmax(self) -> MinMaxResult<Self::Item>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>,

Return the minimum and maximum elements in the iterator. Read more
source§

fn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item>where - Self: Sized, - K: PartialOrd<K>, - F: FnMut(&Self::Item) -> K,

Return the minimum and maximum element of an iterator, as determined by -the specified function. Read more
source§

fn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the minimum and maximum element of an iterator, as determined by -the specified comparison function. Read more
source§

fn position_max(self) -> Option<usize>where - Self: Sized, - Self::Item: Ord,

Return the position of the maximum element in the iterator. Read more
source§

fn position_max_by_key<K, F>(self, key: F) -> Option<usize>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return the position of the maximum element in the iterator, as -determined by the specified function. Read more
source§

fn position_max_by<F>(self, compare: F) -> Option<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the position of the maximum element in the iterator, as -determined by the specified comparison function. Read more
source§

fn position_min(self) -> Option<usize>where - Self: Sized, - Self::Item: Ord,

Return the position of the minimum element in the iterator. Read more
source§

fn position_min_by_key<K, F>(self, key: F) -> Option<usize>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return the position of the minimum element in the iterator, as -determined by the specified function. Read more
source§

fn position_min_by<F>(self, compare: F) -> Option<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the position of the minimum element in the iterator, as -determined by the specified comparison function. Read more
source§

fn position_minmax(self) -> MinMaxResult<usize>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>,

Return the positions of the minimum and maximum elements in -the iterator. Read more
source§

fn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize>where - Self: Sized, - K: PartialOrd<K>, - F: FnMut(&Self::Item) -> K,

Return the postions of the minimum and maximum elements of an -iterator, as determined by the specified function. Read more
source§

fn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the postions of the minimum and maximum elements of an -iterator, as determined by the specified comparison function. Read more
source§

fn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>where - Self: Sized,

If the iterator yields exactly one element, that element will be returned, otherwise -an error will be returned containing an iterator that has the same output as the input -iterator. Read more
source§

fn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>where - Self: Sized,

If the iterator yields no elements, Ok(None) will be returned. If the iterator yields -exactly one element, that element will be returned, otherwise an error will be returned -containing an iterator that has the same output as the input iterator. Read more
source§

fn multipeek(self) -> MultiPeek<Self>where - Self: Sized,

An iterator adaptor that allows the user to peek at multiple .next() -values without advancing the base iterator. Read more
source§

fn counts(self) -> HashMap<Self::Item, usize, RandomState>where - Self: Sized, - Self::Item: Eq + Hash,

Collect the items in this iterator and return a HashMap which -contains each item that appears in the iterator and the number -of times it appears. Read more
source§

fn counts_by<K, F>(self, f: F) -> HashMap<K, usize, RandomState>where - Self: Sized, - K: Eq + Hash, - F: FnMut(Self::Item) -> K,

Collect the items in this iterator and return a HashMap which -contains each item that appears in the iterator and the number -of times it appears, -determining identity using a keying function. Read more
source§

fn multiunzip<FromI>(self) -> FromIwhere - Self: Sized + MultiUnzip<FromI>,

Converts an iterator of tuples into a tuple of containers. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/fn.uumain.html b/coreutils/dev/uu_tail/fn.uumain.html deleted file mode 100644 index 37151e310..000000000 --- a/coreutils/dev/uu_tail/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_tail - Rust

Function uu_tail::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/index.html b/coreutils/dev/uu_tail/index.html deleted file mode 100644 index bf0a4721c..000000000 --- a/coreutils/dev/uu_tail/index.html +++ /dev/null @@ -1,2 +0,0 @@ -uu_tail - Rust

Crate uu_tail

source ·

Re-exports

Modules

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_tail/sidebar-items.js b/coreutils/dev/uu_tail/sidebar-items.js deleted file mode 100644 index 1b2748e2e..000000000 --- a/coreutils/dev/uu_tail/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uumain"],"mod":["args","chunks","text"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.BACKEND.html b/coreutils/dev/uu_tail/text/constant.BACKEND.html deleted file mode 100644 index 6a0c50f19..000000000 --- a/coreutils/dev/uu_tail/text/constant.BACKEND.html +++ /dev/null @@ -1 +0,0 @@ -BACKEND in uu_tail::text - Rust

Constant uu_tail::text::BACKEND

source ·
pub const BACKEND: &str = "inotify";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.BAD_FD.html b/coreutils/dev/uu_tail/text/constant.BAD_FD.html deleted file mode 100644 index 0ff931543..000000000 --- a/coreutils/dev/uu_tail/text/constant.BAD_FD.html +++ /dev/null @@ -1 +0,0 @@ -BAD_FD in uu_tail::text - Rust

Constant uu_tail::text::BAD_FD

source ·
pub const BAD_FD: &str = "Bad file descriptor";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.BECOME_INACCESSIBLE.html b/coreutils/dev/uu_tail/text/constant.BECOME_INACCESSIBLE.html deleted file mode 100644 index c2c69d539..000000000 --- a/coreutils/dev/uu_tail/text/constant.BECOME_INACCESSIBLE.html +++ /dev/null @@ -1 +0,0 @@ -BECOME_INACCESSIBLE in uu_tail::text - Rust
pub const BECOME_INACCESSIBLE: &str = "has become inaccessible";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.DASH.html b/coreutils/dev/uu_tail/text/constant.DASH.html deleted file mode 100644 index 5bd71e41b..000000000 --- a/coreutils/dev/uu_tail/text/constant.DASH.html +++ /dev/null @@ -1 +0,0 @@ -DASH in uu_tail::text - Rust

Constant uu_tail::text::DASH

source ·
pub const DASH: &str = "-";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.DEV_PTMX.html b/coreutils/dev/uu_tail/text/constant.DEV_PTMX.html deleted file mode 100644 index 35c1c6932..000000000 --- a/coreutils/dev/uu_tail/text/constant.DEV_PTMX.html +++ /dev/null @@ -1 +0,0 @@ -DEV_PTMX in uu_tail::text - Rust

Constant uu_tail::text::DEV_PTMX

source ·
pub const DEV_PTMX: &str = "/dev/ptmx";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.DEV_STDIN.html b/coreutils/dev/uu_tail/text/constant.DEV_STDIN.html deleted file mode 100644 index ac52888e5..000000000 --- a/coreutils/dev/uu_tail/text/constant.DEV_STDIN.html +++ /dev/null @@ -1 +0,0 @@ -DEV_STDIN in uu_tail::text - Rust

Constant uu_tail::text::DEV_STDIN

source ·
pub const DEV_STDIN: &str = "/dev/stdin";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.DEV_TTY.html b/coreutils/dev/uu_tail/text/constant.DEV_TTY.html deleted file mode 100644 index 9d6ea7dfa..000000000 --- a/coreutils/dev/uu_tail/text/constant.DEV_TTY.html +++ /dev/null @@ -1 +0,0 @@ -DEV_TTY in uu_tail::text - Rust

Constant uu_tail::text::DEV_TTY

source ·
pub const DEV_TTY: &str = "/dev/tty";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.FD0.html b/coreutils/dev/uu_tail/text/constant.FD0.html deleted file mode 100644 index b4fac8b2f..000000000 --- a/coreutils/dev/uu_tail/text/constant.FD0.html +++ /dev/null @@ -1 +0,0 @@ -FD0 in uu_tail::text - Rust

Constant uu_tail::text::FD0

source ·
pub const FD0: &str = "/dev/fd/0";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.IS_A_DIRECTORY.html b/coreutils/dev/uu_tail/text/constant.IS_A_DIRECTORY.html deleted file mode 100644 index 982bb1eae..000000000 --- a/coreutils/dev/uu_tail/text/constant.IS_A_DIRECTORY.html +++ /dev/null @@ -1 +0,0 @@ -IS_A_DIRECTORY in uu_tail::text - Rust

Constant uu_tail::text::IS_A_DIRECTORY

source ·
pub const IS_A_DIRECTORY: &str = "Is a directory";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.NO_FILES_REMAINING.html b/coreutils/dev/uu_tail/text/constant.NO_FILES_REMAINING.html deleted file mode 100644 index d1b0091cc..000000000 --- a/coreutils/dev/uu_tail/text/constant.NO_FILES_REMAINING.html +++ /dev/null @@ -1 +0,0 @@ -NO_FILES_REMAINING in uu_tail::text - Rust
pub const NO_FILES_REMAINING: &str = "no files remaining";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.NO_SUCH_FILE.html b/coreutils/dev/uu_tail/text/constant.NO_SUCH_FILE.html deleted file mode 100644 index b9ee99239..000000000 --- a/coreutils/dev/uu_tail/text/constant.NO_SUCH_FILE.html +++ /dev/null @@ -1 +0,0 @@ -NO_SUCH_FILE in uu_tail::text - Rust

Constant uu_tail::text::NO_SUCH_FILE

source ·
pub const NO_SUCH_FILE: &str = "No such file or directory";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/constant.STDIN_HEADER.html b/coreutils/dev/uu_tail/text/constant.STDIN_HEADER.html deleted file mode 100644 index fb593b5c1..000000000 --- a/coreutils/dev/uu_tail/text/constant.STDIN_HEADER.html +++ /dev/null @@ -1 +0,0 @@ -STDIN_HEADER in uu_tail::text - Rust

Constant uu_tail::text::STDIN_HEADER

source ·
pub const STDIN_HEADER: &str = "standard input";
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/index.html b/coreutils/dev/uu_tail/text/index.html deleted file mode 100644 index b3f914f4b..000000000 --- a/coreutils/dev/uu_tail/text/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_tail::text - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_tail/text/sidebar-items.js b/coreutils/dev/uu_tail/text/sidebar-items.js deleted file mode 100644 index 398f915f1..000000000 --- a/coreutils/dev/uu_tail/text/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["BACKEND","BAD_FD","BECOME_INACCESSIBLE","DASH","DEV_PTMX","DEV_STDIN","DEV_TTY","FD0","IS_A_DIRECTORY","NO_FILES_REMAINING","NO_SUCH_FILE","STDIN_HEADER"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tee/all.html b/coreutils/dev/uu_tee/all.html deleted file mode 100644 index 65a2e3dbf..000000000 --- a/coreutils/dev/uu_tee/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_tee/fn.uu_app.html b/coreutils/dev/uu_tee/fn.uu_app.html deleted file mode 100644 index 910aa4447..000000000 --- a/coreutils/dev/uu_tee/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_tee - Rust

Function uu_tee::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_tee/fn.uumain.html b/coreutils/dev/uu_tee/fn.uumain.html deleted file mode 100644 index 3a2f4cdd6..000000000 --- a/coreutils/dev/uu_tee/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_tee - Rust

Function uu_tee::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_tee/index.html b/coreutils/dev/uu_tee/index.html deleted file mode 100644 index 9f15c3e47..000000000 --- a/coreutils/dev/uu_tee/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_tee - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_tee/sidebar-items.js b/coreutils/dev/uu_tee/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_tee/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_test/all.html b/coreutils/dev/uu_test/all.html deleted file mode 100644 index e4600cb18..000000000 --- a/coreutils/dev/uu_test/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_test/fn.uu_app.html b/coreutils/dev/uu_test/fn.uu_app.html deleted file mode 100644 index 101b9a2c5..000000000 --- a/coreutils/dev/uu_test/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_test - Rust

Function uu_test::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_test/fn.uumain.html b/coreutils/dev/uu_test/fn.uumain.html deleted file mode 100644 index a489c923a..000000000 --- a/coreutils/dev/uu_test/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_test - Rust

Function uu_test::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_test/index.html b/coreutils/dev/uu_test/index.html deleted file mode 100644 index e7b4d5524..000000000 --- a/coreutils/dev/uu_test/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_test - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_test/sidebar-items.js b/coreutils/dev/uu_test/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_test/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_timeout/all.html b/coreutils/dev/uu_timeout/all.html deleted file mode 100644 index a8a6627b9..000000000 --- a/coreutils/dev/uu_timeout/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/fn.uu_app.html b/coreutils/dev/uu_timeout/fn.uu_app.html deleted file mode 100644 index fd64ffd0e..000000000 --- a/coreutils/dev/uu_timeout/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_timeout - Rust

Function uu_timeout::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/fn.uumain.html b/coreutils/dev/uu_timeout/fn.uumain.html deleted file mode 100644 index 1e412c251..000000000 --- a/coreutils/dev/uu_timeout/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_timeout - Rust

Function uu_timeout::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/index.html b/coreutils/dev/uu_timeout/index.html deleted file mode 100644 index 8fa2e694f..000000000 --- a/coreutils/dev/uu_timeout/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_timeout - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/options/index.html b/coreutils/dev/uu_timeout/options/index.html deleted file mode 100644 index b83c94d9a..000000000 --- a/coreutils/dev/uu_timeout/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_timeout::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/options/sidebar-items.js b/coreutils/dev/uu_timeout/options/sidebar-items.js deleted file mode 100644 index 0d896a610..000000000 --- a/coreutils/dev/uu_timeout/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["COMMAND","DURATION","FOREGROUND","KILL_AFTER","PRESERVE_STATUS","SIGNAL","VERBOSE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_timeout/options/static.COMMAND.html b/coreutils/dev/uu_timeout/options/static.COMMAND.html deleted file mode 100644 index b2e0eafc0..000000000 --- a/coreutils/dev/uu_timeout/options/static.COMMAND.html +++ /dev/null @@ -1 +0,0 @@ -COMMAND in uu_timeout::options - Rust

Static uu_timeout::options::COMMAND

source ·
pub static COMMAND: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/options/static.DURATION.html b/coreutils/dev/uu_timeout/options/static.DURATION.html deleted file mode 100644 index 59b6c6a47..000000000 --- a/coreutils/dev/uu_timeout/options/static.DURATION.html +++ /dev/null @@ -1 +0,0 @@ -DURATION in uu_timeout::options - Rust
pub static DURATION: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/options/static.FOREGROUND.html b/coreutils/dev/uu_timeout/options/static.FOREGROUND.html deleted file mode 100644 index 344fc76e5..000000000 --- a/coreutils/dev/uu_timeout/options/static.FOREGROUND.html +++ /dev/null @@ -1 +0,0 @@ -FOREGROUND in uu_timeout::options - Rust
pub static FOREGROUND: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/options/static.KILL_AFTER.html b/coreutils/dev/uu_timeout/options/static.KILL_AFTER.html deleted file mode 100644 index bd2153015..000000000 --- a/coreutils/dev/uu_timeout/options/static.KILL_AFTER.html +++ /dev/null @@ -1 +0,0 @@ -KILL_AFTER in uu_timeout::options - Rust
pub static KILL_AFTER: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/options/static.PRESERVE_STATUS.html b/coreutils/dev/uu_timeout/options/static.PRESERVE_STATUS.html deleted file mode 100644 index b0b9e85ad..000000000 --- a/coreutils/dev/uu_timeout/options/static.PRESERVE_STATUS.html +++ /dev/null @@ -1 +0,0 @@ -PRESERVE_STATUS in uu_timeout::options - Rust
pub static PRESERVE_STATUS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/options/static.SIGNAL.html b/coreutils/dev/uu_timeout/options/static.SIGNAL.html deleted file mode 100644 index 2544b9c33..000000000 --- a/coreutils/dev/uu_timeout/options/static.SIGNAL.html +++ /dev/null @@ -1 +0,0 @@ -SIGNAL in uu_timeout::options - Rust

Static uu_timeout::options::SIGNAL

source ·
pub static SIGNAL: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/options/static.VERBOSE.html b/coreutils/dev/uu_timeout/options/static.VERBOSE.html deleted file mode 100644 index ebfce96e0..000000000 --- a/coreutils/dev/uu_timeout/options/static.VERBOSE.html +++ /dev/null @@ -1 +0,0 @@ -VERBOSE in uu_timeout::options - Rust

Static uu_timeout::options::VERBOSE

source ·
pub static VERBOSE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_timeout/sidebar-items.js b/coreutils/dev/uu_timeout/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_timeout/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_touch/all.html b/coreutils/dev/uu_touch/all.html deleted file mode 100644 index 1149758ea..000000000 --- a/coreutils/dev/uu_touch/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/fn.uu_app.html b/coreutils/dev/uu_touch/fn.uu_app.html deleted file mode 100644 index 077befdcc..000000000 --- a/coreutils/dev/uu_touch/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_touch - Rust

Function uu_touch::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/fn.uumain.html b/coreutils/dev/uu_touch/fn.uumain.html deleted file mode 100644 index f9cedac9e..000000000 --- a/coreutils/dev/uu_touch/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_touch - Rust

Function uu_touch::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/index.html b/coreutils/dev/uu_touch/index.html deleted file mode 100644 index 039b2605c..000000000 --- a/coreutils/dev/uu_touch/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_touch - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/index.html b/coreutils/dev/uu_touch/options/index.html deleted file mode 100644 index d9cb2bb33..000000000 --- a/coreutils/dev/uu_touch/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_touch::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/sidebar-items.js b/coreutils/dev/uu_touch/options/sidebar-items.js deleted file mode 100644 index 31b3900c5..000000000 --- a/coreutils/dev/uu_touch/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"mod":["sources"],"static":["ACCESS","HELP","MODIFICATION","NO_CREATE","NO_DEREF","SOURCES","TIME"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/sources/index.html b/coreutils/dev/uu_touch/options/sources/index.html deleted file mode 100644 index 7e444b419..000000000 --- a/coreutils/dev/uu_touch/options/sources/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_touch::options::sources - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/sources/sidebar-items.js b/coreutils/dev/uu_touch/options/sources/sidebar-items.js deleted file mode 100644 index 9eac1c0fe..000000000 --- a/coreutils/dev/uu_touch/options/sources/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["DATE","REFERENCE","TIMESTAMP"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/sources/static.DATE.html b/coreutils/dev/uu_touch/options/sources/static.DATE.html deleted file mode 100644 index 969a9163e..000000000 --- a/coreutils/dev/uu_touch/options/sources/static.DATE.html +++ /dev/null @@ -1 +0,0 @@ -DATE in uu_touch::options::sources - Rust

Static uu_touch::options::sources::DATE

source ·
pub static DATE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/sources/static.REFERENCE.html b/coreutils/dev/uu_touch/options/sources/static.REFERENCE.html deleted file mode 100644 index 146a2b142..000000000 --- a/coreutils/dev/uu_touch/options/sources/static.REFERENCE.html +++ /dev/null @@ -1 +0,0 @@ -REFERENCE in uu_touch::options::sources - Rust
pub static REFERENCE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/sources/static.TIMESTAMP.html b/coreutils/dev/uu_touch/options/sources/static.TIMESTAMP.html deleted file mode 100644 index d2a7576aa..000000000 --- a/coreutils/dev/uu_touch/options/sources/static.TIMESTAMP.html +++ /dev/null @@ -1 +0,0 @@ -TIMESTAMP in uu_touch::options::sources - Rust
pub static TIMESTAMP: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/static.ACCESS.html b/coreutils/dev/uu_touch/options/static.ACCESS.html deleted file mode 100644 index 50d882326..000000000 --- a/coreutils/dev/uu_touch/options/static.ACCESS.html +++ /dev/null @@ -1 +0,0 @@ -ACCESS in uu_touch::options - Rust

Static uu_touch::options::ACCESS

source ·
pub static ACCESS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/static.HELP.html b/coreutils/dev/uu_touch/options/static.HELP.html deleted file mode 100644 index 680192f6c..000000000 --- a/coreutils/dev/uu_touch/options/static.HELP.html +++ /dev/null @@ -1 +0,0 @@ -HELP in uu_touch::options - Rust

Static uu_touch::options::HELP

source ·
pub static HELP: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/static.MODIFICATION.html b/coreutils/dev/uu_touch/options/static.MODIFICATION.html deleted file mode 100644 index e253a3a76..000000000 --- a/coreutils/dev/uu_touch/options/static.MODIFICATION.html +++ /dev/null @@ -1 +0,0 @@ -MODIFICATION in uu_touch::options - Rust
pub static MODIFICATION: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/static.NO_CREATE.html b/coreutils/dev/uu_touch/options/static.NO_CREATE.html deleted file mode 100644 index e4ede5c9e..000000000 --- a/coreutils/dev/uu_touch/options/static.NO_CREATE.html +++ /dev/null @@ -1 +0,0 @@ -NO_CREATE in uu_touch::options - Rust

Static uu_touch::options::NO_CREATE

source ·
pub static NO_CREATE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/static.NO_DEREF.html b/coreutils/dev/uu_touch/options/static.NO_DEREF.html deleted file mode 100644 index 340688a27..000000000 --- a/coreutils/dev/uu_touch/options/static.NO_DEREF.html +++ /dev/null @@ -1 +0,0 @@ -NO_DEREF in uu_touch::options - Rust

Static uu_touch::options::NO_DEREF

source ·
pub static NO_DEREF: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/static.SOURCES.html b/coreutils/dev/uu_touch/options/static.SOURCES.html deleted file mode 100644 index 07746de3f..000000000 --- a/coreutils/dev/uu_touch/options/static.SOURCES.html +++ /dev/null @@ -1 +0,0 @@ -SOURCES in uu_touch::options - Rust

Static uu_touch::options::SOURCES

source ·
pub static SOURCES: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/options/static.TIME.html b/coreutils/dev/uu_touch/options/static.TIME.html deleted file mode 100644 index 0e78e44f8..000000000 --- a/coreutils/dev/uu_touch/options/static.TIME.html +++ /dev/null @@ -1 +0,0 @@ -TIME in uu_touch::options - Rust

Static uu_touch::options::TIME

source ·
pub static TIME: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_touch/sidebar-items.js b/coreutils/dev/uu_touch/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_touch/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tr/all.html b/coreutils/dev/uu_tr/all.html deleted file mode 100644 index 59b4fdad5..000000000 --- a/coreutils/dev/uu_tr/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_tr/fn.uu_app.html b/coreutils/dev/uu_tr/fn.uu_app.html deleted file mode 100644 index 541e273ad..000000000 --- a/coreutils/dev/uu_tr/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_tr - Rust

Function uu_tr::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_tr/fn.uumain.html b/coreutils/dev/uu_tr/fn.uumain.html deleted file mode 100644 index 59bd553de..000000000 --- a/coreutils/dev/uu_tr/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_tr - Rust

Function uu_tr::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_tr/index.html b/coreutils/dev/uu_tr/index.html deleted file mode 100644 index 6f951f59f..000000000 --- a/coreutils/dev/uu_tr/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_tr - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_tr/sidebar-items.js b/coreutils/dev/uu_tr/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_tr/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_true/all.html b/coreutils/dev/uu_true/all.html deleted file mode 100644 index 69f78ca6c..000000000 --- a/coreutils/dev/uu_true/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_true/fn.uu_app.html b/coreutils/dev/uu_true/fn.uu_app.html deleted file mode 100644 index 5edee1240..000000000 --- a/coreutils/dev/uu_true/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_true - Rust

Function uu_true::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_true/fn.uumain.html b/coreutils/dev/uu_true/fn.uumain.html deleted file mode 100644 index cb1dc1d9e..000000000 --- a/coreutils/dev/uu_true/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_true - Rust

Function uu_true::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_true/index.html b/coreutils/dev/uu_true/index.html deleted file mode 100644 index fc9bda5ed..000000000 --- a/coreutils/dev/uu_true/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_true - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_true/sidebar-items.js b/coreutils/dev/uu_true/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_true/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_truncate/all.html b/coreutils/dev/uu_truncate/all.html deleted file mode 100644 index 77b859315..000000000 --- a/coreutils/dev/uu_truncate/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/fn.uu_app.html b/coreutils/dev/uu_truncate/fn.uu_app.html deleted file mode 100644 index 1ed0e5e2a..000000000 --- a/coreutils/dev/uu_truncate/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_truncate - Rust

Function uu_truncate::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/fn.uumain.html b/coreutils/dev/uu_truncate/fn.uumain.html deleted file mode 100644 index 489f59f7c..000000000 --- a/coreutils/dev/uu_truncate/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_truncate - Rust

Function uu_truncate::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/index.html b/coreutils/dev/uu_truncate/index.html deleted file mode 100644 index 14480dd7c..000000000 --- a/coreutils/dev/uu_truncate/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_truncate - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/options/index.html b/coreutils/dev/uu_truncate/options/index.html deleted file mode 100644 index 3150c1fbd..000000000 --- a/coreutils/dev/uu_truncate/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_truncate::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/options/sidebar-items.js b/coreutils/dev/uu_truncate/options/sidebar-items.js deleted file mode 100644 index abf12cb64..000000000 --- a/coreutils/dev/uu_truncate/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["ARG_FILES","IO_BLOCKS","NO_CREATE","REFERENCE","SIZE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_truncate/options/static.ARG_FILES.html b/coreutils/dev/uu_truncate/options/static.ARG_FILES.html deleted file mode 100644 index be06cef2e..000000000 --- a/coreutils/dev/uu_truncate/options/static.ARG_FILES.html +++ /dev/null @@ -1 +0,0 @@ -ARG_FILES in uu_truncate::options - Rust
pub static ARG_FILES: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/options/static.IO_BLOCKS.html b/coreutils/dev/uu_truncate/options/static.IO_BLOCKS.html deleted file mode 100644 index 5ee2a6e8b..000000000 --- a/coreutils/dev/uu_truncate/options/static.IO_BLOCKS.html +++ /dev/null @@ -1 +0,0 @@ -IO_BLOCKS in uu_truncate::options - Rust
pub static IO_BLOCKS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/options/static.NO_CREATE.html b/coreutils/dev/uu_truncate/options/static.NO_CREATE.html deleted file mode 100644 index 8ea035bf9..000000000 --- a/coreutils/dev/uu_truncate/options/static.NO_CREATE.html +++ /dev/null @@ -1 +0,0 @@ -NO_CREATE in uu_truncate::options - Rust
pub static NO_CREATE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/options/static.REFERENCE.html b/coreutils/dev/uu_truncate/options/static.REFERENCE.html deleted file mode 100644 index 1e894bb64..000000000 --- a/coreutils/dev/uu_truncate/options/static.REFERENCE.html +++ /dev/null @@ -1 +0,0 @@ -REFERENCE in uu_truncate::options - Rust
pub static REFERENCE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/options/static.SIZE.html b/coreutils/dev/uu_truncate/options/static.SIZE.html deleted file mode 100644 index eb39c6bb3..000000000 --- a/coreutils/dev/uu_truncate/options/static.SIZE.html +++ /dev/null @@ -1 +0,0 @@ -SIZE in uu_truncate::options - Rust

Static uu_truncate::options::SIZE

source ·
pub static SIZE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_truncate/sidebar-items.js b/coreutils/dev/uu_truncate/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_truncate/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tsort/all.html b/coreutils/dev/uu_tsort/all.html deleted file mode 100644 index d9aa0ef41..000000000 --- a/coreutils/dev/uu_tsort/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_tsort/fn.uu_app.html b/coreutils/dev/uu_tsort/fn.uu_app.html deleted file mode 100644 index 10bc1a8c4..000000000 --- a/coreutils/dev/uu_tsort/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_tsort - Rust

Function uu_tsort::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_tsort/fn.uumain.html b/coreutils/dev/uu_tsort/fn.uumain.html deleted file mode 100644 index 349d505c6..000000000 --- a/coreutils/dev/uu_tsort/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_tsort - Rust

Function uu_tsort::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_tsort/index.html b/coreutils/dev/uu_tsort/index.html deleted file mode 100644 index 33fe83505..000000000 --- a/coreutils/dev/uu_tsort/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_tsort - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_tsort/sidebar-items.js b/coreutils/dev/uu_tsort/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_tsort/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_tty/all.html b/coreutils/dev/uu_tty/all.html deleted file mode 100644 index d5a5528e7..000000000 --- a/coreutils/dev/uu_tty/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_tty/fn.uu_app.html b/coreutils/dev/uu_tty/fn.uu_app.html deleted file mode 100644 index f9f404591..000000000 --- a/coreutils/dev/uu_tty/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_tty - Rust

Function uu_tty::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_tty/fn.uumain.html b/coreutils/dev/uu_tty/fn.uumain.html deleted file mode 100644 index c7381f1f7..000000000 --- a/coreutils/dev/uu_tty/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_tty - Rust

Function uu_tty::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_tty/index.html b/coreutils/dev/uu_tty/index.html deleted file mode 100644 index c5ceae0cf..000000000 --- a/coreutils/dev/uu_tty/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_tty - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_tty/sidebar-items.js b/coreutils/dev/uu_tty/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_tty/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_uname/all.html b/coreutils/dev/uu_uname/all.html deleted file mode 100644 index a6de9f71d..000000000 --- a/coreutils/dev/uu_uname/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/fn.uu_app.html b/coreutils/dev/uu_uname/fn.uu_app.html deleted file mode 100644 index a173bdbfb..000000000 --- a/coreutils/dev/uu_uname/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_uname - Rust

Function uu_uname::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/fn.uumain.html b/coreutils/dev/uu_uname/fn.uumain.html deleted file mode 100644 index 40c023aeb..000000000 --- a/coreutils/dev/uu_uname/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_uname - Rust

Function uu_uname::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/index.html b/coreutils/dev/uu_uname/index.html deleted file mode 100644 index 42d2133b7..000000000 --- a/coreutils/dev/uu_uname/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_uname - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/index.html b/coreutils/dev/uu_uname/options/index.html deleted file mode 100644 index 5c5fd8d13..000000000 --- a/coreutils/dev/uu_uname/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_uname::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/sidebar-items.js b/coreutils/dev/uu_uname/options/sidebar-items.js deleted file mode 100644 index f899a3a7e..000000000 --- a/coreutils/dev/uu_uname/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["ALL","HARDWARE_PLATFORM","KERNEL_NAME","KERNEL_RELEASE","KERNEL_VERSION","MACHINE","NODENAME","OS","PROCESSOR"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/static.ALL.html b/coreutils/dev/uu_uname/options/static.ALL.html deleted file mode 100644 index edd8b0cf2..000000000 --- a/coreutils/dev/uu_uname/options/static.ALL.html +++ /dev/null @@ -1 +0,0 @@ -ALL in uu_uname::options - Rust

Static uu_uname::options::ALL

source ·
pub static ALL: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/static.HARDWARE_PLATFORM.html b/coreutils/dev/uu_uname/options/static.HARDWARE_PLATFORM.html deleted file mode 100644 index 996943ef9..000000000 --- a/coreutils/dev/uu_uname/options/static.HARDWARE_PLATFORM.html +++ /dev/null @@ -1 +0,0 @@ -HARDWARE_PLATFORM in uu_uname::options - Rust
pub static HARDWARE_PLATFORM: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/static.KERNEL_NAME.html b/coreutils/dev/uu_uname/options/static.KERNEL_NAME.html deleted file mode 100644 index a8ecea1a6..000000000 --- a/coreutils/dev/uu_uname/options/static.KERNEL_NAME.html +++ /dev/null @@ -1 +0,0 @@ -KERNEL_NAME in uu_uname::options - Rust
pub static KERNEL_NAME: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/static.KERNEL_RELEASE.html b/coreutils/dev/uu_uname/options/static.KERNEL_RELEASE.html deleted file mode 100644 index d714462a1..000000000 --- a/coreutils/dev/uu_uname/options/static.KERNEL_RELEASE.html +++ /dev/null @@ -1 +0,0 @@ -KERNEL_RELEASE in uu_uname::options - Rust
pub static KERNEL_RELEASE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/static.KERNEL_VERSION.html b/coreutils/dev/uu_uname/options/static.KERNEL_VERSION.html deleted file mode 100644 index bccda9b83..000000000 --- a/coreutils/dev/uu_uname/options/static.KERNEL_VERSION.html +++ /dev/null @@ -1 +0,0 @@ -KERNEL_VERSION in uu_uname::options - Rust
pub static KERNEL_VERSION: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/static.MACHINE.html b/coreutils/dev/uu_uname/options/static.MACHINE.html deleted file mode 100644 index ca9b5fffc..000000000 --- a/coreutils/dev/uu_uname/options/static.MACHINE.html +++ /dev/null @@ -1 +0,0 @@ -MACHINE in uu_uname::options - Rust

Static uu_uname::options::MACHINE

source ·
pub static MACHINE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/static.NODENAME.html b/coreutils/dev/uu_uname/options/static.NODENAME.html deleted file mode 100644 index 69c92144d..000000000 --- a/coreutils/dev/uu_uname/options/static.NODENAME.html +++ /dev/null @@ -1 +0,0 @@ -NODENAME in uu_uname::options - Rust

Static uu_uname::options::NODENAME

source ·
pub static NODENAME: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/static.OS.html b/coreutils/dev/uu_uname/options/static.OS.html deleted file mode 100644 index 872a6ace7..000000000 --- a/coreutils/dev/uu_uname/options/static.OS.html +++ /dev/null @@ -1 +0,0 @@ -OS in uu_uname::options - Rust

Static uu_uname::options::OS

source ·
pub static OS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/options/static.PROCESSOR.html b/coreutils/dev/uu_uname/options/static.PROCESSOR.html deleted file mode 100644 index 035eb3c12..000000000 --- a/coreutils/dev/uu_uname/options/static.PROCESSOR.html +++ /dev/null @@ -1 +0,0 @@ -PROCESSOR in uu_uname::options - Rust

Static uu_uname::options::PROCESSOR

source ·
pub static PROCESSOR: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uname/sidebar-items.js b/coreutils/dev/uu_uname/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_uname/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_unexpand/all.html b/coreutils/dev/uu_unexpand/all.html deleted file mode 100644 index b481cc91f..000000000 --- a/coreutils/dev/uu_unexpand/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_unexpand/fn.uu_app.html b/coreutils/dev/uu_unexpand/fn.uu_app.html deleted file mode 100644 index 54c91771f..000000000 --- a/coreutils/dev/uu_unexpand/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_unexpand - Rust

Function uu_unexpand::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_unexpand/fn.uumain.html b/coreutils/dev/uu_unexpand/fn.uumain.html deleted file mode 100644 index cae4bf664..000000000 --- a/coreutils/dev/uu_unexpand/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_unexpand - Rust

Function uu_unexpand::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_unexpand/index.html b/coreutils/dev/uu_unexpand/index.html deleted file mode 100644 index f4d09a0bf..000000000 --- a/coreutils/dev/uu_unexpand/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_unexpand - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_unexpand/sidebar-items.js b/coreutils/dev/uu_unexpand/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_unexpand/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_uniq/all.html b/coreutils/dev/uu_uniq/all.html deleted file mode 100644 index 831fe3d37..000000000 --- a/coreutils/dev/uu_uniq/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/fn.uu_app.html b/coreutils/dev/uu_uniq/fn.uu_app.html deleted file mode 100644 index e3d183b8a..000000000 --- a/coreutils/dev/uu_uniq/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_uniq - Rust

Function uu_uniq::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/fn.uumain.html b/coreutils/dev/uu_uniq/fn.uumain.html deleted file mode 100644 index fafcf2fd4..000000000 --- a/coreutils/dev/uu_uniq/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_uniq - Rust

Function uu_uniq::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/index.html b/coreutils/dev/uu_uniq/index.html deleted file mode 100644 index 4235b9f59..000000000 --- a/coreutils/dev/uu_uniq/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_uniq - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/index.html b/coreutils/dev/uu_uniq/options/index.html deleted file mode 100644 index 10246235b..000000000 --- a/coreutils/dev/uu_uniq/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_uniq::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/sidebar-items.js b/coreutils/dev/uu_uniq/options/sidebar-items.js deleted file mode 100644 index cad109c7e..000000000 --- a/coreutils/dev/uu_uniq/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["ALL_REPEATED","CHECK_CHARS","COUNT","GROUP","IGNORE_CASE","REPEATED","SKIP_CHARS","SKIP_FIELDS","UNIQUE","ZERO_TERMINATED"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.ALL_REPEATED.html b/coreutils/dev/uu_uniq/options/static.ALL_REPEATED.html deleted file mode 100644 index cb331f4e0..000000000 --- a/coreutils/dev/uu_uniq/options/static.ALL_REPEATED.html +++ /dev/null @@ -1 +0,0 @@ -ALL_REPEATED in uu_uniq::options - Rust
pub static ALL_REPEATED: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.CHECK_CHARS.html b/coreutils/dev/uu_uniq/options/static.CHECK_CHARS.html deleted file mode 100644 index 0416e166c..000000000 --- a/coreutils/dev/uu_uniq/options/static.CHECK_CHARS.html +++ /dev/null @@ -1 +0,0 @@ -CHECK_CHARS in uu_uniq::options - Rust
pub static CHECK_CHARS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.COUNT.html b/coreutils/dev/uu_uniq/options/static.COUNT.html deleted file mode 100644 index a20918ee1..000000000 --- a/coreutils/dev/uu_uniq/options/static.COUNT.html +++ /dev/null @@ -1 +0,0 @@ -COUNT in uu_uniq::options - Rust

Static uu_uniq::options::COUNT

source ·
pub static COUNT: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.GROUP.html b/coreutils/dev/uu_uniq/options/static.GROUP.html deleted file mode 100644 index 6f8c3a12e..000000000 --- a/coreutils/dev/uu_uniq/options/static.GROUP.html +++ /dev/null @@ -1 +0,0 @@ -GROUP in uu_uniq::options - Rust

Static uu_uniq::options::GROUP

source ·
pub static GROUP: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.IGNORE_CASE.html b/coreutils/dev/uu_uniq/options/static.IGNORE_CASE.html deleted file mode 100644 index 1aaeec904..000000000 --- a/coreutils/dev/uu_uniq/options/static.IGNORE_CASE.html +++ /dev/null @@ -1 +0,0 @@ -IGNORE_CASE in uu_uniq::options - Rust
pub static IGNORE_CASE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.REPEATED.html b/coreutils/dev/uu_uniq/options/static.REPEATED.html deleted file mode 100644 index 740ed24c8..000000000 --- a/coreutils/dev/uu_uniq/options/static.REPEATED.html +++ /dev/null @@ -1 +0,0 @@ -REPEATED in uu_uniq::options - Rust

Static uu_uniq::options::REPEATED

source ·
pub static REPEATED: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.SKIP_CHARS.html b/coreutils/dev/uu_uniq/options/static.SKIP_CHARS.html deleted file mode 100644 index a51e2ae93..000000000 --- a/coreutils/dev/uu_uniq/options/static.SKIP_CHARS.html +++ /dev/null @@ -1 +0,0 @@ -SKIP_CHARS in uu_uniq::options - Rust

Static uu_uniq::options::SKIP_CHARS

source ·
pub static SKIP_CHARS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.SKIP_FIELDS.html b/coreutils/dev/uu_uniq/options/static.SKIP_FIELDS.html deleted file mode 100644 index 4660eca7a..000000000 --- a/coreutils/dev/uu_uniq/options/static.SKIP_FIELDS.html +++ /dev/null @@ -1 +0,0 @@ -SKIP_FIELDS in uu_uniq::options - Rust
pub static SKIP_FIELDS: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.UNIQUE.html b/coreutils/dev/uu_uniq/options/static.UNIQUE.html deleted file mode 100644 index f00826862..000000000 --- a/coreutils/dev/uu_uniq/options/static.UNIQUE.html +++ /dev/null @@ -1 +0,0 @@ -UNIQUE in uu_uniq::options - Rust

Static uu_uniq::options::UNIQUE

source ·
pub static UNIQUE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/options/static.ZERO_TERMINATED.html b/coreutils/dev/uu_uniq/options/static.ZERO_TERMINATED.html deleted file mode 100644 index 27c63861a..000000000 --- a/coreutils/dev/uu_uniq/options/static.ZERO_TERMINATED.html +++ /dev/null @@ -1 +0,0 @@ -ZERO_TERMINATED in uu_uniq::options - Rust
pub static ZERO_TERMINATED: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uniq/sidebar-items.js b/coreutils/dev/uu_uniq/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_uniq/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_unlink/all.html b/coreutils/dev/uu_unlink/all.html deleted file mode 100644 index 93515f4d7..000000000 --- a/coreutils/dev/uu_unlink/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_unlink/fn.uu_app.html b/coreutils/dev/uu_unlink/fn.uu_app.html deleted file mode 100644 index 7cbcddee4..000000000 --- a/coreutils/dev/uu_unlink/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_unlink - Rust

Function uu_unlink::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_unlink/fn.uumain.html b/coreutils/dev/uu_unlink/fn.uumain.html deleted file mode 100644 index c2f72e95f..000000000 --- a/coreutils/dev/uu_unlink/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_unlink - Rust

Function uu_unlink::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_unlink/index.html b/coreutils/dev/uu_unlink/index.html deleted file mode 100644 index 9f90aac80..000000000 --- a/coreutils/dev/uu_unlink/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_unlink - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_unlink/sidebar-items.js b/coreutils/dev/uu_unlink/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_unlink/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_uptime/all.html b/coreutils/dev/uu_uptime/all.html deleted file mode 100644 index 8824c7436..000000000 --- a/coreutils/dev/uu_uptime/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

Statics

\ No newline at end of file diff --git a/coreutils/dev/uu_uptime/fn.uu_app.html b/coreutils/dev/uu_uptime/fn.uu_app.html deleted file mode 100644 index cd54e3112..000000000 --- a/coreutils/dev/uu_uptime/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_uptime - Rust

Function uu_uptime::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_uptime/fn.uumain.html b/coreutils/dev/uu_uptime/fn.uumain.html deleted file mode 100644 index 25abf891e..000000000 --- a/coreutils/dev/uu_uptime/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_uptime - Rust

Function uu_uptime::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_uptime/index.html b/coreutils/dev/uu_uptime/index.html deleted file mode 100644 index bf872f6ca..000000000 --- a/coreutils/dev/uu_uptime/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_uptime - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_uptime/options/index.html b/coreutils/dev/uu_uptime/options/index.html deleted file mode 100644 index 030541acc..000000000 --- a/coreutils/dev/uu_uptime/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_uptime::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_uptime/options/sidebar-items.js b/coreutils/dev/uu_uptime/options/sidebar-items.js deleted file mode 100644 index 83eecae3b..000000000 --- a/coreutils/dev/uu_uptime/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"static":["SINCE"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_uptime/options/static.SINCE.html b/coreutils/dev/uu_uptime/options/static.SINCE.html deleted file mode 100644 index 308b87fae..000000000 --- a/coreutils/dev/uu_uptime/options/static.SINCE.html +++ /dev/null @@ -1 +0,0 @@ -SINCE in uu_uptime::options - Rust

Static uu_uptime::options::SINCE

source ·
pub static SINCE: &str
\ No newline at end of file diff --git a/coreutils/dev/uu_uptime/sidebar-items.js b/coreutils/dev/uu_uptime/sidebar-items.js deleted file mode 100644 index 9477fb2ee..000000000 --- a/coreutils/dev/uu_uptime/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"],"mod":["options"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_users/all.html b/coreutils/dev/uu_users/all.html deleted file mode 100644 index 8e893d29c..000000000 --- a/coreutils/dev/uu_users/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_users/fn.uu_app.html b/coreutils/dev/uu_users/fn.uu_app.html deleted file mode 100644 index 3057ba86e..000000000 --- a/coreutils/dev/uu_users/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_users - Rust

Function uu_users::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_users/fn.uumain.html b/coreutils/dev/uu_users/fn.uumain.html deleted file mode 100644 index 386855620..000000000 --- a/coreutils/dev/uu_users/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_users - Rust

Function uu_users::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_users/index.html b/coreutils/dev/uu_users/index.html deleted file mode 100644 index 739b5815e..000000000 --- a/coreutils/dev/uu_users/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_users - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_users/sidebar-items.js b/coreutils/dev/uu_users/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_users/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_vdir/all.html b/coreutils/dev/uu_vdir/all.html deleted file mode 100644 index d426ed79f..000000000 --- a/coreutils/dev/uu_vdir/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_vdir/fn.uu_app.html b/coreutils/dev/uu_vdir/fn.uu_app.html deleted file mode 100644 index ed3719216..000000000 --- a/coreutils/dev/uu_vdir/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_vdir - Rust

Function uu_vdir::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_vdir/fn.uumain.html b/coreutils/dev/uu_vdir/fn.uumain.html deleted file mode 100644 index 3e1e9d31e..000000000 --- a/coreutils/dev/uu_vdir/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_vdir - Rust

Function uu_vdir::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_vdir/index.html b/coreutils/dev/uu_vdir/index.html deleted file mode 100644 index 5ef11c14a..000000000 --- a/coreutils/dev/uu_vdir/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_vdir - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_vdir/sidebar-items.js b/coreutils/dev/uu_vdir/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_vdir/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_wc/all.html b/coreutils/dev/uu_wc/all.html deleted file mode 100644 index c79535a81..000000000 --- a/coreutils/dev/uu_wc/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_wc/fn.uu_app.html b/coreutils/dev/uu_wc/fn.uu_app.html deleted file mode 100644 index a7e10d4db..000000000 --- a/coreutils/dev/uu_wc/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_wc - Rust

Function uu_wc::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_wc/fn.uumain.html b/coreutils/dev/uu_wc/fn.uumain.html deleted file mode 100644 index 7fca3d06c..000000000 --- a/coreutils/dev/uu_wc/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_wc - Rust

Function uu_wc::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_wc/index.html b/coreutils/dev/uu_wc/index.html deleted file mode 100644 index eee1d823f..000000000 --- a/coreutils/dev/uu_wc/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_wc - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_wc/sidebar-items.js b/coreutils/dev/uu_wc/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_wc/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_who/all.html b/coreutils/dev/uu_who/all.html deleted file mode 100644 index 441045a13..000000000 --- a/coreutils/dev/uu_who/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_who/fn.uu_app.html b/coreutils/dev/uu_who/fn.uu_app.html deleted file mode 100644 index bb33ad5b3..000000000 --- a/coreutils/dev/uu_who/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_who - Rust

Function uu_who::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_who/fn.uumain.html b/coreutils/dev/uu_who/fn.uumain.html deleted file mode 100644 index 086340da5..000000000 --- a/coreutils/dev/uu_who/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_who - Rust

Function uu_who::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_who/index.html b/coreutils/dev/uu_who/index.html deleted file mode 100644 index 0156f5baa..000000000 --- a/coreutils/dev/uu_who/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_who - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_who/sidebar-items.js b/coreutils/dev/uu_who/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_who/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_whoami/all.html b/coreutils/dev/uu_whoami/all.html deleted file mode 100644 index 2cf574d80..000000000 --- a/coreutils/dev/uu_whoami/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_whoami/fn.uu_app.html b/coreutils/dev/uu_whoami/fn.uu_app.html deleted file mode 100644 index 487603582..000000000 --- a/coreutils/dev/uu_whoami/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_whoami - Rust

Function uu_whoami::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_whoami/fn.uumain.html b/coreutils/dev/uu_whoami/fn.uumain.html deleted file mode 100644 index 0ddef3321..000000000 --- a/coreutils/dev/uu_whoami/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_whoami - Rust

Function uu_whoami::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_whoami/index.html b/coreutils/dev/uu_whoami/index.html deleted file mode 100644 index 8bde459e2..000000000 --- a/coreutils/dev/uu_whoami/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_whoami - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_whoami/sidebar-items.js b/coreutils/dev/uu_whoami/sidebar-items.js deleted file mode 100644 index b75e204de..000000000 --- a/coreutils/dev/uu_whoami/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uu_yes/all.html b/coreutils/dev/uu_yes/all.html deleted file mode 100644 index 3dfa4b9a2..000000000 --- a/coreutils/dev/uu_yes/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uu_yes/fn.exec.html b/coreutils/dev/uu_yes/fn.exec.html deleted file mode 100644 index 62fd4f78e..000000000 --- a/coreutils/dev/uu_yes/fn.exec.html +++ /dev/null @@ -1 +0,0 @@ -exec in uu_yes - Rust

Function uu_yes::exec

source ·
pub fn exec(bytes: &[u8]) -> Result<()>
\ No newline at end of file diff --git a/coreutils/dev/uu_yes/fn.uu_app.html b/coreutils/dev/uu_yes/fn.uu_app.html deleted file mode 100644 index ddd66a36f..000000000 --- a/coreutils/dev/uu_yes/fn.uu_app.html +++ /dev/null @@ -1 +0,0 @@ -uu_app in uu_yes - Rust

Function uu_yes::uu_app

source ·
pub fn uu_app() -> Command
\ No newline at end of file diff --git a/coreutils/dev/uu_yes/fn.uumain.html b/coreutils/dev/uu_yes/fn.uumain.html deleted file mode 100644 index abb0b7d5d..000000000 --- a/coreutils/dev/uu_yes/fn.uumain.html +++ /dev/null @@ -1 +0,0 @@ -uumain in uu_yes - Rust

Function uu_yes::uumain

source ·
pub fn uumain(args: impl Args) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uu_yes/index.html b/coreutils/dev/uu_yes/index.html deleted file mode 100644 index af51b40e5..000000000 --- a/coreutils/dev/uu_yes/index.html +++ /dev/null @@ -1 +0,0 @@ -uu_yes - Rust
\ No newline at end of file diff --git a/coreutils/dev/uu_yes/sidebar-items.js b/coreutils/dev/uu_yes/sidebar-items.js deleted file mode 100644 index 74dee7fb0..000000000 --- a/coreutils/dev/uu_yes/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["exec","uu_app","uumain"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/all.html b/coreutils/dev/uucore/all.html deleted file mode 100644 index 4abdaa5a8..000000000 --- a/coreutils/dev/uucore/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Attribute Macros

Functions

Type Definitions

Statics

Constants

\ No newline at end of file diff --git a/coreutils/dev/uucore/attr.main.html b/coreutils/dev/uucore/attr.main.html deleted file mode 100644 index 665bc1417..000000000 --- a/coreutils/dev/uucore/attr.main.html +++ /dev/null @@ -1 +0,0 @@ -main in uucore - Rust

Attribute Macro uucore::main

source ·
#[main]
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/arguments/fn.backup.html b/coreutils/dev/uucore/backup_control/arguments/fn.backup.html deleted file mode 100644 index 5e5df0131..000000000 --- a/coreutils/dev/uucore/backup_control/arguments/fn.backup.html +++ /dev/null @@ -1,2 +0,0 @@ -backup in uucore::backup_control::arguments - Rust
pub fn backup() -> Arg
Expand description

‘–backup’ argument

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/arguments/fn.backup_no_args.html b/coreutils/dev/uucore/backup_control/arguments/fn.backup_no_args.html deleted file mode 100644 index a9083c9e1..000000000 --- a/coreutils/dev/uucore/backup_control/arguments/fn.backup_no_args.html +++ /dev/null @@ -1,2 +0,0 @@ -backup_no_args in uucore::backup_control::arguments - Rust
pub fn backup_no_args() -> Arg
Expand description

‘-b’ argument

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/arguments/fn.suffix.html b/coreutils/dev/uucore/backup_control/arguments/fn.suffix.html deleted file mode 100644 index ac2982135..000000000 --- a/coreutils/dev/uucore/backup_control/arguments/fn.suffix.html +++ /dev/null @@ -1,2 +0,0 @@ -suffix in uucore::backup_control::arguments - Rust
pub fn suffix() -> Arg
Expand description

‘-S, –suffix’ argument

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/arguments/index.html b/coreutils/dev/uucore/backup_control/arguments/index.html deleted file mode 100644 index 8623b6bdd..000000000 --- a/coreutils/dev/uucore/backup_control/arguments/index.html +++ /dev/null @@ -1,6 +0,0 @@ -uucore::backup_control::arguments - Rust
Expand description

Arguments for backup-related functionality.

-

Rather than implementing the clap-Arguments for every utility, it is -recommended to include the clap arguments via the functions provided here. -This way the backup-specific arguments are handled uniformly across -utilities and can be maintained in one central place.

-

Statics

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/arguments/sidebar-items.js b/coreutils/dev/uucore/backup_control/arguments/sidebar-items.js deleted file mode 100644 index 7a8d611a7..000000000 --- a/coreutils/dev/uucore/backup_control/arguments/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["backup","backup_no_args","suffix"],"static":["OPT_BACKUP","OPT_BACKUP_NO_ARG","OPT_SUFFIX"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/arguments/static.OPT_BACKUP.html b/coreutils/dev/uucore/backup_control/arguments/static.OPT_BACKUP.html deleted file mode 100644 index 3d323d59f..000000000 --- a/coreutils/dev/uucore/backup_control/arguments/static.OPT_BACKUP.html +++ /dev/null @@ -1 +0,0 @@ -OPT_BACKUP in uucore::backup_control::arguments - Rust
pub static OPT_BACKUP: &str
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/arguments/static.OPT_BACKUP_NO_ARG.html b/coreutils/dev/uucore/backup_control/arguments/static.OPT_BACKUP_NO_ARG.html deleted file mode 100644 index 380bc54a6..000000000 --- a/coreutils/dev/uucore/backup_control/arguments/static.OPT_BACKUP_NO_ARG.html +++ /dev/null @@ -1 +0,0 @@ -OPT_BACKUP_NO_ARG in uucore::backup_control::arguments - Rust
pub static OPT_BACKUP_NO_ARG: &str
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/arguments/static.OPT_SUFFIX.html b/coreutils/dev/uucore/backup_control/arguments/static.OPT_SUFFIX.html deleted file mode 100644 index 41b6d6300..000000000 --- a/coreutils/dev/uucore/backup_control/arguments/static.OPT_SUFFIX.html +++ /dev/null @@ -1 +0,0 @@ -OPT_SUFFIX in uucore::backup_control::arguments - Rust
pub static OPT_SUFFIX: &str
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/constant.BACKUP_CONTROL_LONG_HELP.html b/coreutils/dev/uucore/backup_control/constant.BACKUP_CONTROL_LONG_HELP.html deleted file mode 100644 index a92fd89c5..000000000 --- a/coreutils/dev/uucore/backup_control/constant.BACKUP_CONTROL_LONG_HELP.html +++ /dev/null @@ -1,8 +0,0 @@ -BACKUP_CONTROL_LONG_HELP in uucore::backup_control - Rust
pub const BACKUP_CONTROL_LONG_HELP: &str = "The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
-The version control method may be selected via the --backup option or through
-the VERSION_CONTROL environment variable.  Here are the values:
-
-  none, off       never make backups (even if --backup is given)
-  numbered, t     make numbered backups
-  existing, nil   numbered if numbered backups exist, simple otherwise
-  simple, never   always make simple backups";
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/enum.BackupError.html b/coreutils/dev/uucore/backup_control/enum.BackupError.html deleted file mode 100644 index 962b3e3e3..000000000 --- a/coreutils/dev/uucore/backup_control/enum.BackupError.html +++ /dev/null @@ -1,30 +0,0 @@ -BackupError in uucore::backup_control - Rust
pub enum BackupError {
-    InvalidArgument(String, String),
-    AmbiguousArgument(String, String),
-    BackupImpossible(),
-}
Expand description

Backup error types.

-

Errors are currently raised by determine_backup_mode only. All errors -are implemented as UError for uniform handling across utilities.

-

Variants§

§

InvalidArgument(String, String)

An invalid argument (e.g. ‘foo’) was given as backup type. First -parameter is the argument, second is the arguments origin (CLI or -ENV-var)

-
§

AmbiguousArgument(String, String)

An ambiguous argument (e.g. ‘n’) was given as backup type. First -parameter is the argument, second is the arguments origin (CLI or -ENV-var)

-
§

BackupImpossible()

Currently unused

-

Trait Implementations§

source§

impl Debug for BackupError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for BackupError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for BackupError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq<BackupError> for BackupError

source§

fn eq(&self, other: &BackupError) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl UError for BackupError

source§

fn code(&self) -> i32

Error code of a custom error. Read more
source§

fn usage(&self) -> bool

Print usage help to a custom error. Read more
source§

impl Eq for BackupError

source§

impl StructuralEq for BackupError

source§

impl StructuralPartialEq for BackupError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/enum.BackupMode.html b/coreutils/dev/uucore/backup_control/enum.BackupMode.html deleted file mode 100644 index 2a15e7f74..000000000 --- a/coreutils/dev/uucore/backup_control/enum.BackupMode.html +++ /dev/null @@ -1,26 +0,0 @@ -BackupMode in uucore::backup_control - Rust
pub enum BackupMode {
-    NoBackup,
-    SimpleBackup,
-    NumberedBackup,
-    ExistingBackup,
-}
Expand description

Available backup modes.

-

The mapping of the backup modes to the CLI arguments is annotated on the -enum variants.

-

Variants§

§

NoBackup

Argument ‘none’, ‘off’

-
§

SimpleBackup

Argument ‘simple’, ‘never’

-
§

NumberedBackup

Argument ‘numbered’, ‘t’

-
§

ExistingBackup

Argument ‘existing’, ‘nil’

-

Trait Implementations§

source§

impl Clone for BackupMode

source§

fn clone(&self) -> BackupMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BackupMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<BackupMode> for BackupMode

source§

fn eq(&self, other: &BackupMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for BackupMode

source§

impl Eq for BackupMode

source§

impl StructuralEq for BackupMode

source§

impl StructuralPartialEq for BackupMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/fn.determine_backup_mode.html b/coreutils/dev/uucore/backup_control/fn.determine_backup_mode.html deleted file mode 100644 index fecf9e9ec..000000000 --- a/coreutils/dev/uucore/backup_control/fn.determine_backup_mode.html +++ /dev/null @@ -1,59 +0,0 @@ -determine_backup_mode in uucore::backup_control - Rust
pub fn determine_backup_mode(matches: &ArgMatches) -> UResult<BackupMode>
Expand description

Determine the “mode” for the backup operation to perform, if any.

-

Parses the backup options according to the GNU manual, and converts -them to an instance of BackupMode for further processing.

-

Takes [clap::ArgMatches] as argument which must contain the options -from arguments::backup() and arguments::backup_no_args(). Otherwise -the NoBackup mode is returned unconditionally.

-

It is recommended for anyone who would like to implement the -backup-functionality to use the arguments prepared in the arguments -submodule (see examples)

-

Errors

-

If an argument supplied directly to the long backup option, or read in -through the VERSION CONTROL env var is ambiguous (i.e. may resolve to -multiple backup modes) or invalid, an InvalidArgument or -AmbiguousArgument error is returned, respectively.

-

Examples

-

Here’s how one would integrate the backup mode determination into an -application.

- -
#[macro_use]
-extern crate uucore;
-use uucore::backup_control::{self, BackupMode};
-use clap::{Command, Arg, ArgMatches};
-
-fn main() {
-    let matches = Command::new("command")
-        .arg(backup_control::arguments::backup())
-        .arg(backup_control::arguments::backup_no_args())
-        .get_matches_from(vec![
-            "command", "-b", "--backup=t"
-        ]);
-
-    let backup_mode = backup_control::determine_backup_mode(&matches).unwrap();
-    assert_eq!(backup_mode, BackupMode::NumberedBackup)
-}
-

This example shows an ambiguous input, as ‘n’ may resolve to 4 different -backup modes.

- -
#[macro_use]
-extern crate uucore;
-use uucore::backup_control::{self, BackupMode, BackupError};
-use clap::{Command, Arg, ArgMatches};
-
-fn main() {
-    let matches = Command::new("command")
-        .arg(backup_control::arguments::backup())
-        .arg(backup_control::arguments::backup_no_args())
-        .get_matches_from(vec![
-            "command", "-b", "--backup=n"
-        ]);
-
-    let backup_mode = backup_control::determine_backup_mode(&matches);
-
-    assert!(backup_mode.is_err());
-    let err = backup_mode.unwrap_err();
-    // assert_eq!(err, BackupError::AmbiguousArgument);
-    // Use uucore functionality to show the error to the user
-    show!(err);
-}
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/fn.determine_backup_suffix.html b/coreutils/dev/uucore/backup_control/fn.determine_backup_suffix.html deleted file mode 100644 index 52cb412fa..000000000 --- a/coreutils/dev/uucore/backup_control/fn.determine_backup_suffix.html +++ /dev/null @@ -1,10 +0,0 @@ -determine_backup_suffix in uucore::backup_control - Rust
pub fn determine_backup_suffix(matches: &ArgMatches) -> String
Expand description

Obtain the suffix to use for a backup.

-

In order of precedence, this function obtains the backup suffix

-
    -
  1. From the ‘-S’ or ‘–suffix’ CLI argument, if present
  2. -
  3. From the “SIMPLE_BACKUP_SUFFIX” environment variable, if present
  4. -
  5. By using the default ‘~’ if none of the others apply
  6. -
-

This function directly takes [clap::ArgMatches] as argument and looks for -the ‘-S’ and ‘–suffix’ arguments itself.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/fn.get_backup_path.html b/coreutils/dev/uucore/backup_control/fn.get_backup_path.html deleted file mode 100644 index 23a4507fa..000000000 --- a/coreutils/dev/uucore/backup_control/fn.get_backup_path.html +++ /dev/null @@ -1,5 +0,0 @@ -get_backup_path in uucore::backup_control - Rust
pub fn get_backup_path(
-    backup_mode: BackupMode,
-    backup_path: &Path,
-    suffix: &str
-) -> Option<PathBuf>
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/fn.source_is_target_backup.html b/coreutils/dev/uucore/backup_control/fn.source_is_target_backup.html deleted file mode 100644 index 7b83a8611..000000000 --- a/coreutils/dev/uucore/backup_control/fn.source_is_target_backup.html +++ /dev/null @@ -1,20 +0,0 @@ -source_is_target_backup in uucore::backup_control - Rust
pub fn source_is_target_backup(
-    source: &Path,
-    target: &Path,
-    suffix: &str
-) -> bool
Expand description

Returns true if the source file is likely to be the simple backup file for the target file.

-

Arguments

-
    -
  • source - A Path reference that holds the source (backup) file path.
  • -
  • target - A Path reference that holds the target file path.
  • -
  • suffix - Str that holds the backup suffix.
  • -
-

Examples

-
use std::path::Path;
-use uucore::backup_control::source_is_target_backup;
-let source = Path::new("data.txt~");
-let target = Path::new("data.txt");
-let suffix = String::from("~");
-
-assert_eq!(source_is_target_backup(&source, &target, &suffix), true);
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/index.html b/coreutils/dev/uucore/backup_control/index.html deleted file mode 100644 index 201bbf85e..000000000 --- a/coreutils/dev/uucore/backup_control/index.html +++ /dev/null @@ -1,64 +0,0 @@ -uucore::backup_control - Rust

Module uucore::backup_control

source ·
Expand description

Implement GNU-style backup functionality.

-

This module implements the backup functionality as described in the GNU -manual. It provides

- -

Backup-functionality is implemented by the following utilities:

-
    -
  • cp
  • -
  • install
  • -
  • ln
  • -
  • mv
  • -
-

Usage example

-
#[macro_use]
-extern crate uucore;
-
-use clap::{Command, Arg, ArgMatches};
-use std::path::{Path, PathBuf};
-use uucore::backup_control::{self, BackupMode};
-use uucore::error::{UError, UResult};
-
-fn main() {
-    let usage = String::from("command [OPTION]... ARG");
-    let long_usage = String::from("And here's a detailed explanation");
-
-    let matches = Command::new("command")
-        .arg(backup_control::arguments::backup())
-        .arg(backup_control::arguments::backup_no_args())
-        .arg(backup_control::arguments::suffix())
-        .override_usage(usage)
-        .after_help(format!(
-            "{}\n{}",
-            long_usage,
-            backup_control::BACKUP_CONTROL_LONG_HELP
-        ))
-        .get_matches_from(vec![
-            "command", "--backup=t", "--suffix=bak~"
-        ]);
-
-    let backup_mode = match backup_control::determine_backup_mode(&matches) {
-        Err(e) => {
-            show!(e);
-            return;
-        },
-        Ok(mode) => mode,
-    };
-    let backup_suffix = backup_control::determine_backup_suffix(&matches);
-    let target_path = Path::new("/tmp/example");
-
-    let backup_path = backup_control::get_backup_path(
-        backup_mode, target_path, &backup_suffix
-    );
-
-    // Perform your backups here.
-
-}
-

Modules

  • Arguments for backup-related functionality.

Enums

Constants

Statics

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/sidebar-items.js b/coreutils/dev/uucore/backup_control/sidebar-items.js deleted file mode 100644 index 912a67a1b..000000000 --- a/coreutils/dev/uucore/backup_control/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["BACKUP_CONTROL_LONG_HELP"],"enum":["BackupError","BackupMode"],"fn":["determine_backup_mode","determine_backup_suffix","get_backup_path","source_is_target_backup"],"mod":["arguments"],"static":["BACKUP_CONTROL_VALUES"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/backup_control/static.BACKUP_CONTROL_VALUES.html b/coreutils/dev/uucore/backup_control/static.BACKUP_CONTROL_VALUES.html deleted file mode 100644 index 0e303d318..000000000 --- a/coreutils/dev/uucore/backup_control/static.BACKUP_CONTROL_VALUES.html +++ /dev/null @@ -1 +0,0 @@ -BACKUP_CONTROL_VALUES in uucore::backup_control - Rust
pub static BACKUP_CONTROL_VALUES: &[&str]
\ No newline at end of file diff --git a/coreutils/dev/uucore/display/fn.print_verbatim.html b/coreutils/dev/uucore/display/fn.print_verbatim.html deleted file mode 100644 index d185e5c1c..000000000 --- a/coreutils/dev/uucore/display/fn.print_verbatim.html +++ /dev/null @@ -1,2 +0,0 @@ -print_verbatim in uucore::display - Rust

Function uucore::display::print_verbatim

source ·
pub fn print_verbatim<S: AsRef<OsStr>>(text: S) -> Result<()>
Expand description

Like println_verbatim, without the trailing newline.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/display/fn.println_verbatim.html b/coreutils/dev/uucore/display/fn.println_verbatim.html deleted file mode 100644 index 7d766a056..000000000 --- a/coreutils/dev/uucore/display/fn.println_verbatim.html +++ /dev/null @@ -1,9 +0,0 @@ -println_verbatim in uucore::display - Rust
pub fn println_verbatim<S: AsRef<OsStr>>(text: S) -> Result<()>
Expand description

Print a path (or OsStr-like object) directly to stdout, with a trailing newline, -without losing any information if its encoding is invalid.

-

This function is appropriate for commands where printing paths is the point and the -output is likely to be captured, like pwd and basename. For informational output -use Quotable::quote.

-

FIXME: This is lossy on Windows. It could probably be implemented using some low-level -API that takes UTF-16, without going through io::Write. This is not a big priority -because broken filenames are much rarer on Windows than on Unix.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/display/index.html b/coreutils/dev/uucore/display/index.html deleted file mode 100644 index c70dae742..000000000 --- a/coreutils/dev/uucore/display/index.html +++ /dev/null @@ -1,2 +0,0 @@ -uucore::display - Rust

Module uucore::display

source ·

Structs

  • A wrapper around string types for displaying with quoting and escaping applied.

Traits

  • An extension trait to apply quoting to strings.

Functions

  • Like println_verbatim, without the trailing newline.
  • Print a path (or OsStr-like object) directly to stdout, with a trailing newline, -without losing any information if its encoding is invalid.
\ No newline at end of file diff --git a/coreutils/dev/uucore/display/sidebar-items.js b/coreutils/dev/uucore/display/sidebar-items.js deleted file mode 100644 index 8d6462508..000000000 --- a/coreutils/dev/uucore/display/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["print_verbatim","println_verbatim"],"struct":["Quoted"],"trait":["Quotable"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/display/struct.Quoted.html b/coreutils/dev/uucore/display/struct.Quoted.html deleted file mode 100644 index 7a429faf5..000000000 --- a/coreutils/dev/uucore/display/struct.Quoted.html +++ /dev/null @@ -1,38 +0,0 @@ -Quoted in uucore::display - Rust

Struct uucore::display::Quoted

pub struct Quoted<'a> { /* private fields */ }
Expand description

A wrapper around string types for displaying with quoting and escaping applied.

-

Implementations§

§

impl<'a> Quoted<'a>

pub fn native(text: &'a str) -> Quoted<'a>

Quote a string with the default style for the platform.

-

On Windows this is PowerShell syntax, on all other platforms this is -bash/ksh syntax.

-

pub fn native_raw(text: &'a OsStr) -> Quoted<'a>

Quote an OsStr with the default style for the platform.

-

On platforms other than Windows, Unix and WASI, if the encoding is -invalid, the Debug representation will be used.

-

pub fn force(self, force: bool) -> Quoted<'a>

Toggle forced quoting. If true, quotes are added even if no special -characters are present.

-

Defaults to true.

-

pub fn external(self, external: bool) -> Quoted<'a>

When quoting for PowerShell, toggle whether to quote for external programs.

-

If enabled, double quotes (and sometimes backslashes) will be escaped so -that they can be passed to external programs.

-

If disabled, quoting will suit internal commandlets and .NET functions. -Strings that look like options or numbers will be quoted.

-

It is sadly impossible to quote a string such that it’s suitable for both -external and internal commands.

-

The experimental PSNativeCommandArgumentPassing feature in PowerShell 7.2 -disables the stripping of double quotes and backslashes. If it’s enabled -then this setting should be disabled.

-

Defaults to false. This could change in a future (breaking) release.

-
Optional
-

This requires either the windows or the native feature. It has no effect -on Unix-style quoting.

-

Trait Implementations§

§

impl<'a> Clone for Quoted<'a>

§

fn clone(&self) -> Quoted<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'a> Debug for Quoted<'a>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a> Display for Quoted<'a>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a, T> From<&'a T> for Quoted<'a>where - T: Quotable + ?Sized,

§

fn from(val: &'a T) -> Quoted<'a>

Converts to this type from the input type.
§

impl<'a> Copy for Quoted<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Quoted<'a>

§

impl<'a> Send for Quoted<'a>

§

impl<'a> Sync for Quoted<'a>

§

impl<'a> Unpin for Quoted<'a>

§

impl<'a> UnwindSafe for Quoted<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/display/trait.Quotable.html b/coreutils/dev/uucore/display/trait.Quotable.html deleted file mode 100644 index c414f862f..000000000 --- a/coreutils/dev/uucore/display/trait.Quotable.html +++ /dev/null @@ -1,32 +0,0 @@ -Quotable in uucore::display - Rust

Trait uucore::display::Quotable

pub trait Quotable {
-    // Required method
-    fn quote(&self) -> Quoted<'_>;
-
-    // Provided method
-    fn maybe_quote(&self) -> Quoted<'_> { ... }
-}
Expand description

An extension trait to apply quoting to strings.

-

This is implemented on str, OsStr and Path.

-

For finer control, see the constructors on Quoted.

-

Required Methods§

fn quote(&self) -> Quoted<'_>

Returns an object that implements Display for printing strings with -proper quoting and escaping for the platform.

-

On Unix this corresponds to bash/ksh syntax, on Windows PowerShell syntax -is used.

-
Examples
-
use std::path::Path;
-use os_display::Quotable;
-
-let path = Path::new("foo/bar.baz");
-
-println!("Found file {}", path.quote()); // Prints "Found file 'foo/bar.baz'"
-

Provided Methods§

fn maybe_quote(&self) -> Quoted<'_>

Like quote(), but don’t actually add quotes unless necessary because of -whitespace or special characters.

-
Examples
-
use std::path::Path;
-use os_display::Quotable;
-
-let foo = Path::new("foo/bar.baz");
-let bar = "foo bar";
-
-println!("{}: Not found", foo.maybe_quote()); // Prints "foo/bar.baz: Not found"
-println!("{}: Not found", bar.maybe_quote()); // Prints "'foo bar': Not found"
-

Implementations on Foreign Types§

§

impl Quotable for OsStr

§

fn quote(&self) -> Quoted<'_>

§

impl Quotable for str

§

fn quote(&self) -> Quoted<'_>

§

impl Quotable for Path

§

fn quote(&self) -> Quoted<'_>

Implementors§

\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/enum.DecodeError.html b/coreutils/dev/uucore/encoding/enum.DecodeError.html deleted file mode 100644 index 917d79d75..000000000 --- a/coreutils/dev/uucore/encoding/enum.DecodeError.html +++ /dev/null @@ -1,18 +0,0 @@ -DecodeError in uucore::encoding - Rust
pub enum DecodeError {
-    Decode(DecodeError),
-    DecodeZ85(DecodeError),
-    Io(Error),
-}

Variants§

§

Decode(DecodeError)

§

DecodeZ85(DecodeError)

§

Io(Error)

Trait Implementations§

source§

impl Debug for DecodeError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for DecodeError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for DecodeError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<DecodeError> for DecodeError

source§

fn from(source: DecodeError) -> Self

Converts to this type from the input type.
source§

impl From<DecodeError> for DecodeError

source§

fn from(source: DecodeError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for DecodeError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/enum.EncodeError.html b/coreutils/dev/uucore/encoding/enum.EncodeError.html deleted file mode 100644 index 3ed6eaa92..000000000 --- a/coreutils/dev/uucore/encoding/enum.EncodeError.html +++ /dev/null @@ -1,13 +0,0 @@ -EncodeError in uucore::encoding - Rust
pub enum EncodeError {
-    Z85InputLenNotMultipleOf4,
-}

Variants§

§

Z85InputLenNotMultipleOf4

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/enum.Format.html b/coreutils/dev/uucore/encoding/enum.Format.html deleted file mode 100644 index c8effdc1b..000000000 --- a/coreutils/dev/uucore/encoding/enum.Format.html +++ /dev/null @@ -1,21 +0,0 @@ -Format in uucore::encoding - Rust

Enum uucore::encoding::Format

source ·
pub enum Format {
-    Base64,
-    Base64Url,
-    Base32,
-    Base32Hex,
-    Base16,
-    Base2Lsbf,
-    Base2Msbf,
-    Z85,
-}

Variants§

§

Base64

§

Base64Url

§

Base32

§

Base32Hex

§

Base16

§

Base2Lsbf

§

Base2Msbf

§

Z85

Trait Implementations§

source§

impl Clone for Format

source§

fn clone(&self) -> Format

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for Format

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/fn.decode.html b/coreutils/dev/uucore/encoding/fn.decode.html deleted file mode 100644 index a0e4b5fb7..000000000 --- a/coreutils/dev/uucore/encoding/fn.decode.html +++ /dev/null @@ -1 +0,0 @@ -decode in uucore::encoding - Rust

Function uucore::encoding::decode

source ·
pub fn decode(f: Format, input: &[u8]) -> DecodeResult
\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/fn.encode.html b/coreutils/dev/uucore/encoding/fn.encode.html deleted file mode 100644 index 6cd380ce4..000000000 --- a/coreutils/dev/uucore/encoding/fn.encode.html +++ /dev/null @@ -1 +0,0 @@ -encode in uucore::encoding - Rust

Function uucore::encoding::encode

source ·
pub fn encode(f: Format, input: &[u8]) -> Result<String, EncodeError>
\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/fn.wrap_print.html b/coreutils/dev/uucore/encoding/fn.wrap_print.html deleted file mode 100644 index 5ed641cc0..000000000 --- a/coreutils/dev/uucore/encoding/fn.wrap_print.html +++ /dev/null @@ -1 +0,0 @@ -wrap_print in uucore::encoding - Rust

Function uucore::encoding::wrap_print

source ·
pub fn wrap_print<R: Read>(data: &Data<R>, res: &str)
\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/fn.wrap_write.html b/coreutils/dev/uucore/encoding/fn.wrap_write.html deleted file mode 100644 index 904a1ccd1..000000000 --- a/coreutils/dev/uucore/encoding/fn.wrap_write.html +++ /dev/null @@ -1,5 +0,0 @@ -wrap_write in uucore::encoding - Rust

Function uucore::encoding::wrap_write

source ·
pub fn wrap_write<W: Write>(
-    writer: W,
-    line_wrap: usize,
-    res: &str
-) -> Result<()>
\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/index.html b/coreutils/dev/uucore/encoding/index.html deleted file mode 100644 index 091ed012f..000000000 --- a/coreutils/dev/uucore/encoding/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::encoding - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/sidebar-items.js b/coreutils/dev/uucore/encoding/sidebar-items.js deleted file mode 100644 index e4bafbf9c..000000000 --- a/coreutils/dev/uucore/encoding/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["DecodeError","EncodeError","Format"],"fn":["decode","encode","wrap_print","wrap_write"],"struct":["Data"],"type":["DecodeResult"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/struct.Data.html b/coreutils/dev/uucore/encoding/struct.Data.html deleted file mode 100644 index 122024e75..000000000 --- a/coreutils/dev/uucore/encoding/struct.Data.html +++ /dev/null @@ -1,16 +0,0 @@ -Data in uucore::encoding - Rust

Struct uucore::encoding::Data

source ·
pub struct Data<R: Read> { /* private fields */ }

Implementations§

source§

impl<R: Read> Data<R>

source

pub fn new(input: R, format: Format) -> Self

source

pub fn line_wrap(self, wrap: usize) -> Self

source

pub fn ignore_garbage(self, ignore: bool) -> Self

source

pub fn decode(&mut self) -> DecodeResult

source

pub fn encode(&mut self) -> Result<String, EncodeError>

Auto Trait Implementations§

§

impl<R> RefUnwindSafe for Data<R>where - R: RefUnwindSafe,

§

impl<R> Send for Data<R>where - R: Send,

§

impl<R> Sync for Data<R>where - R: Sync,

§

impl<R> Unpin for Data<R>where - R: Unpin,

§

impl<R> UnwindSafe for Data<R>where - R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/encoding/type.DecodeResult.html b/coreutils/dev/uucore/encoding/type.DecodeResult.html deleted file mode 100644 index 0d0127196..000000000 --- a/coreutils/dev/uucore/encoding/type.DecodeResult.html +++ /dev/null @@ -1 +0,0 @@ -DecodeResult in uucore::encoding - Rust

Type Definition uucore::encoding::DecodeResult

source ·
pub type DecodeResult = Result<Vec<u8>, DecodeError>;
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/fn.get_groups.html b/coreutils/dev/uucore/entries/fn.get_groups.html deleted file mode 100644 index 89880b81c..000000000 --- a/coreutils/dev/uucore/entries/fn.get_groups.html +++ /dev/null @@ -1,10 +0,0 @@ -get_groups in uucore::entries - Rust

Function uucore::entries::get_groups

source ·
pub fn get_groups() -> IOResult<Vec<gid_t>>
Expand description

From: <https://man7.org/linux/man-pages/man2/getgroups.2.html>

-
-

getgroups() returns the supplementary group IDs of the calling -process in list. -If size is zero, list is not modified, but the total number of -supplementary group IDs for the process is returned. This allows -the caller to determine the size of a dynamically allocated list -to be used in a further call to getgroups().

-
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/fn.get_groups_gnu.html b/coreutils/dev/uucore/entries/fn.get_groups_gnu.html deleted file mode 100644 index 7accd155c..000000000 --- a/coreutils/dev/uucore/entries/fn.get_groups_gnu.html +++ /dev/null @@ -1,23 +0,0 @@ -get_groups_gnu in uucore::entries - Rust

Function uucore::entries::get_groups_gnu

source ·
pub fn get_groups_gnu(arg_id: Option<u32>) -> IOResult<Vec<gid_t>>
Expand description

The list of group IDs returned from GNU’s groups and GNU’s id --groups -starts with the effective group ID (egid). -This is a wrapper for get_groups() to mimic this behavior.

-

If arg_id is None (default), get_groups_gnu moves the effective -group id (egid) to the first entry in the returned Vector. -If arg_id is Some(x), get_groups_gnu moves the id with value x -to the first entry in the returned Vector. This might be necessary -for id --groups --real if gid and egid are not equal.

-

From: <https://www.man7.org/linux/man-pages/man3/getgroups.3p.html>

-
-

As implied by the definition of supplementary groups, the -effective group ID may appear in the array returned by -getgroups() or it may be returned only by getegid(). Duplication -may exist, but the application needs to call getegid() to be sure -of getting all of the information. Various implementation -variations and administrative sequences cause the set of groups -appearing in the result of getgroups() to vary in order and as to -whether the effective group ID is included, even when the set of -groups is the same (in the mathematical sense of ``set’’). (The -history of a process and its parents could affect the details of -the result.)

-
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/fn.gid2grp.html b/coreutils/dev/uucore/entries/fn.gid2grp.html deleted file mode 100644 index fb8bc9f57..000000000 --- a/coreutils/dev/uucore/entries/fn.gid2grp.html +++ /dev/null @@ -1 +0,0 @@ -gid2grp in uucore::entries - Rust

Function uucore::entries::gid2grp

source ·
pub fn gid2grp(id: gid_t) -> IOResult<String>
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/fn.grp2gid.html b/coreutils/dev/uucore/entries/fn.grp2gid.html deleted file mode 100644 index 9423fa59a..000000000 --- a/coreutils/dev/uucore/entries/fn.grp2gid.html +++ /dev/null @@ -1 +0,0 @@ -grp2gid in uucore::entries - Rust

Function uucore::entries::grp2gid

source ·
pub fn grp2gid(name: &str) -> IOResult<gid_t>
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/fn.uid2usr.html b/coreutils/dev/uucore/entries/fn.uid2usr.html deleted file mode 100644 index 3445d8631..000000000 --- a/coreutils/dev/uucore/entries/fn.uid2usr.html +++ /dev/null @@ -1 +0,0 @@ -uid2usr in uucore::entries - Rust

Function uucore::entries::uid2usr

source ·
pub fn uid2usr(id: uid_t) -> IOResult<String>
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/fn.usr2uid.html b/coreutils/dev/uucore/entries/fn.usr2uid.html deleted file mode 100644 index f75d2066d..000000000 --- a/coreutils/dev/uucore/entries/fn.usr2uid.html +++ /dev/null @@ -1 +0,0 @@ -usr2uid in uucore::entries - Rust

Function uucore::entries::usr2uid

source ·
pub fn usr2uid(name: &str) -> IOResult<uid_t>
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/index.html b/coreutils/dev/uucore/entries/index.html deleted file mode 100644 index c0cf63f62..000000000 --- a/coreutils/dev/uucore/entries/index.html +++ /dev/null @@ -1,25 +0,0 @@ -uucore::entries - Rust

Module uucore::entries

source ·
Expand description

Get password/group file entry

-

Examples:

-
use uucore::entries::{self, Locate};
-
-let root_group = if cfg!(any(target_os = "linux", target_os = "android")) {
-    "root"
-} else {
-    "wheel"
-};
-
-assert_eq!("root", entries::uid2usr(0).unwrap());
-assert_eq!(0, entries::usr2uid("root").unwrap());
-assert!(entries::gid2grp(0).is_ok());
-assert!(entries::grp2gid(root_group).is_ok());
-
-assert!(entries::Passwd::locate(0).is_ok());
-assert!(entries::Passwd::locate("0").is_ok());
-assert!(entries::Passwd::locate("root").is_ok());
-
-assert!(entries::Group::locate(0).is_ok());
-assert!(entries::Group::locate("0").is_ok());
-assert!(entries::Group::locate(root_group).is_ok());
-

Structs

Traits

Functions

  • From: <https://man7.org/linux/man-pages/man2/getgroups.2.html>
  • The list of group IDs returned from GNU’s groups and GNU’s id --groups -starts with the effective group ID (egid). -This is a wrapper for get_groups() to mimic this behavior.
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/sidebar-items.js b/coreutils/dev/uucore/entries/sidebar-items.js deleted file mode 100644 index f3f8ce800..000000000 --- a/coreutils/dev/uucore/entries/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["get_groups","get_groups_gnu","gid2grp","grp2gid","uid2usr","usr2uid"],"struct":["Group","Passwd"],"trait":["Locate"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/entries/struct.Group.html b/coreutils/dev/uucore/entries/struct.Group.html deleted file mode 100644 index 5dfc866aa..000000000 --- a/coreutils/dev/uucore/entries/struct.Group.html +++ /dev/null @@ -1,17 +0,0 @@ -Group in uucore::entries - Rust

Struct uucore::entries::Group

source ·
pub struct Group {
-    pub name: String,
-    pub gid: gid_t,
-}

Fields§

§name: String

AKA group.gr_name

-
§gid: gid_t

AKA group.gr_gid

-

Trait Implementations§

source§

impl Clone for Group

source§

fn clone(&self) -> Group

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Group

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Locate<&'a str> for Group

source§

fn locate(k: &'a str) -> IOResult<Self>

source§

impl Locate<u32> for Group

source§

fn locate(k: gid_t) -> IOResult<Self>

Auto Trait Implementations§

§

impl RefUnwindSafe for Group

§

impl Send for Group

§

impl Sync for Group

§

impl Unpin for Group

§

impl UnwindSafe for Group

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/struct.Passwd.html b/coreutils/dev/uucore/entries/struct.Passwd.html deleted file mode 100644 index eb67d9ca5..000000000 --- a/coreutils/dev/uucore/entries/struct.Passwd.html +++ /dev/null @@ -1,41 +0,0 @@ -Passwd in uucore::entries - Rust

Struct uucore::entries::Passwd

source ·
pub struct Passwd {
-    pub name: String,
-    pub uid: uid_t,
-    pub gid: gid_t,
-    pub user_info: Option<String>,
-    pub user_shell: Option<String>,
-    pub user_dir: Option<String>,
-    pub user_passwd: Option<String>,
-}

Fields§

§name: String

AKA passwd.pw_name

-
§uid: uid_t

AKA passwd.pw_uid

-
§gid: gid_t

AKA passwd.pw_gid

-
§user_info: Option<String>

AKA passwd.pw_gecos

-
§user_shell: Option<String>

AKA passwd.pw_shell

-
§user_dir: Option<String>

AKA passwd.pw_dir

-
§user_passwd: Option<String>

AKA passwd.pw_passwd

-

Implementations§

source§

impl Passwd

source

pub fn belongs_to(&self) -> Vec<gid_t>

This is a wrapper function for libc::getgrouplist.

-

From: <https://man7.org/linux/man-pages/man3/getgrouplist.3.html>

-
-

If the number of groups of which user is a member is less than or -equal to *ngroups, then the value *ngroups is returned. -If the user is a member of more than *ngroups groups, then -getgrouplist() returns -1. In this case, the value returned in -*ngroups can be used to resize the buffer passed to a further -call getgrouplist().

-
-

However, on macOS/darwin (and maybe others?) getgrouplist does -not update ngroups if ngroups is too small. Therefore, if not -updated by getgrouplist, ngroups needs to be increased in a -loop until getgrouplist stops returning -1.

-

Trait Implementations§

source§

impl Clone for Passwd

source§

fn clone(&self) -> Passwd

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Passwd

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Locate<&'a str> for Passwd

source§

fn locate(k: &'a str) -> IOResult<Self>

source§

impl Locate<u32> for Passwd

source§

fn locate(k: uid_t) -> IOResult<Self>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/entries/trait.Locate.html b/coreutils/dev/uucore/entries/trait.Locate.html deleted file mode 100644 index 41eaa9829..000000000 --- a/coreutils/dev/uucore/entries/trait.Locate.html +++ /dev/null @@ -1,7 +0,0 @@ -Locate in uucore::entries - Rust

Trait uucore::entries::Locate

source ·
pub trait Locate<K> {
-    // Required method
-    fn locate(key: K) -> IOResult<Self>
-       where Self: Sized;
-}
Expand description

Fetch desired entry.

-

Required Methods§

source

fn locate(key: K) -> IOResult<Self>where - Self: Sized,

Implementors§

source§

impl Locate<u32> for Group

source§

impl Locate<u32> for Passwd

source§

impl<'a> Locate<&'a str> for Group

source§

impl<'a> Locate<&'a str> for Passwd

\ No newline at end of file diff --git a/coreutils/dev/uucore/error/fn.get_exit_code.html b/coreutils/dev/uucore/error/fn.get_exit_code.html deleted file mode 100644 index 4585cd939..000000000 --- a/coreutils/dev/uucore/error/fn.get_exit_code.html +++ /dev/null @@ -1,3 +0,0 @@ -get_exit_code in uucore::error - Rust

Function uucore::error::get_exit_code

source ·
pub fn get_exit_code() -> i32
Expand description

Get the last exit code set with set_exit_code. -The default value is 0.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/fn.set_exit_code.html b/coreutils/dev/uucore/error/fn.set_exit_code.html deleted file mode 100644 index cd6051151..000000000 --- a/coreutils/dev/uucore/error/fn.set_exit_code.html +++ /dev/null @@ -1,18 +0,0 @@ -set_exit_code in uucore::error - Rust

Function uucore::error::set_exit_code

source ·
pub fn set_exit_code(code: i32)
Expand description

Set the exit code for the program if uumain returns Ok(()).

-

This function is most useful for non-fatal errors, for example when applying an operation to -multiple files:

- -
use uucore::error::{UResult, set_exit_code};
-
-fn uumain(args: impl uucore::Args) -> UResult<()> {
-    ...
-    for file in files {
-        let res = some_operation_that_might_fail(file);
-        match res {
-            Ok() => {},
-            Err(_) => set_exit_code(1),
-        }
-    }
-    Ok(()) // If any of the operations failed, 1 is returned.
-}
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/fn.strip_errno.html b/coreutils/dev/uucore/error/fn.strip_errno.html deleted file mode 100644 index 55046180a..000000000 --- a/coreutils/dev/uucore/error/fn.strip_errno.html +++ /dev/null @@ -1,2 +0,0 @@ -strip_errno in uucore::error - Rust

Function uucore::error::strip_errno

source ·
pub fn strip_errno(err: &Error) -> String
Expand description

Strip the trailing “ (os error XX)“ from io error strings.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/index.html b/coreutils/dev/uucore/error/index.html deleted file mode 100644 index 381506bff..000000000 --- a/coreutils/dev/uucore/error/index.html +++ /dev/null @@ -1,54 +0,0 @@ -uucore::error - Rust

Module uucore::error

source ·
Expand description

All utils return exit with an exit code. Usually, the following scheme is used:

-
    -
  • 0: succeeded
  • -
  • 1: minor problems
  • -
  • 2: major problems
  • -
-

This module provides types to reconcile these exit codes with idiomatic Rust error -handling. This has a couple advantages over manually using std::process::exit:

-
    -
  1. It enables the use of ?, map_err, unwrap_or, etc. in uumain.
  2. -
  3. It encourages the use of UResult/Result in functions in the utils.
  4. -
  5. The error messages are largely standardized across utils.
  6. -
  7. Standardized error messages can be created from external result types -(i.e. std::io::Result & clap::ClapResult).
  8. -
  9. set_exit_code takes away the burden of manually tracking exit codes for non-fatal errors.
  10. -
-

Usage

-

The signature of a typical util should be:

- -
fn uumain(args: impl uucore::Args) -> UResult<()> {
-    ...
-}
-

UResult is a simple wrapper around Result with a custom error trait: UError. The -most important difference with types implementing std::error::Error is that UErrors -can specify the exit code of the program when they are returned from uumain:

-
    -
  • When Ok is returned, the code set with set_exit_code is used as exit code. If -set_exit_code was not used, then 0 is used.
  • -
  • When Err is returned, the code corresponding with the error is used as exit code and the -error message is displayed.
  • -
-

Additionally, the errors can be displayed manually with the [show] and [show_if_err] macros:

- -
let res = Err(USimpleError::new(1, "Error!!"));
-show_if_err!(res);
-// or
-if let Err(e) = res {
-   show!(e);
-}
-

Note: The [show] and [show_if_err] macros set the exit code of the program using -set_exit_code. See the documentation on that function for more information.

-

Guidelines

-
    -
  • Use error types from uucore where possible.
  • -
  • Add error types to uucore if an error appears in multiple utils.
  • -
  • Prefer proper custom error types over ExitCode and USimpleError.
  • -
  • USimpleError may be used in small utils with simple error handling.
  • -
  • Using ExitCode is not recommended but can be useful for converting utils to use -UResult.
  • -
-

Macros

Structs

Traits

Functions

Type Definitions

  • Result type that should be returned by all utils.
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/macro.uio_error!.html b/coreutils/dev/uucore/error/macro.uio_error!.html deleted file mode 100644 index 6e7fc9fa5..000000000 --- a/coreutils/dev/uucore/error/macro.uio_error!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.uio_error.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/error/macro.uio_error.html b/coreutils/dev/uucore/error/macro.uio_error.html deleted file mode 100644 index ac76a8e06..000000000 --- a/coreutils/dev/uucore/error/macro.uio_error.html +++ /dev/null @@ -1,50 +0,0 @@ -uio_error in uucore::error - Rust

Macro uucore::error::uio_error

source ·
macro_rules! uio_error {
-    ($err:expr, $($args:tt)+) => { ... };
-}
Expand description

Shorthand to construct UIoError-instances.

-

This macro serves as a convenience call to quickly construct instances of -UIoError. It takes:

-
    -
  • An instance of std::io::Error
  • -
  • A format!-compatible string and
  • -
  • An arbitrary number of arguments to the format string
  • -
-

In exactly this order. It is equivalent to the more verbose code seen in the -example.

-

Examples

-
use uucore::error::UIoError;
-use uucore::uio_error;
-
-let io_err = std::io::Error::new(
-    std::io::ErrorKind::PermissionDenied, "fix me please!"
-);
-
-let uio_err = UIoError::new(
-    io_err.kind(),
-    format!("Error code: {}", 2)
-);
-
-let other_uio_err = uio_error!(io_err, "Error code: {}", 2);
-
-// prints "fix me please!: Permission denied"
-println!("{}", uio_err);
-// prints "Error code: 2: Permission denied"
-println!("{}", other_uio_err);
-

The std::fmt::Display impl of UIoError will then ensure that an -appropriate error message relating to the actual error kind of the -std::io::Error is appended to whatever error message is defined in -addition (as secondary argument).

-

If you want to show only the error message for the std::io::ErrorKind -that’s contained in UIoError, pass the second argument as empty string:

- -
use uucore::error::UIoError;
-use uucore::uio_error;
-
-let io_err = std::io::Error::new(
-    std::io::ErrorKind::PermissionDenied, "fix me please!"
-);
-
-let other_uio_err = uio_error!(io_err, "");
-
-// prints: ": Permission denied"
-println!("{}", other_uio_err);
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/sidebar-items.js b/coreutils/dev/uucore/error/sidebar-items.js deleted file mode 100644 index 3607d23dc..000000000 --- a/coreutils/dev/uucore/error/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["get_exit_code","set_exit_code","strip_errno"],"macro":["uio_error"],"struct":["ClapErrorWrapper","ExitCode","UIoError","USimpleError","UUsageError"],"trait":["FromIo","UClapError","UError"],"type":["UResult"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/error/struct.ClapErrorWrapper.html b/coreutils/dev/uucore/error/struct.ClapErrorWrapper.html deleted file mode 100644 index ff0552721..000000000 --- a/coreutils/dev/uucore/error/struct.ClapErrorWrapper.html +++ /dev/null @@ -1,29 +0,0 @@ -ClapErrorWrapper in uucore::error - Rust
pub struct ClapErrorWrapper { /* private fields */ }
Expand description

A wrapper for clap::Error that implements UError

-

Contains a custom error code. When Display::fmt is called on this struct -the [clap::Error] will be printed directly to stdout or stderr. -This is because clap only supports colored output when it prints directly.

-

ClapErrorWrapper is generally created by calling the -UClapError::with_exit_code method on [clap::Error] or using the From -implementation from [clap::Error] to Box<dyn UError>, which constructs -a ClapErrorWrapper with an exit code of 1.

- -
use uucore::error::{ClapErrorWrapper, UError, UClapError};
-let command = clap::Command::new("test");
-let result: Result<_, ClapErrorWrapper> = command.try_get_matches().with_exit_code(125);
-
-let command = clap::Command::new("test");
-let result: Result<_, Box<dyn UError>> = command.try_get_matches().map_err(Into::into);
-

Trait Implementations§

source§

impl Debug for ClapErrorWrapper

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ClapErrorWrapper

source§

fn fmt(&self, _f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for ClapErrorWrapper

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl UClapError<ClapErrorWrapper> for Error

source§

impl UError for ClapErrorWrapper

source§

fn code(&self) -> i32

Error code of a custom error. Read more
source§

fn usage(&self) -> bool

Print usage help to a custom error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/struct.ExitCode.html b/coreutils/dev/uucore/error/struct.ExitCode.html deleted file mode 100644 index 055782ec0..000000000 --- a/coreutils/dev/uucore/error/struct.ExitCode.html +++ /dev/null @@ -1,26 +0,0 @@ -ExitCode in uucore::error - Rust

Struct uucore::error::ExitCode

source ·
pub struct ExitCode(pub i32);
Expand description

A special error type that does not print any message when returned from -uumain. Especially useful for porting utilities to using UResult.

-

There are two ways to construct an ExitCode:

- -
use uucore::error::{ExitCode, UResult};
-// Explicit
-let res: UResult<()> = Err(ExitCode(1).into());
-
-// Using into on `i32`:
-let res: UResult<()> = Err(1.into());
-

This type is especially useful for a trivial conversion from utils returning i32 to -returning UResult.

-

Tuple Fields§

§0: i32

Implementations§

source§

impl ExitCode

source

pub fn new(code: i32) -> Box<dyn UError>

Trait Implementations§

source§

impl Debug for ExitCode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ExitCode

source§

fn fmt(&self, _: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for ExitCode

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl UError for ExitCode

source§

fn code(&self) -> i32

Error code of a custom error. Read more
source§

fn usage(&self) -> bool

Print usage help to a custom error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/struct.UIoError.html b/coreutils/dev/uucore/error/struct.UIoError.html deleted file mode 100644 index e918434f9..000000000 --- a/coreutils/dev/uucore/error/struct.UIoError.html +++ /dev/null @@ -1,37 +0,0 @@ -UIoError in uucore::error - Rust

Struct uucore::error::UIoError

source ·
pub struct UIoError { /* private fields */ }
Expand description

Wrapper type around std::io::Error.

-

The messages displayed by UIoError should match the error messages displayed by GNU -coreutils.

-

There are two ways to construct this type: with UIoError::new or by calling the -FromIo::map_err_context method on a std::io::Result or std::io::Error.

- -
use uucore::{
-    display::Quotable,
-    error::{FromIo, UResult, UIoError, UError}
-};
-use std::fs::File;
-use std::path::Path;
-let path = Path::new("test.txt");
-
-// Manual construction
-let e: Box<dyn UError> = UIoError::new(
-    std::io::ErrorKind::NotFound,
-    format!("cannot access {}", path.quote())
-);
-let res: UResult<()> = Err(e.into());
-
-// Converting from an `std::io::Error`.
-let res: UResult<File> = File::open(path).map_err_context(|| format!("cannot access {}", path.quote()));
-

Implementations§

source§

impl UIoError

source

pub fn new<S: Into<String>>(kind: ErrorKind, context: S) -> Box<dyn UError>

Trait Implementations§

source§

impl Debug for UIoError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for UIoError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for UIoError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Errno> for UIoError

source§

fn from(f: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for UIoError

source§

fn from(f: Error) -> Self

Converts to this type from the input type.
source§

impl UError for UIoError

source§

fn code(&self) -> i32

Error code of a custom error. Read more
source§

fn usage(&self) -> bool

Print usage help to a custom error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/struct.USimpleError.html b/coreutils/dev/uucore/error/struct.USimpleError.html deleted file mode 100644 index 4e63cf9cc..000000000 --- a/coreutils/dev/uucore/error/struct.USimpleError.html +++ /dev/null @@ -1,24 +0,0 @@ -USimpleError in uucore::error - Rust

Struct uucore::error::USimpleError

source ·
pub struct USimpleError {
-    pub code: i32,
-    pub message: String,
-}
Expand description

A simple error type with an exit code and a message that implements UError.

- -
use uucore::error::{UResult, USimpleError};
-let err = USimpleError { code: 1, message: "error!".into()};
-let res: UResult<()> = Err(err.into());
-// or using the `new` method:
-let res: UResult<()> = Err(USimpleError::new(1, "error!"));
-

Fields§

§code: i32§message: String

Implementations§

source§

impl USimpleError

source

pub fn new<S: Into<String>>(code: i32, message: S) -> Box<dyn UError>

Trait Implementations§

source§

impl Debug for USimpleError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for USimpleError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for USimpleError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl UError for USimpleError

source§

fn code(&self) -> i32

Error code of a custom error. Read more
source§

fn usage(&self) -> bool

Print usage help to a custom error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/struct.UUsageError.html b/coreutils/dev/uucore/error/struct.UUsageError.html deleted file mode 100644 index d1c6ae9d2..000000000 --- a/coreutils/dev/uucore/error/struct.UUsageError.html +++ /dev/null @@ -1,17 +0,0 @@ -UUsageError in uucore::error - Rust

Struct uucore::error::UUsageError

source ·
pub struct UUsageError {
-    pub code: i32,
-    pub message: String,
-}

Fields§

§code: i32§message: String

Implementations§

source§

impl UUsageError

source

pub fn new<S: Into<String>>(code: i32, message: S) -> Box<dyn UError>

Trait Implementations§

source§

impl Debug for UUsageError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for UUsageError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for UUsageError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl UError for UUsageError

source§

fn code(&self) -> i32

Error code of a custom error. Read more
source§

fn usage(&self) -> bool

Print usage help to a custom error. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/error/trait.FromIo.html b/coreutils/dev/uucore/error/trait.FromIo.html deleted file mode 100644 index 208498198..000000000 --- a/coreutils/dev/uucore/error/trait.FromIo.html +++ /dev/null @@ -1,16 +0,0 @@ -FromIo in uucore::error - Rust

Trait uucore::error::FromIo

source ·
pub trait FromIo<T> {
-    // Required method
-    fn map_err_context(self, context: impl FnOnce() -> String) -> T;
-}
Expand description

Enables the conversion from std::io::Error to UError and from std::io::Result to -UResult.

-

Required Methods§

source

fn map_err_context(self, context: impl FnOnce() -> String) -> T

Implementations on Foreign Types§

source§

impl<T> FromIo<Result<T, Box<dyn UError + 'static, Global>>> for Result<T>

source§

fn map_err_context(self, context: impl FnOnce() -> String) -> UResult<T>

source§

impl FromIo<Box<UIoError, Global>> for Error

source§

fn map_err_context(self, context: impl FnOnce() -> String) -> Box<UIoError>

source§

impl<T> FromIo<Result<T, Box<dyn UError + 'static, Global>>> for Result<T, Error>

Enables the conversion from Result<T, nix::Error> to UResult<T>.

-

Examples

-
use uucore::error::FromIo;
-use nix::errno::Errno;
-
-let nix_err = Err::<(), nix::Error>(Errno::EACCES);
-let uio_result = nix_err.map_err_context(|| String::from("fix me please!"));
-
-// prints "fix me please!: Permission denied"
-println!("{}", uio_result.unwrap_err());
-
source§

fn map_err_context(self, context: impl FnOnce() -> String) -> UResult<T>

source§

impl FromIo<Box<UIoError, Global>> for ErrorKind

source§

fn map_err_context(self, context: impl FnOnce() -> String) -> Box<UIoError>

Implementors§

source§

impl<T> FromIo<Result<T, Box<dyn UError + 'static, Global>>> for uucore::pipes::Error

\ No newline at end of file diff --git a/coreutils/dev/uucore/error/trait.UClapError.html b/coreutils/dev/uucore/error/trait.UClapError.html deleted file mode 100644 index 8c7d9dcc3..000000000 --- a/coreutils/dev/uucore/error/trait.UClapError.html +++ /dev/null @@ -1,5 +0,0 @@ -UClapError in uucore::error - Rust

Trait uucore::error::UClapError

source ·
pub trait UClapError<T> {
-    // Required method
-    fn with_exit_code(self, code: i32) -> T;
-}
Expand description

Extension trait for clap::Error to adjust the exit code.

-

Required Methods§

source

fn with_exit_code(self, code: i32) -> T

Implementations on Foreign Types§

source§

impl UClapError<Result<ArgMatches, ClapErrorWrapper>> for Result<ArgMatches, Error>

source§

fn with_exit_code(self, code: i32) -> Result<ArgMatches, ClapErrorWrapper>

source§

impl UClapError<ClapErrorWrapper> for Error

Implementors§

\ No newline at end of file diff --git a/coreutils/dev/uucore/error/trait.UError.html b/coreutils/dev/uucore/error/trait.UError.html deleted file mode 100644 index 21b6be630..000000000 --- a/coreutils/dev/uucore/error/trait.UError.html +++ /dev/null @@ -1,147 +0,0 @@ -UError in uucore::error - Rust

Trait uucore::error::UError

source ·
pub trait UError: Error + Send {
-    // Provided methods
-    fn code(&self) -> i32 { ... }
-    fn usage(&self) -> bool { ... }
-}
Expand description

Custom errors defined by the utils and uucore.

-

All errors should implement std::error::Error, std::fmt::Display and -std::fmt::Debug and have an additional code method that specifies the -exit code of the program if the error is returned from uumain.

-

An example of a custom error from ls:

- -
use uucore::{
-    display::Quotable,
-    error::{UError, UResult}
-};
-use std::{
-    error::Error,
-    fmt::{Display, Debug},
-    path::PathBuf
-};
-
-#[derive(Debug)]
-enum LsError {
-    InvalidLineWidth(String),
-    NoMetadata(PathBuf),
-}
-
-impl UError for LsError {
-    fn code(&self) -> i32 {
-        match self {
-            LsError::InvalidLineWidth(_) => 2,
-            LsError::NoMetadata(_) => 1,
-        }
-    }
-}
-
-impl Error for LsError {}
-
-impl Display for LsError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        match self {
-            LsError::InvalidLineWidth(s) => write!(f, "invalid line width: {}", s.quote()),
-            LsError::NoMetadata(p) => write!(f, "could not open file: {}", p.quote()),
-        }
-    }
-}
-

The main routine would look like this:

- -
#[uucore::main]
-pub fn uumain(args: impl uucore::Args) -> UResult<()> {
-    // Perform computations here ...
-    return Err(LsError::InvalidLineWidth(String::from("test")).into())
-}
-

The call to into() is required to convert the LsError to -Box<dyn UError>. The implementation for From is provided automatically.

-

A crate like quick_error might -also be used, but will still require an impl for the code method.

-

Provided Methods§

source

fn code(&self) -> i32

Error code of a custom error.

-

Set a return value for each variant of an enum-type to associate an -error code (which is returned to the system shell) with an error -variant.

-
Example
-
use uucore::{
-    display::Quotable,
-    error::UError
-};
-use std::{
-    error::Error,
-    fmt::{Display, Debug},
-    path::PathBuf
-};
-
-#[derive(Debug)]
-enum MyError {
-    Foo(String),
-    Bar(PathBuf),
-    Bing(),
-}
-
-impl UError for MyError {
-    fn code(&self) -> i32 {
-        match self {
-            MyError::Foo(_) => 2,
-            // All other errors yield the same error code, there's no
-            // need to list them explicitly.
-            _ => 1,
-        }
-    }
-}
-
-impl Error for MyError {}
-
-impl Display for MyError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        use MyError as ME;
-        match self {
-            ME::Foo(s) => write!(f, "Unknown Foo: {}", s.quote()),
-            ME::Bar(p) => write!(f, "Couldn't find Bar: {}", p.quote()),
-            ME::Bing() => write!(f, "Exterminate!"),
-        }
-    }
-}
-
source

fn usage(&self) -> bool

Print usage help to a custom error.

-

Return true or false to control whether a short usage help is printed -below the error message. The usage help is in the format: “Try {name} --help for more information.” and printed only if true is returned.

-
Example
-
use uucore::{
-    display::Quotable,
-    error::UError
-};
-use std::{
-    error::Error,
-    fmt::{Display, Debug},
-    path::PathBuf
-};
-
-#[derive(Debug)]
-enum MyError {
-    Foo(String),
-    Bar(PathBuf),
-    Bing(),
-}
-
-impl UError for MyError {
-    fn usage(&self) -> bool {
-        match self {
-            // This will have a short usage help appended
-            MyError::Bar(_) => true,
-            // These matches won't have a short usage help appended
-            _ => false,
-        }
-    }
-}
-
-impl Error for MyError {}
-
-impl Display for MyError {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        use MyError as ME;
-        match self {
-            ME::Foo(s) => write!(f, "Unknown Foo: {}", s.quote()),
-            ME::Bar(p) => write!(f, "Couldn't find Bar: {}", p.quote()),
-            ME::Bing() => write!(f, "Exterminate!"),
-        }
-    }
-}
-

Trait Implementations§

source§

impl From<Errno> for Box<dyn UError>

source§

fn from(f: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error<RichFormatter>> for Box<dyn UError>

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Box<dyn UError>

source§

fn from(f: Error) -> Self

Converts to this type from the input type.
source§

impl<T> From<T> for Box<dyn UError>where - T: UError + 'static,

source§

fn from(t: T) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Box<dyn UError>

source§

fn from(i: i32) -> Self

Converts to this type from the input type.

Implementors§

\ No newline at end of file diff --git a/coreutils/dev/uucore/error/type.UResult.html b/coreutils/dev/uucore/error/type.UResult.html deleted file mode 100644 index 43c8966ab..000000000 --- a/coreutils/dev/uucore/error/type.UResult.html +++ /dev/null @@ -1,2 +0,0 @@ -UResult in uucore::error - Rust

Type Definition uucore::error::UResult

source ·
pub type UResult<T> = Result<T, Box<dyn UError>>;
Expand description

Result type that should be returned by all utils.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/enum.DecodeError.html b/coreutils/dev/uucore/features/encoding/enum.DecodeError.html deleted file mode 100644 index 9fe94b80d..000000000 --- a/coreutils/dev/uucore/features/encoding/enum.DecodeError.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/enum.DecodeError.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/enum.EncodeError.html b/coreutils/dev/uucore/features/encoding/enum.EncodeError.html deleted file mode 100644 index 9ebeeda59..000000000 --- a/coreutils/dev/uucore/features/encoding/enum.EncodeError.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/enum.EncodeError.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/enum.Format.html b/coreutils/dev/uucore/features/encoding/enum.Format.html deleted file mode 100644 index e1906cd3a..000000000 --- a/coreutils/dev/uucore/features/encoding/enum.Format.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/enum.Format.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/fn.decode.html b/coreutils/dev/uucore/features/encoding/fn.decode.html deleted file mode 100644 index e9de41e2e..000000000 --- a/coreutils/dev/uucore/features/encoding/fn.decode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/fn.decode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/fn.encode.html b/coreutils/dev/uucore/features/encoding/fn.encode.html deleted file mode 100644 index ef94d7111..000000000 --- a/coreutils/dev/uucore/features/encoding/fn.encode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/fn.encode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/fn.wrap_print.html b/coreutils/dev/uucore/features/encoding/fn.wrap_print.html deleted file mode 100644 index 6475da2b2..000000000 --- a/coreutils/dev/uucore/features/encoding/fn.wrap_print.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/fn.wrap_print.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/fn.wrap_write.html b/coreutils/dev/uucore/features/encoding/fn.wrap_write.html deleted file mode 100644 index a99951209..000000000 --- a/coreutils/dev/uucore/features/encoding/fn.wrap_write.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/fn.wrap_write.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/index.html b/coreutils/dev/uucore/features/encoding/index.html deleted file mode 100644 index 2ff50eb20..000000000 --- a/coreutils/dev/uucore/features/encoding/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/struct.Data.html b/coreutils/dev/uucore/features/encoding/struct.Data.html deleted file mode 100644 index 76b55cebf..000000000 --- a/coreutils/dev/uucore/features/encoding/struct.Data.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/struct.Data.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/encoding/type.DecodeResult.html b/coreutils/dev/uucore/features/encoding/type.DecodeResult.html deleted file mode 100644 index de08fb3e1..000000000 --- a/coreutils/dev/uucore/features/encoding/type.DecodeResult.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/encoding/type.DecodeResult.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/fn.get_groups.html b/coreutils/dev/uucore/features/entries/fn.get_groups.html deleted file mode 100644 index 80ba0167f..000000000 --- a/coreutils/dev/uucore/features/entries/fn.get_groups.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/fn.get_groups.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/fn.get_groups_gnu.html b/coreutils/dev/uucore/features/entries/fn.get_groups_gnu.html deleted file mode 100644 index 4f38a2c38..000000000 --- a/coreutils/dev/uucore/features/entries/fn.get_groups_gnu.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/fn.get_groups_gnu.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/fn.gid2grp.html b/coreutils/dev/uucore/features/entries/fn.gid2grp.html deleted file mode 100644 index 3e833ee38..000000000 --- a/coreutils/dev/uucore/features/entries/fn.gid2grp.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/fn.gid2grp.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/fn.grp2gid.html b/coreutils/dev/uucore/features/entries/fn.grp2gid.html deleted file mode 100644 index faf1211d4..000000000 --- a/coreutils/dev/uucore/features/entries/fn.grp2gid.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/fn.grp2gid.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/fn.uid2usr.html b/coreutils/dev/uucore/features/entries/fn.uid2usr.html deleted file mode 100644 index 739dee1a7..000000000 --- a/coreutils/dev/uucore/features/entries/fn.uid2usr.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/fn.uid2usr.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/fn.usr2uid.html b/coreutils/dev/uucore/features/entries/fn.usr2uid.html deleted file mode 100644 index c814861b7..000000000 --- a/coreutils/dev/uucore/features/entries/fn.usr2uid.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/fn.usr2uid.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/index.html b/coreutils/dev/uucore/features/entries/index.html deleted file mode 100644 index ca874c09f..000000000 --- a/coreutils/dev/uucore/features/entries/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/struct.Group.html b/coreutils/dev/uucore/features/entries/struct.Group.html deleted file mode 100644 index 25ff7d2c3..000000000 --- a/coreutils/dev/uucore/features/entries/struct.Group.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/struct.Group.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/struct.Passwd.html b/coreutils/dev/uucore/features/entries/struct.Passwd.html deleted file mode 100644 index 1cb03c188..000000000 --- a/coreutils/dev/uucore/features/entries/struct.Passwd.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/struct.Passwd.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/entries/trait.Locate.html b/coreutils/dev/uucore/features/entries/trait.Locate.html deleted file mode 100644 index 0fca81cd2..000000000 --- a/coreutils/dev/uucore/features/entries/trait.Locate.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/entries/trait.Locate.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/enum.MissingHandling.html b/coreutils/dev/uucore/features/fs/enum.MissingHandling.html deleted file mode 100644 index bc30750bb..000000000 --- a/coreutils/dev/uucore/features/fs/enum.MissingHandling.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/enum.MissingHandling.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/enum.ResolveMode.html b/coreutils/dev/uucore/features/fs/enum.ResolveMode.html deleted file mode 100644 index 8744dfd6c..000000000 --- a/coreutils/dev/uucore/features/fs/enum.ResolveMode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/enum.ResolveMode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.are_hardlinks_or_one_way_symlink_to_same_file.html b/coreutils/dev/uucore/features/fs/fn.are_hardlinks_or_one_way_symlink_to_same_file.html deleted file mode 100644 index 6803480ec..000000000 --- a/coreutils/dev/uucore/features/fs/fn.are_hardlinks_or_one_way_symlink_to_same_file.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.are_hardlinks_or_one_way_symlink_to_same_file.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.are_hardlinks_to_same_file.html b/coreutils/dev/uucore/features/fs/fn.are_hardlinks_to_same_file.html deleted file mode 100644 index aec9d4c8e..000000000 --- a/coreutils/dev/uucore/features/fs/fn.are_hardlinks_to_same_file.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.are_hardlinks_to_same_file.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.canonicalize.html b/coreutils/dev/uucore/features/fs/fn.canonicalize.html deleted file mode 100644 index a980bdee8..000000000 --- a/coreutils/dev/uucore/features/fs/fn.canonicalize.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.canonicalize.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.dir_strip_dot_for_creation.html b/coreutils/dev/uucore/features/fs/fn.dir_strip_dot_for_creation.html deleted file mode 100644 index 1d8736c88..000000000 --- a/coreutils/dev/uucore/features/fs/fn.dir_strip_dot_for_creation.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.dir_strip_dot_for_creation.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.display_permissions.html b/coreutils/dev/uucore/features/fs/fn.display_permissions.html deleted file mode 100644 index 6ffac7ab8..000000000 --- a/coreutils/dev/uucore/features/fs/fn.display_permissions.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.display_permissions.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.display_permissions_unix.html b/coreutils/dev/uucore/features/fs/fn.display_permissions_unix.html deleted file mode 100644 index 54234db6a..000000000 --- a/coreutils/dev/uucore/features/fs/fn.display_permissions_unix.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.display_permissions_unix.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.infos_refer_to_same_file.html b/coreutils/dev/uucore/features/fs/fn.infos_refer_to_same_file.html deleted file mode 100644 index a6f15c70f..000000000 --- a/coreutils/dev/uucore/features/fs/fn.infos_refer_to_same_file.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.infos_refer_to_same_file.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.is_symlink_loop.html b/coreutils/dev/uucore/features/fs/fn.is_symlink_loop.html deleted file mode 100644 index 610285d6e..000000000 --- a/coreutils/dev/uucore/features/fs/fn.is_symlink_loop.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.is_symlink_loop.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.make_path_relative_to.html b/coreutils/dev/uucore/features/fs/fn.make_path_relative_to.html deleted file mode 100644 index ea2c1feb6..000000000 --- a/coreutils/dev/uucore/features/fs/fn.make_path_relative_to.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.make_path_relative_to.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.normalize_path.html b/coreutils/dev/uucore/features/fs/fn.normalize_path.html deleted file mode 100644 index 32755fa26..000000000 --- a/coreutils/dev/uucore/features/fs/fn.normalize_path.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.normalize_path.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.paths_refer_to_same_file.html b/coreutils/dev/uucore/features/fs/fn.paths_refer_to_same_file.html deleted file mode 100644 index 2473d6af4..000000000 --- a/coreutils/dev/uucore/features/fs/fn.paths_refer_to_same_file.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.paths_refer_to_same_file.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/fn.resolve_relative_path.html b/coreutils/dev/uucore/features/fs/fn.resolve_relative_path.html deleted file mode 100644 index 25f44513f..000000000 --- a/coreutils/dev/uucore/features/fs/fn.resolve_relative_path.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/fn.resolve_relative_path.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/index.html b/coreutils/dev/uucore/features/fs/index.html deleted file mode 100644 index d5b57ff3c..000000000 --- a/coreutils/dev/uucore/features/fs/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fs/struct.FileInformation.html b/coreutils/dev/uucore/features/fs/struct.FileInformation.html deleted file mode 100644 index e569016ed..000000000 --- a/coreutils/dev/uucore/features/fs/struct.FileInformation.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fs/struct.FileInformation.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/fn.StatFs.html b/coreutils/dev/uucore/features/fsext/fn.StatFs.html deleted file mode 100644 index c2c70fe0a..000000000 --- a/coreutils/dev/uucore/features/fsext/fn.StatFs.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/fn.statfs_fn.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/fn.pretty_filetype.html b/coreutils/dev/uucore/features/fsext/fn.pretty_filetype.html deleted file mode 100644 index ddd6de96f..000000000 --- a/coreutils/dev/uucore/features/fsext/fn.pretty_filetype.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/fn.pretty_filetype.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/fn.pretty_fstype.html b/coreutils/dev/uucore/features/fsext/fn.pretty_fstype.html deleted file mode 100644 index a90e33f49..000000000 --- a/coreutils/dev/uucore/features/fsext/fn.pretty_fstype.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/fn.pretty_fstype.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/fn.pretty_time.html b/coreutils/dev/uucore/features/fsext/fn.pretty_time.html deleted file mode 100644 index aa37e8a78..000000000 --- a/coreutils/dev/uucore/features/fsext/fn.pretty_time.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/fn.pretty_time.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/fn.read_fs_list.html b/coreutils/dev/uucore/features/fsext/fn.read_fs_list.html deleted file mode 100644 index 06968b1da..000000000 --- a/coreutils/dev/uucore/features/fsext/fn.read_fs_list.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/fn.read_fs_list.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/fn.statfs.html b/coreutils/dev/uucore/features/fsext/fn.statfs.html deleted file mode 100644 index ae7f4090d..000000000 --- a/coreutils/dev/uucore/features/fsext/fn.statfs.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/fn.statfs.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/fn.statfs_fn.html b/coreutils/dev/uucore/features/fsext/fn.statfs_fn.html deleted file mode 100644 index c2c70fe0a..000000000 --- a/coreutils/dev/uucore/features/fsext/fn.statfs_fn.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/fn.statfs_fn.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/index.html b/coreutils/dev/uucore/features/fsext/index.html deleted file mode 100644 index 3742bf9e1..000000000 --- a/coreutils/dev/uucore/features/fsext/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/struct.FsUsage.html b/coreutils/dev/uucore/features/fsext/struct.FsUsage.html deleted file mode 100644 index 585337da3..000000000 --- a/coreutils/dev/uucore/features/fsext/struct.FsUsage.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/struct.FsUsage.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/struct.MountInfo.html b/coreutils/dev/uucore/features/fsext/struct.MountInfo.html deleted file mode 100644 index 858ab9df0..000000000 --- a/coreutils/dev/uucore/features/fsext/struct.MountInfo.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/struct.MountInfo.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/struct.StatFs.html b/coreutils/dev/uucore/features/fsext/struct.StatFs.html deleted file mode 100644 index e5274f32e..000000000 --- a/coreutils/dev/uucore/features/fsext/struct.StatFs.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/struct.statfs_fn.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/struct.statfs_fn.html b/coreutils/dev/uucore/features/fsext/struct.statfs_fn.html deleted file mode 100644 index e5274f32e..000000000 --- a/coreutils/dev/uucore/features/fsext/struct.statfs_fn.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/struct.statfs_fn.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/trait.BirthTime.html b/coreutils/dev/uucore/features/fsext/trait.BirthTime.html deleted file mode 100644 index b98156b00..000000000 --- a/coreutils/dev/uucore/features/fsext/trait.BirthTime.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/trait.BirthTime.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/fsext/trait.FsMeta.html b/coreutils/dev/uucore/features/fsext/trait.FsMeta.html deleted file mode 100644 index 80fc834fe..000000000 --- a/coreutils/dev/uucore/features/fsext/trait.FsMeta.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/fsext/trait.FsMeta.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/lines/fn.lines.html b/coreutils/dev/uucore/features/lines/fn.lines.html deleted file mode 100644 index f8bef3623..000000000 --- a/coreutils/dev/uucore/features/lines/fn.lines.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/lines/fn.lines.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/lines/index.html b/coreutils/dev/uucore/features/lines/index.html deleted file mode 100644 index 061e09abe..000000000 --- a/coreutils/dev/uucore/features/lines/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/lines/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/lines/struct.Lines.html b/coreutils/dev/uucore/features/lines/struct.Lines.html deleted file mode 100644 index f6116484a..000000000 --- a/coreutils/dev/uucore/features/lines/struct.Lines.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/lines/struct.Lines.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/memo/fn.printf.html b/coreutils/dev/uucore/features/memo/fn.printf.html deleted file mode 100644 index 80166de0e..000000000 --- a/coreutils/dev/uucore/features/memo/fn.printf.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/memo/fn.printf.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/memo/fn.sprintf.html b/coreutils/dev/uucore/features/memo/fn.sprintf.html deleted file mode 100644 index 92810de6c..000000000 --- a/coreutils/dev/uucore/features/memo/fn.sprintf.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/memo/fn.sprintf.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/memo/index.html b/coreutils/dev/uucore/features/memo/index.html deleted file mode 100644 index 8139e8509..000000000 --- a/coreutils/dev/uucore/features/memo/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/memo/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/mode/fn.get_umask.html b/coreutils/dev/uucore/features/mode/fn.get_umask.html deleted file mode 100644 index ebf18e8f2..000000000 --- a/coreutils/dev/uucore/features/mode/fn.get_umask.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/mode/fn.get_umask.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/mode/fn.parse_mode.html b/coreutils/dev/uucore/features/mode/fn.parse_mode.html deleted file mode 100644 index 0c5922dcd..000000000 --- a/coreutils/dev/uucore/features/mode/fn.parse_mode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/mode/fn.parse_mode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/mode/fn.parse_numeric.html b/coreutils/dev/uucore/features/mode/fn.parse_numeric.html deleted file mode 100644 index 0747b9eef..000000000 --- a/coreutils/dev/uucore/features/mode/fn.parse_numeric.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/mode/fn.parse_numeric.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/mode/fn.parse_symbolic.html b/coreutils/dev/uucore/features/mode/fn.parse_symbolic.html deleted file mode 100644 index 29c513eb3..000000000 --- a/coreutils/dev/uucore/features/mode/fn.parse_symbolic.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/mode/fn.parse_symbolic.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/mode/fn.strip_minus_from_mode.html b/coreutils/dev/uucore/features/mode/fn.strip_minus_from_mode.html deleted file mode 100644 index 4e6d9ce85..000000000 --- a/coreutils/dev/uucore/features/mode/fn.strip_minus_from_mode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/mode/fn.strip_minus_from_mode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/mode/index.html b/coreutils/dev/uucore/features/mode/index.html deleted file mode 100644 index 68f95dafc..000000000 --- a/coreutils/dev/uucore/features/mode/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/mode/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/enum.IfFrom.html b/coreutils/dev/uucore/features/perms/enum.IfFrom.html deleted file mode 100644 index 8955c772c..000000000 --- a/coreutils/dev/uucore/features/perms/enum.IfFrom.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/perms/enum.IfFrom.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/enum.TraverseSymlinks.html b/coreutils/dev/uucore/features/perms/enum.TraverseSymlinks.html deleted file mode 100644 index 1340276c1..000000000 --- a/coreutils/dev/uucore/features/perms/enum.TraverseSymlinks.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/perms/enum.TraverseSymlinks.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/enum.VerbosityLevel.html b/coreutils/dev/uucore/features/perms/enum.VerbosityLevel.html deleted file mode 100644 index 64d4d3377..000000000 --- a/coreutils/dev/uucore/features/perms/enum.VerbosityLevel.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/perms/enum.VerbosityLevel.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/fn.chown_base.html b/coreutils/dev/uucore/features/perms/fn.chown_base.html deleted file mode 100644 index 7138a0d14..000000000 --- a/coreutils/dev/uucore/features/perms/fn.chown_base.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/perms/fn.chown_base.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/fn.wrap_chown.html b/coreutils/dev/uucore/features/perms/fn.wrap_chown.html deleted file mode 100644 index 457892f41..000000000 --- a/coreutils/dev/uucore/features/perms/fn.wrap_chown.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/perms/fn.wrap_chown.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/index.html b/coreutils/dev/uucore/features/perms/index.html deleted file mode 100644 index 822a521ba..000000000 --- a/coreutils/dev/uucore/features/perms/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/perms/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/constant.ARG_FILES.html b/coreutils/dev/uucore/features/perms/options/constant.ARG_FILES.html deleted file mode 100644 index cf33be182..000000000 --- a/coreutils/dev/uucore/features/perms/options/constant.ARG_FILES.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/perms/options/constant.ARG_FILES.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/constant.ARG_GROUP.html b/coreutils/dev/uucore/features/perms/options/constant.ARG_GROUP.html deleted file mode 100644 index a4537e5ae..000000000 --- a/coreutils/dev/uucore/features/perms/options/constant.ARG_GROUP.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/perms/options/constant.ARG_GROUP.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/constant.ARG_OWNER.html b/coreutils/dev/uucore/features/perms/options/constant.ARG_OWNER.html deleted file mode 100644 index ab8d8f3a3..000000000 --- a/coreutils/dev/uucore/features/perms/options/constant.ARG_OWNER.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/perms/options/constant.ARG_OWNER.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/constant.FROM.html b/coreutils/dev/uucore/features/perms/options/constant.FROM.html deleted file mode 100644 index bfbbca940..000000000 --- a/coreutils/dev/uucore/features/perms/options/constant.FROM.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/perms/options/constant.FROM.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/constant.HELP.html b/coreutils/dev/uucore/features/perms/options/constant.HELP.html deleted file mode 100644 index 1e89462f4..000000000 --- a/coreutils/dev/uucore/features/perms/options/constant.HELP.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/perms/options/constant.HELP.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/constant.RECURSIVE.html b/coreutils/dev/uucore/features/perms/options/constant.RECURSIVE.html deleted file mode 100644 index 7b6ce16b2..000000000 --- a/coreutils/dev/uucore/features/perms/options/constant.RECURSIVE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/perms/options/constant.RECURSIVE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/constant.REFERENCE.html b/coreutils/dev/uucore/features/perms/options/constant.REFERENCE.html deleted file mode 100644 index eda31f68c..000000000 --- a/coreutils/dev/uucore/features/perms/options/constant.REFERENCE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/perms/options/constant.REFERENCE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/dereference/constant.DEREFERENCE.html b/coreutils/dev/uucore/features/perms/options/dereference/constant.DEREFERENCE.html deleted file mode 100644 index fcf7b7eda..000000000 --- a/coreutils/dev/uucore/features/perms/options/dereference/constant.DEREFERENCE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/dereference/constant.DEREFERENCE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/dereference/constant.NO_DEREFERENCE.html b/coreutils/dev/uucore/features/perms/options/dereference/constant.NO_DEREFERENCE.html deleted file mode 100644 index 2c2fade59..000000000 --- a/coreutils/dev/uucore/features/perms/options/dereference/constant.NO_DEREFERENCE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/dereference/constant.NO_DEREFERENCE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/dereference/index.html b/coreutils/dev/uucore/features/perms/options/dereference/index.html deleted file mode 100644 index d7c8dddfb..000000000 --- a/coreutils/dev/uucore/features/perms/options/dereference/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/dereference/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/index.html b/coreutils/dev/uucore/features/perms/options/index.html deleted file mode 100644 index ea8f53db1..000000000 --- a/coreutils/dev/uucore/features/perms/options/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/perms/options/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/preserve_root/constant.NO_PRESERVE.html b/coreutils/dev/uucore/features/perms/options/preserve_root/constant.NO_PRESERVE.html deleted file mode 100644 index 8efee5271..000000000 --- a/coreutils/dev/uucore/features/perms/options/preserve_root/constant.NO_PRESERVE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/preserve_root/constant.NO_PRESERVE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/preserve_root/constant.PRESERVE.html b/coreutils/dev/uucore/features/perms/options/preserve_root/constant.PRESERVE.html deleted file mode 100644 index 566044e6e..000000000 --- a/coreutils/dev/uucore/features/perms/options/preserve_root/constant.PRESERVE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/preserve_root/constant.PRESERVE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/preserve_root/index.html b/coreutils/dev/uucore/features/perms/options/preserve_root/index.html deleted file mode 100644 index 22f86c506..000000000 --- a/coreutils/dev/uucore/features/perms/options/preserve_root/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/preserve_root/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/traverse/constant.EVERY.html b/coreutils/dev/uucore/features/perms/options/traverse/constant.EVERY.html deleted file mode 100644 index 3eeaef032..000000000 --- a/coreutils/dev/uucore/features/perms/options/traverse/constant.EVERY.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/traverse/constant.EVERY.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/traverse/constant.NO_TRAVERSE.html b/coreutils/dev/uucore/features/perms/options/traverse/constant.NO_TRAVERSE.html deleted file mode 100644 index 6c484498b..000000000 --- a/coreutils/dev/uucore/features/perms/options/traverse/constant.NO_TRAVERSE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/traverse/constant.NO_TRAVERSE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/traverse/constant.TRAVERSE.html b/coreutils/dev/uucore/features/perms/options/traverse/constant.TRAVERSE.html deleted file mode 100644 index 94c8d5c02..000000000 --- a/coreutils/dev/uucore/features/perms/options/traverse/constant.TRAVERSE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/traverse/constant.TRAVERSE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/traverse/index.html b/coreutils/dev/uucore/features/perms/options/traverse/index.html deleted file mode 100644 index c8576be70..000000000 --- a/coreutils/dev/uucore/features/perms/options/traverse/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/traverse/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/verbosity/constant.CHANGES.html b/coreutils/dev/uucore/features/perms/options/verbosity/constant.CHANGES.html deleted file mode 100644 index b2059cacd..000000000 --- a/coreutils/dev/uucore/features/perms/options/verbosity/constant.CHANGES.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/verbosity/constant.CHANGES.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/verbosity/constant.QUIET.html b/coreutils/dev/uucore/features/perms/options/verbosity/constant.QUIET.html deleted file mode 100644 index 276524a67..000000000 --- a/coreutils/dev/uucore/features/perms/options/verbosity/constant.QUIET.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/verbosity/constant.QUIET.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/verbosity/constant.SILENT.html b/coreutils/dev/uucore/features/perms/options/verbosity/constant.SILENT.html deleted file mode 100644 index cec9d7342..000000000 --- a/coreutils/dev/uucore/features/perms/options/verbosity/constant.SILENT.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/verbosity/constant.SILENT.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/verbosity/constant.VERBOSE.html b/coreutils/dev/uucore/features/perms/options/verbosity/constant.VERBOSE.html deleted file mode 100644 index 01f236298..000000000 --- a/coreutils/dev/uucore/features/perms/options/verbosity/constant.VERBOSE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/verbosity/constant.VERBOSE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/options/verbosity/index.html b/coreutils/dev/uucore/features/perms/options/verbosity/index.html deleted file mode 100644 index a9da454dc..000000000 --- a/coreutils/dev/uucore/features/perms/options/verbosity/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../../uucore/perms/options/verbosity/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/struct.ChownExecutor.html b/coreutils/dev/uucore/features/perms/struct.ChownExecutor.html deleted file mode 100644 index b167d2416..000000000 --- a/coreutils/dev/uucore/features/perms/struct.ChownExecutor.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/perms/struct.ChownExecutor.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/struct.GidUidOwnerFilter.html b/coreutils/dev/uucore/features/perms/struct.GidUidOwnerFilter.html deleted file mode 100644 index 90d5a6d31..000000000 --- a/coreutils/dev/uucore/features/perms/struct.GidUidOwnerFilter.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/perms/struct.GidUidOwnerFilter.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/perms/struct.Verbosity.html b/coreutils/dev/uucore/features/perms/struct.Verbosity.html deleted file mode 100644 index cbb819b5e..000000000 --- a/coreutils/dev/uucore/features/perms/struct.Verbosity.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/perms/struct.Verbosity.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/pipes/fn.pipe.html b/coreutils/dev/uucore/features/pipes/fn.pipe.html deleted file mode 100644 index c6a836e1d..000000000 --- a/coreutils/dev/uucore/features/pipes/fn.pipe.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/pipes/fn.pipe.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/pipes/fn.splice.html b/coreutils/dev/uucore/features/pipes/fn.splice.html deleted file mode 100644 index 238b99e2d..000000000 --- a/coreutils/dev/uucore/features/pipes/fn.splice.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/pipes/fn.splice.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/pipes/fn.splice_exact.html b/coreutils/dev/uucore/features/pipes/fn.splice_exact.html deleted file mode 100644 index f5ead95b1..000000000 --- a/coreutils/dev/uucore/features/pipes/fn.splice_exact.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/pipes/fn.splice_exact.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/pipes/fn.vmsplice.html b/coreutils/dev/uucore/features/pipes/fn.vmsplice.html deleted file mode 100644 index 000ec8bf4..000000000 --- a/coreutils/dev/uucore/features/pipes/fn.vmsplice.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/pipes/fn.vmsplice.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/pipes/index.html b/coreutils/dev/uucore/features/pipes/index.html deleted file mode 100644 index da0a0fc2d..000000000 --- a/coreutils/dev/uucore/features/pipes/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/pipes/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/pipes/type.Error.html b/coreutils/dev/uucore/features/pipes/type.Error.html deleted file mode 100644 index 8450e944e..000000000 --- a/coreutils/dev/uucore/features/pipes/type.Error.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/pipes/type.Error.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/pipes/type.Result.html b/coreutils/dev/uucore/features/pipes/type.Result.html deleted file mode 100644 index e1dea8f15..000000000 --- a/coreutils/dev/uucore/features/pipes/type.Result.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/pipes/type.Result.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/process/fn.getegid.html b/coreutils/dev/uucore/features/process/fn.getegid.html deleted file mode 100644 index b48580252..000000000 --- a/coreutils/dev/uucore/features/process/fn.getegid.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/process/fn.getegid.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/process/fn.geteuid.html b/coreutils/dev/uucore/features/process/fn.geteuid.html deleted file mode 100644 index 963a3d09c..000000000 --- a/coreutils/dev/uucore/features/process/fn.geteuid.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/process/fn.geteuid.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/process/fn.getgid.html b/coreutils/dev/uucore/features/process/fn.getgid.html deleted file mode 100644 index c4c6c73c0..000000000 --- a/coreutils/dev/uucore/features/process/fn.getgid.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/process/fn.getgid.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/process/fn.getuid.html b/coreutils/dev/uucore/features/process/fn.getuid.html deleted file mode 100644 index 59065103c..000000000 --- a/coreutils/dev/uucore/features/process/fn.getuid.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/process/fn.getuid.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/process/index.html b/coreutils/dev/uucore/features/process/index.html deleted file mode 100644 index fab407d06..000000000 --- a/coreutils/dev/uucore/features/process/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/process/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/process/trait.ChildExt.html b/coreutils/dev/uucore/features/process/trait.ChildExt.html deleted file mode 100644 index db70b8378..000000000 --- a/coreutils/dev/uucore/features/process/trait.ChildExt.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/process/trait.ChildExt.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/ringbuffer/index.html b/coreutils/dev/uucore/features/ringbuffer/index.html deleted file mode 100644 index 5cc8f7d52..000000000 --- a/coreutils/dev/uucore/features/ringbuffer/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/ringbuffer/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/ringbuffer/struct.RingBuffer.html b/coreutils/dev/uucore/features/ringbuffer/struct.RingBuffer.html deleted file mode 100644 index 8e1387ccf..000000000 --- a/coreutils/dev/uucore/features/ringbuffer/struct.RingBuffer.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/ringbuffer/struct.RingBuffer.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/signals/fn.enable_pipe_errors.html b/coreutils/dev/uucore/features/signals/fn.enable_pipe_errors.html deleted file mode 100644 index eb0abab03..000000000 --- a/coreutils/dev/uucore/features/signals/fn.enable_pipe_errors.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/signals/fn.enable_pipe_errors.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/signals/fn.ignore_interrupts.html b/coreutils/dev/uucore/features/signals/fn.ignore_interrupts.html deleted file mode 100644 index 02c834689..000000000 --- a/coreutils/dev/uucore/features/signals/fn.ignore_interrupts.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/signals/fn.ignore_interrupts.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/signals/fn.is_signal.html b/coreutils/dev/uucore/features/signals/fn.is_signal.html deleted file mode 100644 index 49109f9fe..000000000 --- a/coreutils/dev/uucore/features/signals/fn.is_signal.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/signals/fn.is_signal.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/signals/fn.signal_by_name_or_value.html b/coreutils/dev/uucore/features/signals/fn.signal_by_name_or_value.html deleted file mode 100644 index 7a60b6c6f..000000000 --- a/coreutils/dev/uucore/features/signals/fn.signal_by_name_or_value.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/signals/fn.signal_by_name_or_value.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/signals/fn.signal_name_by_value.html b/coreutils/dev/uucore/features/signals/fn.signal_name_by_value.html deleted file mode 100644 index a58453c3a..000000000 --- a/coreutils/dev/uucore/features/signals/fn.signal_name_by_value.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/signals/fn.signal_name_by_value.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/signals/index.html b/coreutils/dev/uucore/features/signals/index.html deleted file mode 100644 index 81cb86805..000000000 --- a/coreutils/dev/uucore/features/signals/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/signals/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/signals/static.ALL_SIGNALS.html b/coreutils/dev/uucore/features/signals/static.ALL_SIGNALS.html deleted file mode 100644 index 139a0eebd..000000000 --- a/coreutils/dev/uucore/features/signals/static.ALL_SIGNALS.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/signals/static.ALL_SIGNALS.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/signals/static.DEFAULT_SIGNAL.html b/coreutils/dev/uucore/features/signals/static.DEFAULT_SIGNAL.html deleted file mode 100644 index d4964b3a3..000000000 --- a/coreutils/dev/uucore/features/signals/static.DEFAULT_SIGNAL.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/signals/static.DEFAULT_SIGNAL.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/fn.div_ceil.html b/coreutils/dev/uucore/features/sum/fn.div_ceil.html deleted file mode 100644 index f49553acf..000000000 --- a/coreutils/dev/uucore/features/sum/fn.div_ceil.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/fn.div_ceil.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/index.html b/coreutils/dev/uucore/features/sum/index.html deleted file mode 100644 index 9a9eeb937..000000000 --- a/coreutils/dev/uucore/features/sum/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.BSD.html b/coreutils/dev/uucore/features/sum/struct.BSD.html deleted file mode 100644 index e33d42901..000000000 --- a/coreutils/dev/uucore/features/sum/struct.BSD.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.BSD.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Blake2b.html b/coreutils/dev/uucore/features/sum/struct.Blake2b.html deleted file mode 100644 index 7d1cf99a0..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Blake2b.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Blake2b.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Blake3.html b/coreutils/dev/uucore/features/sum/struct.Blake3.html deleted file mode 100644 index 498c77e81..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Blake3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Blake3.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.CRC.html b/coreutils/dev/uucore/features/sum/struct.CRC.html deleted file mode 100644 index 8cc3b4143..000000000 --- a/coreutils/dev/uucore/features/sum/struct.CRC.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.CRC.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.DigestWriter.html b/coreutils/dev/uucore/features/sum/struct.DigestWriter.html deleted file mode 100644 index d5f5112a4..000000000 --- a/coreutils/dev/uucore/features/sum/struct.DigestWriter.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.DigestWriter.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Md5.html b/coreutils/dev/uucore/features/sum/struct.Md5.html deleted file mode 100644 index 099ff5c79..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Md5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Md5.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.SYSV.html b/coreutils/dev/uucore/features/sum/struct.SYSV.html deleted file mode 100644 index 34ff2e33b..000000000 --- a/coreutils/dev/uucore/features/sum/struct.SYSV.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.SYSV.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sha1.html b/coreutils/dev/uucore/features/sum/struct.Sha1.html deleted file mode 100644 index 6da7a80fc..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sha1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sha1.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sha224.html b/coreutils/dev/uucore/features/sum/struct.Sha224.html deleted file mode 100644 index 8c9402f0e..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sha224.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sha224.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sha256.html b/coreutils/dev/uucore/features/sum/struct.Sha256.html deleted file mode 100644 index f8b70ea8f..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sha256.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sha256.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sha384.html b/coreutils/dev/uucore/features/sum/struct.Sha384.html deleted file mode 100644 index 17d07dc14..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sha384.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sha384.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sha3_224.html b/coreutils/dev/uucore/features/sum/struct.Sha3_224.html deleted file mode 100644 index d585bf9d0..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sha3_224.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sha3_224.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sha3_256.html b/coreutils/dev/uucore/features/sum/struct.Sha3_256.html deleted file mode 100644 index deb476f92..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sha3_256.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sha3_256.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sha3_384.html b/coreutils/dev/uucore/features/sum/struct.Sha3_384.html deleted file mode 100644 index f60671733..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sha3_384.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sha3_384.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sha3_512.html b/coreutils/dev/uucore/features/sum/struct.Sha3_512.html deleted file mode 100644 index e0b58c580..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sha3_512.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sha3_512.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sha512.html b/coreutils/dev/uucore/features/sum/struct.Sha512.html deleted file mode 100644 index 947d506ef..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sha512.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sha512.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Shake128.html b/coreutils/dev/uucore/features/sum/struct.Shake128.html deleted file mode 100644 index 6dd926b33..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Shake128.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Shake128.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Shake256.html b/coreutils/dev/uucore/features/sum/struct.Shake256.html deleted file mode 100644 index 5a46f174d..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Shake256.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Shake256.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/struct.Sm3.html b/coreutils/dev/uucore/features/sum/struct.Sm3.html deleted file mode 100644 index e7414b8fa..000000000 --- a/coreutils/dev/uucore/features/sum/struct.Sm3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/struct.Sm3.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/sum/trait.Digest.html b/coreutils/dev/uucore/features/sum/trait.Digest.html deleted file mode 100644 index ce192540b..000000000 --- a/coreutils/dev/uucore/features/sum/trait.Digest.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/sum/trait.Digest.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/fn.endutxent.html b/coreutils/dev/uucore/features/utmpx/fn.endutxent.html deleted file mode 100644 index 4a0b9cd3f..000000000 --- a/coreutils/dev/uucore/features/utmpx/fn.endutxent.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/utmpx/fn.endutxent.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/fn.getutxent.html b/coreutils/dev/uucore/features/utmpx/fn.getutxent.html deleted file mode 100644 index 52334fce0..000000000 --- a/coreutils/dev/uucore/features/utmpx/fn.getutxent.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/utmpx/fn.getutxent.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/fn.setutxent.html b/coreutils/dev/uucore/features/utmpx/fn.setutxent.html deleted file mode 100644 index 15c8d5a61..000000000 --- a/coreutils/dev/uucore/features/utmpx/fn.setutxent.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/utmpx/fn.setutxent.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/fn.utmpxname.html b/coreutils/dev/uucore/features/utmpx/fn.utmpxname.html deleted file mode 100644 index aab737dd3..000000000 --- a/coreutils/dev/uucore/features/utmpx/fn.utmpxname.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/utmpx/fn.utmpxname.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/index.html b/coreutils/dev/uucore/features/utmpx/index.html deleted file mode 100644 index 44b1449e0..000000000 --- a/coreutils/dev/uucore/features/utmpx/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/utmpx/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/struct.Utmpx.html b/coreutils/dev/uucore/features/utmpx/struct.Utmpx.html deleted file mode 100644 index 1d46b9bc7..000000000 --- a/coreutils/dev/uucore/features/utmpx/struct.Utmpx.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/utmpx/struct.Utmpx.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/struct.UtmpxIter.html b/coreutils/dev/uucore/features/utmpx/struct.UtmpxIter.html deleted file mode 100644 index d1e74b3c3..000000000 --- a/coreutils/dev/uucore/features/utmpx/struct.UtmpxIter.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/utmpx/struct.UtmpxIter.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.ACCOUNTING.html b/coreutils/dev/uucore/features/utmpx/ut/constant.ACCOUNTING.html deleted file mode 100644 index b567f0581..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.ACCOUNTING.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.ACCOUNTING.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.BOOT_TIME.html b/coreutils/dev/uucore/features/utmpx/ut/constant.BOOT_TIME.html deleted file mode 100644 index 0448fe874..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.BOOT_TIME.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.BOOT_TIME.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.DEAD_PROCESS.html b/coreutils/dev/uucore/features/utmpx/ut/constant.DEAD_PROCESS.html deleted file mode 100644 index ad1ccac25..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.DEAD_PROCESS.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.DEAD_PROCESS.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.EMPTY.html b/coreutils/dev/uucore/features/utmpx/ut/constant.EMPTY.html deleted file mode 100644 index 0db75e022..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.EMPTY.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.EMPTY.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.INIT_PROCESS.html b/coreutils/dev/uucore/features/utmpx/ut/constant.INIT_PROCESS.html deleted file mode 100644 index be258642b..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.INIT_PROCESS.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.INIT_PROCESS.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.LOGIN_PROCESS.html b/coreutils/dev/uucore/features/utmpx/ut/constant.LOGIN_PROCESS.html deleted file mode 100644 index 39f27d0b1..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.LOGIN_PROCESS.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.LOGIN_PROCESS.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.NEW_TIME.html b/coreutils/dev/uucore/features/utmpx/ut/constant.NEW_TIME.html deleted file mode 100644 index 436ed9c3e..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.NEW_TIME.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.NEW_TIME.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.OLD_TIME.html b/coreutils/dev/uucore/features/utmpx/ut/constant.OLD_TIME.html deleted file mode 100644 index bc6e4d291..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.OLD_TIME.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.OLD_TIME.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.RUN_LVL.html b/coreutils/dev/uucore/features/utmpx/ut/constant.RUN_LVL.html deleted file mode 100644 index fc4223ad9..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.RUN_LVL.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.RUN_LVL.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.USER_PROCESS.html b/coreutils/dev/uucore/features/utmpx/ut/constant.USER_PROCESS.html deleted file mode 100644 index b3eb15466..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.USER_PROCESS.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.USER_PROCESS.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.UT_HOSTSIZE.html b/coreutils/dev/uucore/features/utmpx/ut/constant.UT_HOSTSIZE.html deleted file mode 100644 index 435d3d06a..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.UT_HOSTSIZE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.UT_HOSTSIZE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.UT_IDSIZE.html b/coreutils/dev/uucore/features/utmpx/ut/constant.UT_IDSIZE.html deleted file mode 100644 index 5c5b0b3dc..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.UT_IDSIZE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.UT_IDSIZE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.UT_LINESIZE.html b/coreutils/dev/uucore/features/utmpx/ut/constant.UT_LINESIZE.html deleted file mode 100644 index 1c9be4f22..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.UT_LINESIZE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.UT_LINESIZE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/constant.UT_NAMESIZE.html b/coreutils/dev/uucore/features/utmpx/ut/constant.UT_NAMESIZE.html deleted file mode 100644 index b03d79421..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/constant.UT_NAMESIZE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/constant.UT_NAMESIZE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/features/utmpx/ut/static.DEFAULT_FILE.html b/coreutils/dev/uucore/features/utmpx/ut/static.DEFAULT_FILE.html deleted file mode 100644 index ae0ec8896..000000000 --- a/coreutils/dev/uucore/features/utmpx/ut/static.DEFAULT_FILE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/utmpx/static.DEFAULT_FILE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/fn.args_os.html b/coreutils/dev/uucore/fn.args_os.html deleted file mode 100644 index 035eba1e0..000000000 --- a/coreutils/dev/uucore/fn.args_os.html +++ /dev/null @@ -1 +0,0 @@ -args_os in uucore - Rust

Function uucore::args_os

source ·
pub fn args_os() -> impl Iterator<Item = OsString>
\ No newline at end of file diff --git a/coreutils/dev/uucore/fn.execution_phrase.html b/coreutils/dev/uucore/fn.execution_phrase.html deleted file mode 100644 index c5f673455..000000000 --- a/coreutils/dev/uucore/fn.execution_phrase.html +++ /dev/null @@ -1,2 +0,0 @@ -execution_phrase in uucore - Rust

Function uucore::execution_phrase

source ·
pub fn execution_phrase() -> &'static str
Expand description

Derive the complete execution phrase for “usage”.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fn.format_usage.html b/coreutils/dev/uucore/fn.format_usage.html deleted file mode 100644 index 9c2483ed1..000000000 --- a/coreutils/dev/uucore/fn.format_usage.html +++ /dev/null @@ -1,7 +0,0 @@ -format_usage in uucore - Rust

Function uucore::format_usage

source ·
pub fn format_usage(s: &str) -> String
Expand description

Generate the usage string for clap.

-

This function does two things. It indents all but the first line to align -the lines because clap adds “Usage: “ to the first line. And it replaces -all occurrences of {} with the execution phrase and returns the resulting -String. It does not support more advanced formatting features such -as {0}.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fn.get_utility_is_second_arg.html b/coreutils/dev/uucore/fn.get_utility_is_second_arg.html deleted file mode 100644 index e69155143..000000000 --- a/coreutils/dev/uucore/fn.get_utility_is_second_arg.html +++ /dev/null @@ -1 +0,0 @@ -get_utility_is_second_arg in uucore - Rust
pub fn get_utility_is_second_arg() -> bool
\ No newline at end of file diff --git a/coreutils/dev/uucore/fn.read_yes.html b/coreutils/dev/uucore/fn.read_yes.html deleted file mode 100644 index ddf85cd36..000000000 --- a/coreutils/dev/uucore/fn.read_yes.html +++ /dev/null @@ -1,2 +0,0 @@ -read_yes in uucore - Rust

Function uucore::read_yes

source ·
pub fn read_yes() -> bool
Expand description

Read a line from stdin and check whether the first character is 'y' or 'Y'

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fn.set_utility_is_second_arg.html b/coreutils/dev/uucore/fn.set_utility_is_second_arg.html deleted file mode 100644 index 447fc49a8..000000000 --- a/coreutils/dev/uucore/fn.set_utility_is_second_arg.html +++ /dev/null @@ -1 +0,0 @@ -set_utility_is_second_arg in uucore - Rust
pub fn set_utility_is_second_arg()
\ No newline at end of file diff --git a/coreutils/dev/uucore/fn.util_name.html b/coreutils/dev/uucore/fn.util_name.html deleted file mode 100644 index 65eb4d890..000000000 --- a/coreutils/dev/uucore/fn.util_name.html +++ /dev/null @@ -1,2 +0,0 @@ -util_name in uucore - Rust

Function uucore::util_name

source ·
pub fn util_name() -> &'static str
Expand description

Derive the utility name.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/enum.MissingHandling.html b/coreutils/dev/uucore/fs/enum.MissingHandling.html deleted file mode 100644 index e995c74e7..000000000 --- a/coreutils/dev/uucore/fs/enum.MissingHandling.html +++ /dev/null @@ -1,22 +0,0 @@ -MissingHandling in uucore::fs - Rust
pub enum MissingHandling {
-    Normal,
-    Existing,
-    Missing,
-}
Expand description

Controls how symbolic links should be handled when canonicalizing a path.

-

Variants§

§

Normal

Return an error if any part of the path is missing.

-
§

Existing

Resolve symbolic links, ignoring errors on the final component.

-
§

Missing

Resolve symbolic links, ignoring errors on the non-final components.

-

Trait Implementations§

source§

impl Clone for MissingHandling

source§

fn clone(&self) -> MissingHandling

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MissingHandling

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<MissingHandling> for MissingHandling

source§

fn eq(&self, other: &MissingHandling) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for MissingHandling

source§

impl Eq for MissingHandling

source§

impl StructuralEq for MissingHandling

source§

impl StructuralPartialEq for MissingHandling

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/enum.ResolveMode.html b/coreutils/dev/uucore/fs/enum.ResolveMode.html deleted file mode 100644 index 8c58acf85..000000000 --- a/coreutils/dev/uucore/fs/enum.ResolveMode.html +++ /dev/null @@ -1,22 +0,0 @@ -ResolveMode in uucore::fs - Rust

Enum uucore::fs::ResolveMode

source ·
pub enum ResolveMode {
-    None,
-    Physical,
-    Logical,
-}
Expand description

Controls when symbolic links are resolved

-

Variants§

§

None

Do not resolve any symbolic links.

-
§

Physical

Resolve symlinks as encountered when processing the path

-
§

Logical

Resolve ‘..’ elements before symlinks

-

Trait Implementations§

source§

impl Clone for ResolveMode

source§

fn clone(&self) -> ResolveMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ResolveMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<ResolveMode> for ResolveMode

source§

fn eq(&self, other: &ResolveMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for ResolveMode

source§

impl Eq for ResolveMode

source§

impl StructuralEq for ResolveMode

source§

impl StructuralPartialEq for ResolveMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.are_hardlinks_or_one_way_symlink_to_same_file.html b/coreutils/dev/uucore/fs/fn.are_hardlinks_or_one_way_symlink_to_same_file.html deleted file mode 100644 index 7b909acf7..000000000 --- a/coreutils/dev/uucore/fs/fn.are_hardlinks_or_one_way_symlink_to_same_file.html +++ /dev/null @@ -1,14 +0,0 @@ -are_hardlinks_or_one_way_symlink_to_same_file in uucore::fs - Rust
pub fn are_hardlinks_or_one_way_symlink_to_same_file(
-    source: &Path,
-    target: &Path
-) -> bool
Expand description

Checks if either two paths are hard links to the same file or if the source path is a symbolic link which when fully resolved points to target path

-

Arguments

-
    -
  • source - A reference to a Path representing the source path.
  • -
  • target - A reference to a Path representing the target path.
  • -
-

Returns

-
    -
  • bool - Returns true if either of above conditions are true, and false otherwise.
  • -
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.are_hardlinks_to_same_file.html b/coreutils/dev/uucore/fs/fn.are_hardlinks_to_same_file.html deleted file mode 100644 index 601867b1f..000000000 --- a/coreutils/dev/uucore/fs/fn.are_hardlinks_to_same_file.html +++ /dev/null @@ -1,11 +0,0 @@ -are_hardlinks_to_same_file in uucore::fs - Rust
pub fn are_hardlinks_to_same_file(source: &Path, target: &Path) -> bool
Expand description

Checks if two paths are hard links to the same file.

-

Arguments

-
    -
  • source - A reference to a Path representing the source path.
  • -
  • target - A reference to a Path representing the target path.
  • -
-

Returns

-
    -
  • bool - Returns true if the paths are hard links to the same file, and false otherwise.
  • -
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.canonicalize.html b/coreutils/dev/uucore/fs/fn.canonicalize.html deleted file mode 100644 index 142561e4b..000000000 --- a/coreutils/dev/uucore/fs/fn.canonicalize.html +++ /dev/null @@ -1,30 +0,0 @@ -canonicalize in uucore::fs - Rust

Function uucore::fs::canonicalize

source ·
pub fn canonicalize<P: AsRef<Path>>(
-    original: P,
-    miss_mode: MissingHandling,
-    res_mode: ResolveMode
-) -> IOResult<PathBuf>
Expand description

Return the canonical, absolute form of a path.

-

This function is a generalization of std::fs::canonicalize that -allows controlling how symbolic links are resolved and how to deal -with missing components. It returns the canonical, absolute form of -a path. -The miss_mode parameter controls how missing path elements are handled

- -

The res_mode parameter controls how symbolic links are -resolved:

- -
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.dir_strip_dot_for_creation.html b/coreutils/dev/uucore/fs/fn.dir_strip_dot_for_creation.html deleted file mode 100644 index 804ea267e..000000000 --- a/coreutils/dev/uucore/fs/fn.dir_strip_dot_for_creation.html +++ /dev/null @@ -1,5 +0,0 @@ -dir_strip_dot_for_creation in uucore::fs - Rust
pub fn dir_strip_dot_for_creation(path: &Path) -> PathBuf
Expand description

For some programs like install or mkdir, dir/. can be provided -Special case to match GNU’s behavior: -install -d foo/. should work and just create foo/ -std::fs::create_dir(“foo/.”); fails in pure Rust

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.display_permissions.html b/coreutils/dev/uucore/fs/fn.display_permissions.html deleted file mode 100644 index 4ecd1902c..000000000 --- a/coreutils/dev/uucore/fs/fn.display_permissions.html +++ /dev/null @@ -1,6 +0,0 @@ -display_permissions in uucore::fs - Rust

Function uucore::fs::display_permissions

source ·
pub fn display_permissions(
-    metadata: &Metadata,
-    display_file_type: bool
-) -> String
Expand description

Display the permissions of a file -On non unix like system, just show ‘–––––’

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.display_permissions_unix.html b/coreutils/dev/uucore/fs/fn.display_permissions_unix.html deleted file mode 100644 index 1d7b91171..000000000 --- a/coreutils/dev/uucore/fs/fn.display_permissions_unix.html +++ /dev/null @@ -1,2 +0,0 @@ -display_permissions_unix in uucore::fs - Rust
pub fn display_permissions_unix(mode: mode_t, display_file_type: bool) -> String
Expand description

Display the permissions of a file on a unix like system

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.infos_refer_to_same_file.html b/coreutils/dev/uucore/fs/fn.infos_refer_to_same_file.html deleted file mode 100644 index 875ddc385..000000000 --- a/coreutils/dev/uucore/fs/fn.infos_refer_to_same_file.html +++ /dev/null @@ -1,6 +0,0 @@ -infos_refer_to_same_file in uucore::fs - Rust
pub fn infos_refer_to_same_file(
-    info1: IOResult<FileInformation>,
-    info2: IOResult<FileInformation>
-) -> bool
Expand description

Checks if p1 and p2 are the same file information. -If error happens when trying to get files’ metadata, returns false

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.is_symlink_loop.html b/coreutils/dev/uucore/fs/fn.is_symlink_loop.html deleted file mode 100644 index c23d726a3..000000000 --- a/coreutils/dev/uucore/fs/fn.is_symlink_loop.html +++ /dev/null @@ -1,11 +0,0 @@ -is_symlink_loop in uucore::fs - Rust

Function uucore::fs::is_symlink_loop

source ·
pub fn is_symlink_loop(path: &Path) -> bool
Expand description

Checks if there is a symlink loop in the given path.

-

A symlink loop is a chain of symlinks where the last symlink points back to one of the previous symlinks in the chain.

-

Arguments

-
    -
  • path - A reference to a Path representing the starting path to check for symlink loops.
  • -
-

Returns

-
    -
  • bool - Returns true if a symlink loop is detected, false otherwise.
  • -
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.make_path_relative_to.html b/coreutils/dev/uucore/fs/fn.make_path_relative_to.html deleted file mode 100644 index f83c57df4..000000000 --- a/coreutils/dev/uucore/fs/fn.make_path_relative_to.html +++ /dev/null @@ -1,5 +0,0 @@ -make_path_relative_to in uucore::fs - Rust
pub fn make_path_relative_to<P1: AsRef<Path>, P2: AsRef<Path>>(
-    path: P1,
-    to: P2
-) -> PathBuf
Expand description

Converts absolute path to be relative to absolute to path.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.normalize_path.html b/coreutils/dev/uucore/fs/fn.normalize_path.html deleted file mode 100644 index 695b05ee5..000000000 --- a/coreutils/dev/uucore/fs/fn.normalize_path.html +++ /dev/null @@ -1,7 +0,0 @@ -normalize_path in uucore::fs - Rust

Function uucore::fs::normalize_path

source ·
pub fn normalize_path(path: &Path) -> PathBuf
Expand description

Normalize a path by removing relative information -For example, convert ‘bar/../foo/bar.txt’ => ‘foo/bar.txt’ -copied from <https://github.com/rust-lang/cargo/blob/2e4cfc2b7d43328b207879228a2ca7d427d188bb/src/cargo/util/paths.rs#L65-L90> -both projects are MIT <https://github.com/rust-lang/cargo/blob/master/LICENSE-MIT> -for std impl progress see rfc <https://github.com/rust-lang/rfcs/issues/2208> -replace this once that lands

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.paths_refer_to_same_file.html b/coreutils/dev/uucore/fs/fn.paths_refer_to_same_file.html deleted file mode 100644 index afcaf9dfc..000000000 --- a/coreutils/dev/uucore/fs/fn.paths_refer_to_same_file.html +++ /dev/null @@ -1,7 +0,0 @@ -paths_refer_to_same_file in uucore::fs - Rust
pub fn paths_refer_to_same_file<P: AsRef<Path>>(
-    p1: P,
-    p2: P,
-    dereference: bool
-) -> bool
Expand description

Checks if p1 and p2 are the same file. -If error happens when trying to get files’ metadata, returns false

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/fn.resolve_relative_path.html b/coreutils/dev/uucore/fs/fn.resolve_relative_path.html deleted file mode 100644 index 1590a7693..000000000 --- a/coreutils/dev/uucore/fs/fn.resolve_relative_path.html +++ /dev/null @@ -1,2 +0,0 @@ -resolve_relative_path in uucore::fs - Rust
pub fn resolve_relative_path(path: &Path) -> Cow<'_, Path>
Expand description

resolve a relative path

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/index.html b/coreutils/dev/uucore/fs/index.html deleted file mode 100644 index ae054752e..000000000 --- a/coreutils/dev/uucore/fs/index.html +++ /dev/null @@ -1,13 +0,0 @@ -uucore::fs - Rust

Module uucore::fs

source ·
Expand description

Set of functions to manage files and symlinks

-

Macros

  • Used to check if the mode has its perm bit set.

Structs

Enums

  • Controls how symbolic links should be handled when canonicalizing a path.
  • Controls when symbolic links are resolved

Functions

  • Checks if either two paths are hard links to the same file or if the source path is a symbolic link which when fully resolved points to target path
  • Checks if two paths are hard links to the same file.
  • Return the canonical, absolute form of a path.
  • For some programs like install or mkdir, dir/. can be provided -Special case to match GNU’s behavior: -install -d foo/. should work and just create foo/ -std::fs::create_dir(“foo/.”); fails in pure Rust
  • Display the permissions of a file -On non unix like system, just show ‘–––––’
  • Display the permissions of a file on a unix like system
  • Checks if p1 and p2 are the same file information. -If error happens when trying to get files’ metadata, returns false
  • Checks if there is a symlink loop in the given path.
  • Converts absolute path to be relative to absolute to path.
  • Normalize a path by removing relative information -For example, convert ‘bar/../foo/bar.txt’ => ‘foo/bar.txt’ -copied from <https://github.com/rust-lang/cargo/blob/2e4cfc2b7d43328b207879228a2ca7d427d188bb/src/cargo/util/paths.rs#L65-L90> -both projects are MIT <https://github.com/rust-lang/cargo/blob/master/LICENSE-MIT> -for std impl progress see rfc <https://github.com/rust-lang/rfcs/issues/2208> -replace this once that lands
  • Checks if p1 and p2 are the same file. -If error happens when trying to get files’ metadata, returns false
  • resolve a relative path
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/macro.has!.html b/coreutils/dev/uucore/fs/macro.has!.html deleted file mode 100644 index a69015b17..000000000 --- a/coreutils/dev/uucore/fs/macro.has!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.has.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/fs/macro.has.html b/coreutils/dev/uucore/fs/macro.has.html deleted file mode 100644 index d33ca6dca..000000000 --- a/coreutils/dev/uucore/fs/macro.has.html +++ /dev/null @@ -1,5 +0,0 @@ -has in uucore::fs - Rust

Macro uucore::fs::has

source ·
macro_rules! has {
-    ($mode:expr, $perm:expr) => { ... };
-}
Expand description

Used to check if the mode has its perm bit set.

-

This macro expands to mode & perm != 0.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fs/sidebar-items.js b/coreutils/dev/uucore/fs/sidebar-items.js deleted file mode 100644 index 38ebdb931..000000000 --- a/coreutils/dev/uucore/fs/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["MissingHandling","ResolveMode"],"fn":["are_hardlinks_or_one_way_symlink_to_same_file","are_hardlinks_to_same_file","canonicalize","dir_strip_dot_for_creation","display_permissions","display_permissions_unix","infos_refer_to_same_file","is_symlink_loop","make_path_relative_to","normalize_path","paths_refer_to_same_file","resolve_relative_path"],"macro":["has"],"struct":["FileInformation"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/fs/struct.FileInformation.html b/coreutils/dev/uucore/fs/struct.FileInformation.html deleted file mode 100644 index 4c1286dec..000000000 --- a/coreutils/dev/uucore/fs/struct.FileInformation.html +++ /dev/null @@ -1,20 +0,0 @@ -FileInformation in uucore::fs - Rust

Struct uucore::fs::FileInformation

source ·
pub struct FileInformation(_);
Expand description

Information to uniquely identify a file

-

Implementations§

source§

impl FileInformation

source

pub fn from_file(file: &impl AsRawFd) -> IOResult<Self>

Get information from a currently open file

-
source

pub fn from_path(path: impl AsRef<Path>, dereference: bool) -> IOResult<Self>

Get information for a given path.

-

If path points to a symlink and dereference is true, information about -the link’s target will be returned.

-
source

pub fn file_size(&self) -> u64

source

pub fn inode(&self) -> u64

Trait Implementations§

source§

impl Hash for FileInformation

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<FileInformation> for FileInformation

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for FileInformation

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/fn.StatFs.html b/coreutils/dev/uucore/fsext/fn.StatFs.html deleted file mode 100644 index dd12d0986..000000000 --- a/coreutils/dev/uucore/fsext/fn.StatFs.html +++ /dev/null @@ -1,4 +0,0 @@ -StatFs in uucore::fsext - Rust

Function uucore::fsext::StatFs

pub unsafe extern "C" fn StatFs(
-    path: *const i8,
-    buf: *mut statfs
-) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/fn.pretty_filetype.html b/coreutils/dev/uucore/fsext/fn.pretty_filetype.html deleted file mode 100644 index 91910a48e..000000000 --- a/coreutils/dev/uucore/fsext/fn.pretty_filetype.html +++ /dev/null @@ -1 +0,0 @@ -pretty_filetype in uucore::fsext - Rust

Function uucore::fsext::pretty_filetype

source ·
pub fn pretty_filetype<'a>(mode: mode_t, size: u64) -> &'a str
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/fn.pretty_fstype.html b/coreutils/dev/uucore/fsext/fn.pretty_fstype.html deleted file mode 100644 index c77610d20..000000000 --- a/coreutils/dev/uucore/fsext/fn.pretty_fstype.html +++ /dev/null @@ -1 +0,0 @@ -pretty_fstype in uucore::fsext - Rust

Function uucore::fsext::pretty_fstype

source ·
pub fn pretty_fstype<'a>(fstype: i64) -> Cow<'a, str>
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/fn.pretty_time.html b/coreutils/dev/uucore/fsext/fn.pretty_time.html deleted file mode 100644 index 546846872..000000000 --- a/coreutils/dev/uucore/fsext/fn.pretty_time.html +++ /dev/null @@ -1 +0,0 @@ -pretty_time in uucore::fsext - Rust

Function uucore::fsext::pretty_time

source ·
pub fn pretty_time(sec: i64, nsec: i64) -> String
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/fn.read_fs_list.html b/coreutils/dev/uucore/fsext/fn.read_fs_list.html deleted file mode 100644 index 04b5ef207..000000000 --- a/coreutils/dev/uucore/fsext/fn.read_fs_list.html +++ /dev/null @@ -1,2 +0,0 @@ -read_fs_list in uucore::fsext - Rust

Function uucore::fsext::read_fs_list

source ·
pub fn read_fs_list() -> Result<Vec<MountInfo>, Error>
Expand description

Read file system list.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/fn.statfs.html b/coreutils/dev/uucore/fsext/fn.statfs.html deleted file mode 100644 index e0cf6f976..000000000 --- a/coreutils/dev/uucore/fsext/fn.statfs.html +++ /dev/null @@ -1,2 +0,0 @@ -statfs in uucore::fsext - Rust

Function uucore::fsext::statfs

source ·
pub fn statfs<P>(path: P) -> Result<StatFs, String>where
-    P: Into<Vec<u8>>,
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/fn.statfs_fn.html b/coreutils/dev/uucore/fsext/fn.statfs_fn.html deleted file mode 100644 index 959d1fc5a..000000000 --- a/coreutils/dev/uucore/fsext/fn.statfs_fn.html +++ /dev/null @@ -1,4 +0,0 @@ -statfs_fn in uucore::fsext - Rust

Function uucore::fsext::statfs_fn

pub unsafe extern "C" fn statfs_fn(
-    path: *const i8,
-    buf: *mut statfs
-) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/index.html b/coreutils/dev/uucore/fsext/index.html deleted file mode 100644 index 20e49ca8b..000000000 --- a/coreutils/dev/uucore/fsext/index.html +++ /dev/null @@ -1,2 +0,0 @@ -uucore::fsext - Rust

Module uucore::fsext

source ·
Expand description

Set of functions to manage file systems

-

Re-exports

Structs

Traits

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/sidebar-items.js b/coreutils/dev/uucore/fsext/sidebar-items.js deleted file mode 100644 index 994da7963..000000000 --- a/coreutils/dev/uucore/fsext/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["StatFs","pretty_filetype","pretty_fstype","pretty_time","read_fs_list","statfs","statfs_fn"],"struct":["FsUsage","MountInfo","StatFs","statfs_fn"],"trait":["BirthTime","FsMeta"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/struct.FsUsage.html b/coreutils/dev/uucore/fsext/struct.FsUsage.html deleted file mode 100644 index 23f9ec5a4..000000000 --- a/coreutils/dev/uucore/fsext/struct.FsUsage.html +++ /dev/null @@ -1,20 +0,0 @@ -FsUsage in uucore::fsext - Rust

Struct uucore::fsext::FsUsage

source ·
pub struct FsUsage {
-    pub blocksize: u64,
-    pub blocks: u64,
-    pub bfree: u64,
-    pub bavail: u64,
-    pub bavail_top_bit_set: bool,
-    pub files: u64,
-    pub ffree: u64,
-}

Fields§

§blocksize: u64§blocks: u64§bfree: u64§bavail: u64§bavail_top_bit_set: bool§files: u64§ffree: u64

Implementations§

source§

impl FsUsage

source

pub fn new(statvfs: StatFs) -> Self

Trait Implementations§

source§

impl Clone for FsUsage

source§

fn clone(&self) -> FsUsage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FsUsage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/struct.MountInfo.html b/coreutils/dev/uucore/fsext/struct.MountInfo.html deleted file mode 100644 index ff1092214..000000000 --- a/coreutils/dev/uucore/fsext/struct.MountInfo.html +++ /dev/null @@ -1,21 +0,0 @@ -MountInfo in uucore::fsext - Rust

Struct uucore::fsext::MountInfo

source ·
pub struct MountInfo {
-    pub dev_id: String,
-    pub dev_name: String,
-    pub fs_type: String,
-    pub mount_dir: String,
-    pub mount_option: String,
-    pub mount_root: String,
-    pub remote: bool,
-    pub dummy: bool,
-}

Fields§

§dev_id: String§dev_name: String§fs_type: String§mount_dir: String§mount_option: String§mount_root: String§remote: bool§dummy: bool

Trait Implementations§

source§

impl Clone for MountInfo

source§

fn clone(&self) -> MountInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MountInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/struct.StatFs.html b/coreutils/dev/uucore/fsext/struct.StatFs.html deleted file mode 100644 index 20b585381..000000000 --- a/coreutils/dev/uucore/fsext/struct.StatFs.html +++ /dev/null @@ -1,29 +0,0 @@ -StatFs in uucore::fsext - Rust

Struct uucore::fsext::StatFs

#[repr(C)]
pub struct StatFs { - pub f_type: i64, - pub f_bsize: i64, - pub f_blocks: u64, - pub f_bfree: u64, - pub f_bavail: u64, - pub f_files: u64, - pub f_ffree: u64, - pub f_fsid: fsid_t, - pub f_namelen: i64, - pub f_frsize: i64, - /* private fields */ -}

Fields§

§f_type: i64§f_bsize: i64§f_blocks: u64§f_bfree: u64§f_bavail: u64§f_files: u64§f_ffree: u64§f_fsid: fsid_t§f_namelen: i64§f_frsize: i64

Trait Implementations§

§

impl Clone for statfs

§

fn clone(&self) -> statfs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for statfs

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl FsMeta for StatFs

§

impl Hash for statfs

§

fn hash<__H>(&self, state: &mut __H)where - __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq<statfs> for statfs

§

fn eq(&self, other: &statfs) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl Copy for statfs

§

impl Eq for statfs

§

impl StructuralEq for statfs

§

impl StructuralPartialEq for statfs

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/struct.statfs_fn.html b/coreutils/dev/uucore/fsext/struct.statfs_fn.html deleted file mode 100644 index 99ac07c35..000000000 --- a/coreutils/dev/uucore/fsext/struct.statfs_fn.html +++ /dev/null @@ -1,29 +0,0 @@ -statfs_fn in uucore::fsext - Rust

Struct uucore::fsext::statfs_fn

#[repr(C)]
pub struct statfs_fn { - pub f_type: i64, - pub f_bsize: i64, - pub f_blocks: u64, - pub f_bfree: u64, - pub f_bavail: u64, - pub f_files: u64, - pub f_ffree: u64, - pub f_fsid: fsid_t, - pub f_namelen: i64, - pub f_frsize: i64, - /* private fields */ -}

Fields§

§f_type: i64§f_bsize: i64§f_blocks: u64§f_bfree: u64§f_bavail: u64§f_files: u64§f_ffree: u64§f_fsid: fsid_t§f_namelen: i64§f_frsize: i64

Trait Implementations§

§

impl Clone for statfs

§

fn clone(&self) -> statfs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for statfs

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl FsMeta for StatFs

§

impl Hash for statfs

§

fn hash<__H>(&self, state: &mut __H)where - __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl PartialEq<statfs> for statfs

§

fn eq(&self, other: &statfs) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl Copy for statfs

§

impl Eq for statfs

§

impl StructuralEq for statfs

§

impl StructuralPartialEq for statfs

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/trait.BirthTime.html b/coreutils/dev/uucore/fsext/trait.BirthTime.html deleted file mode 100644 index 7f202d5b5..000000000 --- a/coreutils/dev/uucore/fsext/trait.BirthTime.html +++ /dev/null @@ -1,5 +0,0 @@ -BirthTime in uucore::fsext - Rust

Trait uucore::fsext::BirthTime

source ·
pub trait BirthTime {
-    // Required methods
-    fn pretty_birth(&self) -> String;
-    fn birth(&self) -> u64;
-}

Required Methods§

source

fn pretty_birth(&self) -> String

source

fn birth(&self) -> u64

Implementations on Foreign Types§

source§

impl BirthTime for Metadata

source§

fn pretty_birth(&self) -> String

source§

fn birth(&self) -> u64

Implementors§

\ No newline at end of file diff --git a/coreutils/dev/uucore/fsext/trait.FsMeta.html b/coreutils/dev/uucore/fsext/trait.FsMeta.html deleted file mode 100644 index 25c378006..000000000 --- a/coreutils/dev/uucore/fsext/trait.FsMeta.html +++ /dev/null @@ -1,13 +0,0 @@ -FsMeta in uucore::fsext - Rust

Trait uucore::fsext::FsMeta

source ·
pub trait FsMeta {
-    // Required methods
-    fn fs_type(&self) -> i64;
-    fn io_size(&self) -> u64;
-    fn block_size(&self) -> i64;
-    fn total_blocks(&self) -> u64;
-    fn free_blocks(&self) -> u64;
-    fn avail_blocks(&self) -> u64;
-    fn total_file_nodes(&self) -> u64;
-    fn free_file_nodes(&self) -> u64;
-    fn fsid(&self) -> u64;
-    fn namelen(&self) -> u64;
-}

Required Methods§

source

fn fs_type(&self) -> i64

source

fn io_size(&self) -> u64

source

fn block_size(&self) -> i64

source

fn total_blocks(&self) -> u64

source

fn free_blocks(&self) -> u64

source

fn avail_blocks(&self) -> u64

source

fn total_file_nodes(&self) -> u64

source

fn free_file_nodes(&self) -> u64

source

fn fsid(&self) -> u64

source

fn namelen(&self) -> u64

Implementors§

\ No newline at end of file diff --git a/coreutils/dev/uucore/index.html b/coreutils/dev/uucore/index.html deleted file mode 100644 index f0f59ea2f..000000000 --- a/coreutils/dev/uucore/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore - Rust

Crate uucore

source ·

Re-exports

  • pub extern crate libc;

Modules

Macros

Traits

Functions

Attribute Macros

\ No newline at end of file diff --git a/coreutils/dev/uucore/line_ending/enum.LineEnding.html b/coreutils/dev/uucore/line_ending/enum.LineEnding.html deleted file mode 100644 index 29a441366..000000000 --- a/coreutils/dev/uucore/line_ending/enum.LineEnding.html +++ /dev/null @@ -1,27 +0,0 @@ -LineEnding in uucore::line_ending - Rust
#[repr(u8)]
pub enum LineEnding { - Newline, - Nul, -}
Expand description

Line ending of either \n or \0

-

Used by various utilities that have the option to separate lines by nul -characters instead of \n. Usually, this is specified with the -z or ---zero flag.

-

The Display implementation writes the character corresponding to the -variant to the formatter.

-

Variants§

§

Newline

§

Nul

Implementations§

source§

impl LineEnding

source

pub fn from_zero_flag(is_zero_terminated: bool) -> Self

Create a LineEnding from a -z/--zero flag

-

If is_zero_terminated is true, LineEnding::Nul is returned, -otherwise LineEnding::Newline.

-

Trait Implementations§

source§

impl Clone for LineEnding

source§

fn clone(&self) -> LineEnding

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LineEnding

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for LineEnding

source§

fn default() -> LineEnding

Returns the “default value” for a type. Read more
source§

impl Display for LineEnding

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<LineEnding> for u8

source§

fn from(line_ending: LineEnding) -> Self

Converts to this type from the input type.
source§

impl PartialEq<LineEnding> for LineEnding

source§

fn eq(&self, other: &LineEnding) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for LineEnding

source§

impl StructuralPartialEq for LineEnding

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/line_ending/index.html b/coreutils/dev/uucore/line_ending/index.html deleted file mode 100644 index 640cef6c2..000000000 --- a/coreutils/dev/uucore/line_ending/index.html +++ /dev/null @@ -1,3 +0,0 @@ -uucore::line_ending - Rust

Module uucore::line_ending

source ·
Expand description

Provides consistent newline/zero terminator handling for -z/--zero flags.

-

See the LineEnding struct for more information.

-

Enums

\ No newline at end of file diff --git a/coreutils/dev/uucore/line_ending/sidebar-items.js b/coreutils/dev/uucore/line_ending/sidebar-items.js deleted file mode 100644 index 659ffe5dc..000000000 --- a/coreutils/dev/uucore/line_ending/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["LineEnding"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/lines/fn.lines.html b/coreutils/dev/uucore/lines/fn.lines.html deleted file mode 100644 index 05e080489..000000000 --- a/coreutils/dev/uucore/lines/fn.lines.html +++ /dev/null @@ -1,32 +0,0 @@ -lines in uucore::lines - Rust

Function uucore::lines::lines

source ·
pub fn lines<B>(reader: B, sep: u8) -> Lines<B> where
-    B: BufRead,
Expand description

Returns an iterator over the lines, including line ending characters.

-

This function is just like BufRead::lines, but it includes the -line ending characters in each yielded String if the input -data has them. Set the sep parameter to the line ending -character; for Unix line endings, use b'\n'.

-

Examples

-

Use sep to specify an alternate character for line endings. For -example, if lines are terminated by the null character b'\0':

- -
use std::io::BufRead;
-use std::io::Cursor;
-
-let cursor = Cursor::new(b"x\0y\0z\0");
-let mut it = lines(cursor, b'\0').map(|l| l.unwrap());
-
-assert_eq!(it.next(), Some(Vec::from("x\0")));
-assert_eq!(it.next(), Some(Vec::from("y\0")));
-assert_eq!(it.next(), Some(Vec::from("z\0")));
-assert_eq!(it.next(), None);
-

If the input data does not end with a newline character ('\n'), -then the last String yielded by this iterator also does not -end with a newline:

- -
let cursor = Cursor::new(b"x\ny\nz");
-let mut it = lines(cursor, b'\n').map(|l| l.unwrap());
-
-assert_eq!(it.next(), Some(Vec::from("x\n")));
-assert_eq!(it.next(), Some(Vec::from("y\n")));
-assert_eq!(it.next(), Some(Vec::from("z")));
-assert_eq!(it.next(), None);
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/lines/index.html b/coreutils/dev/uucore/lines/index.html deleted file mode 100644 index 5ec132f45..000000000 --- a/coreutils/dev/uucore/lines/index.html +++ /dev/null @@ -1,10 +0,0 @@ -uucore::lines - Rust

Module uucore::lines

source ·
Expand description

Iterate over lines, including the line ending character(s).

-

This module provides the lines function, similar to the -BufRead::lines method. While the BufRead::lines method -yields String instances that do not include the line ending -characters ("\n" or "\r\n"), our functions yield -Vec<[‘u8’]> instances that include the line ending -characters. This is useful if the input data does not end with a -newline character and you want to preserve the exact form of the -input data.

-

Structs

  • An iterator over the lines of an instance of BufRead.

Functions

  • Returns an iterator over the lines, including line ending characters.
\ No newline at end of file diff --git a/coreutils/dev/uucore/lines/sidebar-items.js b/coreutils/dev/uucore/lines/sidebar-items.js deleted file mode 100644 index 8a879f828..000000000 --- a/coreutils/dev/uucore/lines/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["lines"],"struct":["Lines"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/lines/struct.Lines.html b/coreutils/dev/uucore/lines/struct.Lines.html deleted file mode 100644 index 71457efc9..000000000 --- a/coreutils/dev/uucore/lines/struct.Lines.html +++ /dev/null @@ -1,598 +0,0 @@ -Lines in uucore::lines - Rust

Struct uucore::lines::Lines

source ·
pub struct Lines<B> { /* private fields */ }
Expand description

An iterator over the lines of an instance of BufRead.

-

This struct is generally created by calling lines on a BufRead. -Please see the documentation of lines for more details.

-

Trait Implementations§

source§

impl<B: BufRead> Iterator for Lines<B>

§

type Item = Result<Vec<u8, Global>, Error>

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Result<Vec<u8>>>

Advances the iterator and returns the next value. Read more
source§

fn next_chunk<const N: usize>( - &mut self -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0 · source§

fn count(self) -> usizewhere - Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>where - Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>where - Self: Sized,

Creates an iterator starting at the same point, but stepping by -the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>where - Self: Sized, - G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator -between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each -element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)where - Self: Sized, - F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element -should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>where - Self: Sized,

Creates an iterator which gives the current iteration count as well as -the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>where - Self: Sized,

Creates an iterator which can use the peek and peek_mut methods -to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>where - Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>where - Self: Sized,

Creates an iterator that yields the first n elements, or fewer -if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where - Self: Sized, - F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but -unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where - Self: Sized, - U: IntoIterator, - F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>where - Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where - Self: Sized, - F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere - Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> Bwhere - B: FromIterator<Self::Item>, - Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere - E: Extend<Self::Item>, - Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)where - Self: Sized, - B: Default + Extend<Self::Item>, - F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> boolwhere - Self: Sized, - P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, -such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere - Self: Sized, - F: FnMut(B, Self::Item) -> R, - R: Try<Output = B>,

An iterator method that applies a function as long as it returns -successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> Rwhere - Self: Sized, - F: FnMut(Self::Item) -> R, - R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the -iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> Bwhere - Self: Sized, - F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, -returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing -operation. Read more
source§

fn try_reduce<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> R, - R: Try<Output = Self::Item>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the -closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns -the first non-none result. Read more
source§

fn try_find<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere - Self: Sized, - F: FnMut(&Self::Item) -> R, - R: Try<Output = bool>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns -the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the -specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the -specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the -specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the -specified comparison function. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where - FromA: Default + Extend<A>, - FromB: Default + Extend<B>, - Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>where - T: 'a + Copy, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>where - T: 'a + Clone, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> Swhere - Self: Sized, - S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> Pwhere - Self: Sized, - P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Lexicographically compares the PartialOrd elements of -this Iterator with those of another. The comparison works like short-circuit -evaluation, returning a result without comparing the remaining elements. -As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are equal to those of -another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of -another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are not equal to those of -another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> boolwhere - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction -function. Read more

Auto Trait Implementations§

§

impl<B> RefUnwindSafe for Lines<B>where - B: RefUnwindSafe,

§

impl<B> Send for Lines<B>where - B: Send,

§

impl<B> Sync for Lines<B>where - B: Sync,

§

impl<B> Unpin for Lines<B>where - B: Unpin,

§

impl<B> UnwindSafe for Lines<B>where - B: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<I> IntoIterator for Iwhere - I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T> Itertools for Twhere - T: Iterator + ?Sized,

source§

fn interleave<J>( - self, - other: J -) -> Interleave<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator<Item = Self::Item>, - Self: Sized,

Alternate elements from two iterators until both have run out. Read more
source§

fn interleave_shortest<J>( - self, - other: J -) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator<Item = Self::Item>, - Self: Sized,

Alternate elements from two iterators until at least one of them has run -out. Read more
source§

fn intersperse( - self, - element: Self::Item -) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>>where - Self: Sized, - Self::Item: Clone,

An iterator adaptor to insert a particular value -between each element of the adapted iterator. Read more
source§

fn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F>where - Self: Sized, - F: FnMut() -> Self::Item,

An iterator adaptor to insert a particular value created by a function -between each element of the adapted iterator. Read more
source§

fn zip_longest<J>( - self, - other: J -) -> ZipLongest<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator, - Self: Sized,

Create an iterator which iterates over both this and the specified -iterator simultaneously, yielding pairs of two optional elements. Read more
source§

fn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator, - Self: Sized,

Create an iterator which iterates over both this and the specified -iterator simultaneously, yielding pairs of elements. Read more
source§

fn batching<B, F>(self, f: F) -> Batching<Self, F>where - F: FnMut(&mut Self) -> Option<B>, - Self: Sized,

A “meta iterator adaptor”. Its closure receives a reference to the -iterator and may pick off as many elements as it likes, to produce the -next iterator element. Read more
source§

fn group_by<K, F>(self, key: F) -> GroupBy<K, Self, F>where - Self: Sized, - F: FnMut(&Self::Item) -> K, - K: PartialEq<K>,

Return an iterable that can group iterator elements. -Consecutive elements that map to the same key (“runs”), are assigned -to the same group. Read more
source§

fn chunks(self, size: usize) -> IntoChunks<Self>where - Self: Sized,

Return an iterable that can chunk the iterator. Read more
source§

fn tuple_windows<T>(self) -> TupleWindows<Self, T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple, - <T as TupleCollect>::Item: Clone,

Return an iterator over all contiguous windows producing tuples of -a specific size (up to 12). Read more
source§

fn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T>where - Self: Sized + Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator, - T: TupleCollect + Clone, - <T as TupleCollect>::Item: Clone,

Return an iterator over all windows, wrapping back to the first -elements when the window would otherwise exceed the length of the -iterator, producing tuples of a specific size (up to 12). Read more
source§

fn tuples<T>(self) -> Tuples<Self, T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Return an iterator that groups the items in tuples of a specific size -(up to 12). Read more
source§

fn tee(self) -> (Tee<Self>, Tee<Self>)where - Self: Sized, - Self::Item: Clone,

Split into an iterator pair that both yield all elements from -the original iterator. Read more
source§

fn step(self, n: usize) -> Step<Self>where - Self: Sized,

👎Deprecated since 0.8.0: Use std .step_by() instead
Return an iterator adaptor that steps n elements in the base iterator -for each iteration. Read more
source§

fn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>>where - Self: Sized, - Self::Item: Into<R>,

Convert each item of the iterator using the Into trait. Read more
source§

fn map_results<F, T, U, E>( - self, - f: F -) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> U,

👎Deprecated since 0.10.0: Use .map_ok() instead
source§

fn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> U,

Return an iterator adaptor that applies the provided closure -to every Result::Ok value. Result::Err values are -unchanged. Read more
source§

fn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(&T) -> bool,

Return an iterator adaptor that filters every Result::Ok -value with the provided closure. Result::Err values are -unchanged. Read more
source§

fn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> Option<U>,

Return an iterator adaptor that filters and transforms every -Result::Ok value with the provided closure. Result::Err -values are unchanged. Read more
source§

fn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E>where - Self: Iterator<Item = Result<T, E>> + Sized, - T: IntoIterator,

Return an iterator adaptor that flattens every Result::Ok value into -a series of Result::Ok values. Result::Err values are unchanged. Read more
source§

fn process_results<F, T, E, R>(self, processor: F) -> Result<R, E>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnOnce(ProcessResults<'_, Self, E>) -> R,

“Lift” a function of the values of the current iterator so as to process -an iterator of Result values instead. Read more
source§

fn merge<J>( - self, - other: J -) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>, - J: IntoIterator<Item = Self::Item>,

Return an iterator adaptor that merges the two base iterators in -ascending order. If both base iterators are sorted (ascending), the -result is sorted. Read more
source§

fn merge_by<J, F>( - self, - other: J, - is_first: F -) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F>where - Self: Sized, - J: IntoIterator<Item = Self::Item>, - F: FnMut(&Self::Item, &Self::Item) -> bool,

Return an iterator adaptor that merges the two base iterators in order. -This is much like .merge() but allows for a custom ordering. Read more
source§

fn merge_join_by<J, F, T>( - self, - other: J, - cmp_fn: F -) -> MergeJoinBy<Self, <J as IntoIterator>::IntoIter, F>where - J: IntoIterator, - F: FnMut(&Self::Item, &<J as IntoIterator>::Item) -> T, - T: OrderingOrBool<Self::Item, <J as IntoIterator>::Item>, - Self: Sized,

Create an iterator that merges items from both this and the specified -iterator in ascending order. Read more
source§

fn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt>where - Self: Sized, - Self::Item: IntoIterator, - <Self::Item as IntoIterator>::Item: PartialOrd<<Self::Item as IntoIterator>::Item>,

Return an iterator adaptor that flattens an iterator of iterators by -merging them in ascending order. Read more
source§

fn kmerge_by<F>( - self, - first: F -) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F>where - Self: Sized, - Self::Item: IntoIterator, - F: FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,

Return an iterator adaptor that flattens an iterator of iterators by -merging them according to the given closure. Read more
source§

fn cartesian_product<J>( - self, - other: J -) -> Product<Self, <J as IntoIterator>::IntoIter>where - Self: Sized, - Self::Item: Clone, - J: IntoIterator, - <J as IntoIterator>::IntoIter: Clone,

Return an iterator adaptor that iterates over the cartesian product of -the element sets of two iterators self and J. Read more
source§

fn multi_cartesian_product( - self -) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter>where - Self: Sized, - Self::Item: IntoIterator, - <Self::Item as IntoIterator>::IntoIter: Clone, - <Self::Item as IntoIterator>::Item: Clone,

Return an iterator adaptor that iterates over the cartesian product of -all subiterators returned by meta-iterator self. Read more
source§

fn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Result<Self::Item, (Self::Item, Self::Item)>,

Return an iterator adaptor that uses the passed-in closure to -optionally merge together consecutive elements. Read more
source§

fn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, Self::Item>where - Self: Sized, - Self::Item: PartialEq<Self::Item>,

Remove duplicates from sections of consecutive identical elements. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_by<Cmp>( - self, - cmp: Cmp -) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, Self::Item>where - Self: Sized, - Cmp: FnMut(&Self::Item, &Self::Item) -> bool,

Remove duplicates from sections of consecutive identical elements, -determining equality using a comparison function. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_with_count( - self -) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, (usize, Self::Item)>where - Self: Sized,

Remove duplicates from sections of consecutive identical elements, while keeping a count of -how many repeated elements were present. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_by_with_count<Cmp>( - self, - cmp: Cmp -) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, (usize, Self::Item)>where - Self: Sized, - Cmp: FnMut(&Self::Item, &Self::Item) -> bool,

Remove duplicates from sections of consecutive identical elements, while keeping a count of -how many repeated elements were present. -This will determine equality using a comparison function. -If the iterator is sorted, all elements will be unique. Read more
source§

fn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById>where - Self: Sized, - Self::Item: Eq + Hash,

Return an iterator adaptor that produces elements that appear more than once during the -iteration. Duplicates are detected using hash and equality. Read more
source§

fn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>>where - Self: Sized, - V: Eq + Hash, - F: FnMut(&Self::Item) -> V,

Return an iterator adaptor that produces elements that appear more than once during the -iteration. Duplicates are detected using hash and equality. Read more
source§

fn unique(self) -> Unique<Self>where - Self: Sized, - Self::Item: Clone + Eq + Hash,

Return an iterator adaptor that filters out elements that have -already been produced once during the iteration. Duplicates -are detected using hash and equality. Read more
source§

fn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F>where - Self: Sized, - V: Eq + Hash, - F: FnMut(&Self::Item) -> V,

Return an iterator adaptor that filters out elements that have -already been produced once during the iteration. Read more
source§

fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F>where - Self: Sized + PeekingNext, - F: FnMut(&Self::Item) -> bool,

Return an iterator adaptor that borrows from this iterator and -takes items while the closure accept returns true. Read more
source§

fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F>where - Self: Clone, - F: FnMut(&Self::Item) -> bool,

Return an iterator adaptor that borrows from a Clone-able iterator -to only pick off elements while the predicate accept returns true. Read more
source§

fn take_while_inclusive<F>( - &mut self, - accept: F -) -> TakeWhileInclusive<'_, Self, F>where - Self: Sized, - F: FnMut(&Self::Item) -> bool,

Returns an iterator adaptor that consumes elements while the given -predicate is true, including the element for which the predicate -first returned false. Read more
source§

fn while_some<A>(self) -> WhileSome<Self>where - Self: Sized + Iterator<Item = Option<A>>,

Return an iterator adaptor that filters Option<A> iterator elements -and produces A. Stops on the first None encountered. Read more
source§

fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>where - Self: Sized + Clone, - Self::Item: Clone, - T: HasCombination<Self>,

Return an iterator adaptor that iterates over the combinations of the -elements from an iterator. Read more
source§

fn combinations(self, k: usize) -> Combinations<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator adaptor that iterates over the k-length combinations of -the elements from an iterator. Read more
source§

fn combinations_with_replacement( - self, - k: usize -) -> CombinationsWithReplacement<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator that iterates over the k-length combinations of -the elements from an iterator, with replacement. Read more
source§

fn permutations(self, k: usize) -> Permutations<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator adaptor that iterates over all k-permutations of the -elements from an iterator. Read more
source§

fn powerset(self) -> Powerset<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator that iterates through the powerset of the elements from an -iterator. Read more
source§

fn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F>where - Self: Sized, - F: FnMut(usize) -> Self::Item,

Return an iterator adaptor that pads the sequence to a minimum length of -min by filling missing elements using a closure f. Read more
source§

fn with_position(self) -> WithPosition<Self>where - Self: Sized,

Return an iterator adaptor that combines each element with a Position to -ease special-case handling of the first or last elements. Read more
source§

fn positions<P>(self, predicate: P) -> Positions<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Return an iterator adaptor that yields the indices of all elements -satisfying a predicate, counted from the start of the iterator. Read more
source§

fn update<F>(self, updater: F) -> Update<Self, F>where - Self: Sized, - F: FnMut(&mut Self::Item),

Return an iterator adaptor that applies a mutating function -to each element before yielding it. Read more
source§

fn next_tuple<T>(&mut self) -> Option<T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Advances the iterator and returns the next items grouped in a tuple of -a specific size (up to 12). Read more
source§

fn collect_tuple<T>(self) -> Option<T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Collects all items from the iterator into a tuple of a specific size -(up to 12). Read more
source§

fn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)>where - P: FnMut(&Self::Item) -> bool,

Find the position and value of the first element satisfying a predicate. Read more
source§

fn find_or_last<P>(self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Find the value of the first element satisfying a predicate or return the last element, if any. Read more
source§

fn find_or_first<P>(self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Find the value of the first element satisfying a predicate or return the first element, if any. Read more
source§

fn contains<Q>(&mut self, query: &Q) -> boolwhere - Self: Sized, - Self::Item: Borrow<Q>, - Q: PartialEq<Q>,

Returns true if the given item is present in this iterator. Read more
source§

fn all_equal(&mut self) -> boolwhere - Self: Sized, - Self::Item: PartialEq<Self::Item>,

Check whether all elements compare equal. Read more
source§

fn all_equal_value( - &mut self -) -> Result<Self::Item, Option<(Self::Item, Self::Item)>>where - Self: Sized, - Self::Item: PartialEq<Self::Item>,

If there are elements and they are all equal, return a single copy of that element. -If there are no elements, return an Error containing None. -If there are elements and they are not all equal, return a tuple containing the first -two non-equal elements found. Read more
source§

fn all_unique(&mut self) -> boolwhere - Self: Sized, - Self::Item: Eq + Hash,

Check whether all elements are unique (non equal). Read more
source§

fn dropping(self, n: usize) -> Selfwhere - Self: Sized,

Consume the first n elements from the iterator eagerly, -and return the same iterator again. Read more
source§

fn dropping_back(self, n: usize) -> Selfwhere - Self: Sized + DoubleEndedIterator,

Consume the last n elements from the iterator eagerly, -and return the same iterator again. Read more
source§

fn foreach<F>(self, f: F)where - F: FnMut(Self::Item), - Self: Sized,

👎Deprecated since 0.8.0: Use .for_each() instead
Run the closure f eagerly on each element of the iterator. Read more
source§

fn concat(self) -> Self::Itemwhere - Self: Sized, - Self::Item: Extend<<Self::Item as IntoIterator>::Item> + IntoIterator + Default,

Combine all an iterator’s elements into one element by using Extend. Read more
source§

fn collect_vec(self) -> Vec<Self::Item, Global>where - Self: Sized,

.collect_vec() is simply a type specialization of Iterator::collect, -for convenience.
source§

fn try_collect<T, U, E>(self) -> Result<U, E>where - Self: Sized + Iterator<Item = Result<T, E>>, - Result<U, E>: FromIterator<Result<T, E>>,

.try_collect() is more convenient way of writing -.collect::<Result<_, _>>() Read more
source§

fn set_from<'a, A, J>(&mut self, from: J) -> usizewhere - A: 'a, - Self: Iterator<Item = &'a mut A>, - J: IntoIterator<Item = A>,

Assign to each reference in self from the from iterator, -stopping at the shortest of the two iterators. Read more
source§

fn join(&mut self, sep: &str) -> Stringwhere - Self::Item: Display,

Combine all iterator elements into one String, separated by sep. Read more
source§

fn format(self, sep: &str) -> Format<'_, Self>where - Self: Sized,

Format all iterator elements, separated by sep. Read more
source§

fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F>where - Self: Sized, - F: FnMut(Self::Item, &mut dyn FnMut(&dyn Display) -> Result<(), Error>) -> Result<(), Error>,

Format all iterator elements, separated by sep. Read more
source§

fn fold_results<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>where - Self: Iterator<Item = Result<A, E>>, - F: FnMut(B, A) -> B,

👎Deprecated since 0.10.0: Use .fold_ok() instead
source§

fn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>where - Self: Iterator<Item = Result<A, E>>, - F: FnMut(B, A) -> B,

Fold Result values from an iterator. Read more
source§

fn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B>where - Self: Iterator<Item = Option<A>>, - F: FnMut(B, A) -> B,

Fold Option values from an iterator. Read more
source§

fn fold1<F>(self, f: F) -> Option<Self::Item>where - F: FnMut(Self::Item, Self::Item) -> Self::Item, - Self: Sized,

👎Deprecated since 0.10.2: Use Iterator::reduce instead
Accumulator of the elements in the iterator. Read more
source§

fn tree_fold1<F>(self, f: F) -> Option<Self::Item>where - F: FnMut(Self::Item, Self::Item) -> Self::Item, - Self: Sized,

Accumulate the elements in the iterator in a tree-like manner. Read more
source§

fn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B>where - Self: Sized, - F: FnMut(B, Self::Item) -> FoldWhile<B>,

An iterator method that applies a function, producing a single, final value. Read more
source§

fn sum1<S>(self) -> Option<S>where - Self: Sized, - S: Sum<Self::Item>,

Iterate over the entire iterator and add all the elements. Read more
source§

fn product1<P>(self) -> Option<P>where - Self: Sized, - P: Product<Self::Item>,

Iterate over the entire iterator and multiply all the elements. Read more
source§

fn sorted_unstable(self) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted(self) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. The key function is -called exactly once per key. Read more
source§

fn k_smallest(self, k: usize) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort the k smallest elements into a new iterator, in ascending order. Read more
source§

fn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B)where - Self: Sized, - F: FnMut(Self::Item) -> Either<L, R>, - A: Default + Extend<L>, - B: Default + Extend<R>,

Collect all iterator elements into one of two -partitions. Unlike Iterator::partition, each partition may -have a distinct type. Read more
source§

fn partition_result<A, B, T, E>(self) -> (A, B)where - Self: Iterator<Item = Result<T, E>> + Sized, - A: Default + Extend<T>, - B: Default + Extend<E>,

Partition a sequence of Results into one list of all the Ok elements -and another list of all the Err elements. Read more
source§

fn into_group_map<K, V>(self) -> HashMap<K, Vec<V, Global>, RandomState>where - Self: Iterator<Item = (K, V)> + Sized, - K: Hash + Eq,

Return a HashMap of keys mapped to Vecs of values. Keys and values -are taken from (Key, Value) tuple pairs yielded by the input iterator. Read more
source§

fn into_group_map_by<K, V, F>( - self, - f: F -) -> HashMap<K, Vec<V, Global>, RandomState>where - Self: Iterator<Item = V> + Sized, - K: Hash + Eq, - F: Fn(&V) -> K,

Return an Iterator on a HashMap. Keys mapped to Vecs of values. The key is specified -in the closure. Read more
source§

fn into_grouping_map<K, V>(self) -> GroupingMap<Self>where - Self: Iterator<Item = (K, V)> + Sized, - K: Hash + Eq,

Constructs a GroupingMap to be used later with one of the efficient -group-and-fold operations it allows to perform. Read more
source§

fn into_grouping_map_by<K, V, F>( - self, - key_mapper: F -) -> GroupingMap<MapForGrouping<Self, F>>where - Self: Iterator<Item = V> + Sized, - K: Hash + Eq, - F: FnMut(&V) -> K,

Constructs a GroupingMap to be used later with one of the efficient -group-and-fold operations it allows to perform. Read more
source§

fn min_set(self) -> Vec<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Return all minimum elements of an iterator. Read more
source§

fn min_set_by<F>(self, compare: F) -> Vec<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return all minimum elements of an iterator, as determined by -the specified function. Read more
source§

fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return all minimum elements of an iterator, as determined by -the specified function. Read more
source§

fn max_set(self) -> Vec<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Return all maximum elements of an iterator. Read more
source§

fn max_set_by<F>(self, compare: F) -> Vec<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return all maximum elements of an iterator, as determined by -the specified function. Read more
source§

fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return all maximum elements of an iterator, as determined by -the specified function. Read more
source§

fn minmax(self) -> MinMaxResult<Self::Item>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>,

Return the minimum and maximum elements in the iterator. Read more
source§

fn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item>where - Self: Sized, - K: PartialOrd<K>, - F: FnMut(&Self::Item) -> K,

Return the minimum and maximum element of an iterator, as determined by -the specified function. Read more
source§

fn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the minimum and maximum element of an iterator, as determined by -the specified comparison function. Read more
source§

fn position_max(self) -> Option<usize>where - Self: Sized, - Self::Item: Ord,

Return the position of the maximum element in the iterator. Read more
source§

fn position_max_by_key<K, F>(self, key: F) -> Option<usize>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return the position of the maximum element in the iterator, as -determined by the specified function. Read more
source§

fn position_max_by<F>(self, compare: F) -> Option<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the position of the maximum element in the iterator, as -determined by the specified comparison function. Read more
source§

fn position_min(self) -> Option<usize>where - Self: Sized, - Self::Item: Ord,

Return the position of the minimum element in the iterator. Read more
source§

fn position_min_by_key<K, F>(self, key: F) -> Option<usize>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return the position of the minimum element in the iterator, as -determined by the specified function. Read more
source§

fn position_min_by<F>(self, compare: F) -> Option<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the position of the minimum element in the iterator, as -determined by the specified comparison function. Read more
source§

fn position_minmax(self) -> MinMaxResult<usize>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>,

Return the positions of the minimum and maximum elements in -the iterator. Read more
source§

fn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize>where - Self: Sized, - K: PartialOrd<K>, - F: FnMut(&Self::Item) -> K,

Return the postions of the minimum and maximum elements of an -iterator, as determined by the specified function. Read more
source§

fn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the postions of the minimum and maximum elements of an -iterator, as determined by the specified comparison function. Read more
source§

fn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>where - Self: Sized,

If the iterator yields exactly one element, that element will be returned, otherwise -an error will be returned containing an iterator that has the same output as the input -iterator. Read more
source§

fn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>where - Self: Sized,

If the iterator yields no elements, Ok(None) will be returned. If the iterator yields -exactly one element, that element will be returned, otherwise an error will be returned -containing an iterator that has the same output as the input iterator. Read more
source§

fn multipeek(self) -> MultiPeek<Self>where - Self: Sized,

An iterator adaptor that allows the user to peek at multiple .next() -values without advancing the base iterator. Read more
source§

fn counts(self) -> HashMap<Self::Item, usize, RandomState>where - Self: Sized, - Self::Item: Eq + Hash,

Collect the items in this iterator and return a HashMap which -contains each item that appears in the iterator and the number -of times it appears. Read more
source§

fn counts_by<K, F>(self, f: F) -> HashMap<K, usize, RandomState>where - Self: Sized, - K: Eq + Hash, - F: FnMut(Self::Item) -> K,

Collect the items in this iterator and return a HashMap which -contains each item that appears in the iterator and the number -of times it appears, -determining identity using a keying function. Read more
source§

fn multiunzip<FromI>(self) -> FromIwhere - Self: Sized + MultiUnzip<FromI>,

Converts an iterator of tuples into a tuple of containers. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.bin!.html b/coreutils/dev/uucore/macro.bin!.html deleted file mode 100644 index 7dcf164a6..000000000 --- a/coreutils/dev/uucore/macro.bin!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.bin.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.bin.html b/coreutils/dev/uucore/macro.bin.html deleted file mode 100644 index ac972db5c..000000000 --- a/coreutils/dev/uucore/macro.bin.html +++ /dev/null @@ -1,6 +0,0 @@ -bin in uucore - Rust

Macro uucore::bin

source ·
macro_rules! bin {
-    ($util:ident) => { ... };
-}
Expand description

Execute utility code for util.

-

This macro expands to a main function that invokes the uumain function in util -Exits with code returned by uumain.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.crash!.html b/coreutils/dev/uucore/macro.crash!.html deleted file mode 100644 index 568fcb67a..000000000 --- a/coreutils/dev/uucore/macro.crash!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.crash.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.crash.html b/coreutils/dev/uucore/macro.crash.html deleted file mode 100644 index 22708d58a..000000000 --- a/coreutils/dev/uucore/macro.crash.html +++ /dev/null @@ -1,10 +0,0 @@ -crash in uucore - Rust

Macro uucore::crash

source ·
macro_rules! crash {
-    ($exit_code:expr, $($args:tt)+) => { ... };
-}
Expand description

Display an error and std::process::exit

-

Displays the provided error message using show_error!, then invokes -std::process::exit with the provided exit code.

-

Examples

-
// outputs <name>: Couldn't apply foo to bar
-// and terminates execution
-crash!(1, "Couldn't apply {} to {}", "foo", "bar");
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.crash_if_err!.html b/coreutils/dev/uucore/macro.crash_if_err!.html deleted file mode 100644 index 1d7e6274f..000000000 --- a/coreutils/dev/uucore/macro.crash_if_err!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.crash_if_err.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.crash_if_err.html b/coreutils/dev/uucore/macro.crash_if_err.html deleted file mode 100644 index 3950f8575..000000000 --- a/coreutils/dev/uucore/macro.crash_if_err.html +++ /dev/null @@ -1,14 +0,0 @@ -crash_if_err in uucore - Rust

Macro uucore::crash_if_err

source ·
macro_rules! crash_if_err {
-    ($exit_code:expr, $exp:expr) => { ... };
-}
Expand description

Unwrap a std::result::Result, crashing instead of panicking.

-

If the result is an Ok-variant, returns the value contained inside. If it -is an Err-variant, invokes crash! with the formatted error instead.

-

Examples

-
let is_ok: Result<u32, &str> = Ok(1);
-// Does nothing
-crash_if_err!(1, is_ok);
-
-let is_err: Result<u32, &str> = Err("This didn't work...");
-// Calls `crash!`
-crash_if_err!(1, is_err);
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.has!.html b/coreutils/dev/uucore/macro.has!.html deleted file mode 100644 index a69015b17..000000000 --- a/coreutils/dev/uucore/macro.has!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.has.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.has.html b/coreutils/dev/uucore/macro.has.html deleted file mode 100644 index b50d8c159..000000000 --- a/coreutils/dev/uucore/macro.has.html +++ /dev/null @@ -1,5 +0,0 @@ -has in uucore - Rust

Macro uucore::has

source ·
macro_rules! has {
-    ($mode:expr, $perm:expr) => { ... };
-}
Expand description

Used to check if the mode has its perm bit set.

-

This macro expands to mode & perm != 0.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.help_about!.html b/coreutils/dev/uucore/macro.help_about!.html deleted file mode 100644 index 109684508..000000000 --- a/coreutils/dev/uucore/macro.help_about!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.help_about.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.help_about.html b/coreutils/dev/uucore/macro.help_about.html deleted file mode 100644 index 858e50b74..000000000 --- a/coreutils/dev/uucore/macro.help_about.html +++ /dev/null @@ -1,4 +0,0 @@ -help_about in uucore - Rust

Macro uucore::help_about

source ·
help_about!() { /* proc-macro */ }
Expand description

Get the about text from the help file.

-

The about text is assumed to be the text between the first markdown -code block and the next header, if any. It may span multiple lines.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.help_section!.html b/coreutils/dev/uucore/macro.help_section!.html deleted file mode 100644 index f76d64649..000000000 --- a/coreutils/dev/uucore/macro.help_section!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.help_section.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.help_section.html b/coreutils/dev/uucore/macro.help_section.html deleted file mode 100644 index 5ee4143fe..000000000 --- a/coreutils/dev/uucore/macro.help_section.html +++ /dev/null @@ -1,19 +0,0 @@ -help_section in uucore - Rust

Macro uucore::help_section

source ·
help_section!() { /* proc-macro */ }
Expand description

Reads a section from a file of the util as a str literal.

-

It reads from the file specified as the second argument, relative to the -crate root. The contents of this file are read verbatim, without parsing or -escaping. The name of the help file should match the name of the util. -I.e. numfmt should have a file called numfmt.md. By convention, the file -should start with a top-level section with the name of the util. The other -sections must start with 2 # characters. Capitalization of the sections -does not matter. Leading and trailing whitespace of each section will be -removed.

-

Example:

-
# numfmt
-## About
-Convert numbers from/to human-readable strings
-
-## Long help
-This text will be the long help
-
-
help_section!("about", "numfmt.md");
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.help_usage!.html b/coreutils/dev/uucore/macro.help_usage!.html deleted file mode 100644 index f7bab7cb2..000000000 --- a/coreutils/dev/uucore/macro.help_usage!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.help_usage.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.help_usage.html b/coreutils/dev/uucore/macro.help_usage.html deleted file mode 100644 index 591d37621..000000000 --- a/coreutils/dev/uucore/macro.help_usage.html +++ /dev/null @@ -1,6 +0,0 @@ -help_usage in uucore - Rust

Macro uucore::help_usage

source ·
help_usage!() { /* proc-macro */ }
Expand description

Get the usage from the help file.

-

The usage is assumed to be surrounded by markdown code fences. It may span -multiple lines. The first word of each line is assumed to be the name of -the util and is replaced by “{}” so that the output of this function can be -used with uucore::format_usage.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.prompt_yes!.html b/coreutils/dev/uucore/macro.prompt_yes!.html deleted file mode 100644 index 725c8d777..000000000 --- a/coreutils/dev/uucore/macro.prompt_yes!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.prompt_yes.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.prompt_yes.html b/coreutils/dev/uucore/macro.prompt_yes.html deleted file mode 100644 index b8111ee9d..000000000 --- a/coreutils/dev/uucore/macro.prompt_yes.html +++ /dev/null @@ -1,14 +0,0 @@ -prompt_yes in uucore - Rust

Macro uucore::prompt_yes

source ·
macro_rules! prompt_yes {
-    ($($args:tt)+) => { ... };
-}
Expand description

Prompt the user with a formatted string and returns true if they reply 'y' or 'Y'

-

This macro functions accepts the same syntax as format!. The prompt is written to -stderr. A space is also printed at the end for nice spacing between the prompt and -the user input. Any input starting with 'y' or 'Y' is interpreted as yes.

-

Examples

-
use uucore::prompt_yes;
-let file = "foo.rs";
-prompt_yes!("Do you want to delete '{}'?", file);
-

will print something like below to stderr (with util_name substituted by the actual -util name) and will wait for user input.

-
util_name: Do you want to delete 'foo.rs'?
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.show!.html b/coreutils/dev/uucore/macro.show!.html deleted file mode 100644 index bb5cc3235..000000000 --- a/coreutils/dev/uucore/macro.show!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.show.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.show.html b/coreutils/dev/uucore/macro.show.html deleted file mode 100644 index 077091924..000000000 --- a/coreutils/dev/uucore/macro.show.html +++ /dev/null @@ -1,30 +0,0 @@ -show in uucore - Rust

Macro uucore::show

source ·
macro_rules! show {
-    ($err:expr) => { ... };
-}
Expand description

Display a crate::error::UError and set global exit code.

-

Prints the error message contained in an crate::error::UError to stderr -and sets the exit code through crate::error::set_exit_code. The printed -error message is prepended with the calling utility’s name. A call to this -macro will not finish program execution.

-

Examples

-

The following example would print a message “Some error occurred” and set -the utility’s exit code to 2.

- -

-use uucore::error::{self, USimpleError};
-
-fn main() {
-    let err = USimpleError::new(2, "Some error occurred.");
-    show!(err);
-    assert_eq!(error::get_exit_code(), 2);
-}
-

If not using crate::error::UError, one may achieve the same behavior -like this:

- -

-use uucore::error::set_exit_code;
-
-fn main() {
-    set_exit_code(2);
-    show_error!("Some error occurred.");
-}
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.show_error!.html b/coreutils/dev/uucore/macro.show_error!.html deleted file mode 100644 index 697242dd3..000000000 --- a/coreutils/dev/uucore/macro.show_error!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.show_error.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.show_error.html b/coreutils/dev/uucore/macro.show_error.html deleted file mode 100644 index 8d2e36b1f..000000000 --- a/coreutils/dev/uucore/macro.show_error.html +++ /dev/null @@ -1,8 +0,0 @@ -show_error in uucore - Rust

Macro uucore::show_error

source ·
macro_rules! show_error {
-    ($($args:tt)+) => { ... };
-}
Expand description

Show an error to stderr in a similar style to GNU coreutils.

-

Takes a format!-like input and prints it to stderr. The output is -prepended with the current utility’s name.

-

Examples

-
show_error!("Couldn't apply {} to {}", "foo", "bar");
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.show_if_err!.html b/coreutils/dev/uucore/macro.show_if_err!.html deleted file mode 100644 index 32ddd8c57..000000000 --- a/coreutils/dev/uucore/macro.show_if_err!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.show_if_err.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.show_if_err.html b/coreutils/dev/uucore/macro.show_if_err.html deleted file mode 100644 index 2295db92f..000000000 --- a/coreutils/dev/uucore/macro.show_if_err.html +++ /dev/null @@ -1,19 +0,0 @@ -show_if_err in uucore - Rust

Macro uucore::show_if_err

source ·
macro_rules! show_if_err {
-    ($res:expr) => { ... };
-}
Expand description

Display an error and set global exit code in error case.

-

Wraps around show! and takes a crate::error::UResult instead of a -crate::error::UError type. This macro invokes show! if the -crate::error::UResult is an Err-variant. This can be invoked directly -on the result of a function call, like in the install utility:

- -
show_if_err!(copy(sourcepath, &targetpath, b));
-

Examples

-

-let is_ok = Ok(1);
-// This does nothing at all
-show_if_err!(is_ok);
-
-let is_err = Err(USimpleError::new(1, "I'm an error").into());
-// Calls `show!` on the contained USimpleError
-show_if_err!(is_err);
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.show_warning!.html b/coreutils/dev/uucore/macro.show_warning!.html deleted file mode 100644 index c47251a43..000000000 --- a/coreutils/dev/uucore/macro.show_warning!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.show_warning.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.show_warning.html b/coreutils/dev/uucore/macro.show_warning.html deleted file mode 100644 index b8a85a405..000000000 --- a/coreutils/dev/uucore/macro.show_warning.html +++ /dev/null @@ -1,9 +0,0 @@ -show_warning in uucore - Rust

Macro uucore::show_warning

source ·
macro_rules! show_warning {
-    ($($args:tt)+) => { ... };
-}
Expand description

Print a warning message to stderr.

-

Takes format!-compatible input and prepends it with the current -utility’s name and “warning: “ before printing to stderr.

-

Examples

-
// outputs <name>: warning: Couldn't apply foo to bar
-show_warning!("Couldn't apply {} to {}", "foo", "bar");
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/macro.uio_error!.html b/coreutils/dev/uucore/macro.uio_error!.html deleted file mode 100644 index 6e7fc9fa5..000000000 --- a/coreutils/dev/uucore/macro.uio_error!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.uio_error.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/macro.uio_error.html b/coreutils/dev/uucore/macro.uio_error.html deleted file mode 100644 index bf46ff3b2..000000000 --- a/coreutils/dev/uucore/macro.uio_error.html +++ /dev/null @@ -1,50 +0,0 @@ -uio_error in uucore - Rust

Macro uucore::uio_error

source ·
macro_rules! uio_error {
-    ($err:expr, $($args:tt)+) => { ... };
-}
Expand description

Shorthand to construct UIoError-instances.

-

This macro serves as a convenience call to quickly construct instances of -UIoError. It takes:

-
    -
  • An instance of std::io::Error
  • -
  • A format!-compatible string and
  • -
  • An arbitrary number of arguments to the format string
  • -
-

In exactly this order. It is equivalent to the more verbose code seen in the -example.

-

Examples

-
use uucore::error::UIoError;
-use uucore::uio_error;
-
-let io_err = std::io::Error::new(
-    std::io::ErrorKind::PermissionDenied, "fix me please!"
-);
-
-let uio_err = UIoError::new(
-    io_err.kind(),
-    format!("Error code: {}", 2)
-);
-
-let other_uio_err = uio_error!(io_err, "Error code: {}", 2);
-
-// prints "fix me please!: Permission denied"
-println!("{}", uio_err);
-// prints "Error code: 2: Permission denied"
-println!("{}", other_uio_err);
-

The std::fmt::Display impl of UIoError will then ensure that an -appropriate error message relating to the actual error kind of the -std::io::Error is appended to whatever error message is defined in -addition (as secondary argument).

-

If you want to show only the error message for the std::io::ErrorKind -that’s contained in UIoError, pass the second argument as empty string:

- -
use uucore::error::UIoError;
-use uucore::uio_error;
-
-let io_err = std::io::Error::new(
-    std::io::ErrorKind::PermissionDenied, "fix me please!"
-);
-
-let other_uio_err = uio_error!(io_err, "");
-
-// prints: ": Permission denied"
-println!("{}", other_uio_err);
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/memo/fn.printf.html b/coreutils/dev/uucore/memo/fn.printf.html deleted file mode 100644 index 9b4994a0b..000000000 --- a/coreutils/dev/uucore/memo/fn.printf.html +++ /dev/null @@ -1,10 +0,0 @@ -printf in uucore::memo - Rust

Function uucore::memo::printf

source ·
pub fn printf(format_string: &str, args: &[String]) -> UResult<()>
Expand description

Write a formatted string to stdout.

-

format_string contains the template and args contains the -arguments to render into the template.

-

See also sprintf, which creates a new formatted String.

-

Examples

-
use uucore::memo::printf;
-
-printf("hello %s", &["world".to_string()]).unwrap();
-// prints "hello world"
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/memo/fn.sprintf.html b/coreutils/dev/uucore/memo/fn.sprintf.html deleted file mode 100644 index ad094fada..000000000 --- a/coreutils/dev/uucore/memo/fn.sprintf.html +++ /dev/null @@ -1,10 +0,0 @@ -sprintf in uucore::memo - Rust

Function uucore::memo::sprintf

source ·
pub fn sprintf(format_string: &str, args: &[String]) -> UResult<String>
Expand description

Create a new formatted string.

-

format_string contains the template and args contains the -arguments to render into the template.

-

See also printf, which prints to stdout.

-

Examples

-
use uucore::memo::sprintf;
-
-let s = sprintf("hello %s", &["world".to_string()]).unwrap();
-assert_eq!(s, "hello world".to_string());
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/memo/index.html b/coreutils/dev/uucore/memo/index.html deleted file mode 100644 index 92edaf0bc..000000000 --- a/coreutils/dev/uucore/memo/index.html +++ /dev/null @@ -1,5 +0,0 @@ -uucore::memo - Rust

Module uucore::memo

source ·
Expand description

Main entry point for our implementation of printf.

-

The printf and sprintf closely match the behavior of the -corresponding C functions: the former renders a formatted string -to stdout, the latter renders to a new String object.

-

Functions

  • Write a formatted string to stdout.
  • Create a new formatted string.
\ No newline at end of file diff --git a/coreutils/dev/uucore/memo/sidebar-items.js b/coreutils/dev/uucore/memo/sidebar-items.js deleted file mode 100644 index c191ed7a7..000000000 --- a/coreutils/dev/uucore/memo/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["printf","sprintf"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/mode/fn.get_umask.html b/coreutils/dev/uucore/mode/fn.get_umask.html deleted file mode 100644 index ed840006e..000000000 --- a/coreutils/dev/uucore/mode/fn.get_umask.html +++ /dev/null @@ -1 +0,0 @@ -get_umask in uucore::mode - Rust

Function uucore::mode::get_umask

source ·
pub fn get_umask() -> u32
\ No newline at end of file diff --git a/coreutils/dev/uucore/mode/fn.parse_mode.html b/coreutils/dev/uucore/mode/fn.parse_mode.html deleted file mode 100644 index 1d53df50c..000000000 --- a/coreutils/dev/uucore/mode/fn.parse_mode.html +++ /dev/null @@ -1 +0,0 @@ -parse_mode in uucore::mode - Rust

Function uucore::mode::parse_mode

source ·
pub fn parse_mode(mode: &str) -> Result<mode_t, String>
\ No newline at end of file diff --git a/coreutils/dev/uucore/mode/fn.parse_numeric.html b/coreutils/dev/uucore/mode/fn.parse_numeric.html deleted file mode 100644 index 84f7e660e..000000000 --- a/coreutils/dev/uucore/mode/fn.parse_numeric.html +++ /dev/null @@ -1,5 +0,0 @@ -parse_numeric in uucore::mode - Rust

Function uucore::mode::parse_numeric

source ·
pub fn parse_numeric(
-    fperm: u32,
-    mode: &str,
-    considering_dir: bool
-) -> Result<u32, String>
\ No newline at end of file diff --git a/coreutils/dev/uucore/mode/fn.parse_symbolic.html b/coreutils/dev/uucore/mode/fn.parse_symbolic.html deleted file mode 100644 index f3b448260..000000000 --- a/coreutils/dev/uucore/mode/fn.parse_symbolic.html +++ /dev/null @@ -1,6 +0,0 @@ -parse_symbolic in uucore::mode - Rust

Function uucore::mode::parse_symbolic

source ·
pub fn parse_symbolic(
-    fperm: u32,
-    mode: &str,
-    umask: u32,
-    considering_dir: bool
-) -> Result<u32, String>
\ No newline at end of file diff --git a/coreutils/dev/uucore/mode/fn.strip_minus_from_mode.html b/coreutils/dev/uucore/mode/fn.strip_minus_from_mode.html deleted file mode 100644 index 087714d4b..000000000 --- a/coreutils/dev/uucore/mode/fn.strip_minus_from_mode.html +++ /dev/null @@ -1 +0,0 @@ -strip_minus_from_mode in uucore::mode - Rust
pub fn strip_minus_from_mode(args: &mut Vec<String>) -> bool
\ No newline at end of file diff --git a/coreutils/dev/uucore/mode/index.html b/coreutils/dev/uucore/mode/index.html deleted file mode 100644 index 3a5e9449e..000000000 --- a/coreutils/dev/uucore/mode/index.html +++ /dev/null @@ -1,2 +0,0 @@ -uucore::mode - Rust

Module uucore::mode

source ·
Expand description

Set of functions to parse modes

-

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/mode/sidebar-items.js b/coreutils/dev/uucore/mode/sidebar-items.js deleted file mode 100644 index fafd13f18..000000000 --- a/coreutils/dev/uucore/mode/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["get_umask","parse_mode","parse_numeric","parse_symbolic","strip_minus_from_mode"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/arguments/fn.backup.html b/coreutils/dev/uucore/mods/backup_control/arguments/fn.backup.html deleted file mode 100644 index ad2a3e6c8..000000000 --- a/coreutils/dev/uucore/mods/backup_control/arguments/fn.backup.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/backup_control/arguments/fn.backup.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/arguments/fn.backup_no_args.html b/coreutils/dev/uucore/mods/backup_control/arguments/fn.backup_no_args.html deleted file mode 100644 index 7b1f39692..000000000 --- a/coreutils/dev/uucore/mods/backup_control/arguments/fn.backup_no_args.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/backup_control/arguments/fn.backup_no_args.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/arguments/fn.suffix.html b/coreutils/dev/uucore/mods/backup_control/arguments/fn.suffix.html deleted file mode 100644 index 766898bf5..000000000 --- a/coreutils/dev/uucore/mods/backup_control/arguments/fn.suffix.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/backup_control/arguments/fn.suffix.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/arguments/index.html b/coreutils/dev/uucore/mods/backup_control/arguments/index.html deleted file mode 100644 index 0d3e4234d..000000000 --- a/coreutils/dev/uucore/mods/backup_control/arguments/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/backup_control/arguments/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/arguments/static.OPT_BACKUP.html b/coreutils/dev/uucore/mods/backup_control/arguments/static.OPT_BACKUP.html deleted file mode 100644 index 16eb496f4..000000000 --- a/coreutils/dev/uucore/mods/backup_control/arguments/static.OPT_BACKUP.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/backup_control/arguments/static.OPT_BACKUP.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/arguments/static.OPT_BACKUP_NO_ARG.html b/coreutils/dev/uucore/mods/backup_control/arguments/static.OPT_BACKUP_NO_ARG.html deleted file mode 100644 index bc495dcc3..000000000 --- a/coreutils/dev/uucore/mods/backup_control/arguments/static.OPT_BACKUP_NO_ARG.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/backup_control/arguments/static.OPT_BACKUP_NO_ARG.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/arguments/static.OPT_SUFFIX.html b/coreutils/dev/uucore/mods/backup_control/arguments/static.OPT_SUFFIX.html deleted file mode 100644 index c8cc7da60..000000000 --- a/coreutils/dev/uucore/mods/backup_control/arguments/static.OPT_SUFFIX.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/backup_control/arguments/static.OPT_SUFFIX.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/constant.BACKUP_CONTROL_LONG_HELP.html b/coreutils/dev/uucore/mods/backup_control/constant.BACKUP_CONTROL_LONG_HELP.html deleted file mode 100644 index 5ce6450e3..000000000 --- a/coreutils/dev/uucore/mods/backup_control/constant.BACKUP_CONTROL_LONG_HELP.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/backup_control/constant.BACKUP_CONTROL_LONG_HELP.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/enum.BackupError.html b/coreutils/dev/uucore/mods/backup_control/enum.BackupError.html deleted file mode 100644 index 1321acc41..000000000 --- a/coreutils/dev/uucore/mods/backup_control/enum.BackupError.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/backup_control/enum.BackupError.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/enum.BackupMode.html b/coreutils/dev/uucore/mods/backup_control/enum.BackupMode.html deleted file mode 100644 index 8900c0811..000000000 --- a/coreutils/dev/uucore/mods/backup_control/enum.BackupMode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/backup_control/enum.BackupMode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/fn.determine_backup_mode.html b/coreutils/dev/uucore/mods/backup_control/fn.determine_backup_mode.html deleted file mode 100644 index df1af6cd6..000000000 --- a/coreutils/dev/uucore/mods/backup_control/fn.determine_backup_mode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/backup_control/fn.determine_backup_mode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/fn.determine_backup_suffix.html b/coreutils/dev/uucore/mods/backup_control/fn.determine_backup_suffix.html deleted file mode 100644 index ed1bee620..000000000 --- a/coreutils/dev/uucore/mods/backup_control/fn.determine_backup_suffix.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/backup_control/fn.determine_backup_suffix.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/fn.get_backup_path.html b/coreutils/dev/uucore/mods/backup_control/fn.get_backup_path.html deleted file mode 100644 index 0deee334b..000000000 --- a/coreutils/dev/uucore/mods/backup_control/fn.get_backup_path.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/backup_control/fn.get_backup_path.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/fn.source_is_target_backup.html b/coreutils/dev/uucore/mods/backup_control/fn.source_is_target_backup.html deleted file mode 100644 index f71763ffc..000000000 --- a/coreutils/dev/uucore/mods/backup_control/fn.source_is_target_backup.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/backup_control/fn.source_is_target_backup.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/index.html b/coreutils/dev/uucore/mods/backup_control/index.html deleted file mode 100644 index a2b404ca4..000000000 --- a/coreutils/dev/uucore/mods/backup_control/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/backup_control/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/backup_control/static.BACKUP_CONTROL_VALUES.html b/coreutils/dev/uucore/mods/backup_control/static.BACKUP_CONTROL_VALUES.html deleted file mode 100644 index 3a01e2909..000000000 --- a/coreutils/dev/uucore/mods/backup_control/static.BACKUP_CONTROL_VALUES.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/backup_control/static.BACKUP_CONTROL_VALUES.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/display/fn.print_verbatim.html b/coreutils/dev/uucore/mods/display/fn.print_verbatim.html deleted file mode 100644 index 7208328aa..000000000 --- a/coreutils/dev/uucore/mods/display/fn.print_verbatim.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/display/fn.print_verbatim.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/display/fn.println_verbatim.html b/coreutils/dev/uucore/mods/display/fn.println_verbatim.html deleted file mode 100644 index 52bcb60c2..000000000 --- a/coreutils/dev/uucore/mods/display/fn.println_verbatim.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/display/fn.println_verbatim.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/display/index.html b/coreutils/dev/uucore/mods/display/index.html deleted file mode 100644 index 31f7da8e5..000000000 --- a/coreutils/dev/uucore/mods/display/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/display/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/display/struct.Quoted.html b/coreutils/dev/uucore/mods/display/struct.Quoted.html deleted file mode 100644 index 63f15f306..000000000 --- a/coreutils/dev/uucore/mods/display/struct.Quoted.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/display/struct.Quoted.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/display/trait.Quotable.html b/coreutils/dev/uucore/mods/display/trait.Quotable.html deleted file mode 100644 index caa876ef7..000000000 --- a/coreutils/dev/uucore/mods/display/trait.Quotable.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/display/trait.Quotable.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/fn.get_exit_code.html b/coreutils/dev/uucore/mods/error/fn.get_exit_code.html deleted file mode 100644 index 4000fab39..000000000 --- a/coreutils/dev/uucore/mods/error/fn.get_exit_code.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/fn.get_exit_code.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/fn.set_exit_code.html b/coreutils/dev/uucore/mods/error/fn.set_exit_code.html deleted file mode 100644 index 185af1485..000000000 --- a/coreutils/dev/uucore/mods/error/fn.set_exit_code.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/fn.set_exit_code.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/fn.strip_errno.html b/coreutils/dev/uucore/mods/error/fn.strip_errno.html deleted file mode 100644 index 37137c64f..000000000 --- a/coreutils/dev/uucore/mods/error/fn.strip_errno.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/fn.strip_errno.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/index.html b/coreutils/dev/uucore/mods/error/index.html deleted file mode 100644 index a2e10f173..000000000 --- a/coreutils/dev/uucore/mods/error/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/struct.ClapErrorWrapper.html b/coreutils/dev/uucore/mods/error/struct.ClapErrorWrapper.html deleted file mode 100644 index 47171b278..000000000 --- a/coreutils/dev/uucore/mods/error/struct.ClapErrorWrapper.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/struct.ClapErrorWrapper.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/struct.ExitCode.html b/coreutils/dev/uucore/mods/error/struct.ExitCode.html deleted file mode 100644 index c0de249bf..000000000 --- a/coreutils/dev/uucore/mods/error/struct.ExitCode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/struct.ExitCode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/struct.UIoError.html b/coreutils/dev/uucore/mods/error/struct.UIoError.html deleted file mode 100644 index eda01256e..000000000 --- a/coreutils/dev/uucore/mods/error/struct.UIoError.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/struct.UIoError.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/struct.USimpleError.html b/coreutils/dev/uucore/mods/error/struct.USimpleError.html deleted file mode 100644 index 2c4f24d18..000000000 --- a/coreutils/dev/uucore/mods/error/struct.USimpleError.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/struct.USimpleError.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/struct.UUsageError.html b/coreutils/dev/uucore/mods/error/struct.UUsageError.html deleted file mode 100644 index f190feaab..000000000 --- a/coreutils/dev/uucore/mods/error/struct.UUsageError.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/struct.UUsageError.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/trait.FromIo.html b/coreutils/dev/uucore/mods/error/trait.FromIo.html deleted file mode 100644 index 1ea037c10..000000000 --- a/coreutils/dev/uucore/mods/error/trait.FromIo.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/trait.FromIo.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/trait.UClapError.html b/coreutils/dev/uucore/mods/error/trait.UClapError.html deleted file mode 100644 index fa8c4751c..000000000 --- a/coreutils/dev/uucore/mods/error/trait.UClapError.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/trait.UClapError.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/trait.UError.html b/coreutils/dev/uucore/mods/error/trait.UError.html deleted file mode 100644 index dc34b8240..000000000 --- a/coreutils/dev/uucore/mods/error/trait.UError.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/trait.UError.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/error/type.UResult.html b/coreutils/dev/uucore/mods/error/type.UResult.html deleted file mode 100644 index 2571350d0..000000000 --- a/coreutils/dev/uucore/mods/error/type.UResult.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/error/type.UResult.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/line_ending/enum.LineEnding.html b/coreutils/dev/uucore/mods/line_ending/enum.LineEnding.html deleted file mode 100644 index ced8bedbc..000000000 --- a/coreutils/dev/uucore/mods/line_ending/enum.LineEnding.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/line_ending/enum.LineEnding.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/line_ending/index.html b/coreutils/dev/uucore/mods/line_ending/index.html deleted file mode 100644 index af46a25f1..000000000 --- a/coreutils/dev/uucore/mods/line_ending/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/line_ending/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/os/fn.is_wsl_1.html b/coreutils/dev/uucore/mods/os/fn.is_wsl_1.html deleted file mode 100644 index 55dabfeca..000000000 --- a/coreutils/dev/uucore/mods/os/fn.is_wsl_1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/os/fn.is_wsl_1.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/os/fn.is_wsl_2.html b/coreutils/dev/uucore/mods/os/fn.is_wsl_2.html deleted file mode 100644 index d64caa06c..000000000 --- a/coreutils/dev/uucore/mods/os/fn.is_wsl_2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/os/fn.is_wsl_2.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/os/index.html b/coreutils/dev/uucore/mods/os/index.html deleted file mode 100644 index d3d2d8e44..000000000 --- a/coreutils/dev/uucore/mods/os/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/os/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/panic/fn.mute_sigpipe_panic.html b/coreutils/dev/uucore/mods/panic/fn.mute_sigpipe_panic.html deleted file mode 100644 index 9fb938615..000000000 --- a/coreutils/dev/uucore/mods/panic/fn.mute_sigpipe_panic.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/panic/fn.mute_sigpipe_panic.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/panic/index.html b/coreutils/dev/uucore/mods/panic/index.html deleted file mode 100644 index 40843c5c3..000000000 --- a/coreutils/dev/uucore/mods/panic/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/panic/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/quoting_style/enum.Quotes.html b/coreutils/dev/uucore/mods/quoting_style/enum.Quotes.html deleted file mode 100644 index fa2c83356..000000000 --- a/coreutils/dev/uucore/mods/quoting_style/enum.Quotes.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/quoting_style/enum.Quotes.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/quoting_style/enum.QuotingStyle.html b/coreutils/dev/uucore/mods/quoting_style/enum.QuotingStyle.html deleted file mode 100644 index e216b3696..000000000 --- a/coreutils/dev/uucore/mods/quoting_style/enum.QuotingStyle.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/quoting_style/enum.QuotingStyle.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/quoting_style/fn.escape_name.html b/coreutils/dev/uucore/mods/quoting_style/fn.escape_name.html deleted file mode 100644 index c5b2125a2..000000000 --- a/coreutils/dev/uucore/mods/quoting_style/fn.escape_name.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/quoting_style/fn.escape_name.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/quoting_style/index.html b/coreutils/dev/uucore/mods/quoting_style/index.html deleted file mode 100644 index 742a5f03d..000000000 --- a/coreutils/dev/uucore/mods/quoting_style/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/quoting_style/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/ranges/fn.complement.html b/coreutils/dev/uucore/mods/ranges/fn.complement.html deleted file mode 100644 index d44c3f075..000000000 --- a/coreutils/dev/uucore/mods/ranges/fn.complement.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/ranges/fn.complement.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/ranges/fn.contain.html b/coreutils/dev/uucore/mods/ranges/fn.contain.html deleted file mode 100644 index 4f38bf25b..000000000 --- a/coreutils/dev/uucore/mods/ranges/fn.contain.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/ranges/fn.contain.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/ranges/index.html b/coreutils/dev/uucore/mods/ranges/index.html deleted file mode 100644 index 6e2dc3107..000000000 --- a/coreutils/dev/uucore/mods/ranges/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/ranges/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/ranges/struct.Range.html b/coreutils/dev/uucore/mods/ranges/struct.Range.html deleted file mode 100644 index 8483cb75e..000000000 --- a/coreutils/dev/uucore/mods/ranges/struct.Range.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/ranges/struct.Range.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/update_control/arguments/fn.update.html b/coreutils/dev/uucore/mods/update_control/arguments/fn.update.html deleted file mode 100644 index 3f854fea7..000000000 --- a/coreutils/dev/uucore/mods/update_control/arguments/fn.update.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/update_control/arguments/fn.update.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/update_control/arguments/fn.update_no_args.html b/coreutils/dev/uucore/mods/update_control/arguments/fn.update_no_args.html deleted file mode 100644 index 3d159ad9f..000000000 --- a/coreutils/dev/uucore/mods/update_control/arguments/fn.update_no_args.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/update_control/arguments/fn.update_no_args.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/update_control/arguments/index.html b/coreutils/dev/uucore/mods/update_control/arguments/index.html deleted file mode 100644 index d6ea5bc9f..000000000 --- a/coreutils/dev/uucore/mods/update_control/arguments/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/update_control/arguments/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/update_control/arguments/static.OPT_UPDATE.html b/coreutils/dev/uucore/mods/update_control/arguments/static.OPT_UPDATE.html deleted file mode 100644 index 4287088aa..000000000 --- a/coreutils/dev/uucore/mods/update_control/arguments/static.OPT_UPDATE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/update_control/arguments/static.OPT_UPDATE.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/update_control/arguments/static.OPT_UPDATE_NO_ARG.html b/coreutils/dev/uucore/mods/update_control/arguments/static.OPT_UPDATE_NO_ARG.html deleted file mode 100644 index fde772679..000000000 --- a/coreutils/dev/uucore/mods/update_control/arguments/static.OPT_UPDATE_NO_ARG.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../../uucore/update_control/arguments/static.OPT_UPDATE_NO_ARG.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/update_control/enum.UpdateMode.html b/coreutils/dev/uucore/mods/update_control/enum.UpdateMode.html deleted file mode 100644 index 5ee93429b..000000000 --- a/coreutils/dev/uucore/mods/update_control/enum.UpdateMode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/update_control/enum.UpdateMode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/update_control/fn.determine_update_mode.html b/coreutils/dev/uucore/mods/update_control/fn.determine_update_mode.html deleted file mode 100644 index f7094e304..000000000 --- a/coreutils/dev/uucore/mods/update_control/fn.determine_update_mode.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/update_control/fn.determine_update_mode.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/update_control/index.html b/coreutils/dev/uucore/mods/update_control/index.html deleted file mode 100644 index 8299a8801..000000000 --- a/coreutils/dev/uucore/mods/update_control/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/update_control/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/version_cmp/fn.version_cmp.html b/coreutils/dev/uucore/mods/version_cmp/fn.version_cmp.html deleted file mode 100644 index 30aa9a79e..000000000 --- a/coreutils/dev/uucore/mods/version_cmp/fn.version_cmp.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/version_cmp/fn.version_cmp.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/mods/version_cmp/index.html b/coreutils/dev/uucore/mods/version_cmp/index.html deleted file mode 100644 index 988351405..000000000 --- a/coreutils/dev/uucore/mods/version_cmp/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/version_cmp/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/os/fn.is_wsl_1.html b/coreutils/dev/uucore/os/fn.is_wsl_1.html deleted file mode 100644 index 48df94a2d..000000000 --- a/coreutils/dev/uucore/os/fn.is_wsl_1.html +++ /dev/null @@ -1,2 +0,0 @@ -is_wsl_1 in uucore::os - Rust

Function uucore::os::is_wsl_1

source ·
pub fn is_wsl_1() -> bool
Expand description

Test if the program is running under WSL

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/os/fn.is_wsl_2.html b/coreutils/dev/uucore/os/fn.is_wsl_2.html deleted file mode 100644 index 4f895dd75..000000000 --- a/coreutils/dev/uucore/os/fn.is_wsl_2.html +++ /dev/null @@ -1 +0,0 @@ -is_wsl_2 in uucore::os - Rust

Function uucore::os::is_wsl_2

source ·
pub fn is_wsl_2() -> bool
\ No newline at end of file diff --git a/coreutils/dev/uucore/os/index.html b/coreutils/dev/uucore/os/index.html deleted file mode 100644 index ee212356b..000000000 --- a/coreutils/dev/uucore/os/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::os - Rust

Module uucore::os

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/os/sidebar-items.js b/coreutils/dev/uucore/os/sidebar-items.js deleted file mode 100644 index a18e2a1bb..000000000 --- a/coreutils/dev/uucore/os/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["is_wsl_1","is_wsl_2"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/panic/fn.mute_sigpipe_panic.html b/coreutils/dev/uucore/panic/fn.mute_sigpipe_panic.html deleted file mode 100644 index 389fa230a..000000000 --- a/coreutils/dev/uucore/panic/fn.mute_sigpipe_panic.html +++ /dev/null @@ -1,10 +0,0 @@ -mute_sigpipe_panic in uucore::panic - Rust
pub fn mute_sigpipe_panic()
Expand description

Terminate without error on panics that occur due to broken pipe errors.

-

For background discussions on SIGPIPE handling, see

-
    -
  • <https://github.com/uutils/coreutils/issues/374>
  • -
  • <https://github.com/uutils/coreutils/pull/1106>
  • -
  • <https://github.com/rust-lang/rust/issues/62569>
  • -
  • <https://github.com/BurntSushi/ripgrep/issues/200>
  • -
  • <https://github.com/crev-dev/cargo-crev/issues/287>
  • -
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/panic/index.html b/coreutils/dev/uucore/panic/index.html deleted file mode 100644 index df66f115b..000000000 --- a/coreutils/dev/uucore/panic/index.html +++ /dev/null @@ -1,7 +0,0 @@ -uucore::panic - Rust

Module uucore::panic

source ·
Expand description

Custom panic hooks that allow silencing certain types of errors.

-

Use the mute_sigpipe_panic function to silence panics caused by -broken pipe errors. This can happen when a process is still -producing data when the consuming process terminates and closes the -pipe. For example,

-
$ seq inf | head -n 1
-

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/panic/sidebar-items.js b/coreutils/dev/uucore/panic/sidebar-items.js deleted file mode 100644 index 0e3ce7984..000000000 --- a/coreutils/dev/uucore/panic/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["mute_sigpipe_panic"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/parse_glob/fn.from_str.html b/coreutils/dev/uucore/parse_glob/fn.from_str.html deleted file mode 100644 index 21cd21e3c..000000000 --- a/coreutils/dev/uucore/parse_glob/fn.from_str.html +++ /dev/null @@ -1,11 +0,0 @@ -from_str in uucore::parse_glob - Rust

Function uucore::parse_glob::from_str

source ·
pub fn from_str(glob: &str) -> Result<Pattern, PatternError>
Expand description

Parse a glob Pattern from a string.

-

This function amends the input string to replace any caret or circumflex -character (^) used to negate a set of characters with an exclamation mark -(!), which adapts rust’s glob matching to function the way the GNU utils’ -fnmatch does.

-

Examples

-
use std::time::Duration;
-use uucore::parse_glob::from_str;
-assert!(!from_str("[^abc]").unwrap().matches("a"));
-assert!(from_str("[^abc]").unwrap().matches("x"));
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/parse_glob/index.html b/coreutils/dev/uucore/parse_glob/index.html deleted file mode 100644 index e74a2a71d..000000000 --- a/coreutils/dev/uucore/parse_glob/index.html +++ /dev/null @@ -1,3 +0,0 @@ -uucore::parse_glob - Rust

Module uucore::parse_glob

source ·
Expand description

Parsing a glob Pattern from a string.

-

Use the from_str function to parse a Pattern from a string.

-

Functions

  • Parse a glob Pattern from a string.
\ No newline at end of file diff --git a/coreutils/dev/uucore/parse_glob/sidebar-items.js b/coreutils/dev/uucore/parse_glob/sidebar-items.js deleted file mode 100644 index c279fc9f3..000000000 --- a/coreutils/dev/uucore/parse_glob/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["from_str"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/parse_size/enum.ParseSizeError.html b/coreutils/dev/uucore/parse_size/enum.ParseSizeError.html deleted file mode 100644 index fc6a9b7be..000000000 --- a/coreutils/dev/uucore/parse_size/enum.ParseSizeError.html +++ /dev/null @@ -1,20 +0,0 @@ -ParseSizeError in uucore::parse_size - Rust
pub enum ParseSizeError {
-    InvalidSuffix(String),
-    ParseFailure(String),
-    SizeTooBig(String),
-}

Variants§

§

InvalidSuffix(String)

§

ParseFailure(String)

§

SizeTooBig(String)

Trait Implementations§

source§

impl Debug for ParseSizeError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ParseSizeError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Error for ParseSizeError

source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl PartialEq<ParseSizeError> for ParseSizeError

source§

fn eq(&self, other: &ParseSizeError) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for ParseSizeError

source§

impl StructuralEq for ParseSizeError

source§

impl StructuralPartialEq for ParseSizeError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<E> Provider for Ewhere - E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to -provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere - T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/parse_size/fn.parse_size.html b/coreutils/dev/uucore/parse_size/fn.parse_size.html deleted file mode 100644 index 2a268cd8e..000000000 --- a/coreutils/dev/uucore/parse_size/fn.parse_size.html +++ /dev/null @@ -1,16 +0,0 @@ -parse_size in uucore::parse_size - Rust

Function uucore::parse_size::parse_size

source ·
pub fn parse_size(size: &str) -> Result<u64, ParseSizeError>
Expand description

Parse a size string into a number of bytes.

-

A size string comprises an integer and an optional unit. The unit -may be K, M, G, T, P, E, Z or Y (powers of 1024), or KB, MB, -etc. (powers of 1000), or b which is 512. -Binary prefixes can be used, too: KiB=K, MiB=M, and so on.

-

Errors

-

Will return ParseSizeError if it’s not possible to parse this -string into a number, e.g. if the string does not begin with a -numeral, or if the unit is not one of the supported units described -in the preceding section.

-

Examples

-
use uucore::parse_size::parse_size;
-assert_eq!(Ok(123), parse_size("123"));
-assert_eq!(Ok(9 * 1000), parse_size("9kB")); // kB is 1000
-assert_eq!(Ok(2 * 1024), parse_size("2K")); // K is 1024
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/parse_size/index.html b/coreutils/dev/uucore/parse_size/index.html deleted file mode 100644 index 88c88637c..000000000 --- a/coreutils/dev/uucore/parse_size/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::parse_size - Rust

Module uucore::parse_size

source ·

Structs

  • Parser for sizes in SI or IEC units (multiples of 1000 or 1024 bytes).

Enums

Functions

  • Parse a size string into a number of bytes.
\ No newline at end of file diff --git a/coreutils/dev/uucore/parse_size/sidebar-items.js b/coreutils/dev/uucore/parse_size/sidebar-items.js deleted file mode 100644 index 44ee4be82..000000000 --- a/coreutils/dev/uucore/parse_size/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["ParseSizeError"],"fn":["parse_size"],"struct":["Parser"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/parse_size/struct.Parser.html b/coreutils/dev/uucore/parse_size/struct.Parser.html deleted file mode 100644 index 8197a7827..000000000 --- a/coreutils/dev/uucore/parse_size/struct.Parser.html +++ /dev/null @@ -1,38 +0,0 @@ -Parser in uucore::parse_size - Rust

Struct uucore::parse_size::Parser

source ·
pub struct Parser<'parser> {
-    pub capital_b_bytes: bool,
-    pub b_byte_count: bool,
-    pub allow_list: Option<&'parser [&'parser str]>,
-    pub default_unit: Option<&'parser str>,
-}
Expand description

Parser for sizes in SI or IEC units (multiples of 1000 or 1024 bytes).

-

The Parser::parse function performs the parse.

-

Fields§

§capital_b_bytes: bool

Whether to treat the suffix “B” as meaning “bytes”.

-
§b_byte_count: bool

Whether to treat “b” as a “byte count” instead of “block”

-
§allow_list: Option<&'parser [&'parser str]>

Whitelist for the suffix

-
§default_unit: Option<&'parser str>

Default unit when no suffix is provided

-

Implementations§

source§

impl<'parser> Parser<'parser>

source

pub fn with_allow_list(&mut self, allow_list: &'parser [&str]) -> &mut Self

source

pub fn with_default_unit(&mut self, default_unit: &'parser str) -> &mut Self

source

pub fn with_b_byte_count(&mut self, value: bool) -> &mut Self

source

pub fn parse(&self, size: &str) -> Result<u64, ParseSizeError>

Parse a size string into a number of bytes.

-

A size string comprises an integer and an optional unit. The unit -may be K, M, G, T, P, E, Z or Y (powers of 1024), or KB, MB, -etc. (powers of 1000), or b which is 512. -Binary prefixes can be used, too: KiB=K, MiB=M, and so on.

-
Errors
-

Will return ParseSizeError if it’s not possible to parse this -string into a number, e.g. if the string does not begin with a -numeral, or if the unit is not one of the supported units described -in the preceding section.

-
Examples
-
use uucore::parse_size::parse_size;
-assert_eq!(Ok(123), parse_size("123"));
-assert_eq!(Ok(9 * 1000), parse_size("9kB")); // kB is 1000
-assert_eq!(Ok(2 * 1024), parse_size("2K")); // K is 1024
-assert_eq!(Ok(44251 * 1024), parse_size("0xACDBK"));
-

Trait Implementations§

source§

impl<'parser> Default for Parser<'parser>

source§

fn default() -> Parser<'parser>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'parser> RefUnwindSafe for Parser<'parser>

§

impl<'parser> Send for Parser<'parser>

§

impl<'parser> Sync for Parser<'parser>

§

impl<'parser> Unpin for Parser<'parser>

§

impl<'parser> UnwindSafe for Parser<'parser>

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/parse_time/fn.from_str.html b/coreutils/dev/uucore/parse_time/fn.from_str.html deleted file mode 100644 index 121fe245f..000000000 --- a/coreutils/dev/uucore/parse_time/fn.from_str.html +++ /dev/null @@ -1,25 +0,0 @@ -from_str in uucore::parse_time - Rust

Function uucore::parse_time::from_str

source ·
pub fn from_str(string: &str) -> Result<Duration, String>
Expand description

Parse a duration from a string.

-

The string may contain only a number, like “123” or “4.5”, or it -may contain a number with a unit specifier, like “123s” meaning -one hundred twenty three seconds or “4.5d” meaning four and a half -days. If no unit is specified, the unit is assumed to be seconds.

-

The only allowed suffixes are

-
    -
  • “s” for seconds,
  • -
  • “m” for minutes,
  • -
  • “h” for hours,
  • -
  • “d” for days.
  • -
-

This function uses Duration::saturating_mul to compute the -number of seconds, so it does not overflow. If overflow would have -occurred, Duration::MAX is returned instead.

-

Errors

-

This function returns an error if the input string is empty, the -input is not a valid number, or the unit specifier is invalid or -unknown.

-

Examples

-
use std::time::Duration;
-use uucore::parse_time::from_str;
-assert_eq!(from_str("123"), Ok(Duration::from_secs(123)));
-assert_eq!(from_str("2d"), Ok(Duration::from_secs(60 * 60 * 24 * 2)));
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/parse_time/index.html b/coreutils/dev/uucore/parse_time/index.html deleted file mode 100644 index 6d52eb53e..000000000 --- a/coreutils/dev/uucore/parse_time/index.html +++ /dev/null @@ -1,3 +0,0 @@ -uucore::parse_time - Rust

Module uucore::parse_time

source ·
Expand description

Parsing a duration from a string.

-

Use the from_str function to parse a Duration from a string.

-

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/parse_time/sidebar-items.js b/coreutils/dev/uucore/parse_time/sidebar-items.js deleted file mode 100644 index c279fc9f3..000000000 --- a/coreutils/dev/uucore/parse_time/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["from_str"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/parse_glob/fn.from_str.html b/coreutils/dev/uucore/parser/parse_glob/fn.from_str.html deleted file mode 100644 index 5272afbd7..000000000 --- a/coreutils/dev/uucore/parser/parse_glob/fn.from_str.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/parse_glob/fn.from_str.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/parse_glob/index.html b/coreutils/dev/uucore/parser/parse_glob/index.html deleted file mode 100644 index 1d74f4c20..000000000 --- a/coreutils/dev/uucore/parser/parse_glob/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/parse_glob/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/parse_size/enum.ParseSizeError.html b/coreutils/dev/uucore/parser/parse_size/enum.ParseSizeError.html deleted file mode 100644 index d1c47d25e..000000000 --- a/coreutils/dev/uucore/parser/parse_size/enum.ParseSizeError.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/parse_size/enum.ParseSizeError.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/parse_size/fn.parse_size.html b/coreutils/dev/uucore/parser/parse_size/fn.parse_size.html deleted file mode 100644 index 2891cf150..000000000 --- a/coreutils/dev/uucore/parser/parse_size/fn.parse_size.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/parse_size/fn.parse_size.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/parse_size/index.html b/coreutils/dev/uucore/parser/parse_size/index.html deleted file mode 100644 index e95a993b8..000000000 --- a/coreutils/dev/uucore/parser/parse_size/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/parse_size/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/parse_size/struct.Parser.html b/coreutils/dev/uucore/parser/parse_size/struct.Parser.html deleted file mode 100644 index 2b684a3d3..000000000 --- a/coreutils/dev/uucore/parser/parse_size/struct.Parser.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/parse_size/struct.Parser.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/parse_time/fn.from_str.html b/coreutils/dev/uucore/parser/parse_time/fn.from_str.html deleted file mode 100644 index 7bf0fa0a2..000000000 --- a/coreutils/dev/uucore/parser/parse_time/fn.from_str.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/parse_time/fn.from_str.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/parse_time/index.html b/coreutils/dev/uucore/parser/parse_time/index.html deleted file mode 100644 index 4e80d2b2e..000000000 --- a/coreutils/dev/uucore/parser/parse_time/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/parse_time/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/shortcut_value_parser/index.html b/coreutils/dev/uucore/parser/shortcut_value_parser/index.html deleted file mode 100644 index 103683d6c..000000000 --- a/coreutils/dev/uucore/parser/shortcut_value_parser/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/shortcut_value_parser/index.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/parser/shortcut_value_parser/struct.ShortcutValueParser.html b/coreutils/dev/uucore/parser/shortcut_value_parser/struct.ShortcutValueParser.html deleted file mode 100644 index 9ca500b19..000000000 --- a/coreutils/dev/uucore/parser/shortcut_value_parser/struct.ShortcutValueParser.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../uucore/shortcut_value_parser/struct.ShortcutValueParser.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/fn.get_groups.html b/coreutils/dev/uucore/perms/entries/fn.get_groups.html deleted file mode 100644 index c7b6ee0a4..000000000 --- a/coreutils/dev/uucore/perms/entries/fn.get_groups.html +++ /dev/null @@ -1,10 +0,0 @@ -get_groups in uucore::perms::entries - Rust

Function uucore::perms::entries::get_groups

source ·
pub fn get_groups() -> IOResult<Vec<gid_t>>
Expand description

From: <https://man7.org/linux/man-pages/man2/getgroups.2.html>

-
-

getgroups() returns the supplementary group IDs of the calling -process in list. -If size is zero, list is not modified, but the total number of -supplementary group IDs for the process is returned. This allows -the caller to determine the size of a dynamically allocated list -to be used in a further call to getgroups().

-
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/fn.get_groups_gnu.html b/coreutils/dev/uucore/perms/entries/fn.get_groups_gnu.html deleted file mode 100644 index 4a4010f79..000000000 --- a/coreutils/dev/uucore/perms/entries/fn.get_groups_gnu.html +++ /dev/null @@ -1,23 +0,0 @@ -get_groups_gnu in uucore::perms::entries - Rust
pub fn get_groups_gnu(arg_id: Option<u32>) -> IOResult<Vec<gid_t>>
Expand description

The list of group IDs returned from GNU’s groups and GNU’s id --groups -starts with the effective group ID (egid). -This is a wrapper for get_groups() to mimic this behavior.

-

If arg_id is None (default), get_groups_gnu moves the effective -group id (egid) to the first entry in the returned Vector. -If arg_id is Some(x), get_groups_gnu moves the id with value x -to the first entry in the returned Vector. This might be necessary -for id --groups --real if gid and egid are not equal.

-

From: <https://www.man7.org/linux/man-pages/man3/getgroups.3p.html>

-
-

As implied by the definition of supplementary groups, the -effective group ID may appear in the array returned by -getgroups() or it may be returned only by getegid(). Duplication -may exist, but the application needs to call getegid() to be sure -of getting all of the information. Various implementation -variations and administrative sequences cause the set of groups -appearing in the result of getgroups() to vary in order and as to -whether the effective group ID is included, even when the set of -groups is the same (in the mathematical sense of ``set’’). (The -history of a process and its parents could affect the details of -the result.)

-
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/fn.gid2grp.html b/coreutils/dev/uucore/perms/entries/fn.gid2grp.html deleted file mode 100644 index 646859d8e..000000000 --- a/coreutils/dev/uucore/perms/entries/fn.gid2grp.html +++ /dev/null @@ -1 +0,0 @@ -gid2grp in uucore::perms::entries - Rust

Function uucore::perms::entries::gid2grp

source ·
pub fn gid2grp(id: gid_t) -> IOResult<String>
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/fn.grp2gid.html b/coreutils/dev/uucore/perms/entries/fn.grp2gid.html deleted file mode 100644 index 631f41674..000000000 --- a/coreutils/dev/uucore/perms/entries/fn.grp2gid.html +++ /dev/null @@ -1 +0,0 @@ -grp2gid in uucore::perms::entries - Rust

Function uucore::perms::entries::grp2gid

source ·
pub fn grp2gid(name: &str) -> IOResult<gid_t>
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/fn.uid2usr.html b/coreutils/dev/uucore/perms/entries/fn.uid2usr.html deleted file mode 100644 index ad34cb752..000000000 --- a/coreutils/dev/uucore/perms/entries/fn.uid2usr.html +++ /dev/null @@ -1 +0,0 @@ -uid2usr in uucore::perms::entries - Rust

Function uucore::perms::entries::uid2usr

source ·
pub fn uid2usr(id: uid_t) -> IOResult<String>
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/fn.usr2uid.html b/coreutils/dev/uucore/perms/entries/fn.usr2uid.html deleted file mode 100644 index 3b080e5c2..000000000 --- a/coreutils/dev/uucore/perms/entries/fn.usr2uid.html +++ /dev/null @@ -1 +0,0 @@ -usr2uid in uucore::perms::entries - Rust

Function uucore::perms::entries::usr2uid

source ·
pub fn usr2uid(name: &str) -> IOResult<uid_t>
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/index.html b/coreutils/dev/uucore/perms/entries/index.html deleted file mode 100644 index 9e2f5b214..000000000 --- a/coreutils/dev/uucore/perms/entries/index.html +++ /dev/null @@ -1,25 +0,0 @@ -uucore::perms::entries - Rust

Module uucore::perms::entries

source ·
Expand description

Get password/group file entry

-

Examples:

-
use uucore::entries::{self, Locate};
-
-let root_group = if cfg!(any(target_os = "linux", target_os = "android")) {
-    "root"
-} else {
-    "wheel"
-};
-
-assert_eq!("root", entries::uid2usr(0).unwrap());
-assert_eq!(0, entries::usr2uid("root").unwrap());
-assert!(entries::gid2grp(0).is_ok());
-assert!(entries::grp2gid(root_group).is_ok());
-
-assert!(entries::Passwd::locate(0).is_ok());
-assert!(entries::Passwd::locate("0").is_ok());
-assert!(entries::Passwd::locate("root").is_ok());
-
-assert!(entries::Group::locate(0).is_ok());
-assert!(entries::Group::locate("0").is_ok());
-assert!(entries::Group::locate(root_group).is_ok());
-

Structs

Traits

Functions

  • From: <https://man7.org/linux/man-pages/man2/getgroups.2.html>
  • The list of group IDs returned from GNU’s groups and GNU’s id --groups -starts with the effective group ID (egid). -This is a wrapper for get_groups() to mimic this behavior.
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/sidebar-items.js b/coreutils/dev/uucore/perms/entries/sidebar-items.js deleted file mode 100644 index f3f8ce800..000000000 --- a/coreutils/dev/uucore/perms/entries/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["get_groups","get_groups_gnu","gid2grp","grp2gid","uid2usr","usr2uid"],"struct":["Group","Passwd"],"trait":["Locate"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/struct.Group.html b/coreutils/dev/uucore/perms/entries/struct.Group.html deleted file mode 100644 index a14cdc1f0..000000000 --- a/coreutils/dev/uucore/perms/entries/struct.Group.html +++ /dev/null @@ -1,17 +0,0 @@ -Group in uucore::perms::entries - Rust

Struct uucore::perms::entries::Group

source ·
pub struct Group {
-    pub name: String,
-    pub gid: gid_t,
-}

Fields§

§name: String

AKA group.gr_name

-
§gid: gid_t

AKA group.gr_gid

-

Trait Implementations§

source§

impl Clone for Group

source§

fn clone(&self) -> Group

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Group

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Locate<&'a str> for Group

source§

fn locate(k: &'a str) -> IOResult<Self>

source§

impl Locate<u32> for Group

source§

fn locate(k: gid_t) -> IOResult<Self>

Auto Trait Implementations§

§

impl RefUnwindSafe for Group

§

impl Send for Group

§

impl Sync for Group

§

impl Unpin for Group

§

impl UnwindSafe for Group

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/struct.Passwd.html b/coreutils/dev/uucore/perms/entries/struct.Passwd.html deleted file mode 100644 index 39225765b..000000000 --- a/coreutils/dev/uucore/perms/entries/struct.Passwd.html +++ /dev/null @@ -1,41 +0,0 @@ -Passwd in uucore::perms::entries - Rust

Struct uucore::perms::entries::Passwd

source ·
pub struct Passwd {
-    pub name: String,
-    pub uid: uid_t,
-    pub gid: gid_t,
-    pub user_info: Option<String>,
-    pub user_shell: Option<String>,
-    pub user_dir: Option<String>,
-    pub user_passwd: Option<String>,
-}

Fields§

§name: String

AKA passwd.pw_name

-
§uid: uid_t

AKA passwd.pw_uid

-
§gid: gid_t

AKA passwd.pw_gid

-
§user_info: Option<String>

AKA passwd.pw_gecos

-
§user_shell: Option<String>

AKA passwd.pw_shell

-
§user_dir: Option<String>

AKA passwd.pw_dir

-
§user_passwd: Option<String>

AKA passwd.pw_passwd

-

Implementations§

source§

impl Passwd

source

pub fn belongs_to(&self) -> Vec<gid_t>

This is a wrapper function for libc::getgrouplist.

-

From: <https://man7.org/linux/man-pages/man3/getgrouplist.3.html>

-
-

If the number of groups of which user is a member is less than or -equal to *ngroups, then the value *ngroups is returned. -If the user is a member of more than *ngroups groups, then -getgrouplist() returns -1. In this case, the value returned in -*ngroups can be used to resize the buffer passed to a further -call getgrouplist().

-
-

However, on macOS/darwin (and maybe others?) getgrouplist does -not update ngroups if ngroups is too small. Therefore, if not -updated by getgrouplist, ngroups needs to be increased in a -loop until getgrouplist stops returning -1.

-

Trait Implementations§

source§

impl Clone for Passwd

source§

fn clone(&self) -> Passwd

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Passwd

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Locate<&'a str> for Passwd

source§

fn locate(k: &'a str) -> IOResult<Self>

source§

impl Locate<u32> for Passwd

source§

fn locate(k: uid_t) -> IOResult<Self>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/entries/trait.Locate.html b/coreutils/dev/uucore/perms/entries/trait.Locate.html deleted file mode 100644 index a1c795113..000000000 --- a/coreutils/dev/uucore/perms/entries/trait.Locate.html +++ /dev/null @@ -1,7 +0,0 @@ -Locate in uucore::perms::entries - Rust

Trait uucore::perms::entries::Locate

source ·
pub trait Locate<K> {
-    // Required method
-    fn locate(key: K) -> IOResult<Self>
-       where Self: Sized;
-}
Expand description

Fetch desired entry.

-

Required Methods§

source

fn locate(key: K) -> IOResult<Self>where - Self: Sized,

Implementors§

source§

impl Locate<u32> for Group

source§

impl Locate<u32> for Passwd

source§

impl<'a> Locate<&'a str> for Group

source§

impl<'a> Locate<&'a str> for Passwd

\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/enum.IfFrom.html b/coreutils/dev/uucore/perms/enum.IfFrom.html deleted file mode 100644 index f60e03f0e..000000000 --- a/coreutils/dev/uucore/perms/enum.IfFrom.html +++ /dev/null @@ -1,16 +0,0 @@ -IfFrom in uucore::perms - Rust

Enum uucore::perms::IfFrom

source ·
pub enum IfFrom {
-    All,
-    User(u32),
-    Group(u32),
-    UserGroup(u32, u32),
-}

Variants§

§

All

§

User(u32)

§

Group(u32)

§

UserGroup(u32, u32)

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/enum.TraverseSymlinks.html b/coreutils/dev/uucore/perms/enum.TraverseSymlinks.html deleted file mode 100644 index c59c1eee3..000000000 --- a/coreutils/dev/uucore/perms/enum.TraverseSymlinks.html +++ /dev/null @@ -1,17 +0,0 @@ -TraverseSymlinks in uucore::perms - Rust
pub enum TraverseSymlinks {
-    None,
-    First,
-    All,
-}

Variants§

§

None

§

First

§

All

Trait Implementations§

source§

fn eq(&self, other: &TraverseSymlinks) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
§

type Output = T

Should always be Self
§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/enum.VerbosityLevel.html b/coreutils/dev/uucore/perms/enum.VerbosityLevel.html deleted file mode 100644 index 0d7112e38..000000000 --- a/coreutils/dev/uucore/perms/enum.VerbosityLevel.html +++ /dev/null @@ -1,20 +0,0 @@ -VerbosityLevel in uucore::perms - Rust
pub enum VerbosityLevel {
-    Silent,
-    Changes,
-    Verbose,
-    Normal,
-}
Expand description

The various level of verbosity

-

Variants§

§

Silent

§

Changes

§

Verbose

§

Normal

Trait Implementations§

source§

impl Clone for VerbosityLevel

source§

fn clone(&self) -> VerbosityLevel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VerbosityLevel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<VerbosityLevel> for VerbosityLevel

source§

fn eq(&self, other: &VerbosityLevel) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for VerbosityLevel

source§

impl StructuralEq for VerbosityLevel

source§

impl StructuralPartialEq for VerbosityLevel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/fn.chown_base.html b/coreutils/dev/uucore/perms/fn.chown_base.html deleted file mode 100644 index 91f827e54..000000000 --- a/coreutils/dev/uucore/perms/fn.chown_base.html +++ /dev/null @@ -1,13 +0,0 @@ -chown_base in uucore::perms - Rust

Function uucore::perms::chown_base

source ·
pub fn chown_base(
-    command: Command,
-    args: impl Args,
-    add_arg_if_not_reference: &'static str,
-    parse_gid_uid_and_filter: fn(_: &ArgMatches) -> UResult<GidUidOwnerFilter>,
-    groups_only: bool
-) -> UResult<()>
Expand description

Base implementation for chgrp and chown.

-

An argument called add_arg_if_not_reference will be added to command if -args does not contain the --reference option. -parse_gid_uid_and_filter will be called to obtain the target gid and uid, and the filter, -from ArgMatches. -groups_only determines whether verbose output will only mention the group.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/fn.wrap_chown.html b/coreutils/dev/uucore/perms/fn.wrap_chown.html deleted file mode 100644 index fcd6b12f1..000000000 --- a/coreutils/dev/uucore/perms/fn.wrap_chown.html +++ /dev/null @@ -1,11 +0,0 @@ -wrap_chown in uucore::perms - Rust

Function uucore::perms::wrap_chown

source ·
pub fn wrap_chown<P: AsRef<Path>>(
-    path: P,
-    meta: &Metadata,
-    dest_uid: Option<u32>,
-    dest_gid: Option<u32>,
-    follow: bool,
-    verbosity: Verbosity
-) -> Result<String, String>
Expand description

Perform the change of owner on a path -with the various options -and error messages management

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/index.html b/coreutils/dev/uucore/perms/index.html deleted file mode 100644 index 52cc19596..000000000 --- a/coreutils/dev/uucore/perms/index.html +++ /dev/null @@ -1,4 +0,0 @@ -uucore::perms - Rust

Module uucore::perms

source ·
Expand description

Common functions to manage permissions

-

Modules

Structs

Enums

Functions

  • Base implementation for chgrp and chown.
  • Perform the change of owner on a path -with the various options -and error messages management
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/constant.ARG_FILES.html b/coreutils/dev/uucore/perms/options/constant.ARG_FILES.html deleted file mode 100644 index f76d7d971..000000000 --- a/coreutils/dev/uucore/perms/options/constant.ARG_FILES.html +++ /dev/null @@ -1 +0,0 @@ -ARG_FILES in uucore::perms::options - Rust

Constant uucore::perms::options::ARG_FILES

source ·
pub const ARG_FILES: &str = "FILE";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/constant.ARG_GROUP.html b/coreutils/dev/uucore/perms/options/constant.ARG_GROUP.html deleted file mode 100644 index f5596d07b..000000000 --- a/coreutils/dev/uucore/perms/options/constant.ARG_GROUP.html +++ /dev/null @@ -1 +0,0 @@ -ARG_GROUP in uucore::perms::options - Rust

Constant uucore::perms::options::ARG_GROUP

source ·
pub const ARG_GROUP: &str = "GROUP";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/constant.ARG_OWNER.html b/coreutils/dev/uucore/perms/options/constant.ARG_OWNER.html deleted file mode 100644 index d6d2ac156..000000000 --- a/coreutils/dev/uucore/perms/options/constant.ARG_OWNER.html +++ /dev/null @@ -1 +0,0 @@ -ARG_OWNER in uucore::perms::options - Rust

Constant uucore::perms::options::ARG_OWNER

source ·
pub const ARG_OWNER: &str = "OWNER";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/constant.FROM.html b/coreutils/dev/uucore/perms/options/constant.FROM.html deleted file mode 100644 index 609a836a7..000000000 --- a/coreutils/dev/uucore/perms/options/constant.FROM.html +++ /dev/null @@ -1 +0,0 @@ -FROM in uucore::perms::options - Rust

Constant uucore::perms::options::FROM

source ·
pub const FROM: &str = "from";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/constant.HELP.html b/coreutils/dev/uucore/perms/options/constant.HELP.html deleted file mode 100644 index f14bfe4b2..000000000 --- a/coreutils/dev/uucore/perms/options/constant.HELP.html +++ /dev/null @@ -1 +0,0 @@ -HELP in uucore::perms::options - Rust

Constant uucore::perms::options::HELP

source ·
pub const HELP: &str = "help";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/constant.RECURSIVE.html b/coreutils/dev/uucore/perms/options/constant.RECURSIVE.html deleted file mode 100644 index 29cf16d25..000000000 --- a/coreutils/dev/uucore/perms/options/constant.RECURSIVE.html +++ /dev/null @@ -1 +0,0 @@ -RECURSIVE in uucore::perms::options - Rust

Constant uucore::perms::options::RECURSIVE

source ·
pub const RECURSIVE: &str = "recursive";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/constant.REFERENCE.html b/coreutils/dev/uucore/perms/options/constant.REFERENCE.html deleted file mode 100644 index 1d664784d..000000000 --- a/coreutils/dev/uucore/perms/options/constant.REFERENCE.html +++ /dev/null @@ -1 +0,0 @@ -REFERENCE in uucore::perms::options - Rust

Constant uucore::perms::options::REFERENCE

source ·
pub const REFERENCE: &str = "reference";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/dereference/constant.DEREFERENCE.html b/coreutils/dev/uucore/perms/options/dereference/constant.DEREFERENCE.html deleted file mode 100644 index 2bbbfe05a..000000000 --- a/coreutils/dev/uucore/perms/options/dereference/constant.DEREFERENCE.html +++ /dev/null @@ -1 +0,0 @@ -DEREFERENCE in uucore::perms::options::dereference - Rust
pub const DEREFERENCE: &str = "dereference";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/dereference/constant.NO_DEREFERENCE.html b/coreutils/dev/uucore/perms/options/dereference/constant.NO_DEREFERENCE.html deleted file mode 100644 index 6d371bccc..000000000 --- a/coreutils/dev/uucore/perms/options/dereference/constant.NO_DEREFERENCE.html +++ /dev/null @@ -1 +0,0 @@ -NO_DEREFERENCE in uucore::perms::options::dereference - Rust
pub const NO_DEREFERENCE: &str = "no-dereference";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/dereference/index.html b/coreutils/dev/uucore/perms/options/dereference/index.html deleted file mode 100644 index c91dbf8a1..000000000 --- a/coreutils/dev/uucore/perms/options/dereference/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::perms::options::dereference - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/dereference/sidebar-items.js b/coreutils/dev/uucore/perms/options/dereference/sidebar-items.js deleted file mode 100644 index f23a92350..000000000 --- a/coreutils/dev/uucore/perms/options/dereference/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["DEREFERENCE","NO_DEREFERENCE"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/index.html b/coreutils/dev/uucore/perms/options/index.html deleted file mode 100644 index e1fa6b21c..000000000 --- a/coreutils/dev/uucore/perms/options/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::perms::options - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/preserve_root/constant.NO_PRESERVE.html b/coreutils/dev/uucore/perms/options/preserve_root/constant.NO_PRESERVE.html deleted file mode 100644 index b110cc782..000000000 --- a/coreutils/dev/uucore/perms/options/preserve_root/constant.NO_PRESERVE.html +++ /dev/null @@ -1 +0,0 @@ -NO_PRESERVE in uucore::perms::options::preserve_root - Rust
pub const NO_PRESERVE: &str = "no-preserve-root";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/preserve_root/constant.PRESERVE.html b/coreutils/dev/uucore/perms/options/preserve_root/constant.PRESERVE.html deleted file mode 100644 index 886b842af..000000000 --- a/coreutils/dev/uucore/perms/options/preserve_root/constant.PRESERVE.html +++ /dev/null @@ -1 +0,0 @@ -PRESERVE in uucore::perms::options::preserve_root - Rust
pub const PRESERVE: &str = "preserve-root";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/preserve_root/index.html b/coreutils/dev/uucore/perms/options/preserve_root/index.html deleted file mode 100644 index 0fa4a560c..000000000 --- a/coreutils/dev/uucore/perms/options/preserve_root/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::perms::options::preserve_root - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/preserve_root/sidebar-items.js b/coreutils/dev/uucore/perms/options/preserve_root/sidebar-items.js deleted file mode 100644 index 99ccf1371..000000000 --- a/coreutils/dev/uucore/perms/options/preserve_root/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["NO_PRESERVE","PRESERVE"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/sidebar-items.js b/coreutils/dev/uucore/perms/options/sidebar-items.js deleted file mode 100644 index 1bf0db0d9..000000000 --- a/coreutils/dev/uucore/perms/options/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["ARG_FILES","ARG_GROUP","ARG_OWNER","FROM","HELP","RECURSIVE","REFERENCE"],"mod":["dereference","preserve_root","traverse","verbosity"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/traverse/constant.EVERY.html b/coreutils/dev/uucore/perms/options/traverse/constant.EVERY.html deleted file mode 100644 index 94a76f650..000000000 --- a/coreutils/dev/uucore/perms/options/traverse/constant.EVERY.html +++ /dev/null @@ -1 +0,0 @@ -EVERY in uucore::perms::options::traverse - Rust

Constant uucore::perms::options::traverse::EVERY

source ·
pub const EVERY: &str = "L";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/traverse/constant.NO_TRAVERSE.html b/coreutils/dev/uucore/perms/options/traverse/constant.NO_TRAVERSE.html deleted file mode 100644 index 0c68e382e..000000000 --- a/coreutils/dev/uucore/perms/options/traverse/constant.NO_TRAVERSE.html +++ /dev/null @@ -1 +0,0 @@ -NO_TRAVERSE in uucore::perms::options::traverse - Rust
pub const NO_TRAVERSE: &str = "P";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/traverse/constant.TRAVERSE.html b/coreutils/dev/uucore/perms/options/traverse/constant.TRAVERSE.html deleted file mode 100644 index 40e5ec422..000000000 --- a/coreutils/dev/uucore/perms/options/traverse/constant.TRAVERSE.html +++ /dev/null @@ -1 +0,0 @@ -TRAVERSE in uucore::perms::options::traverse - Rust
pub const TRAVERSE: &str = "H";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/traverse/index.html b/coreutils/dev/uucore/perms/options/traverse/index.html deleted file mode 100644 index f69dd4066..000000000 --- a/coreutils/dev/uucore/perms/options/traverse/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::perms::options::traverse - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/traverse/sidebar-items.js b/coreutils/dev/uucore/perms/options/traverse/sidebar-items.js deleted file mode 100644 index 7604ba605..000000000 --- a/coreutils/dev/uucore/perms/options/traverse/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["EVERY","NO_TRAVERSE","TRAVERSE"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/verbosity/constant.CHANGES.html b/coreutils/dev/uucore/perms/options/verbosity/constant.CHANGES.html deleted file mode 100644 index e21fb996f..000000000 --- a/coreutils/dev/uucore/perms/options/verbosity/constant.CHANGES.html +++ /dev/null @@ -1 +0,0 @@ -CHANGES in uucore::perms::options::verbosity - Rust
pub const CHANGES: &str = "changes";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/verbosity/constant.QUIET.html b/coreutils/dev/uucore/perms/options/verbosity/constant.QUIET.html deleted file mode 100644 index 1e7644aa7..000000000 --- a/coreutils/dev/uucore/perms/options/verbosity/constant.QUIET.html +++ /dev/null @@ -1 +0,0 @@ -QUIET in uucore::perms::options::verbosity - Rust

Constant uucore::perms::options::verbosity::QUIET

source ·
pub const QUIET: &str = "quiet";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/verbosity/constant.SILENT.html b/coreutils/dev/uucore/perms/options/verbosity/constant.SILENT.html deleted file mode 100644 index 47a45ca3d..000000000 --- a/coreutils/dev/uucore/perms/options/verbosity/constant.SILENT.html +++ /dev/null @@ -1 +0,0 @@ -SILENT in uucore::perms::options::verbosity - Rust

Constant uucore::perms::options::verbosity::SILENT

source ·
pub const SILENT: &str = "silent";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/verbosity/constant.VERBOSE.html b/coreutils/dev/uucore/perms/options/verbosity/constant.VERBOSE.html deleted file mode 100644 index 5e2dfa331..000000000 --- a/coreutils/dev/uucore/perms/options/verbosity/constant.VERBOSE.html +++ /dev/null @@ -1 +0,0 @@ -VERBOSE in uucore::perms::options::verbosity - Rust
pub const VERBOSE: &str = "verbose";
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/verbosity/index.html b/coreutils/dev/uucore/perms/options/verbosity/index.html deleted file mode 100644 index a67614464..000000000 --- a/coreutils/dev/uucore/perms/options/verbosity/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::perms::options::verbosity - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/options/verbosity/sidebar-items.js b/coreutils/dev/uucore/perms/options/verbosity/sidebar-items.js deleted file mode 100644 index 29b5adf85..000000000 --- a/coreutils/dev/uucore/perms/options/verbosity/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["CHANGES","QUIET","SILENT","VERBOSE"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/perms/sidebar-items.js b/coreutils/dev/uucore/perms/sidebar-items.js deleted file mode 100644 index f619c8fcf..000000000 --- a/coreutils/dev/uucore/perms/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["IfFrom","TraverseSymlinks","VerbosityLevel"],"fn":["chown_base","wrap_chown"],"mod":["entries","options"],"struct":["ChownExecutor","GidUidOwnerFilter","Verbosity"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/perms/struct.ChownExecutor.html b/coreutils/dev/uucore/perms/struct.ChownExecutor.html deleted file mode 100644 index 6cb5a6be9..000000000 --- a/coreutils/dev/uucore/perms/struct.ChownExecutor.html +++ /dev/null @@ -1,22 +0,0 @@ -ChownExecutor in uucore::perms - Rust

Struct uucore::perms::ChownExecutor

source ·
pub struct ChownExecutor {
-    pub dest_uid: Option<u32>,
-    pub dest_gid: Option<u32>,
-    pub raw_owner: String,
-    pub traverse_symlinks: TraverseSymlinks,
-    pub verbosity: Verbosity,
-    pub filter: IfFrom,
-    pub files: Vec<String>,
-    pub recursive: bool,
-    pub preserve_root: bool,
-    pub dereference: bool,
-}

Fields§

§dest_uid: Option<u32>§dest_gid: Option<u32>§raw_owner: String§traverse_symlinks: TraverseSymlinks§verbosity: Verbosity§filter: IfFrom§files: Vec<String>§recursive: bool§preserve_root: bool§dereference: bool

Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/struct.GidUidOwnerFilter.html b/coreutils/dev/uucore/perms/struct.GidUidOwnerFilter.html deleted file mode 100644 index 98ff11f0c..000000000 --- a/coreutils/dev/uucore/perms/struct.GidUidOwnerFilter.html +++ /dev/null @@ -1,16 +0,0 @@ -GidUidOwnerFilter in uucore::perms - Rust
pub struct GidUidOwnerFilter {
-    pub dest_gid: Option<u32>,
-    pub dest_uid: Option<u32>,
-    pub raw_owner: String,
-    pub filter: IfFrom,
-}

Fields§

§dest_gid: Option<u32>§dest_uid: Option<u32>§raw_owner: String§filter: IfFrom

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/perms/struct.Verbosity.html b/coreutils/dev/uucore/perms/struct.Verbosity.html deleted file mode 100644 index a037ff4b7..000000000 --- a/coreutils/dev/uucore/perms/struct.Verbosity.html +++ /dev/null @@ -1,17 +0,0 @@ -Verbosity in uucore::perms - Rust

Struct uucore::perms::Verbosity

source ·
pub struct Verbosity {
-    pub groups_only: bool,
-    pub level: VerbosityLevel,
-}

Fields§

§groups_only: bool§level: VerbosityLevel

Trait Implementations§

source§

impl Clone for Verbosity

source§

fn clone(&self) -> Verbosity

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Verbosity

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Verbosity> for Verbosity

source§

fn eq(&self, other: &Verbosity) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for Verbosity

source§

impl StructuralEq for Verbosity

source§

impl StructuralPartialEq for Verbosity

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/pipes/fn.pipe.html b/coreutils/dev/uucore/pipes/fn.pipe.html deleted file mode 100644 index 4232f317b..000000000 --- a/coreutils/dev/uucore/pipes/fn.pipe.html +++ /dev/null @@ -1,4 +0,0 @@ -pipe in uucore::pipes - Rust

Function uucore::pipes::pipe

source ·
pub fn pipe() -> Result<(File, File)>
Expand description

A wrapper around [nix::unistd::pipe] that ensures the pipe is cleaned up.

-

Returns two File objects: everything written to the second can be read -from the first.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/pipes/fn.splice.html b/coreutils/dev/uucore/pipes/fn.splice.html deleted file mode 100644 index ed490edfa..000000000 --- a/coreutils/dev/uucore/pipes/fn.splice.html +++ /dev/null @@ -1,12 +0,0 @@ -splice in uucore::pipes - Rust

Function uucore::pipes::splice

source ·
pub fn splice(
-    source: &impl AsRawFd,
-    target: &impl AsRawFd,
-    len: usize
-) -> Result<usize>
Expand description

Less noisy wrapper around [nix::fcntl::splice].

-

Up to len bytes are moved from source to target. Returns the number -of successfully moved bytes.

-

At least one of source and target must be some sort of pipe. -To get around this requirement, consider splicing from your source into -a pipe and then from the pipe into your target (with splice_exact): -this is still very efficient.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/pipes/fn.splice_exact.html b/coreutils/dev/uucore/pipes/fn.splice_exact.html deleted file mode 100644 index 3b8c6c673..000000000 --- a/coreutils/dev/uucore/pipes/fn.splice_exact.html +++ /dev/null @@ -1,8 +0,0 @@ -splice_exact in uucore::pipes - Rust

Function uucore::pipes::splice_exact

source ·
pub fn splice_exact(
-    source: &impl AsRawFd,
-    target: &impl AsRawFd,
-    len: usize
-) -> Result<()>
Expand description

Splice wrapper which fully finishes the write.

-

Exactly len bytes are moved from source into target.

-

Panics if source runs out of data before len bytes have been moved.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/pipes/fn.vmsplice.html b/coreutils/dev/uucore/pipes/fn.vmsplice.html deleted file mode 100644 index af067cc06..000000000 --- a/coreutils/dev/uucore/pipes/fn.vmsplice.html +++ /dev/null @@ -1,3 +0,0 @@ -vmsplice in uucore::pipes - Rust

Function uucore::pipes::vmsplice

source ·
pub fn vmsplice(target: &impl AsRawFd, bytes: &[u8]) -> Result<usize>
Expand description

Copy data from bytes into target, which must be a pipe.

-

Returns the number of successfully copied bytes.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/pipes/index.html b/coreutils/dev/uucore/pipes/index.html deleted file mode 100644 index d901a053e..000000000 --- a/coreutils/dev/uucore/pipes/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::pipes - Rust

Module uucore::pipes

source ·

Functions

  • A wrapper around [nix::unistd::pipe] that ensures the pipe is cleaned up.
  • Less noisy wrapper around [nix::fcntl::splice].
  • Splice wrapper which fully finishes the write.
  • Copy data from bytes into target, which must be a pipe.

Type Definitions

\ No newline at end of file diff --git a/coreutils/dev/uucore/pipes/sidebar-items.js b/coreutils/dev/uucore/pipes/sidebar-items.js deleted file mode 100644 index 8b00cad2b..000000000 --- a/coreutils/dev/uucore/pipes/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["pipe","splice","splice_exact","vmsplice"],"type":["Error","Result"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/pipes/type.Error.html b/coreutils/dev/uucore/pipes/type.Error.html deleted file mode 100644 index 884dd76cb..000000000 --- a/coreutils/dev/uucore/pipes/type.Error.html +++ /dev/null @@ -1,12 +0,0 @@ -Error in uucore::pipes - Rust

Type Definition uucore::pipes::Error

pub type Error = Errno;
Expand description

Nix’s main error type.

-

It’s a wrapper around Errno. As such, it’s very interoperable with -std::io::Error, but it has the advantages of:

-
    -
  • Clone
  • -
  • Copy
  • -
  • Eq
  • -
  • Small size
  • -
  • Represents all of the system’s errnos, instead of just the most common -ones.
  • -
-

Trait Implementations§

source§

impl<T> FromIo<Result<T, Box<dyn UError + 'static, Global>>> for Error

source§

fn map_err_context(self, context: impl FnOnce() -> String) -> UResult<T>

\ No newline at end of file diff --git a/coreutils/dev/uucore/pipes/type.Result.html b/coreutils/dev/uucore/pipes/type.Result.html deleted file mode 100644 index 9085b2f1e..000000000 --- a/coreutils/dev/uucore/pipes/type.Result.html +++ /dev/null @@ -1,2 +0,0 @@ -Result in uucore::pipes - Rust

Type Definition uucore::pipes::Result

pub type Result<T> = Result<T, Errno>;
Expand description

Nix Result Type

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/process/fn.getegid.html b/coreutils/dev/uucore/process/fn.getegid.html deleted file mode 100644 index 785cf95a7..000000000 --- a/coreutils/dev/uucore/process/fn.getegid.html +++ /dev/null @@ -1,2 +0,0 @@ -getegid in uucore::process - Rust

Function uucore::process::getegid

source ·
pub fn getegid() -> gid_t
Expand description

getegid() returns the effective group ID of the calling process.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/process/fn.geteuid.html b/coreutils/dev/uucore/process/fn.geteuid.html deleted file mode 100644 index f3a7dc039..000000000 --- a/coreutils/dev/uucore/process/fn.geteuid.html +++ /dev/null @@ -1,2 +0,0 @@ -geteuid in uucore::process - Rust

Function uucore::process::geteuid

source ·
pub fn geteuid() -> uid_t
Expand description

geteuid() returns the effective user ID of the calling process.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/process/fn.getgid.html b/coreutils/dev/uucore/process/fn.getgid.html deleted file mode 100644 index 36c7a7d9d..000000000 --- a/coreutils/dev/uucore/process/fn.getgid.html +++ /dev/null @@ -1,2 +0,0 @@ -getgid in uucore::process - Rust

Function uucore::process::getgid

source ·
pub fn getgid() -> gid_t
Expand description

getgid() returns the real group ID of the calling process.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/process/fn.getuid.html b/coreutils/dev/uucore/process/fn.getuid.html deleted file mode 100644 index 2360ffac3..000000000 --- a/coreutils/dev/uucore/process/fn.getuid.html +++ /dev/null @@ -1,2 +0,0 @@ -getuid in uucore::process - Rust

Function uucore::process::getuid

source ·
pub fn getuid() -> uid_t
Expand description

getuid() returns the real user ID of the calling process.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore/process/index.html b/coreutils/dev/uucore/process/index.html deleted file mode 100644 index d4d67088b..000000000 --- a/coreutils/dev/uucore/process/index.html +++ /dev/null @@ -1,2 +0,0 @@ -uucore::process - Rust

Module uucore::process

source ·
Expand description

Set of functions to manage IDs

-

Traits

  • Missing methods for Child objects

Functions

  • getegid() returns the effective group ID of the calling process.
  • geteuid() returns the effective user ID of the calling process.
  • getgid() returns the real group ID of the calling process.
  • getuid() returns the real user ID of the calling process.
\ No newline at end of file diff --git a/coreutils/dev/uucore/process/sidebar-items.js b/coreutils/dev/uucore/process/sidebar-items.js deleted file mode 100644 index 1c2b8cf6e..000000000 --- a/coreutils/dev/uucore/process/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["getegid","geteuid","getgid","getuid"],"trait":["ChildExt"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/process/trait.ChildExt.html b/coreutils/dev/uucore/process/trait.ChildExt.html deleted file mode 100644 index 9a18d380c..000000000 --- a/coreutils/dev/uucore/process/trait.ChildExt.html +++ /dev/null @@ -1,16 +0,0 @@ -ChildExt in uucore::process - Rust

Trait uucore::process::ChildExt

source ·
pub trait ChildExt {
-    // Required methods
-    fn send_signal(&mut self, signal: usize) -> Result<()>;
-    fn send_signal_group(&mut self, signal: usize) -> Result<()>;
-    fn wait_or_timeout(
-        &mut self,
-        timeout: Duration
-    ) -> Result<Option<ExitStatus>>;
-}
Expand description

Missing methods for Child objects

-

Required Methods§

source

fn send_signal(&mut self, signal: usize) -> Result<()>

Send a signal to a Child process.

-

Caller beware: if the process already exited then you may accidentally -send the signal to an unrelated process that recycled the PID.

-
source

fn send_signal_group(&mut self, signal: usize) -> Result<()>

Send a signal to a process group.

-
source

fn wait_or_timeout(&mut self, timeout: Duration) -> Result<Option<ExitStatus>>

Wait for a process to finish or return after the specified duration. -A timeout of zero disables the timeout.

-

Implementations on Foreign Types§

source§

impl ChildExt for Child

source§

fn send_signal(&mut self, signal: usize) -> Result<()>

source§

fn send_signal_group(&mut self, signal: usize) -> Result<()>

source§

fn wait_or_timeout(&mut self, timeout: Duration) -> Result<Option<ExitStatus>>

Implementors§

\ No newline at end of file diff --git a/coreutils/dev/uucore/quoting_style/enum.Quotes.html b/coreutils/dev/uucore/quoting_style/enum.Quotes.html deleted file mode 100644 index 7e5c8ab40..000000000 --- a/coreutils/dev/uucore/quoting_style/enum.Quotes.html +++ /dev/null @@ -1,16 +0,0 @@ -Quotes in uucore::quoting_style - Rust
pub enum Quotes {
-    None,
-    Single,
-    Double,
-}

Variants§

§

None

§

Single

§

Double

Trait Implementations§

source§

impl Clone for Quotes

source§

fn clone(&self) -> Quotes

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for Quotes

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/quoting_style/enum.QuotingStyle.html b/coreutils/dev/uucore/quoting_style/enum.QuotingStyle.html deleted file mode 100644 index fd0fc05d7..000000000 --- a/coreutils/dev/uucore/quoting_style/enum.QuotingStyle.html +++ /dev/null @@ -1,23 +0,0 @@ -QuotingStyle in uucore::quoting_style - Rust
pub enum QuotingStyle {
-    Shell {
-        escape: bool,
-        always_quote: bool,
-        show_control: bool,
-    },
-    C {
-        quotes: Quotes,
-    },
-    Literal {
-        show_control: bool,
-    },
-}

Variants§

§

Shell

Fields

§escape: bool
§always_quote: bool
§show_control: bool
§

C

Fields

§quotes: Quotes
§

Literal

Fields

§show_control: bool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/quoting_style/fn.escape_name.html b/coreutils/dev/uucore/quoting_style/fn.escape_name.html deleted file mode 100644 index 4080eb3e6..000000000 --- a/coreutils/dev/uucore/quoting_style/fn.escape_name.html +++ /dev/null @@ -1 +0,0 @@ -escape_name in uucore::quoting_style - Rust
pub fn escape_name(name: &OsStr, style: &QuotingStyle) -> String
\ No newline at end of file diff --git a/coreutils/dev/uucore/quoting_style/index.html b/coreutils/dev/uucore/quoting_style/index.html deleted file mode 100644 index 9891ae9e2..000000000 --- a/coreutils/dev/uucore/quoting_style/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::quoting_style - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/quoting_style/sidebar-items.js b/coreutils/dev/uucore/quoting_style/sidebar-items.js deleted file mode 100644 index 18c1392e2..000000000 --- a/coreutils/dev/uucore/quoting_style/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["Quotes","QuotingStyle"],"fn":["escape_name"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/ranges/fn.complement.html b/coreutils/dev/uucore/ranges/fn.complement.html deleted file mode 100644 index 6df6f4231..000000000 --- a/coreutils/dev/uucore/ranges/fn.complement.html +++ /dev/null @@ -1 +0,0 @@ -complement in uucore::ranges - Rust

Function uucore::ranges::complement

source ·
pub fn complement(ranges: &[Range]) -> Vec<Range>
\ No newline at end of file diff --git a/coreutils/dev/uucore/ranges/fn.contain.html b/coreutils/dev/uucore/ranges/fn.contain.html deleted file mode 100644 index e57134698..000000000 --- a/coreutils/dev/uucore/ranges/fn.contain.html +++ /dev/null @@ -1,16 +0,0 @@ -contain in uucore::ranges - Rust

Function uucore::ranges::contain

source ·
pub fn contain(ranges: &[Range], n: usize) -> bool
Expand description

Test if at least one of the given Ranges contain the supplied value.

-

Examples:

- -
let ranges = uucore::ranges::Range::from_list("11,2,6-8").unwrap();
-
-assert!(!uucore::ranges::contain(&ranges, 0));
-assert!(!uucore::ranges::contain(&ranges, 1));
-assert!(!uucore::ranges::contain(&ranges, 5));
-assert!(!uucore::ranges::contain(&ranges, 10));
-
-assert!(uucore::ranges::contain(&ranges, 2));
-assert!(uucore::ranges::contain(&ranges, 6));
-assert!(uucore::ranges::contain(&ranges, 7));
-assert!(uucore::ranges::contain(&ranges, 8));
-assert!(uucore::ranges::contain(&ranges, 11));
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/ranges/index.html b/coreutils/dev/uucore/ranges/index.html deleted file mode 100644 index 687188ca8..000000000 --- a/coreutils/dev/uucore/ranges/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::ranges - Rust

Module uucore::ranges

source ·

Structs

Functions

  • Test if at least one of the given Ranges contain the supplied value.
\ No newline at end of file diff --git a/coreutils/dev/uucore/ranges/sidebar-items.js b/coreutils/dev/uucore/ranges/sidebar-items.js deleted file mode 100644 index 47f4f03da..000000000 --- a/coreutils/dev/uucore/ranges/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["complement","contain"],"struct":["Range"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/ranges/struct.Range.html b/coreutils/dev/uucore/ranges/struct.Range.html deleted file mode 100644 index 1730b583f..000000000 --- a/coreutils/dev/uucore/ranges/struct.Range.html +++ /dev/null @@ -1,34 +0,0 @@ -Range in uucore::ranges - Rust

Struct uucore::ranges::Range

source ·
pub struct Range {
-    pub low: usize,
-    pub high: usize,
-}

Fields§

§low: usize§high: usize

Implementations§

source§

impl Range

source

pub fn from_list(list: &str) -> Result<Vec<Self>, String>

Trait Implementations§

source§

impl Debug for Range

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromStr for Range

source§

fn from_str(s: &str) -> Result<Self, &'static str>

Parse a string of the form a-b into a Range

- -
use std::str::FromStr;
-use uucore::ranges::Range;
-assert_eq!(Range::from_str("5"), Ok(Range { low: 5, high: 5 }));
-assert_eq!(Range::from_str("4-"), Ok(Range { low: 4, high: usize::MAX - 1 }));
-assert_eq!(Range::from_str("-4"), Ok(Range { low: 1, high: 4 }));
-assert_eq!(Range::from_str("2-4"), Ok(Range { low: 2, high: 4 }));
-assert!(Range::from_str("0-4").is_err());
-assert!(Range::from_str("4-2").is_err());
-assert!(Range::from_str("-").is_err());
-assert!(Range::from_str("a").is_err());
-assert!(Range::from_str("a-b").is_err());
-
§

type Err = &'static str

The associated error which can be returned from parsing.
source§

impl Ord for Range

source§

fn cmp(&self, other: &Range) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Range> for Range

source§

fn eq(&self, other: &Range) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Range> for Range

source§

fn partial_cmp(&self, other: &Range) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Eq for Range

source§

impl StructuralEq for Range

source§

impl StructuralPartialEq for Range

Auto Trait Implementations§

§

impl RefUnwindSafe for Range

§

impl Send for Range

§

impl Sync for Range

§

impl Unpin for Range

§

impl UnwindSafe for Range

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/ringbuffer/index.html b/coreutils/dev/uucore/ringbuffer/index.html deleted file mode 100644 index a20049d15..000000000 --- a/coreutils/dev/uucore/ringbuffer/index.html +++ /dev/null @@ -1,2 +0,0 @@ -uucore::ringbuffer - Rust

Module uucore::ringbuffer

source ·
Expand description

A fixed-size ring buffer.

-

Structs

  • A fixed-size ring buffer backed by a VecDeque.
\ No newline at end of file diff --git a/coreutils/dev/uucore/ringbuffer/sidebar-items.js b/coreutils/dev/uucore/ringbuffer/sidebar-items.js deleted file mode 100644 index 43b20f378..000000000 --- a/coreutils/dev/uucore/ringbuffer/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"struct":["RingBuffer"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/ringbuffer/struct.RingBuffer.html b/coreutils/dev/uucore/ringbuffer/struct.RingBuffer.html deleted file mode 100644 index a55da2a70..000000000 --- a/coreutils/dev/uucore/ringbuffer/struct.RingBuffer.html +++ /dev/null @@ -1,66 +0,0 @@ -RingBuffer in uucore::ringbuffer - Rust
pub struct RingBuffer<T> {
-    pub data: VecDeque<T>,
-    /* private fields */
-}
Expand description

A fixed-size ring buffer backed by a VecDeque.

-

If the ring buffer is not full, then calling the push_back -method appends elements, as in a VecDeque. If the ring buffer -is full, then calling push_back removes the element at the -front of the buffer (in a first-in, first-out manner) before -appending the new element to the back of the buffer.

-

Use from_iter to take the last size elements from an -iterator.

-

Examples

-

After exceeding the size limit, the oldest elements are dropped in -favor of the newest element:

- -
let mut buffer: RingBuffer<u8> = RingBuffer::new(2);
-buffer.push_back(0);
-buffer.push_back(1);
-buffer.push_back(2);
-assert_eq!(vec![1, 2], buffer.data);
-

Take the last n elements from an iterator:

- -
let iter = [0, 1, 2].iter();
-let actual = RingBuffer::from_iter(iter, 2).data;
-let expected = VecDeque::from_iter([1, 2].iter());
-assert_eq!(expected, actual);
-

Fields§

§data: VecDeque<T>

Implementations§

source§

impl<T> RingBuffer<T>

source

pub fn new(size: usize) -> Self

source

pub fn from_iter(iter: impl Iterator<Item = T>, size: usize) -> Self

source

pub fn push_back(&mut self, value: T) -> Option<T>

Append a value to the end of the ring buffer.

-

If the ring buffer is not full, this method return None. If -the ring buffer is full, appending a new element will cause the -oldest element to be evicted. In that case this method returns -that element, or None.

-

In the special case where the size limit is zero, each call to -this method with input value returns Some(value), because -the input is immediately evicted.

-
Examples
-

Appending an element when the buffer is full returns the oldest -element:

- -
let mut buf = RingBuffer::new(3);
-assert_eq!(None, buf.push_back(0));
-assert_eq!(None, buf.push_back(1));
-assert_eq!(None, buf.push_back(2));
-assert_eq!(Some(0), buf.push_back(3));
-

If the size limit is zero, then this method always returns the -input value:

- -
let mut buf = RingBuffer::new(0);
-assert_eq!(Some(0), buf.push_back(0));
-assert_eq!(Some(1), buf.push_back(1));
-assert_eq!(Some(2), buf.push_back(2));
-

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for RingBuffer<T>where - T: RefUnwindSafe,

§

impl<T> Send for RingBuffer<T>where - T: Send,

§

impl<T> Sync for RingBuffer<T>where - T: Sync,

§

impl<T> Unpin for RingBuffer<T>where - T: Unpin,

§

impl<T> UnwindSafe for RingBuffer<T>where - T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/shortcut_value_parser/index.html b/coreutils/dev/uucore/shortcut_value_parser/index.html deleted file mode 100644 index c3a6a9057..000000000 --- a/coreutils/dev/uucore/shortcut_value_parser/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::shortcut_value_parser - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/shortcut_value_parser/sidebar-items.js b/coreutils/dev/uucore/shortcut_value_parser/sidebar-items.js deleted file mode 100644 index 44b7d3382..000000000 --- a/coreutils/dev/uucore/shortcut_value_parser/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"struct":["ShortcutValueParser"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/shortcut_value_parser/struct.ShortcutValueParser.html b/coreutils/dev/uucore/shortcut_value_parser/struct.ShortcutValueParser.html deleted file mode 100644 index 6e2a7ab85..000000000 --- a/coreutils/dev/uucore/shortcut_value_parser/struct.ShortcutValueParser.html +++ /dev/null @@ -1,36 +0,0 @@ -ShortcutValueParser in uucore::shortcut_value_parser - Rust
pub struct ShortcutValueParser(_);

Implementations§

source§

impl ShortcutValueParser

ShortcutValueParser is similar to clap’s PossibleValuesParser: it verifies that the value is -from an enumerated set of PossibleValue.

-

Whereas PossibleValuesParser only accepts exact matches, ShortcutValueParser also accepts -shortcuts as long as they are unambiguous.

-
source

pub fn new(values: impl Into<Self>) -> Self

Trait Implementations§

source§

impl Clone for ShortcutValueParser

source§

fn clone(&self) -> ShortcutValueParser

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<I, T> From<I> for ShortcutValueParserwhere - I: IntoIterator<Item = T>, - T: Into<PossibleValue>,

source§

fn from(values: I) -> Self

Converts to this type from the input type.
source§

impl TypedValueParser for ShortcutValueParser

§

type Value = String

Argument’s value type
source§

fn parse_ref( - &self, - cmd: &Command, - arg: Option<&Arg>, - value: &OsStr -) -> Result<Self::Value, Error>

Parse the argument value Read more
source§

fn possible_values( - &self -) -> Option<Box<dyn Iterator<Item = PossibleValue> + '_>>

Reflect on enumerated value properties Read more
§

fn parse( - &self, - cmd: &Command, - arg: Option<&Arg>, - value: OsString -) -> Result<Self::Value, Error<RichFormatter>>

Parse the argument value Read more
§

fn map<T, F>(self, func: F) -> MapValueParser<Self, F>where - T: Send + Sync + Clone, - F: Fn(Self::Value) -> T + Clone,

Adapt a TypedValueParser from one value to another Read more
§

fn try_map<T, E, F>(self, func: F) -> TryMapValueParser<Self, F>where - F: Fn(Self::Value) -> Result<T, E> + Clone + Send + Sync + 'static, - T: Send + Sync + Clone, - E: Into<Box<dyn Error + Sync + Send + 'static, Global>>,

Adapt a TypedValueParser from one value to another Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
§

impl<I> IntoResettable<ValueParser> for Iwhere - I: Into<ValueParser>,

§

fn into_resettable(self) -> Resettable<ValueParser>

Convert to the intended resettable type
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sidebar-items.js b/coreutils/dev/uucore/sidebar-items.js deleted file mode 100644 index 3888a9506..000000000 --- a/coreutils/dev/uucore/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"attr":["main"],"externcrate":["libc"],"fn":["args_os","execution_phrase","format_usage","get_utility_is_second_arg","read_yes","set_utility_is_second_arg","util_name"],"macro":["bin","crash","crash_if_err","has","help_about","help_section","help_usage","prompt_yes","show","show_error","show_if_err","show_warning","uio_error"],"mod":["backup_control","display","encoding","entries","error","fs","fsext","line_ending","lines","memo","mode","os","panic","parse_glob","parse_size","parse_time","perms","pipes","process","quoting_style","ranges","ringbuffer","shortcut_value_parser","signals","sum","update_control","utmpx","version_cmp"],"trait":["Args"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/signals/fn.enable_pipe_errors.html b/coreutils/dev/uucore/signals/fn.enable_pipe_errors.html deleted file mode 100644 index 7cdb0bd4e..000000000 --- a/coreutils/dev/uucore/signals/fn.enable_pipe_errors.html +++ /dev/null @@ -1 +0,0 @@ -enable_pipe_errors in uucore::signals - Rust
pub fn enable_pipe_errors() -> Result<(), Errno>
\ No newline at end of file diff --git a/coreutils/dev/uucore/signals/fn.ignore_interrupts.html b/coreutils/dev/uucore/signals/fn.ignore_interrupts.html deleted file mode 100644 index aa1d4e8f9..000000000 --- a/coreutils/dev/uucore/signals/fn.ignore_interrupts.html +++ /dev/null @@ -1 +0,0 @@ -ignore_interrupts in uucore::signals - Rust
pub fn ignore_interrupts() -> Result<(), Errno>
\ No newline at end of file diff --git a/coreutils/dev/uucore/signals/fn.is_signal.html b/coreutils/dev/uucore/signals/fn.is_signal.html deleted file mode 100644 index 9b36635a4..000000000 --- a/coreutils/dev/uucore/signals/fn.is_signal.html +++ /dev/null @@ -1 +0,0 @@ -is_signal in uucore::signals - Rust

Function uucore::signals::is_signal

source ·
pub fn is_signal(num: usize) -> bool
\ No newline at end of file diff --git a/coreutils/dev/uucore/signals/fn.signal_by_name_or_value.html b/coreutils/dev/uucore/signals/fn.signal_by_name_or_value.html deleted file mode 100644 index aa08d6dad..000000000 --- a/coreutils/dev/uucore/signals/fn.signal_by_name_or_value.html +++ /dev/null @@ -1 +0,0 @@ -signal_by_name_or_value in uucore::signals - Rust
pub fn signal_by_name_or_value(signal_name_or_value: &str) -> Option<usize>
\ No newline at end of file diff --git a/coreutils/dev/uucore/signals/fn.signal_name_by_value.html b/coreutils/dev/uucore/signals/fn.signal_name_by_value.html deleted file mode 100644 index 55df8d342..000000000 --- a/coreutils/dev/uucore/signals/fn.signal_name_by_value.html +++ /dev/null @@ -1 +0,0 @@ -signal_name_by_value in uucore::signals - Rust
pub fn signal_name_by_value(signal_value: usize) -> Option<&'static str>
\ No newline at end of file diff --git a/coreutils/dev/uucore/signals/index.html b/coreutils/dev/uucore/signals/index.html deleted file mode 100644 index 73d93150e..000000000 --- a/coreutils/dev/uucore/signals/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::signals - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/signals/sidebar-items.js b/coreutils/dev/uucore/signals/sidebar-items.js deleted file mode 100644 index 137acc1ff..000000000 --- a/coreutils/dev/uucore/signals/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["enable_pipe_errors","ignore_interrupts","is_signal","signal_by_name_or_value","signal_name_by_value"],"static":["ALL_SIGNALS","DEFAULT_SIGNAL"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/signals/static.ALL_SIGNALS.html b/coreutils/dev/uucore/signals/static.ALL_SIGNALS.html deleted file mode 100644 index f913bde82..000000000 --- a/coreutils/dev/uucore/signals/static.ALL_SIGNALS.html +++ /dev/null @@ -1 +0,0 @@ -ALL_SIGNALS in uucore::signals - Rust

Static uucore::signals::ALL_SIGNALS

source ·
pub static ALL_SIGNALS: [&str; 32]
\ No newline at end of file diff --git a/coreutils/dev/uucore/signals/static.DEFAULT_SIGNAL.html b/coreutils/dev/uucore/signals/static.DEFAULT_SIGNAL.html deleted file mode 100644 index db4ef6643..000000000 --- a/coreutils/dev/uucore/signals/static.DEFAULT_SIGNAL.html +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_SIGNAL in uucore::signals - Rust
pub static DEFAULT_SIGNAL: usize
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/fn.div_ceil.html b/coreutils/dev/uucore/sum/fn.div_ceil.html deleted file mode 100644 index e93f3bf22..000000000 --- a/coreutils/dev/uucore/sum/fn.div_ceil.html +++ /dev/null @@ -1 +0,0 @@ -div_ceil in uucore::sum - Rust

Function uucore::sum::div_ceil

source ·
pub fn div_ceil(a: usize, b: usize) -> usize
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/index.html b/coreutils/dev/uucore/sum/index.html deleted file mode 100644 index 7e63c587a..000000000 --- a/coreutils/dev/uucore/sum/index.html +++ /dev/null @@ -1,8 +0,0 @@ -uucore::sum - Rust

Module uucore::sum

source ·
Expand description

Implementations of digest functions, like md5 and sha1.

-

The Digest trait represents the interface for providing inputs -to these digest functions and accessing the resulting hash. The -DigestWriter struct provides a wrapper around Digest that -implements the Write trait, for use in situations where calling -write would be useful.

-

Structs

Traits

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/sidebar-items.js b/coreutils/dev/uucore/sum/sidebar-items.js deleted file mode 100644 index ff08d183c..000000000 --- a/coreutils/dev/uucore/sum/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["div_ceil"],"struct":["BSD","Blake2b","Blake3","CRC","DigestWriter","Md5","SYSV","Sha1","Sha224","Sha256","Sha384","Sha3_224","Sha3_256","Sha3_384","Sha3_512","Sha512","Shake128","Shake256","Sm3"],"trait":["Digest"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.BSD.html b/coreutils/dev/uucore/sum/struct.BSD.html deleted file mode 100644 index b851a7616..000000000 --- a/coreutils/dev/uucore/sum/struct.BSD.html +++ /dev/null @@ -1,11 +0,0 @@ -BSD in uucore::sum - Rust

Struct uucore::sum::BSD

source ·
pub struct BSD { /* private fields */ }

Trait Implementations§

source§

impl Digest for BSD

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn result_str(&mut self) -> String

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

Auto Trait Implementations§

§

impl RefUnwindSafe for BSD

§

impl Send for BSD

§

impl Sync for BSD

§

impl Unpin for BSD

§

impl UnwindSafe for BSD

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Blake2b.html b/coreutils/dev/uucore/sum/struct.Blake2b.html deleted file mode 100644 index 1c62097a5..000000000 --- a/coreutils/dev/uucore/sum/struct.Blake2b.html +++ /dev/null @@ -1,14 +0,0 @@ -Blake2b in uucore::sum - Rust

Struct uucore::sum::Blake2b

source ·
pub struct Blake2b(_, _);
Expand description

first element of the tuple is the blake2b state -second is the number of output bits

-

Implementations§

source§

impl Blake2b

source

pub fn with_output_bytes(output_bytes: usize) -> Self

Return a new Blake2b instance with a custom output bytes length

-

Trait Implementations§

source§

impl Digest for Blake2b

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Blake3.html b/coreutils/dev/uucore/sum/struct.Blake3.html deleted file mode 100644 index 088dee077..000000000 --- a/coreutils/dev/uucore/sum/struct.Blake3.html +++ /dev/null @@ -1,11 +0,0 @@ -Blake3 in uucore::sum - Rust

Struct uucore::sum::Blake3

source ·
pub struct Blake3(_);

Trait Implementations§

source§

impl Digest for Blake3

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.CRC.html b/coreutils/dev/uucore/sum/struct.CRC.html deleted file mode 100644 index 8b02412cc..000000000 --- a/coreutils/dev/uucore/sum/struct.CRC.html +++ /dev/null @@ -1,11 +0,0 @@ -CRC in uucore::sum - Rust

Struct uucore::sum::CRC

source ·
pub struct CRC { /* private fields */ }

Trait Implementations§

source§

impl Digest for CRC

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn result_str(&mut self) -> String

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

Auto Trait Implementations§

§

impl RefUnwindSafe for CRC

§

impl Send for CRC

§

impl Sync for CRC

§

impl Unpin for CRC

§

impl UnwindSafe for CRC

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.DigestWriter.html b/coreutils/dev/uucore/sum/struct.DigestWriter.html deleted file mode 100644 index 626b0825a..000000000 --- a/coreutils/dev/uucore/sum/struct.DigestWriter.html +++ /dev/null @@ -1,22 +0,0 @@ -DigestWriter in uucore::sum - Rust

Struct uucore::sum::DigestWriter

source ·
pub struct DigestWriter<'a> { /* private fields */ }
Expand description

A struct that writes to a digest.

-

This struct wraps a Digest and provides a Write -implementation that passes input bytes directly to the -Digest::hash_update.

-

On Windows, if binary is false, then the write -implementation replaces instances of “\r\n” with “\n” before passing -the input bytes to the [digest].

-

Implementations§

source§

impl<'a> DigestWriter<'a>

source

pub fn new(digest: &'a mut Box<dyn Digest>, binary: bool) -> DigestWriter<'_>

source

pub fn finalize(&mut self) -> bool

Trait Implementations§

source§

impl<'a> Write for DigestWriter<'a>

source§

fn write(&mut self, buf: &[u8]) -> Result<usize>

Write a buffer into this writer, returning how many bytes were written. Read more
source§

fn flush(&mut self) -> Result<()>

Flush this output stream, ensuring that all intermediately buffered -contents reach their destination. Read more
1.36.0 · source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored -implementation. Read more
1.0.0 · source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · source§

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error -encountered. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere - Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for DigestWriter<'a>

§

impl<'a> !Send for DigestWriter<'a>

§

impl<'a> !Sync for DigestWriter<'a>

§

impl<'a> Unpin for DigestWriter<'a>

§

impl<'a> !UnwindSafe for DigestWriter<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Md5.html b/coreutils/dev/uucore/sum/struct.Md5.html deleted file mode 100644 index 57a083710..000000000 --- a/coreutils/dev/uucore/sum/struct.Md5.html +++ /dev/null @@ -1,11 +0,0 @@ -Md5 in uucore::sum - Rust

Struct uucore::sum::Md5

source ·
pub struct Md5(_);

Trait Implementations§

source§

impl Digest for Md5

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

§

impl RefUnwindSafe for Md5

§

impl Send for Md5

§

impl Sync for Md5

§

impl Unpin for Md5

§

impl UnwindSafe for Md5

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.SYSV.html b/coreutils/dev/uucore/sum/struct.SYSV.html deleted file mode 100644 index f1bd988f7..000000000 --- a/coreutils/dev/uucore/sum/struct.SYSV.html +++ /dev/null @@ -1,11 +0,0 @@ -SYSV in uucore::sum - Rust

Struct uucore::sum::SYSV

source ·
pub struct SYSV { /* private fields */ }

Trait Implementations§

source§

impl Digest for SYSV

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn result_str(&mut self) -> String

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

Auto Trait Implementations§

§

impl RefUnwindSafe for SYSV

§

impl Send for SYSV

§

impl Sync for SYSV

§

impl Unpin for SYSV

§

impl UnwindSafe for SYSV

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sha1.html b/coreutils/dev/uucore/sum/struct.Sha1.html deleted file mode 100644 index 068ecc892..000000000 --- a/coreutils/dev/uucore/sum/struct.Sha1.html +++ /dev/null @@ -1,11 +0,0 @@ -Sha1 in uucore::sum - Rust

Struct uucore::sum::Sha1

source ·
pub struct Sha1(_);

Trait Implementations§

source§

impl Digest for Sha1

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

§

impl RefUnwindSafe for Sha1

§

impl Send for Sha1

§

impl Sync for Sha1

§

impl Unpin for Sha1

§

impl UnwindSafe for Sha1

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sha224.html b/coreutils/dev/uucore/sum/struct.Sha224.html deleted file mode 100644 index 2b09f948d..000000000 --- a/coreutils/dev/uucore/sum/struct.Sha224.html +++ /dev/null @@ -1,11 +0,0 @@ -Sha224 in uucore::sum - Rust

Struct uucore::sum::Sha224

source ·
pub struct Sha224(_);

Trait Implementations§

source§

impl Digest for Sha224

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sha256.html b/coreutils/dev/uucore/sum/struct.Sha256.html deleted file mode 100644 index 17d51e6e6..000000000 --- a/coreutils/dev/uucore/sum/struct.Sha256.html +++ /dev/null @@ -1,11 +0,0 @@ -Sha256 in uucore::sum - Rust

Struct uucore::sum::Sha256

source ·
pub struct Sha256(_);

Trait Implementations§

source§

impl Digest for Sha256

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sha384.html b/coreutils/dev/uucore/sum/struct.Sha384.html deleted file mode 100644 index 5210ae63e..000000000 --- a/coreutils/dev/uucore/sum/struct.Sha384.html +++ /dev/null @@ -1,11 +0,0 @@ -Sha384 in uucore::sum - Rust

Struct uucore::sum::Sha384

source ·
pub struct Sha384(_);

Trait Implementations§

source§

impl Digest for Sha384

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sha3_224.html b/coreutils/dev/uucore/sum/struct.Sha3_224.html deleted file mode 100644 index 850c58455..000000000 --- a/coreutils/dev/uucore/sum/struct.Sha3_224.html +++ /dev/null @@ -1,11 +0,0 @@ -Sha3_224 in uucore::sum - Rust

Struct uucore::sum::Sha3_224

source ·
pub struct Sha3_224(_);

Trait Implementations§

source§

impl Digest for Sha3_224

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sha3_256.html b/coreutils/dev/uucore/sum/struct.Sha3_256.html deleted file mode 100644 index 1cf87dd9a..000000000 --- a/coreutils/dev/uucore/sum/struct.Sha3_256.html +++ /dev/null @@ -1,11 +0,0 @@ -Sha3_256 in uucore::sum - Rust

Struct uucore::sum::Sha3_256

source ·
pub struct Sha3_256(_);

Trait Implementations§

source§

impl Digest for Sha3_256

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sha3_384.html b/coreutils/dev/uucore/sum/struct.Sha3_384.html deleted file mode 100644 index 1f3980b23..000000000 --- a/coreutils/dev/uucore/sum/struct.Sha3_384.html +++ /dev/null @@ -1,11 +0,0 @@ -Sha3_384 in uucore::sum - Rust

Struct uucore::sum::Sha3_384

source ·
pub struct Sha3_384(_);

Trait Implementations§

source§

impl Digest for Sha3_384

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sha3_512.html b/coreutils/dev/uucore/sum/struct.Sha3_512.html deleted file mode 100644 index f2e28dbd7..000000000 --- a/coreutils/dev/uucore/sum/struct.Sha3_512.html +++ /dev/null @@ -1,11 +0,0 @@ -Sha3_512 in uucore::sum - Rust

Struct uucore::sum::Sha3_512

source ·
pub struct Sha3_512(_);

Trait Implementations§

source§

impl Digest for Sha3_512

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sha512.html b/coreutils/dev/uucore/sum/struct.Sha512.html deleted file mode 100644 index 0fd696aa3..000000000 --- a/coreutils/dev/uucore/sum/struct.Sha512.html +++ /dev/null @@ -1,11 +0,0 @@ -Sha512 in uucore::sum - Rust

Struct uucore::sum::Sha512

source ·
pub struct Sha512(_);

Trait Implementations§

source§

impl Digest for Sha512

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Shake128.html b/coreutils/dev/uucore/sum/struct.Shake128.html deleted file mode 100644 index 4df943722..000000000 --- a/coreutils/dev/uucore/sum/struct.Shake128.html +++ /dev/null @@ -1,11 +0,0 @@ -Shake128 in uucore::sum - Rust

Struct uucore::sum::Shake128

source ·
pub struct Shake128(_);

Trait Implementations§

source§

impl Digest for Shake128

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Shake256.html b/coreutils/dev/uucore/sum/struct.Shake256.html deleted file mode 100644 index 27e99b196..000000000 --- a/coreutils/dev/uucore/sum/struct.Shake256.html +++ /dev/null @@ -1,11 +0,0 @@ -Shake256 in uucore::sum - Rust

Struct uucore::sum::Shake256

source ·
pub struct Shake256(_);

Trait Implementations§

source§

impl Digest for Shake256

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/struct.Sm3.html b/coreutils/dev/uucore/sum/struct.Sm3.html deleted file mode 100644 index e100a249c..000000000 --- a/coreutils/dev/uucore/sum/struct.Sm3.html +++ /dev/null @@ -1,11 +0,0 @@ -Sm3 in uucore::sum - Rust

Struct uucore::sum::Sm3

source ·
pub struct Sm3(_);

Trait Implementations§

source§

impl Digest for Sm3

source§

fn new() -> Self

source§

fn hash_update(&mut self, input: &[u8])

source§

fn hash_finalize(&mut self, out: &mut [u8])

source§

fn reset(&mut self)

source§

fn output_bits(&self) -> usize

source§

fn output_bytes(&self) -> usize

source§

fn result_str(&mut self) -> String

Auto Trait Implementations§

§

impl RefUnwindSafe for Sm3

§

impl Send for Sm3

§

impl Sync for Sm3

§

impl Unpin for Sm3

§

impl UnwindSafe for Sm3

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/sum/trait.Digest.html b/coreutils/dev/uucore/sum/trait.Digest.html deleted file mode 100644 index e6c8fba13..000000000 --- a/coreutils/dev/uucore/sum/trait.Digest.html +++ /dev/null @@ -1,14 +0,0 @@ -Digest in uucore::sum - Rust

Trait uucore::sum::Digest

source ·
pub trait Digest {
-    // Required methods
-    fn new() -> Self
-       where Self: Sized;
-    fn hash_update(&mut self, input: &[u8]);
-    fn hash_finalize(&mut self, out: &mut [u8]);
-    fn reset(&mut self);
-    fn output_bits(&self) -> usize;
-
-    // Provided methods
-    fn output_bytes(&self) -> usize { ... }
-    fn result_str(&mut self) -> String { ... }
-}

Required Methods§

source

fn new() -> Selfwhere - Self: Sized,

source

fn hash_update(&mut self, input: &[u8])

source

fn hash_finalize(&mut self, out: &mut [u8])

source

fn reset(&mut self)

source

fn output_bits(&self) -> usize

Provided Methods§

source

fn output_bytes(&self) -> usize

source

fn result_str(&mut self) -> String

Implementors§

\ No newline at end of file diff --git a/coreutils/dev/uucore/trait.Args.html b/coreutils/dev/uucore/trait.Args.html deleted file mode 100644 index dea74f98b..000000000 --- a/coreutils/dev/uucore/trait.Args.html +++ /dev/null @@ -1,7 +0,0 @@ -Args in uucore - Rust

Trait uucore::Args

source ·
pub trait Args: Iterator<Item = OsString> + Sized {
-    // Provided methods
-    fn collect_lossy(self) -> Vec<String> { ... }
-    fn collect_ignore(self) -> Vec<String> { ... }
-}

Provided Methods§

source

fn collect_lossy(self) -> Vec<String>

Collects the iterator into a Vec<String>, lossily converting the OsStrings to Strings.

-
source

fn collect_ignore(self) -> Vec<String>

Collects the iterator into a Vec<String>, removing any elements that contain invalid encoding.

-

Implementors§

source§

impl<T: Iterator<Item = OsString> + Sized> Args for T

\ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/arguments/fn.update.html b/coreutils/dev/uucore/update_control/arguments/fn.update.html deleted file mode 100644 index d19d689ca..000000000 --- a/coreutils/dev/uucore/update_control/arguments/fn.update.html +++ /dev/null @@ -1 +0,0 @@ -update in uucore::update_control::arguments - Rust
pub fn update() -> Arg
\ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/arguments/fn.update_no_args.html b/coreutils/dev/uucore/update_control/arguments/fn.update_no_args.html deleted file mode 100644 index b619feb8b..000000000 --- a/coreutils/dev/uucore/update_control/arguments/fn.update_no_args.html +++ /dev/null @@ -1 +0,0 @@ -update_no_args in uucore::update_control::arguments - Rust
pub fn update_no_args() -> Arg
\ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/arguments/index.html b/coreutils/dev/uucore/update_control/arguments/index.html deleted file mode 100644 index 6b6edd30e..000000000 --- a/coreutils/dev/uucore/update_control/arguments/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::update_control::arguments - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/arguments/sidebar-items.js b/coreutils/dev/uucore/update_control/arguments/sidebar-items.js deleted file mode 100644 index b595d6404..000000000 --- a/coreutils/dev/uucore/update_control/arguments/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["update","update_no_args"],"static":["OPT_UPDATE","OPT_UPDATE_NO_ARG"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/arguments/static.OPT_UPDATE.html b/coreutils/dev/uucore/update_control/arguments/static.OPT_UPDATE.html deleted file mode 100644 index ef74b5e7f..000000000 --- a/coreutils/dev/uucore/update_control/arguments/static.OPT_UPDATE.html +++ /dev/null @@ -1 +0,0 @@ -OPT_UPDATE in uucore::update_control::arguments - Rust
pub static OPT_UPDATE: &str
\ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/arguments/static.OPT_UPDATE_NO_ARG.html b/coreutils/dev/uucore/update_control/arguments/static.OPT_UPDATE_NO_ARG.html deleted file mode 100644 index beee3fd40..000000000 --- a/coreutils/dev/uucore/update_control/arguments/static.OPT_UPDATE_NO_ARG.html +++ /dev/null @@ -1 +0,0 @@ -OPT_UPDATE_NO_ARG in uucore::update_control::arguments - Rust
pub static OPT_UPDATE_NO_ARG: &str
\ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/enum.UpdateMode.html b/coreutils/dev/uucore/update_control/enum.UpdateMode.html deleted file mode 100644 index c5b5f6ff0..000000000 --- a/coreutils/dev/uucore/update_control/enum.UpdateMode.html +++ /dev/null @@ -1,18 +0,0 @@ -UpdateMode in uucore::update_control - Rust
pub enum UpdateMode {
-    ReplaceAll,
-    ReplaceNone,
-    ReplaceIfOlder,
-}

Variants§

§

ReplaceAll

§

ReplaceNone

§

ReplaceIfOlder

Trait Implementations§

source§

impl Clone for UpdateMode

source§

fn clone(&self) -> UpdateMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UpdateMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<UpdateMode> for UpdateMode

source§

fn eq(&self, other: &UpdateMode) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for UpdateMode

source§

impl StructuralEq for UpdateMode

source§

impl StructuralPartialEq for UpdateMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/fn.determine_update_mode.html b/coreutils/dev/uucore/update_control/fn.determine_update_mode.html deleted file mode 100644 index 55bf2da10..000000000 --- a/coreutils/dev/uucore/update_control/fn.determine_update_mode.html +++ /dev/null @@ -1,27 +0,0 @@ -determine_update_mode in uucore::update_control - Rust
pub fn determine_update_mode(matches: &ArgMatches) -> UpdateMode
Expand description

Determine the “mode” for the update operation to perform, if any.

-

Parses the backup options and converts them to an instance of -UpdateMode for further processing.

-

Takes [clap::ArgMatches] as argument which must contain the options -from arguments::update() or arguments::update_no_args(). Otherwise -the ReplaceAll mode is returned unconditionally.

-

Examples

-

Here’s how one would integrate the update mode determination into an -application.

- -
#[macro_use]
-extern crate uucore;
-use uucore::update_control::{self, UpdateMode};
-use clap::{Command, Arg, ArgMatches};
-
-fn main() {
-    let matches = Command::new("command")
-        .arg(update_control::arguments::update())
-        .arg(update_control::arguments::update_no_args())
-        .get_matches_from(vec![
-            "command", "--update=all"
-        ]);
-
-    let update_mode = update_control::determine_update_mode(&matches);
-    assert_eq!(update_mode, UpdateMode::ReplaceAll)
-}
-
\ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/index.html b/coreutils/dev/uucore/update_control/index.html deleted file mode 100644 index 1c9646cb7..000000000 --- a/coreutils/dev/uucore/update_control/index.html +++ /dev/null @@ -1,36 +0,0 @@ -uucore::update_control - Rust

Module uucore::update_control

source ·
Expand description

Implement GNU-style update functionality.

- -

Update-functionality is implemented by the following utilities:

-
    -
  • cp
  • -
  • mv
  • -
-

Usage example

-
#[macro_use]
-extern crate uucore;
-
-use clap::{Command, Arg, ArgMatches};
-use uucore::update_control::{self, UpdateMode};
-
-fn main() {
-    let matches = Command::new("command")
-        .arg(update_control::arguments::update())
-        .arg(update_control::arguments::update_no_args())
-        .get_matches_from(vec![
-            "command", "--update=older"
-        ]);
-
-    let update_mode = update_control::determine_update_mode(&matches);
-
-    // handle cases
-    if update_mode == UpdateMode::ReplaceIfOlder {
-        // do
-    } else {
-        unreachable!()
-    }
-}
-

Modules

Enums

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/update_control/sidebar-items.js b/coreutils/dev/uucore/update_control/sidebar-items.js deleted file mode 100644 index b730d1f11..000000000 --- a/coreutils/dev/uucore/update_control/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["UpdateMode"],"fn":["determine_update_mode"],"mod":["arguments"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.ACCOUNTING.html b/coreutils/dev/uucore/utmpx/constant.ACCOUNTING.html deleted file mode 100644 index 535a9f820..000000000 --- a/coreutils/dev/uucore/utmpx/constant.ACCOUNTING.html +++ /dev/null @@ -1 +0,0 @@ -ACCOUNTING in uucore::utmpx - Rust

Constant uucore::utmpx::ACCOUNTING

pub const ACCOUNTING: i16 = 9; // 9i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.BOOT_TIME.html b/coreutils/dev/uucore/utmpx/constant.BOOT_TIME.html deleted file mode 100644 index 6d285a1ad..000000000 --- a/coreutils/dev/uucore/utmpx/constant.BOOT_TIME.html +++ /dev/null @@ -1 +0,0 @@ -BOOT_TIME in uucore::utmpx - Rust

Constant uucore::utmpx::BOOT_TIME

pub const BOOT_TIME: i16 = 2; // 2i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.DEAD_PROCESS.html b/coreutils/dev/uucore/utmpx/constant.DEAD_PROCESS.html deleted file mode 100644 index 111d605d4..000000000 --- a/coreutils/dev/uucore/utmpx/constant.DEAD_PROCESS.html +++ /dev/null @@ -1 +0,0 @@ -DEAD_PROCESS in uucore::utmpx - Rust

Constant uucore::utmpx::DEAD_PROCESS

pub const DEAD_PROCESS: i16 = 8; // 8i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.EMPTY.html b/coreutils/dev/uucore/utmpx/constant.EMPTY.html deleted file mode 100644 index 30bb968bd..000000000 --- a/coreutils/dev/uucore/utmpx/constant.EMPTY.html +++ /dev/null @@ -1 +0,0 @@ -EMPTY in uucore::utmpx - Rust

Constant uucore::utmpx::EMPTY

pub const EMPTY: i16 = 0; // 0i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.INIT_PROCESS.html b/coreutils/dev/uucore/utmpx/constant.INIT_PROCESS.html deleted file mode 100644 index 8e76a1019..000000000 --- a/coreutils/dev/uucore/utmpx/constant.INIT_PROCESS.html +++ /dev/null @@ -1 +0,0 @@ -INIT_PROCESS in uucore::utmpx - Rust

Constant uucore::utmpx::INIT_PROCESS

pub const INIT_PROCESS: i16 = 5; // 5i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.LOGIN_PROCESS.html b/coreutils/dev/uucore/utmpx/constant.LOGIN_PROCESS.html deleted file mode 100644 index bbe419995..000000000 --- a/coreutils/dev/uucore/utmpx/constant.LOGIN_PROCESS.html +++ /dev/null @@ -1 +0,0 @@ -LOGIN_PROCESS in uucore::utmpx - Rust

Constant uucore::utmpx::LOGIN_PROCESS

pub const LOGIN_PROCESS: i16 = 6; // 6i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.NEW_TIME.html b/coreutils/dev/uucore/utmpx/constant.NEW_TIME.html deleted file mode 100644 index 9aa142385..000000000 --- a/coreutils/dev/uucore/utmpx/constant.NEW_TIME.html +++ /dev/null @@ -1 +0,0 @@ -NEW_TIME in uucore::utmpx - Rust

Constant uucore::utmpx::NEW_TIME

pub const NEW_TIME: i16 = 3; // 3i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.OLD_TIME.html b/coreutils/dev/uucore/utmpx/constant.OLD_TIME.html deleted file mode 100644 index e90dc361f..000000000 --- a/coreutils/dev/uucore/utmpx/constant.OLD_TIME.html +++ /dev/null @@ -1 +0,0 @@ -OLD_TIME in uucore::utmpx - Rust

Constant uucore::utmpx::OLD_TIME

pub const OLD_TIME: i16 = 4; // 4i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.RUN_LVL.html b/coreutils/dev/uucore/utmpx/constant.RUN_LVL.html deleted file mode 100644 index c63c42aeb..000000000 --- a/coreutils/dev/uucore/utmpx/constant.RUN_LVL.html +++ /dev/null @@ -1 +0,0 @@ -RUN_LVL in uucore::utmpx - Rust

Constant uucore::utmpx::RUN_LVL

pub const RUN_LVL: i16 = 1; // 1i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.USER_PROCESS.html b/coreutils/dev/uucore/utmpx/constant.USER_PROCESS.html deleted file mode 100644 index 3d56e5498..000000000 --- a/coreutils/dev/uucore/utmpx/constant.USER_PROCESS.html +++ /dev/null @@ -1 +0,0 @@ -USER_PROCESS in uucore::utmpx - Rust

Constant uucore::utmpx::USER_PROCESS

pub const USER_PROCESS: i16 = 7; // 7i16
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.UT_HOSTSIZE.html b/coreutils/dev/uucore/utmpx/constant.UT_HOSTSIZE.html deleted file mode 100644 index da38fb02e..000000000 --- a/coreutils/dev/uucore/utmpx/constant.UT_HOSTSIZE.html +++ /dev/null @@ -1 +0,0 @@ -UT_HOSTSIZE in uucore::utmpx - Rust

Constant uucore::utmpx::UT_HOSTSIZE

pub const UT_HOSTSIZE: usize = 256; // 256usize
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.UT_IDSIZE.html b/coreutils/dev/uucore/utmpx/constant.UT_IDSIZE.html deleted file mode 100644 index f1796a05a..000000000 --- a/coreutils/dev/uucore/utmpx/constant.UT_IDSIZE.html +++ /dev/null @@ -1 +0,0 @@ -UT_IDSIZE in uucore::utmpx - Rust

Constant uucore::utmpx::UT_IDSIZE

source ·
pub const UT_IDSIZE: usize = 4;
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.UT_LINESIZE.html b/coreutils/dev/uucore/utmpx/constant.UT_LINESIZE.html deleted file mode 100644 index 9dfd3059c..000000000 --- a/coreutils/dev/uucore/utmpx/constant.UT_LINESIZE.html +++ /dev/null @@ -1 +0,0 @@ -UT_LINESIZE in uucore::utmpx - Rust

Constant uucore::utmpx::UT_LINESIZE

pub const UT_LINESIZE: usize = 32; // 32usize
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/constant.UT_NAMESIZE.html b/coreutils/dev/uucore/utmpx/constant.UT_NAMESIZE.html deleted file mode 100644 index 9ebb8f066..000000000 --- a/coreutils/dev/uucore/utmpx/constant.UT_NAMESIZE.html +++ /dev/null @@ -1 +0,0 @@ -UT_NAMESIZE in uucore::utmpx - Rust

Constant uucore::utmpx::UT_NAMESIZE

pub const UT_NAMESIZE: usize = 32; // 32usize
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/fn.endutxent.html b/coreutils/dev/uucore/utmpx/fn.endutxent.html deleted file mode 100644 index c522fdd2e..000000000 --- a/coreutils/dev/uucore/utmpx/fn.endutxent.html +++ /dev/null @@ -1 +0,0 @@ -endutxent in uucore::utmpx - Rust

Function uucore::utmpx::endutxent

pub unsafe extern "C" fn endutxent()
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/fn.getutxent.html b/coreutils/dev/uucore/utmpx/fn.getutxent.html deleted file mode 100644 index 424df6a55..000000000 --- a/coreutils/dev/uucore/utmpx/fn.getutxent.html +++ /dev/null @@ -1 +0,0 @@ -getutxent in uucore::utmpx - Rust

Function uucore::utmpx::getutxent

pub unsafe extern "C" fn getutxent() -> *mut utmpx
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/fn.setutxent.html b/coreutils/dev/uucore/utmpx/fn.setutxent.html deleted file mode 100644 index 88902fac5..000000000 --- a/coreutils/dev/uucore/utmpx/fn.setutxent.html +++ /dev/null @@ -1 +0,0 @@ -setutxent in uucore::utmpx - Rust

Function uucore::utmpx::setutxent

pub unsafe extern "C" fn setutxent()
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/fn.utmpxname.html b/coreutils/dev/uucore/utmpx/fn.utmpxname.html deleted file mode 100644 index c4e1ec275..000000000 --- a/coreutils/dev/uucore/utmpx/fn.utmpxname.html +++ /dev/null @@ -1 +0,0 @@ -utmpxname in uucore::utmpx - Rust

Function uucore::utmpx::utmpxname

pub unsafe extern "C" fn utmpxname(file: *const i8) -> i32
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/index.html b/coreutils/dev/uucore/utmpx/index.html deleted file mode 100644 index a2689768e..000000000 --- a/coreutils/dev/uucore/utmpx/index.html +++ /dev/null @@ -1,18 +0,0 @@ -uucore::utmpx - Rust

Module uucore::utmpx

source ·
Expand description

Aims to provide platform-independent methods to obtain login records

-

ONLY support linux, macos and freebsd for the time being

-

Examples:

-
use uucore::utmpx::Utmpx;
-for ut in Utmpx::iter_all_records() {
-    if ut.is_user_process() {
-        println!("{}: {}", ut.host(), ut.user())
-    }
-}
-

Specifying the path to login record:

- -
use uucore::utmpx::Utmpx;
-for ut in Utmpx::iter_all_records_from("/some/where/else") {
-    if ut.is_user_process() {
-        println!("{}: {}", ut.host(), ut.user())
-    }
-}
-

Re-exports

  • pub extern crate time;

Structs

Constants

Statics

Functions

\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/sidebar-items.js b/coreutils/dev/uucore/utmpx/sidebar-items.js deleted file mode 100644 index eb8b21dc0..000000000 --- a/coreutils/dev/uucore/utmpx/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["ACCOUNTING","BOOT_TIME","DEAD_PROCESS","EMPTY","INIT_PROCESS","LOGIN_PROCESS","NEW_TIME","OLD_TIME","RUN_LVL","USER_PROCESS","UT_HOSTSIZE","UT_IDSIZE","UT_LINESIZE","UT_NAMESIZE"],"externcrate":["time"],"fn":["endutxent","getutxent","setutxent","utmpxname"],"static":["DEFAULT_FILE"],"struct":["Utmpx","UtmpxIter"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/static.DEFAULT_FILE.html b/coreutils/dev/uucore/utmpx/static.DEFAULT_FILE.html deleted file mode 100644 index 96377d829..000000000 --- a/coreutils/dev/uucore/utmpx/static.DEFAULT_FILE.html +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FILE in uucore::utmpx - Rust

Static uucore::utmpx::DEFAULT_FILE

source ·
pub static DEFAULT_FILE: &str
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/struct.Utmpx.html b/coreutils/dev/uucore/utmpx/struct.Utmpx.html deleted file mode 100644 index c0479ca13..000000000 --- a/coreutils/dev/uucore/utmpx/struct.Utmpx.html +++ /dev/null @@ -1,31 +0,0 @@ -Utmpx in uucore::utmpx - Rust

Struct uucore::utmpx::Utmpx

source ·
pub struct Utmpx { /* private fields */ }

Implementations§

source§

impl Utmpx

source

pub fn record_type(&self) -> i16

A.K.A. ut.ut_type

-
source

pub fn pid(&self) -> i32

A.K.A. ut.ut_pid

-
source

pub fn terminal_suffix(&self) -> String

A.K.A. ut.ut_id

-
source

pub fn user(&self) -> String

A.K.A. ut.ut_user

-
source

pub fn host(&self) -> String

A.K.A. ut.ut_host

-
source

pub fn tty_device(&self) -> String

A.K.A. ut.ut_line

-
source

pub fn login_time(&self) -> OffsetDateTime

A.K.A. ut.ut_tv

-
source

pub fn exit_status(&self) -> (i16, i16)

A.K.A. ut.ut_exit

-

Return (e_termination, e_exit)

-
source

pub fn into_inner(self) -> utmpx

Consumes the Utmpx, returning the underlying C struct utmpx

-
source

pub fn is_user_process(&self) -> bool

source

pub fn canon_host(&self) -> IOResult<String>

Canonicalize host name using DNS

-
source

pub fn iter_all_records() -> UtmpxIter

Iterate through all the utmp records.

-

This will use the default location, or the path Utmpx::iter_all_records_from -was most recently called with.

-

Only one instance of UtmpxIter may be active at a time. This -function will block as long as one is still active. Beware!

-
source

pub fn iter_all_records_from<P: AsRef<Path>>(path: P) -> UtmpxIter

Iterate through all the utmp records from a specific file.

-

No failure is reported or detected.

-

This function affects subsequent calls to Utmpx::iter_all_records.

-

The same caveats as for Utmpx::iter_all_records apply.

-

Auto Trait Implementations§

§

impl RefUnwindSafe for Utmpx

§

impl Send for Utmpx

§

impl Sync for Utmpx

§

impl Unpin for Utmpx

§

impl UnwindSafe for Utmpx

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/utmpx/struct.UtmpxIter.html b/coreutils/dev/uucore/utmpx/struct.UtmpxIter.html deleted file mode 100644 index f949bfcfc..000000000 --- a/coreutils/dev/uucore/utmpx/struct.UtmpxIter.html +++ /dev/null @@ -1,591 +0,0 @@ -UtmpxIter in uucore::utmpx - Rust

Struct uucore::utmpx::UtmpxIter

source ·
pub struct UtmpxIter { /* private fields */ }
Expand description

Iterator of login records

-

Trait Implementations§

source§

impl Drop for UtmpxIter

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Iterator for UtmpxIter

§

type Item = Utmpx

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn next_chunk<const N: usize>( - &mut self -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0 · source§

fn count(self) -> usizewhere - Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>where - Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>where - Self: Sized,

Creates an iterator starting at the same point, but stepping by -the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>where - Self: Sized, - G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator -between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each -element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)where - Self: Sized, - F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element -should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>where - Self: Sized,

Creates an iterator which gives the current iteration count as well as -the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>where - Self: Sized,

Creates an iterator which can use the peek and peek_mut methods -to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>where - Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>where - Self: Sized,

Creates an iterator that yields the first n elements, or fewer -if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where - Self: Sized, - F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but -unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where - Self: Sized, - U: IntoIterator, - F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>where - Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where - Self: Sized, - F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Selfwhere - Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> Bwhere - B: FromIterator<Self::Item>, - Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere - E: Extend<Self::Item>, - Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)where - Self: Sized, - B: Default + Extend<Self::Item>, - F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> boolwhere - Self: Sized, - P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, -such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere - Self: Sized, - F: FnMut(B, Self::Item) -> R, - R: Try<Output = B>,

An iterator method that applies a function as long as it returns -successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> Rwhere - Self: Sized, - F: FnMut(Self::Item) -> R, - R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the -iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> Bwhere - Self: Sized, - F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, -returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing -operation. Read more
source§

fn try_reduce<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> R, - R: Try<Output = Self::Item>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the -closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns -the first non-none result. Read more
source§

fn try_find<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere - Self: Sized, - F: FnMut(&Self::Item) -> R, - R: Try<Output = bool>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns -the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the -specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the -specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the -specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the -specified comparison function. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where - FromA: Default + Extend<A>, - FromB: Default + Extend<B>, - Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>where - T: 'a + Copy, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>where - T: 'a + Clone, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> Swhere - Self: Sized, - S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> Pwhere - Self: Sized, - P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Lexicographically compares the PartialOrd elements of -this Iterator with those of another. The comparison works like short-circuit -evaluation, returning a result without comparing the remaining elements. -As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are equal to those of -another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of -another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are not equal to those of -another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> boolwhere - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction -function. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
source§

impl<I> IntoIterator for Iwhere - I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T> Itertools for Twhere - T: Iterator + ?Sized,

source§

fn interleave<J>( - self, - other: J -) -> Interleave<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator<Item = Self::Item>, - Self: Sized,

Alternate elements from two iterators until both have run out. Read more
source§

fn interleave_shortest<J>( - self, - other: J -) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator<Item = Self::Item>, - Self: Sized,

Alternate elements from two iterators until at least one of them has run -out. Read more
source§

fn intersperse( - self, - element: Self::Item -) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>>where - Self: Sized, - Self::Item: Clone,

An iterator adaptor to insert a particular value -between each element of the adapted iterator. Read more
source§

fn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F>where - Self: Sized, - F: FnMut() -> Self::Item,

An iterator adaptor to insert a particular value created by a function -between each element of the adapted iterator. Read more
source§

fn zip_longest<J>( - self, - other: J -) -> ZipLongest<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator, - Self: Sized,

Create an iterator which iterates over both this and the specified -iterator simultaneously, yielding pairs of two optional elements. Read more
source§

fn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter>where - J: IntoIterator, - Self: Sized,

Create an iterator which iterates over both this and the specified -iterator simultaneously, yielding pairs of elements. Read more
source§

fn batching<B, F>(self, f: F) -> Batching<Self, F>where - F: FnMut(&mut Self) -> Option<B>, - Self: Sized,

A “meta iterator adaptor”. Its closure receives a reference to the -iterator and may pick off as many elements as it likes, to produce the -next iterator element. Read more
source§

fn group_by<K, F>(self, key: F) -> GroupBy<K, Self, F>where - Self: Sized, - F: FnMut(&Self::Item) -> K, - K: PartialEq<K>,

Return an iterable that can group iterator elements. -Consecutive elements that map to the same key (“runs”), are assigned -to the same group. Read more
source§

fn chunks(self, size: usize) -> IntoChunks<Self>where - Self: Sized,

Return an iterable that can chunk the iterator. Read more
source§

fn tuple_windows<T>(self) -> TupleWindows<Self, T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple, - <T as TupleCollect>::Item: Clone,

Return an iterator over all contiguous windows producing tuples of -a specific size (up to 12). Read more
source§

fn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T>where - Self: Sized + Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator, - T: TupleCollect + Clone, - <T as TupleCollect>::Item: Clone,

Return an iterator over all windows, wrapping back to the first -elements when the window would otherwise exceed the length of the -iterator, producing tuples of a specific size (up to 12). Read more
source§

fn tuples<T>(self) -> Tuples<Self, T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Return an iterator that groups the items in tuples of a specific size -(up to 12). Read more
source§

fn tee(self) -> (Tee<Self>, Tee<Self>)where - Self: Sized, - Self::Item: Clone,

Split into an iterator pair that both yield all elements from -the original iterator. Read more
source§

fn step(self, n: usize) -> Step<Self>where - Self: Sized,

👎Deprecated since 0.8.0: Use std .step_by() instead
Return an iterator adaptor that steps n elements in the base iterator -for each iteration. Read more
source§

fn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>>where - Self: Sized, - Self::Item: Into<R>,

Convert each item of the iterator using the Into trait. Read more
source§

fn map_results<F, T, U, E>( - self, - f: F -) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> U,

👎Deprecated since 0.10.0: Use .map_ok() instead
source§

fn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> U,

Return an iterator adaptor that applies the provided closure -to every Result::Ok value. Result::Err values are -unchanged. Read more
source§

fn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(&T) -> bool,

Return an iterator adaptor that filters every Result::Ok -value with the provided closure. Result::Err values are -unchanged. Read more
source§

fn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnMut(T) -> Option<U>,

Return an iterator adaptor that filters and transforms every -Result::Ok value with the provided closure. Result::Err -values are unchanged. Read more
source§

fn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E>where - Self: Iterator<Item = Result<T, E>> + Sized, - T: IntoIterator,

Return an iterator adaptor that flattens every Result::Ok value into -a series of Result::Ok values. Result::Err values are unchanged. Read more
source§

fn process_results<F, T, E, R>(self, processor: F) -> Result<R, E>where - Self: Iterator<Item = Result<T, E>> + Sized, - F: FnOnce(ProcessResults<'_, Self, E>) -> R,

“Lift” a function of the values of the current iterator so as to process -an iterator of Result values instead. Read more
source§

fn merge<J>( - self, - other: J -) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>, - J: IntoIterator<Item = Self::Item>,

Return an iterator adaptor that merges the two base iterators in -ascending order. If both base iterators are sorted (ascending), the -result is sorted. Read more
source§

fn merge_by<J, F>( - self, - other: J, - is_first: F -) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F>where - Self: Sized, - J: IntoIterator<Item = Self::Item>, - F: FnMut(&Self::Item, &Self::Item) -> bool,

Return an iterator adaptor that merges the two base iterators in order. -This is much like .merge() but allows for a custom ordering. Read more
source§

fn merge_join_by<J, F, T>( - self, - other: J, - cmp_fn: F -) -> MergeJoinBy<Self, <J as IntoIterator>::IntoIter, F>where - J: IntoIterator, - F: FnMut(&Self::Item, &<J as IntoIterator>::Item) -> T, - T: OrderingOrBool<Self::Item, <J as IntoIterator>::Item>, - Self: Sized,

Create an iterator that merges items from both this and the specified -iterator in ascending order. Read more
source§

fn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt>where - Self: Sized, - Self::Item: IntoIterator, - <Self::Item as IntoIterator>::Item: PartialOrd<<Self::Item as IntoIterator>::Item>,

Return an iterator adaptor that flattens an iterator of iterators by -merging them in ascending order. Read more
source§

fn kmerge_by<F>( - self, - first: F -) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F>where - Self: Sized, - Self::Item: IntoIterator, - F: FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,

Return an iterator adaptor that flattens an iterator of iterators by -merging them according to the given closure. Read more
source§

fn cartesian_product<J>( - self, - other: J -) -> Product<Self, <J as IntoIterator>::IntoIter>where - Self: Sized, - Self::Item: Clone, - J: IntoIterator, - <J as IntoIterator>::IntoIter: Clone,

Return an iterator adaptor that iterates over the cartesian product of -the element sets of two iterators self and J. Read more
source§

fn multi_cartesian_product( - self -) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter>where - Self: Sized, - Self::Item: IntoIterator, - <Self::Item as IntoIterator>::IntoIter: Clone, - <Self::Item as IntoIterator>::Item: Clone,

Return an iterator adaptor that iterates over the cartesian product of -all subiterators returned by meta-iterator self. Read more
source§

fn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Result<Self::Item, (Self::Item, Self::Item)>,

Return an iterator adaptor that uses the passed-in closure to -optionally merge together consecutive elements. Read more
source§

fn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, Self::Item>where - Self: Sized, - Self::Item: PartialEq<Self::Item>,

Remove duplicates from sections of consecutive identical elements. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_by<Cmp>( - self, - cmp: Cmp -) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, Self::Item>where - Self: Sized, - Cmp: FnMut(&Self::Item, &Self::Item) -> bool,

Remove duplicates from sections of consecutive identical elements, -determining equality using a comparison function. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_with_count( - self -) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, (usize, Self::Item)>where - Self: Sized,

Remove duplicates from sections of consecutive identical elements, while keeping a count of -how many repeated elements were present. -If the iterator is sorted, all elements will be unique. Read more
source§

fn dedup_by_with_count<Cmp>( - self, - cmp: Cmp -) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, (usize, Self::Item)>where - Self: Sized, - Cmp: FnMut(&Self::Item, &Self::Item) -> bool,

Remove duplicates from sections of consecutive identical elements, while keeping a count of -how many repeated elements were present. -This will determine equality using a comparison function. -If the iterator is sorted, all elements will be unique. Read more
source§

fn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById>where - Self: Sized, - Self::Item: Eq + Hash,

Return an iterator adaptor that produces elements that appear more than once during the -iteration. Duplicates are detected using hash and equality. Read more
source§

fn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>>where - Self: Sized, - V: Eq + Hash, - F: FnMut(&Self::Item) -> V,

Return an iterator adaptor that produces elements that appear more than once during the -iteration. Duplicates are detected using hash and equality. Read more
source§

fn unique(self) -> Unique<Self>where - Self: Sized, - Self::Item: Clone + Eq + Hash,

Return an iterator adaptor that filters out elements that have -already been produced once during the iteration. Duplicates -are detected using hash and equality. Read more
source§

fn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F>where - Self: Sized, - V: Eq + Hash, - F: FnMut(&Self::Item) -> V,

Return an iterator adaptor that filters out elements that have -already been produced once during the iteration. Read more
source§

fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F>where - Self: Sized + PeekingNext, - F: FnMut(&Self::Item) -> bool,

Return an iterator adaptor that borrows from this iterator and -takes items while the closure accept returns true. Read more
source§

fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F>where - Self: Clone, - F: FnMut(&Self::Item) -> bool,

Return an iterator adaptor that borrows from a Clone-able iterator -to only pick off elements while the predicate accept returns true. Read more
source§

fn take_while_inclusive<F>( - &mut self, - accept: F -) -> TakeWhileInclusive<'_, Self, F>where - Self: Sized, - F: FnMut(&Self::Item) -> bool,

Returns an iterator adaptor that consumes elements while the given -predicate is true, including the element for which the predicate -first returned false. Read more
source§

fn while_some<A>(self) -> WhileSome<Self>where - Self: Sized + Iterator<Item = Option<A>>,

Return an iterator adaptor that filters Option<A> iterator elements -and produces A. Stops on the first None encountered. Read more
source§

fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>where - Self: Sized + Clone, - Self::Item: Clone, - T: HasCombination<Self>,

Return an iterator adaptor that iterates over the combinations of the -elements from an iterator. Read more
source§

fn combinations(self, k: usize) -> Combinations<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator adaptor that iterates over the k-length combinations of -the elements from an iterator. Read more
source§

fn combinations_with_replacement( - self, - k: usize -) -> CombinationsWithReplacement<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator that iterates over the k-length combinations of -the elements from an iterator, with replacement. Read more
source§

fn permutations(self, k: usize) -> Permutations<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator adaptor that iterates over all k-permutations of the -elements from an iterator. Read more
source§

fn powerset(self) -> Powerset<Self>where - Self: Sized, - Self::Item: Clone,

Return an iterator that iterates through the powerset of the elements from an -iterator. Read more
source§

fn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F>where - Self: Sized, - F: FnMut(usize) -> Self::Item,

Return an iterator adaptor that pads the sequence to a minimum length of -min by filling missing elements using a closure f. Read more
source§

fn with_position(self) -> WithPosition<Self>where - Self: Sized,

Return an iterator adaptor that combines each element with a Position to -ease special-case handling of the first or last elements. Read more
source§

fn positions<P>(self, predicate: P) -> Positions<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Return an iterator adaptor that yields the indices of all elements -satisfying a predicate, counted from the start of the iterator. Read more
source§

fn update<F>(self, updater: F) -> Update<Self, F>where - Self: Sized, - F: FnMut(&mut Self::Item),

Return an iterator adaptor that applies a mutating function -to each element before yielding it. Read more
source§

fn next_tuple<T>(&mut self) -> Option<T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Advances the iterator and returns the next items grouped in a tuple of -a specific size (up to 12). Read more
source§

fn collect_tuple<T>(self) -> Option<T>where - Self: Sized + Iterator<Item = <T as TupleCollect>::Item>, - T: HomogeneousTuple,

Collects all items from the iterator into a tuple of a specific size -(up to 12). Read more
source§

fn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)>where - P: FnMut(&Self::Item) -> bool,

Find the position and value of the first element satisfying a predicate. Read more
source§

fn find_or_last<P>(self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Find the value of the first element satisfying a predicate or return the last element, if any. Read more
source§

fn find_or_first<P>(self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Find the value of the first element satisfying a predicate or return the first element, if any. Read more
source§

fn contains<Q>(&mut self, query: &Q) -> boolwhere - Self: Sized, - Self::Item: Borrow<Q>, - Q: PartialEq<Q>,

Returns true if the given item is present in this iterator. Read more
source§

fn all_equal(&mut self) -> boolwhere - Self: Sized, - Self::Item: PartialEq<Self::Item>,

Check whether all elements compare equal. Read more
source§

fn all_equal_value( - &mut self -) -> Result<Self::Item, Option<(Self::Item, Self::Item)>>where - Self: Sized, - Self::Item: PartialEq<Self::Item>,

If there are elements and they are all equal, return a single copy of that element. -If there are no elements, return an Error containing None. -If there are elements and they are not all equal, return a tuple containing the first -two non-equal elements found. Read more
source§

fn all_unique(&mut self) -> boolwhere - Self: Sized, - Self::Item: Eq + Hash,

Check whether all elements are unique (non equal). Read more
source§

fn dropping(self, n: usize) -> Selfwhere - Self: Sized,

Consume the first n elements from the iterator eagerly, -and return the same iterator again. Read more
source§

fn dropping_back(self, n: usize) -> Selfwhere - Self: Sized + DoubleEndedIterator,

Consume the last n elements from the iterator eagerly, -and return the same iterator again. Read more
source§

fn foreach<F>(self, f: F)where - F: FnMut(Self::Item), - Self: Sized,

👎Deprecated since 0.8.0: Use .for_each() instead
Run the closure f eagerly on each element of the iterator. Read more
source§

fn concat(self) -> Self::Itemwhere - Self: Sized, - Self::Item: Extend<<Self::Item as IntoIterator>::Item> + IntoIterator + Default,

Combine all an iterator’s elements into one element by using Extend. Read more
source§

fn collect_vec(self) -> Vec<Self::Item, Global>where - Self: Sized,

.collect_vec() is simply a type specialization of Iterator::collect, -for convenience.
source§

fn try_collect<T, U, E>(self) -> Result<U, E>where - Self: Sized + Iterator<Item = Result<T, E>>, - Result<U, E>: FromIterator<Result<T, E>>,

.try_collect() is more convenient way of writing -.collect::<Result<_, _>>() Read more
source§

fn set_from<'a, A, J>(&mut self, from: J) -> usizewhere - A: 'a, - Self: Iterator<Item = &'a mut A>, - J: IntoIterator<Item = A>,

Assign to each reference in self from the from iterator, -stopping at the shortest of the two iterators. Read more
source§

fn join(&mut self, sep: &str) -> Stringwhere - Self::Item: Display,

Combine all iterator elements into one String, separated by sep. Read more
source§

fn format(self, sep: &str) -> Format<'_, Self>where - Self: Sized,

Format all iterator elements, separated by sep. Read more
source§

fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F>where - Self: Sized, - F: FnMut(Self::Item, &mut dyn FnMut(&dyn Display) -> Result<(), Error>) -> Result<(), Error>,

Format all iterator elements, separated by sep. Read more
source§

fn fold_results<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>where - Self: Iterator<Item = Result<A, E>>, - F: FnMut(B, A) -> B,

👎Deprecated since 0.10.0: Use .fold_ok() instead
source§

fn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E>where - Self: Iterator<Item = Result<A, E>>, - F: FnMut(B, A) -> B,

Fold Result values from an iterator. Read more
source§

fn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B>where - Self: Iterator<Item = Option<A>>, - F: FnMut(B, A) -> B,

Fold Option values from an iterator. Read more
source§

fn fold1<F>(self, f: F) -> Option<Self::Item>where - F: FnMut(Self::Item, Self::Item) -> Self::Item, - Self: Sized,

👎Deprecated since 0.10.2: Use Iterator::reduce instead
Accumulator of the elements in the iterator. Read more
source§

fn tree_fold1<F>(self, f: F) -> Option<Self::Item>where - F: FnMut(Self::Item, Self::Item) -> Self::Item, - Self: Sized,

Accumulate the elements in the iterator in a tree-like manner. Read more
source§

fn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B>where - Self: Sized, - F: FnMut(B, Self::Item) -> FoldWhile<B>,

An iterator method that applies a function, producing a single, final value. Read more
source§

fn sum1<S>(self) -> Option<S>where - Self: Sized, - S: Sum<Self::Item>,

Iterate over the entire iterator and add all the elements. Read more
source§

fn product1<P>(self) -> Option<P>where - Self: Sized, - P: Product<Self::Item>,

Iterate over the entire iterator and multiply all the elements. Read more
source§

fn sorted_unstable(self) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted(self) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. Read more
source§

fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Sort all iterator elements into a new iterator in ascending order. The key function is -called exactly once per key. Read more
source§

fn k_smallest(self, k: usize) -> IntoIter<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Sort the k smallest elements into a new iterator, in ascending order. Read more
source§

fn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B)where - Self: Sized, - F: FnMut(Self::Item) -> Either<L, R>, - A: Default + Extend<L>, - B: Default + Extend<R>,

Collect all iterator elements into one of two -partitions. Unlike Iterator::partition, each partition may -have a distinct type. Read more
source§

fn partition_result<A, B, T, E>(self) -> (A, B)where - Self: Iterator<Item = Result<T, E>> + Sized, - A: Default + Extend<T>, - B: Default + Extend<E>,

Partition a sequence of Results into one list of all the Ok elements -and another list of all the Err elements. Read more
source§

fn into_group_map<K, V>(self) -> HashMap<K, Vec<V, Global>, RandomState>where - Self: Iterator<Item = (K, V)> + Sized, - K: Hash + Eq,

Return a HashMap of keys mapped to Vecs of values. Keys and values -are taken from (Key, Value) tuple pairs yielded by the input iterator. Read more
source§

fn into_group_map_by<K, V, F>( - self, - f: F -) -> HashMap<K, Vec<V, Global>, RandomState>where - Self: Iterator<Item = V> + Sized, - K: Hash + Eq, - F: Fn(&V) -> K,

Return an Iterator on a HashMap. Keys mapped to Vecs of values. The key is specified -in the closure. Read more
source§

fn into_grouping_map<K, V>(self) -> GroupingMap<Self>where - Self: Iterator<Item = (K, V)> + Sized, - K: Hash + Eq,

Constructs a GroupingMap to be used later with one of the efficient -group-and-fold operations it allows to perform. Read more
source§

fn into_grouping_map_by<K, V, F>( - self, - key_mapper: F -) -> GroupingMap<MapForGrouping<Self, F>>where - Self: Iterator<Item = V> + Sized, - K: Hash + Eq, - F: FnMut(&V) -> K,

Constructs a GroupingMap to be used later with one of the efficient -group-and-fold operations it allows to perform. Read more
source§

fn min_set(self) -> Vec<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Return all minimum elements of an iterator. Read more
source§

fn min_set_by<F>(self, compare: F) -> Vec<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return all minimum elements of an iterator, as determined by -the specified function. Read more
source§

fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return all minimum elements of an iterator, as determined by -the specified function. Read more
source§

fn max_set(self) -> Vec<Self::Item, Global>where - Self: Sized, - Self::Item: Ord,

Return all maximum elements of an iterator. Read more
source§

fn max_set_by<F>(self, compare: F) -> Vec<Self::Item, Global>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return all maximum elements of an iterator, as determined by -the specified function. Read more
source§

fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item, Global>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return all maximum elements of an iterator, as determined by -the specified function. Read more
source§

fn minmax(self) -> MinMaxResult<Self::Item>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>,

Return the minimum and maximum elements in the iterator. Read more
source§

fn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item>where - Self: Sized, - K: PartialOrd<K>, - F: FnMut(&Self::Item) -> K,

Return the minimum and maximum element of an iterator, as determined by -the specified function. Read more
source§

fn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the minimum and maximum element of an iterator, as determined by -the specified comparison function. Read more
source§

fn position_max(self) -> Option<usize>where - Self: Sized, - Self::Item: Ord,

Return the position of the maximum element in the iterator. Read more
source§

fn position_max_by_key<K, F>(self, key: F) -> Option<usize>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return the position of the maximum element in the iterator, as -determined by the specified function. Read more
source§

fn position_max_by<F>(self, compare: F) -> Option<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the position of the maximum element in the iterator, as -determined by the specified comparison function. Read more
source§

fn position_min(self) -> Option<usize>where - Self: Sized, - Self::Item: Ord,

Return the position of the minimum element in the iterator. Read more
source§

fn position_min_by_key<K, F>(self, key: F) -> Option<usize>where - Self: Sized, - K: Ord, - F: FnMut(&Self::Item) -> K,

Return the position of the minimum element in the iterator, as -determined by the specified function. Read more
source§

fn position_min_by<F>(self, compare: F) -> Option<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the position of the minimum element in the iterator, as -determined by the specified comparison function. Read more
source§

fn position_minmax(self) -> MinMaxResult<usize>where - Self: Sized, - Self::Item: PartialOrd<Self::Item>,

Return the positions of the minimum and maximum elements in -the iterator. Read more
source§

fn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize>where - Self: Sized, - K: PartialOrd<K>, - F: FnMut(&Self::Item) -> K,

Return the postions of the minimum and maximum elements of an -iterator, as determined by the specified function. Read more
source§

fn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Return the postions of the minimum and maximum elements of an -iterator, as determined by the specified comparison function. Read more
source§

fn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>where - Self: Sized,

If the iterator yields exactly one element, that element will be returned, otherwise -an error will be returned containing an iterator that has the same output as the input -iterator. Read more
source§

fn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>where - Self: Sized,

If the iterator yields no elements, Ok(None) will be returned. If the iterator yields -exactly one element, that element will be returned, otherwise an error will be returned -containing an iterator that has the same output as the input iterator. Read more
source§

fn multipeek(self) -> MultiPeek<Self>where - Self: Sized,

An iterator adaptor that allows the user to peek at multiple .next() -values without advancing the base iterator. Read more
source§

fn counts(self) -> HashMap<Self::Item, usize, RandomState>where - Self: Sized, - Self::Item: Eq + Hash,

Collect the items in this iterator and return a HashMap which -contains each item that appears in the iterator and the number -of times it appears. Read more
source§

fn counts_by<K, F>(self, f: F) -> HashMap<K, usize, RandomState>where - Self: Sized, - K: Eq + Hash, - F: FnMut(Self::Item) -> K,

Collect the items in this iterator and return a HashMap which -contains each item that appears in the iterator and the number -of times it appears, -determining identity using a keying function. Read more
source§

fn multiunzip<FromI>(self) -> FromIwhere - Self: Sized + MultiUnzip<FromI>,

Converts an iterator of tuples into a tuple of containers. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/coreutils/dev/uucore/version_cmp/fn.version_cmp.html b/coreutils/dev/uucore/version_cmp/fn.version_cmp.html deleted file mode 100644 index d41c0e6a8..000000000 --- a/coreutils/dev/uucore/version_cmp/fn.version_cmp.html +++ /dev/null @@ -1 +0,0 @@ -version_cmp in uucore::version_cmp - Rust
pub fn version_cmp(a: &str, b: &str) -> Ordering
\ No newline at end of file diff --git a/coreutils/dev/uucore/version_cmp/index.html b/coreutils/dev/uucore/version_cmp/index.html deleted file mode 100644 index d4524a8ff..000000000 --- a/coreutils/dev/uucore/version_cmp/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore::version_cmp - Rust
\ No newline at end of file diff --git a/coreutils/dev/uucore/version_cmp/sidebar-items.js b/coreutils/dev/uucore/version_cmp/sidebar-items.js deleted file mode 100644 index adb23ce82..000000000 --- a/coreutils/dev/uucore/version_cmp/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["version_cmp"]}; \ No newline at end of file diff --git a/coreutils/dev/uucore_procs/all.html b/coreutils/dev/uucore_procs/all.html deleted file mode 100644 index 954e7e0f0..000000000 --- a/coreutils/dev/uucore_procs/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Macros

Attribute Macros

\ No newline at end of file diff --git a/coreutils/dev/uucore_procs/attr.main.html b/coreutils/dev/uucore_procs/attr.main.html deleted file mode 100644 index 5dde5f6c9..000000000 --- a/coreutils/dev/uucore_procs/attr.main.html +++ /dev/null @@ -1 +0,0 @@ -main in uucore_procs - Rust

Attribute Macro uucore_procs::main

source ·
#[main]
\ No newline at end of file diff --git a/coreutils/dev/uucore_procs/index.html b/coreutils/dev/uucore_procs/index.html deleted file mode 100644 index 02ff7010e..000000000 --- a/coreutils/dev/uucore_procs/index.html +++ /dev/null @@ -1 +0,0 @@ -uucore_procs - Rust

Crate uucore_procs

source ·

Macros

  • Get the about text from the help file.
  • Reads a section from a file of the util as a str literal.
  • Get the usage from the help file.

Attribute Macros

\ No newline at end of file diff --git a/coreutils/dev/uucore_procs/macro.help_about!.html b/coreutils/dev/uucore_procs/macro.help_about!.html deleted file mode 100644 index 109684508..000000000 --- a/coreutils/dev/uucore_procs/macro.help_about!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.help_about.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore_procs/macro.help_about.html b/coreutils/dev/uucore_procs/macro.help_about.html deleted file mode 100644 index 4ff941aec..000000000 --- a/coreutils/dev/uucore_procs/macro.help_about.html +++ /dev/null @@ -1,4 +0,0 @@ -help_about in uucore_procs - Rust
help_about!() { /* proc-macro */ }
Expand description

Get the about text from the help file.

-

The about text is assumed to be the text between the first markdown -code block and the next header, if any. It may span multiple lines.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore_procs/macro.help_section!.html b/coreutils/dev/uucore_procs/macro.help_section!.html deleted file mode 100644 index f76d64649..000000000 --- a/coreutils/dev/uucore_procs/macro.help_section!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.help_section.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore_procs/macro.help_section.html b/coreutils/dev/uucore_procs/macro.help_section.html deleted file mode 100644 index 1397cb1ff..000000000 --- a/coreutils/dev/uucore_procs/macro.help_section.html +++ /dev/null @@ -1,19 +0,0 @@ -help_section in uucore_procs - Rust
help_section!() { /* proc-macro */ }
Expand description

Reads a section from a file of the util as a str literal.

-

It reads from the file specified as the second argument, relative to the -crate root. The contents of this file are read verbatim, without parsing or -escaping. The name of the help file should match the name of the util. -I.e. numfmt should have a file called numfmt.md. By convention, the file -should start with a top-level section with the name of the util. The other -sections must start with 2 # characters. Capitalization of the sections -does not matter. Leading and trailing whitespace of each section will be -removed.

-

Example:

-
# numfmt
-## About
-Convert numbers from/to human-readable strings
-
-## Long help
-This text will be the long help
-
-
help_section!("about", "numfmt.md");
-
\ No newline at end of file diff --git a/coreutils/dev/uucore_procs/macro.help_usage!.html b/coreutils/dev/uucore_procs/macro.help_usage!.html deleted file mode 100644 index f7bab7cb2..000000000 --- a/coreutils/dev/uucore_procs/macro.help_usage!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.help_usage.html...

- - - \ No newline at end of file diff --git a/coreutils/dev/uucore_procs/macro.help_usage.html b/coreutils/dev/uucore_procs/macro.help_usage.html deleted file mode 100644 index b258f45e3..000000000 --- a/coreutils/dev/uucore_procs/macro.help_usage.html +++ /dev/null @@ -1,6 +0,0 @@ -help_usage in uucore_procs - Rust
help_usage!() { /* proc-macro */ }
Expand description

Get the usage from the help file.

-

The usage is assumed to be surrounded by markdown code fences. It may span -multiple lines. The first word of each line is assumed to be the name of -the util and is replaced by “{}” so that the output of this function can be -used with uucore::format_usage.

-
\ No newline at end of file diff --git a/coreutils/dev/uucore_procs/sidebar-items.js b/coreutils/dev/uucore_procs/sidebar-items.js deleted file mode 100644 index 68eda0182..000000000 --- a/coreutils/dev/uucore_procs/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"attr":["main"],"macro":["help_about","help_section","help_usage"]}; \ No newline at end of file diff --git a/coreutils/dev/uudoc/all.html b/coreutils/dev/uudoc/all.html deleted file mode 100644 index 84510f206..000000000 --- a/coreutils/dev/uudoc/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Functions

Type Definitions

\ No newline at end of file diff --git a/coreutils/dev/uudoc/fn.get_zip_content.html b/coreutils/dev/uudoc/fn.get_zip_content.html deleted file mode 100644 index 3c461ba67..000000000 --- a/coreutils/dev/uudoc/fn.get_zip_content.html +++ /dev/null @@ -1,4 +0,0 @@ -get_zip_content in uudoc - Rust

Function uudoc::get_zip_content

source ·
pub(crate) fn get_zip_content(
-    archive: &mut ZipArchive<impl Read + Seek>,
-    name: &str
-) -> Option<String>
\ No newline at end of file diff --git a/coreutils/dev/uudoc/fn.main.html b/coreutils/dev/uudoc/fn.main.html deleted file mode 100644 index b9b05b91f..000000000 --- a/coreutils/dev/uudoc/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in uudoc - Rust

Function uudoc::main

source ·
pub(crate) fn main() -> Result<()>
\ No newline at end of file diff --git a/coreutils/dev/uudoc/fn.util_map.html b/coreutils/dev/uudoc/fn.util_map.html deleted file mode 100644 index 36202811f..000000000 --- a/coreutils/dev/uudoc/fn.util_map.html +++ /dev/null @@ -1,3 +0,0 @@ -util_map in uudoc - Rust

Function uudoc::util_map

source ·
pub(crate) fn util_map<T: Args>(
-    
-) -> OrderedMap<&'static str, (fn(_: T) -> i32, fn() -> Command)>
\ No newline at end of file diff --git a/coreutils/dev/uudoc/index.html b/coreutils/dev/uudoc/index.html deleted file mode 100644 index b6d21c12a..000000000 --- a/coreutils/dev/uudoc/index.html +++ /dev/null @@ -1 +0,0 @@ -uudoc - Rust
\ No newline at end of file diff --git a/coreutils/dev/uudoc/sidebar-items.js b/coreutils/dev/uudoc/sidebar-items.js deleted file mode 100644 index bdddfd3e0..000000000 --- a/coreutils/dev/uudoc/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["get_zip_content","main","util_map"],"struct":["MDWriter"],"type":["UtilityMap"]}; \ No newline at end of file diff --git a/coreutils/dev/uudoc/struct.MDWriter.html b/coreutils/dev/uudoc/struct.MDWriter.html deleted file mode 100644 index c29b8389a..000000000 --- a/coreutils/dev/uudoc/struct.MDWriter.html +++ /dev/null @@ -1,19 +0,0 @@ -MDWriter in uudoc - Rust

Struct uudoc::MDWriter

source ·
pub(crate) struct MDWriter<'a, 'b> {
-    pub(crate) w: Box<dyn Write>,
-    pub(crate) command: Command,
-    pub(crate) name: &'a str,
-    pub(crate) tldr_zip: &'b mut Option<ZipArchive<File>>,
-    pub(crate) utils_per_platform: &'b HashMap<&'b str, Vec<String>>,
-    pub(crate) markdown: Option<String>,
-}

Fields§

§w: Box<dyn Write>§command: Command§name: &'a str§tldr_zip: &'b mut Option<ZipArchive<File>>§utils_per_platform: &'b HashMap<&'b str, Vec<String>>§markdown: Option<String>

Implementations§

source§

impl<'a, 'b> MDWriter<'a, 'b>

source

pub(crate) fn markdown(&mut self) -> Result<()>

source

pub(crate) fn additional(&mut self) -> Result<()>

source

pub(crate) fn platforms(&mut self) -> Result<()>

source

pub(crate) fn version(&mut self) -> Result<()>

source

pub(crate) fn usage(&mut self) -> Result<()>

source

pub(crate) fn about(&mut self) -> Result<()>

source

pub(crate) fn after_help(&mut self) -> Result<()>

source

pub(crate) fn examples(&mut self) -> Result<()>

source

pub(crate) fn options(&mut self) -> Result<()>

Auto Trait Implementations§

§

impl<'a, 'b> !RefUnwindSafe for MDWriter<'a, 'b>

§

impl<'a, 'b> !Send for MDWriter<'a, 'b>

§

impl<'a, 'b> !Sync for MDWriter<'a, 'b>

§

impl<'a, 'b> Unpin for MDWriter<'a, 'b>

§

impl<'a, 'b> !UnwindSafe for MDWriter<'a, 'b>

Blanket Implementations§

source§

impl<T> Any for Twhere - T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere - T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for Twhere - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -From<T> for U chooses to do.

-
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere - V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/coreutils/dev/uudoc/type.UtilityMap.html b/coreutils/dev/uudoc/type.UtilityMap.html deleted file mode 100644 index 886f24bc7..000000000 --- a/coreutils/dev/uudoc/type.UtilityMap.html +++ /dev/null @@ -1 +0,0 @@ -UtilityMap in uudoc - Rust

Type Definition uudoc::UtilityMap

source ·
pub(crate) type UtilityMap<T> = OrderedMap<&'static str, (fn(_: T) -> i32, fn() -> Command)>;
\ No newline at end of file diff --git a/coreutils/dev/uuhelp_parser/all.html b/coreutils/dev/uuhelp_parser/all.html deleted file mode 100644 index 8d3c4333e..000000000 --- a/coreutils/dev/uuhelp_parser/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/uuhelp_parser/fn.parse_about.html b/coreutils/dev/uuhelp_parser/fn.parse_about.html deleted file mode 100644 index 5c661c8b2..000000000 --- a/coreutils/dev/uuhelp_parser/fn.parse_about.html +++ /dev/null @@ -1,3 +0,0 @@ -parse_about in uuhelp_parser - Rust

Function uuhelp_parser::parse_about

source ·
pub fn parse_about(content: &str) -> String
Expand description

Parses the text between the first markdown code block and the next header, if any, -into an about string.

-
\ No newline at end of file diff --git a/coreutils/dev/uuhelp_parser/fn.parse_section.html b/coreutils/dev/uuhelp_parser/fn.parse_section.html deleted file mode 100644 index 6310c989c..000000000 --- a/coreutils/dev/uuhelp_parser/fn.parse_section.html +++ /dev/null @@ -1,3 +0,0 @@ -parse_section in uuhelp_parser - Rust
pub fn parse_section(section: &str, content: &str) -> Option<String>
Expand description

Get a single section from content

-

The section must be a second level section (i.e. start with ##).

-
\ No newline at end of file diff --git a/coreutils/dev/uuhelp_parser/fn.parse_usage.html b/coreutils/dev/uuhelp_parser/fn.parse_usage.html deleted file mode 100644 index 796f77361..000000000 --- a/coreutils/dev/uuhelp_parser/fn.parse_usage.html +++ /dev/null @@ -1,5 +0,0 @@ -parse_usage in uuhelp_parser - Rust

Function uuhelp_parser::parse_usage

source ·
pub fn parse_usage(content: &str) -> String
Expand description

Parses the first markdown code block into a usage string

-

The code fences are removed and the name of the util is replaced -with {} so that it can be replaced with the appropriate name -at runtime.

-
\ No newline at end of file diff --git a/coreutils/dev/uuhelp_parser/index.html b/coreutils/dev/uuhelp_parser/index.html deleted file mode 100644 index 312c1fdfd..000000000 --- a/coreutils/dev/uuhelp_parser/index.html +++ /dev/null @@ -1,11 +0,0 @@ -uuhelp_parser - Rust

Crate uuhelp_parser

source ·
Expand description

A collection of functions to parse the markdown code of help files.

-

The structure of the markdown code is assumed to be:

-

util name

usage info
-
-

About text

-

Section 1

-

Some content

-

Section 2

-

Some content

-

Functions

  • Parses the text between the first markdown code block and the next header, if any, -into an about string.
  • Get a single section from content
  • Parses the first markdown code block into a usage string
\ No newline at end of file diff --git a/coreutils/dev/uuhelp_parser/sidebar-items.js b/coreutils/dev/uuhelp_parser/sidebar-items.js deleted file mode 100644 index ff51ed95b..000000000 --- a/coreutils/dev/uuhelp_parser/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["parse_about","parse_section","parse_usage"]}; \ No newline at end of file diff --git a/coreutils/dev/vdir/all.html b/coreutils/dev/vdir/all.html deleted file mode 100644 index 636f4335b..000000000 --- a/coreutils/dev/vdir/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/vdir/fn.main.html b/coreutils/dev/vdir/fn.main.html deleted file mode 100644 index fa014ed06..000000000 --- a/coreutils/dev/vdir/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in vdir - Rust

Function vdir::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/vdir/index.html b/coreutils/dev/vdir/index.html deleted file mode 100644 index 6f3bd159b..000000000 --- a/coreutils/dev/vdir/index.html +++ /dev/null @@ -1 +0,0 @@ -vdir - Rust
\ No newline at end of file diff --git a/coreutils/dev/vdir/sidebar-items.js b/coreutils/dev/vdir/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/vdir/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/wc/all.html b/coreutils/dev/wc/all.html deleted file mode 100644 index 5d2e21b07..000000000 --- a/coreutils/dev/wc/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/wc/fn.main.html b/coreutils/dev/wc/fn.main.html deleted file mode 100644 index b0243266f..000000000 --- a/coreutils/dev/wc/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in wc - Rust

Function wc::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/wc/index.html b/coreutils/dev/wc/index.html deleted file mode 100644 index 58138bb62..000000000 --- a/coreutils/dev/wc/index.html +++ /dev/null @@ -1 +0,0 @@ -wc - Rust

Crate wc

source ·

Functions

\ No newline at end of file diff --git a/coreutils/dev/wc/sidebar-items.js b/coreutils/dev/wc/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/wc/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/who/all.html b/coreutils/dev/who/all.html deleted file mode 100644 index f682a2c34..000000000 --- a/coreutils/dev/who/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/who/fn.main.html b/coreutils/dev/who/fn.main.html deleted file mode 100644 index 4fce4b594..000000000 --- a/coreutils/dev/who/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in who - Rust

Function who::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/who/index.html b/coreutils/dev/who/index.html deleted file mode 100644 index f7918ca52..000000000 --- a/coreutils/dev/who/index.html +++ /dev/null @@ -1 +0,0 @@ -who - Rust
\ No newline at end of file diff --git a/coreutils/dev/who/sidebar-items.js b/coreutils/dev/who/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/who/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/whoami/all.html b/coreutils/dev/whoami/all.html deleted file mode 100644 index 5933b901b..000000000 --- a/coreutils/dev/whoami/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/whoami/fn.main.html b/coreutils/dev/whoami/fn.main.html deleted file mode 100644 index cb1fb2523..000000000 --- a/coreutils/dev/whoami/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in whoami - Rust

Function whoami::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/whoami/index.html b/coreutils/dev/whoami/index.html deleted file mode 100644 index 3adae6253..000000000 --- a/coreutils/dev/whoami/index.html +++ /dev/null @@ -1 +0,0 @@ -whoami - Rust
\ No newline at end of file diff --git a/coreutils/dev/whoami/sidebar-items.js b/coreutils/dev/whoami/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/whoami/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/dev/yes/all.html b/coreutils/dev/yes/all.html deleted file mode 100644 index 762a7e39d..000000000 --- a/coreutils/dev/yes/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/coreutils/dev/yes/fn.main.html b/coreutils/dev/yes/fn.main.html deleted file mode 100644 index 20d6cc4dc..000000000 --- a/coreutils/dev/yes/fn.main.html +++ /dev/null @@ -1 +0,0 @@ -main in yes - Rust

Function yes::main

source ·
pub fn main()
\ No newline at end of file diff --git a/coreutils/dev/yes/index.html b/coreutils/dev/yes/index.html deleted file mode 100644 index 0c70efb76..000000000 --- a/coreutils/dev/yes/index.html +++ /dev/null @@ -1 +0,0 @@ -yes - Rust
\ No newline at end of file diff --git a/coreutils/dev/yes/sidebar-items.js b/coreutils/dev/yes/sidebar-items.js deleted file mode 100644 index 9b556a055..000000000 --- a/coreutils/dev/yes/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/coreutils/funding/index.html b/coreutils/funding/index.html index b8777bea2..833084b44 100644 --- a/coreutils/funding/index.html +++ b/coreutils/funding/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils

diff --git a/coreutils/index.html b/coreutils/index.html index cb530d356..76fe764b9 100644 --- a/coreutils/index.html +++ b/coreutils/index.html @@ -18,9 +18,9 @@ - + - + @@ -39,28 +39,28 @@
- +

uutils coreutils