Skip to content

Commit 07a5c79

Browse files
committed
deploy: 2ed80ff
1 parent 61ae926 commit 07a5c79

10 files changed

+69
-11
lines changed

dev/src/uu_cp/cp.rs.html

+15-1
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,13 @@
16531653
<span id="1653">1653</span>
16541654
<span id="1654">1654</span>
16551655
<span id="1655">1655</span>
1656+
<span id="1656">1656</span>
1657+
<span id="1657">1657</span>
1658+
<span id="1658">1658</span>
1659+
<span id="1659">1659</span>
1660+
<span id="1660">1660</span>
1661+
<span id="1661">1661</span>
1662+
<span id="1662">1662</span>
16561663
</pre><pre class="rust"><code><span class="attribute">#![allow(clippy::missing_safety_doc)]
16571664
#![allow(clippy::extra_unused_lifetimes)]
16581665

@@ -3005,7 +3012,14 @@
30053012
}
30063013

30073014
<span class="kw">if </span>options.verbose {
3008-
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, context_for(source, dest));
3015+
<span class="kw">if let </span><span class="prelude-val">Some</span>(pb) = progress_bar {
3016+
<span class="comment">// Suspend (hide) the progress bar so the println won&#39;t overlap with the progress bar.
3017+
</span>pb.suspend(|| {
3018+
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, context_for(source, dest));
3019+
});
3020+
} <span class="kw">else </span>{
3021+
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, context_for(source, dest));
3022+
}
30093023
}
30103024

30113025
<span class="comment">// Calculate the context upfront before canonicalizing the path

dev/src/uu_dd/dd.rs.html

+45-1
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,28 @@
900900
<span id="900">900</span>
901901
<span id="901">901</span>
902902
<span id="902">902</span>
903+
<span id="903">903</span>
904+
<span id="904">904</span>
905+
<span id="905">905</span>
906+
<span id="906">906</span>
907+
<span id="907">907</span>
908+
<span id="908">908</span>
909+
<span id="909">909</span>
910+
<span id="910">910</span>
911+
<span id="911">911</span>
912+
<span id="912">912</span>
913+
<span id="913">913</span>
914+
<span id="914">914</span>
915+
<span id="915">915</span>
916+
<span id="916">916</span>
917+
<span id="917">917</span>
918+
<span id="918">918</span>
919+
<span id="919">919</span>
920+
<span id="920">920</span>
921+
<span id="921">921</span>
922+
<span id="922">922</span>
923+
<span id="923">923</span>
924+
<span id="924">924</span>
903925
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
904926
//
905927
// (c) Tyler Steele &lt;tyler.steele@protonmail.com&gt;
@@ -1226,6 +1248,17 @@
12261248
<span class="self">Self</span>::File(f, <span class="kw">_</span>) =&gt; f.seek(io::SeekFrom::Start(n)),
12271249
}
12281250
}
1251+
1252+
<span class="doccomment">/// Truncate the underlying file to the current stream position, if possible.
1253+
</span><span class="kw">fn </span>truncate(<span class="kw-2">&amp;mut </span><span class="self">self</span>) -&gt; io::Result&lt;()&gt; {
1254+
<span class="kw">match </span><span class="self">self </span>{
1255+
<span class="self">Self</span>::Stdout(<span class="kw">_</span>) =&gt; <span class="prelude-val">Ok</span>(()),
1256+
<span class="self">Self</span>::File(f, <span class="kw">_</span>) =&gt; {
1257+
<span class="kw">let </span>pos = f.stream_position()<span class="question-mark">?</span>;
1258+
f.set_len(pos)
1259+
}
1260+
}
1261+
}
12291262
}
12301263

12311264
<span class="doccomment">/// Decide whether the given buffer is all zeros.
@@ -1308,7 +1341,6 @@
13081341
// suppress the error by calling `Result::ok()`. This matches
13091342
// the behavior of GNU `dd` when given the command-line
13101343
// argument `of=/dev/null`.
1311-
13121344
</span><span class="kw">if </span>!settings.oconv.notrunc {
13131345
dst.set_len(settings.seek).ok();
13141346
}
@@ -1472,6 +1504,18 @@
14721504
<span class="comment">// Flush the output, if configured to do so.
14731505
</span><span class="self">self</span>.sync()<span class="question-mark">?</span>;
14741506

1507+
<span class="comment">// Truncate the file to the final cursor location.
1508+
//
1509+
// Calling `set_len()` may result in an error (for example,
1510+
// when calling it on `/dev/null`), but we don&#39;t want to
1511+
// terminate the process when that happens. Instead, we
1512+
// suppress the error by calling `Result::ok()`. This matches
1513+
// the behavior of GNU `dd` when given the command-line
1514+
// argument `of=/dev/null`.
1515+
</span><span class="kw">if </span>!<span class="self">self</span>.settings.oconv.notrunc {
1516+
<span class="self">self</span>.dst.truncate().ok();
1517+
}
1518+
14751519
<span class="comment">// Print the final read/write statistics.
14761520
</span><span class="kw">let </span>prog_update = ProgUpdate::new(rstat, wstat, start.elapsed(), <span class="bool-val">true</span>);
14771521
prog_tx.send(prog_update).unwrap_or(());

