Skip to content

Commit d40f3cc

Browse files
committed
deploy: f0e8d44
1 parent 3dda602 commit d40f3cc

File tree

6 files changed

+58
-18
lines changed

6 files changed

+58
-18
lines changed

dev/src/uu_comm/comm.rs.html

+36
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,24 @@
188188
<a href="#188" id="188">188</a>
189189
<a href="#189" id="189">189</a>
190190
<a href="#190" id="190">190</a>
191+
<a href="#191" id="191">191</a>
192+
<a href="#192" id="192">192</a>
193+
<a href="#193" id="193">193</a>
194+
<a href="#194" id="194">194</a>
195+
<a href="#195" id="195">195</a>
196+
<a href="#196" id="196">196</a>
197+
<a href="#197" id="197">197</a>
198+
<a href="#198" id="198">198</a>
199+
<a href="#199" id="199">199</a>
200+
<a href="#200" id="200">200</a>
201+
<a href="#201" id="201">201</a>
202+
<a href="#202" id="202">202</a>
203+
<a href="#203" id="203">203</a>
204+
<a href="#204" id="204">204</a>
205+
<a href="#205" id="205">205</a>
206+
<a href="#206" id="206">206</a>
207+
<a href="#207" id="207">207</a>
208+
<a href="#208" id="208">208</a>
191209
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
192210
//
193211
// (c) Michael Gehring &lt;mg@ebfe.org&gt;
@@ -219,6 +237,7 @@
219237
<span class="kw">pub const </span>DELIMITER_DEFAULT: <span class="kw-2">&amp;</span>str = <span class="string">&quot;\t&quot;</span>;
220238
<span class="kw">pub const </span>FILE_1: <span class="kw-2">&amp;</span>str = <span class="string">&quot;FILE1&quot;</span>;
221239
<span class="kw">pub const </span>FILE_2: <span class="kw-2">&amp;</span>str = <span class="string">&quot;FILE2&quot;</span>;
240+
<span class="kw">pub const </span>TOTAL: <span class="kw-2">&amp;</span>str = <span class="string">&quot;total&quot;</span>;
222241
}
223242

224243
<span class="kw">fn </span>mkdelim(col: usize, opts: <span class="kw-2">&amp;</span>ArgMatches) -&gt; String {
@@ -266,6 +285,10 @@
266285
<span class="kw">let </span>rb = <span class="kw-2">&amp;mut </span>String::new();
267286
<span class="kw">let </span><span class="kw-2">mut </span>nb = b.read_line(rb);
268287

288+
<span class="kw">let </span><span class="kw-2">mut </span>total_col_1 = <span class="number">0</span>;
289+
<span class="kw">let </span><span class="kw-2">mut </span>total_col_2 = <span class="number">0</span>;
290+
<span class="kw">let </span><span class="kw-2">mut </span>total_col_3 = <span class="number">0</span>;
291+
269292
<span class="kw">while </span>na.is_ok() || nb.is_ok() {
270293
<span class="kw">let </span>ord = <span class="kw">match </span>(na.is_ok(), nb.is_ok()) {
271294
(<span class="bool-val">false</span>, <span class="bool-val">true</span>) =&gt; Ordering::Greater,
@@ -287,6 +310,7 @@
287310
}
288311
ra.clear();
289312
na = a.read_line(ra);
313+
total_col_1 += <span class="number">1</span>;
290314
}
291315
Ordering::Greater =&gt; {
292316
<span class="kw">if </span>!opts.get_flag(options::COLUMN_2) {
@@ -295,6 +319,7 @@
295319
}
296320
rb.clear();
297321
nb = b.read_line(rb);
322+
total_col_2 += <span class="number">1</span>;
298323
}
299324
Ordering::Equal =&gt; {
300325
<span class="kw">if </span>!opts.get_flag(options::COLUMN_3) {
@@ -305,9 +330,14 @@
305330
rb.clear();
306331
na = a.read_line(ra);
307332
nb = b.read_line(rb);
333+
total_col_3 += <span class="number">1</span>;
308334
}
309335
}
310336
}
337+
338+
<span class="kw">if </span>opts.get_flag(options::TOTAL) {
339+
<span class="macro">println!</span>(<span class="string">&quot;{total_col_1}\t{total_col_2}\t{total_col_3}\ttotal&quot;</span>);
340+
}
311341
}
312342

313343
<span class="kw">fn </span>open_file(name: <span class="kw-2">&amp;</span>str) -&gt; io::Result&lt;LineReader&gt; {
@@ -377,6 +407,12 @@
377407
.required(<span class="bool-val">true</span>)
378408
.value_hint(clap::ValueHint::FilePath),
379409
)
410+
.arg(
411+
Arg::new(options::TOTAL)
412+
.long(options::TOTAL)
413+
.help(<span class="string">&quot;output a summary&quot;</span>)
414+
.action(ArgAction::SetTrue),
415+
)
380416
}
381417
</code></pre></div>
382418
</section></div></main><div id="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="uu_comm" data-themes="" data-resource-suffix="" data-rustdoc-version="1.67.0 (fc594f156 2023-01-24)" data-search-js="search-444266647c4dba98.js" data-settings-js="settings-bebeae96e00e4617.js" data-settings-css="settings-af96d9e2fc13e081.css" ></div></body></html>

dev/src/uu_expand/expand.rs.html

+18-14
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@
505505
<a href="#505" id="505">505</a>
506506
<a href="#506" id="506">506</a>
507507
<a href="#507" id="507">507</a>
508+
<a href="#508" id="508">508</a>
509+
<a href="#509" id="509">509</a>
508510
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
509511
//
510512
// (c) Virgile Andreani &lt;virgile.andreani@anbuco.fr&gt;
@@ -633,12 +635,8 @@
633635
<span class="kw">let </span>bytes = word.as_bytes();
634636
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..bytes.len() {
635637
<span class="kw">match </span>bytes[i] {
636-
<span class="string">b&#39;+&#39; </span>=&gt; {
637-
remaining_mode = RemainingMode::Plus;
638-
}
639-
<span class="string">b&#39;/&#39; </span>=&gt; {
640-
remaining_mode = RemainingMode::Slash;
641-
}
638+
<span class="string">b&#39;+&#39; </span>=&gt; remaining_mode = RemainingMode::Plus,
639+
<span class="string">b&#39;/&#39; </span>=&gt; remaining_mode = RemainingMode::Slash,
642640
<span class="kw">_ </span>=&gt; {
643641
<span class="comment">// Parse a number from the byte sequence.
644642
</span><span class="kw">let </span>s = from_utf8(<span class="kw-2">&amp;</span>bytes[i..]).unwrap();
@@ -698,6 +696,10 @@
698696
</span><span class="kw">if </span>nums.is_empty() {
699697
nums = <span class="macro">vec!</span>[DEFAULT_TABSTOP];
700698
}
699+
700+
<span class="kw">if </span>nums.len() &lt; <span class="number">2 </span>{
701+
remaining_mode = RemainingMode::None;
702+
}
701703
<span class="prelude-val">Ok</span>((remaining_mode, nums))
702704
}
703705