dev/src/uu_split/filenames.rs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
/// This iterator yields filenames for use with ``split``.
316316
///
317317
/// The `prefix` is prepended to each filename and the
318-
/// `additional_suffix1 is appended to each filename.
318+
/// `additional_suffix1` is appended to each filename.
319319
///
320320
/// If `suffix_length` is 0, then the variable portion of the filename
321321
/// that identifies the current chunk will have a dynamically

dev/src/uu_split/number.rs.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@
649649
///
650650
/// For the [`DynamicWidthNumber`], the digits are not unique in the
651651
/// sense that repeatedly incrementing the number will eventually
652-
/// yield `vec![0, 0]`, `vec![0, 0, 0], `vec![0, 0, 0, 0]`, etc.
652+
/// yield `vec![0, 0]`, `vec![0, 0, 0]`, `vec![0, 0, 0, 0]`, etc.
653653
/// That&#39;s okay because each of these numbers will be displayed
654654
/// differently and we only intend to use these numbers for display
655655
/// purposes and not for mathematical purposes.
@@ -677,7 +677,7 @@
677677
///
678678
/// For the [`DynamicWidthNumber`], the digits are not unique in the
679679
/// sense that repeatedly incrementing the number will eventually
680-
/// yield `vec![0, 0]`, `vec![0, 0, 0], `vec![0, 0, 0, 0]`, etc.
680+
/// yield `vec![0, 0]`, `vec![0, 0, 0]`, `vec![0, 0, 0, 0]`, etc.
681681
/// That&#39;s okay because each of these numbers will be displayed
682682
/// differently and we only intend to use these numbers for display
683683
/// purposes and not for mathematical purposes.

dev/uu_cp/fn.localize_to_target.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Remove the `root` prefix from `source` and prefix it with `target` to create a file that is local to `target`"><meta name="keywords" content="rust, rustlang, rust-lang, localize_to_target"><title>localize_to_target in uu_cp - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../normalize.css"><link rel="stylesheet" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../ayu.css" disabled><link rel="stylesheet" href="../dark.css" disabled><link rel="stylesheet" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../uu_cp/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../uu_cp/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In uu_cp</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../uu_cp/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="index.html">uu_cp</a>::<wbr><a class="fn" href="#">localize_to_target</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/uu_cp/cp.rs.html#1603-1606">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn localize_to_target(<br>&nbsp;&nbsp;&nbsp;&nbsp;root: &amp;<a class="struct" href="https://doc.rust-lang.org/1.65.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;source: &amp;<a class="struct" href="https://doc.rust-lang.org/1.65.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;target: &amp;<a class="struct" href="https://doc.rust-lang.org/1.65.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a><br>) -&gt; <a class="type" href="type.CopyResult.html" title="type uu_cp::CopyResult">CopyResult</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.65.0/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Remove the <code>root</code> prefix from <code>source</code> and prefix it with <code>target</code>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Remove the `root` prefix from `source` and prefix it with `target` to create a file that is local to `target`"><meta name="keywords" content="rust, rustlang, rust-lang, localize_to_target"><title>localize_to_target in uu_cp - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../normalize.css"><link rel="stylesheet" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../ayu.css" disabled><link rel="stylesheet" href="../dark.css" disabled><link rel="stylesheet" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../uu_cp/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../uu_cp/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In uu_cp</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../uu_cp/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="index.html">uu_cp</a>::<wbr><a class="fn" href="#">localize_to_target</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/uu_cp/cp.rs.html#1610-1613">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn localize_to_target(<br>&nbsp;&nbsp;&nbsp;&nbsp;root: &amp;<a class="struct" href="https://doc.rust-lang.org/1.65.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;source: &amp;<a class="struct" href="https://doc.rust-lang.org/1.65.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;target: &amp;<a class="struct" href="https://doc.rust-lang.org/1.65.0/std/path/struct.Path.html" title="struct std::path::Path">Path</a><br>) -&gt; <a class="type" href="type.CopyResult.html" title="type uu_cp::CopyResult">CopyResult</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.65.0/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Remove the <code>root</code> prefix from <code>source</code> and prefix it with <code>target</code>
22
to create a file that is local to <code>target</code></p>
33
<h2 id="examples"><a href="#examples">Examples</a></h2>
44
<div class="example-wrap ignore"><div class='tooltip'></div><pre class="rust rust-example-rendered"><code><span class="macro">assert!</span>(uu_cp::localize_to_target(

0 commit comments

Comments
 (0)