@@ -843,17 +845,19 @@
843845
/// in the `tabstops` slice is interpreted as a relative number of
844846
/// spaces, which this function will return for every input value of
845847
/// `col` beyond the end of the second-to-last element of `tabstops`.
846-
///
847-
/// If `remaining_mode` is [`RemainingMode::Plus`], then the last entry
848-
/// in the `tabstops` slice is interpreted as a relative number of
849-
/// spaces, which this function will return for every input value of
850-
/// `col` beyond the end of the second-to-last element of `tabstops`.
851848
</span><span class="kw">fn </span>next_tabstop(tabstops: <span class="kw-2">&amp;</span>[usize], col: usize, remaining_mode: <span class="kw-2">&amp;</span>RemainingMode) -&gt; usize {
852849
<span class="kw">let </span>num_tabstops = tabstops.len();
853850
<span class="kw">match </span>remaining_mode {
854851
RemainingMode::Plus =&gt; <span class="kw">match </span>tabstops[<span class="number">0</span>..num_tabstops - <span class="number">1</span>].iter().find(|&amp;&amp;t| t &gt; col) {
855852
<span class="prelude-val">Some</span>(t) =&gt; t - col,
856-
<span class="prelude-val">None </span>=&gt; tabstops[num_tabstops - <span class="number">1</span>] - <span class="number">1</span>,
853+
<span class="prelude-val">None </span>=&gt; {
854+
<span class="kw">let </span>step_size = tabstops[num_tabstops - <span class="number">1</span>];
855+
<span class="kw">let </span>last_fixed_tabstop = tabstops[num_tabstops - <span class="number">2</span>];
856+
<span class="kw">let </span>characters_since_last_tabstop = col - last_fixed_tabstop;
857+
858+
<span class="kw">let </span>steps_required = <span class="number">1 </span>+ characters_since_last_tabstop / step_size;
859+
steps_required * step_size - characters_since_last_tabstop
860+
}
857861
},
858862
RemainingMode::Slash =&gt; <span class="kw">match </span>tabstops[<span class="number">0</span>..num_tabstops - <span class="number">1</span>].iter().find(|&amp;&amp;t| t &gt; col) {
859863
<span class="prelude-val">Some</span>(t) =&gt; t - col,
@@ -994,8 +998,8 @@
994998
<span class="attr">#[test]
995999
</span><span class="kw">fn </span>test_next_tabstop_remaining_mode_plus() {
9961000
<span class="macro">assert_eq!</span>(next_tabstop(<span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">5</span>], <span class="number">0</span>, <span class="kw-2">&amp;</span>RemainingMode::Plus), <span class="number">1</span>);
997-
<span class="macro">assert_eq!</span>(next_tabstop(<span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">5</span>], <span class="number">3</span>, <span class="kw-2">&amp;</span>RemainingMode::Plus), <span class="number">4</span>);
998-
<span class="macro">assert_eq!</span>(next_tabstop(<span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">5</span>], <span class="number">6</span>, <span class="kw-2">&amp;</span>RemainingMode::Plus), <span class="number">4</span>);
1001+
<span class="macro">assert_eq!</span>(next_tabstop(<span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">5</span>], <span class="number">3</span>, <span class="kw-2">&amp;</span>RemainingMode::Plus), <span class="number">3</span>);
1002+
<span class="macro">assert_eq!</span>(next_tabstop(<span class="kw-2">&amp;</span>[<span class="number">1</span>, <span class="number">5</span>], <span class="number">6</span>, <span class="kw-2">&amp;</span>RemainingMode::Plus), <span class="number">5</span>);
9991003
}
10001004

10011005
<span class="attr">#[test]

dev/uu_comm/fn.uu_app.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
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="API documentation for the Rust `uu_app` fn in crate `uu_comm`."><meta name="keywords" content="rust, rustlang, rust-lang, uu_app"><title>uu_app in uu_comm - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-6827029ac823cab7.css" id="mainThemeStyle"><link rel="stylesheet" id="themeStyle" href="../static.files/light-ebce58d0a40c3431.css"><link rel="stylesheet" disabled href="../static.files/dark-f23faae4a2daf9a6.css"><link rel="stylesheet" disabled href="../static.files/ayu-8af5e100b21cd173.css"><script id="default-settings" ></script><script src="../static.files/storage-d43fa987303ecbbb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-c55e1eb52e1886b4.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-13285aec31fa243e.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.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_comm/index.html"><div class="logo-container"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../uu_comm/index.html"><div class="logo-container"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></div></a><div class="sidebar-elems"><h2><a href="index.html">In uu_comm</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-5ec35bf9ca753509.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Function <a href="index.html">uu_comm</a>::<wbr><a class="fn" href="#">uu_app</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/uu_comm/comm.rs.html#147-190">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><div class="item-decl"><pre class="rust fn"><code>pub fn uu_app() -&gt; Command</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="uu_comm" data-themes="" data-resource-suffix="" data-rustdoc-version="1.67.0 (fc594f156 2023-01-24)" data-search-js="search-444266647c4dba98.js" data-settings-js="settings-bebeae96e00e4617.js" data-settings-css="settings-af96d9e2fc13e081.css" ></div></body></html>
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="API documentation for the Rust `uu_app` fn in crate `uu_comm`."><meta name="keywords" content="rust, rustlang, rust-lang, uu_app"><title>uu_app in uu_comm - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-6827029ac823cab7.css" id="mainThemeStyle"><link rel="stylesheet" id="themeStyle" href="../static.files/light-ebce58d0a40c3431.css"><link rel="stylesheet" disabled href="../static.files/dark-f23faae4a2daf9a6.css"><link rel="stylesheet" disabled href="../static.files/ayu-8af5e100b21cd173.css"><script id="default-settings" ></script><script src="../static.files/storage-d43fa987303ecbbb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-c55e1eb52e1886b4.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-13285aec31fa243e.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.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_comm/index.html"><div class="logo-container"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../uu_comm/index.html"><div class="logo-container"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></div></a><div class="sidebar-elems"><h2><a href="index.html">In uu_comm</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-5ec35bf9ca753509.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Function <a href="index.html">uu_comm</a>::<wbr><a class="fn" href="#">uu_app</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/uu_comm/comm.rs.html#159-208">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><div class="item-decl"><pre class="rust fn"><code>pub fn uu_app() -&gt; Command</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="uu_comm" data-themes="" data-resource-suffix="" data-rustdoc-version="1.67.0 (fc594f156 2023-01-24)" data-search-js="search-444266647c4dba98.js" data-settings-js="settings-bebeae96e00e4617.js" data-settings-css="settings-af96d9e2fc13e081.css" ></div></body></html>

0 commit comments

Comments
 (0)