This commit is contained in:
sylvestre
2023-08-20 02:20:37 +00:00
parent 21881ec6e8
commit a7a0d88f9f
9 changed files with 99 additions and 11 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -6,7 +6,7 @@
"uu_ln":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_ln/enum.OverwriteMode.html\" title=\"enum uu_ln::OverwriteMode\">OverwriteMode</a>"]],
"uu_ls":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_ls/enum.Format.html\" title=\"enum uu_ls::Format\">Format</a>"]],
"uu_numfmt":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"uu_numfmt/options/struct.FormatOptions.html\" title=\"struct uu_numfmt::options::FormatOptions\">FormatOptions</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_numfmt/options/enum.InvalidModes.html\" title=\"enum uu_numfmt::options::InvalidModes\">InvalidModes</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_numfmt/errors/enum.NumfmtError.html\" title=\"enum uu_numfmt::errors::NumfmtError\">NumfmtError</a>"]],
"uu_sort":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_sort/enum.GeneralF64ParseResult.html\" title=\"enum uu_sort::GeneralF64ParseResult\">GeneralF64ParseResult</a>"],["impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"uu_sort/struct.Line.html\" title=\"struct uu_sort::Line\">Line</a>&lt;'a&gt;"]],
"uu_sort":[["impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"uu_sort/struct.Line.html\" title=\"struct uu_sort::Line\">Line</a>&lt;'a&gt;"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_sort/enum.GeneralF64ParseResult.html\" title=\"enum uu_sort::GeneralF64ParseResult\">GeneralF64ParseResult</a>"]],
"uu_stat":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_stat/enum.OutputType.html\" title=\"enum uu_stat::OutputType\">OutputType</a>"]],
"uu_stty":[["impl&lt;T: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a>&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"uu_stty/struct.Flag.html\" title=\"struct uu_stty::Flag\">Flag</a>&lt;T&gt;"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"uu_stty/struct.TermSize.html\" title=\"struct uu_stty::TermSize\">TermSize</a>"]],
"uu_tail":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_tail/args/enum.VerificationResult.html\" title=\"enum uu_tail::args::VerificationResult\">VerificationResult</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_tail/args/enum.FollowMode.html\" title=\"enum uu_tail::args::FollowMode\">FollowMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"uu_tail/chunks/struct.LinesChunk.html\" title=\"struct uu_tail::chunks::LinesChunk\">LinesChunk</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"uu_tail/args/struct.Settings.html\" title=\"struct uu_tail::args::Settings\">Settings</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_tail/args/enum.FilterMode.html\" title=\"enum uu_tail::args::FilterMode\">FilterMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"uu_tail/chunks/struct.BytesChunk.html\" title=\"struct uu_tail::chunks::BytesChunk\">BytesChunk</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.71.1/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"uu_tail/args/enum.Signum.html\" title=\"enum uu_tail::args::Signum\">Signum</a>"]],
+7 -1
View File
@@ -376,6 +376,9 @@
<a href="#376" id="376">376</a>
<a href="#377" id="377">377</a>
<a href="#378" id="378">378</a>
<a href="#379" id="379">379</a>
<a href="#380" id="380">380</a>
<a href="#381" id="381">381</a>
</pre></div><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
// *
// * (c) Tobias Bohumir Schottdorf &lt;tobias.schottdorf@gmail.com&gt;
@@ -722,7 +725,10 @@
line
);
<span class="comment">// update line number for the potential next line
</span>line_no += settings.line_increment;
</span><span class="kw">match </span>line_no.checked_add(settings.line_increment) {
<span class="prelude-val">Some</span>(new_line_no) =&gt; line_no = new_line_no,
<span class="prelude-val">None </span>=&gt; <span class="kw">return </span><span class="prelude-val">Err</span>(USimpleError::new(<span class="number">1</span>, <span class="string">&quot;line number overflow&quot;</span>)),
}
} <span class="kw">else </span>{
<span class="kw">let </span>spaces = <span class="string">&quot; &quot;</span>.repeat(settings.number_width + <span class="number">1</span>);
<span class="macro">println!</span>(<span class="string">&quot;{spaces}{line}&quot;</span>);
+84 -2
View File
@@ -318,6 +318,47 @@
<a href="#318" id="318">318</a>
<a href="#319" id="319">319</a>
<a href="#320" id="320">320</a>
<a href="#321" id="321">321</a>
<a href="#322" id="322">322</a>
<a href="#323" id="323">323</a>
<a href="#324" id="324">324</a>
<a href="#325" id="325">325</a>
<a href="#326" id="326">326</a>
<a href="#327" id="327">327</a>
<a href="#328" id="328">328</a>
<a href="#329" id="329">329</a>
<a href="#330" id="330">330</a>
<a href="#331" id="331">331</a>
<a href="#332" id="332">332</a>
<a href="#333" id="333">333</a>
<a href="#334" id="334">334</a>
<a href="#335" id="335">335</a>
<a href="#336" id="336">336</a>
<a href="#337" id="337">337</a>
<a href="#338" id="338">338</a>
<a href="#339" id="339">339</a>
<a href="#340" id="340">340</a>
<a href="#341" id="341">341</a>
<a href="#342" id="342">342</a>
<a href="#343" id="343">343</a>
<a href="#344" id="344">344</a>
<a href="#345" id="345">345</a>
<a href="#346" id="346">346</a>
<a href="#347" id="347">347</a>
<a href="#348" id="348">348</a>
<a href="#349" id="349">349</a>
<a href="#350" id="350">350</a>
<a href="#351" id="351">351</a>
<a href="#352" id="352">352</a>
<a href="#353" id="353">353</a>
<a href="#354" id="354">354</a>
<a href="#355" id="355">355</a>
<a href="#356" id="356">356</a>
<a href="#357" id="357">357</a>
<a href="#358" id="358">358</a>
<a href="#359" id="359">359</a>
<a href="#360" id="360">360</a>
<a href="#361" id="361">361</a>
</pre></div><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
//
// For the full copyright and license information, please view the LICENSE
@@ -362,6 +403,7 @@
[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\
@@ -373,7 +415,7 @@
<span class="macro">println!</span>(<span class="string">&quot;Gathering utils per platform&quot;</span>);
<span class="kw">let </span>utils_per_platform = {
<span class="kw">let </span><span class="kw-2">mut </span>map = HashMap::new();
<span class="kw">for </span>platform <span class="kw">in </span>[<span class="string">&quot;unix&quot;</span>, <span class="string">&quot;macos&quot;</span>, <span class="string">&quot;windows&quot;</span>] {
<span class="kw">for </span>platform <span class="kw">in </span>[<span class="string">&quot;unix&quot;</span>, <span class="string">&quot;macos&quot;</span>, <span class="string">&quot;windows&quot;</span>, <span class="string">&quot;unix_android&quot;</span>] {
<span class="kw">let </span>platform_utils: Vec&lt;String&gt; = String::from_utf8(
std::process::Command::new(<span class="string">&quot;./util/show-utils.sh&quot;</span>)
.arg(<span class="macro">format!</span>(<span class="string">&quot;--features=feat_os_{}&quot;</span>, platform))
@@ -381,6 +423,7 @@
</span>.stdout,
)
.unwrap()
.trim()
.split(<span class="string">&#39; &#39;</span>)
.map(ToString::to_string)
.collect();
@@ -395,6 +438,7 @@
</span>.stdout,
)
.unwrap()
.trim()
.split(<span class="string">&#39; &#39;</span>)
.map(ToString::to_string)
.collect();
@@ -403,9 +447,47 @@
map
};
<span class="macro">println!</span>(<span class="string">&quot;Writing to utils&quot;</span>);
<span class="kw">let </span><span class="kw-2">mut </span>utils = utils.entries().collect::&lt;Vec&lt;<span class="kw">_</span>&gt;&gt;();
utils.sort();
<span class="macro">println!</span>(<span class="string">&quot;Writing util per platform table&quot;</span>);
{
<span class="kw">let </span><span class="kw-2">mut </span>platform_table_file = File::create(<span class="string">&quot;docs/src/platform_table.md&quot;</span>).unwrap();
<span class="comment">// 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.
</span><span class="kw">let </span>check_supported = |name: <span class="kw-2">&amp;</span>str, platform: <span class="kw-2">&amp;</span>str| {
<span class="kw">if </span>name.ends_with(<span class="string">&quot;sum&quot;</span>) || utils_per_platform[platform].iter().any(|u| u == name) {
<span class="string">&quot;&quot;
</span>} <span class="kw">else </span>{
<span class="string">&quot; &quot;
</span>}
};
<span class="macro">writeln!</span>(
platform_table_file,
<span class="string">&quot;| util | Linux | macOS | Windows | FreeBSD | Android |\n\
| ---------------- | ----- | ----- | ------- | ------- | ------- |&quot;
</span>)<span class="question-mark">?</span>;
<span class="kw">for </span>(<span class="kw-2">&amp;</span>name, <span class="kw">_</span>) <span class="kw">in </span><span class="kw-2">&amp;</span>utils {
<span class="kw">if </span>name == <span class="string">&quot;[&quot; </span>{
<span class="kw">continue</span>;
}
<span class="comment">// The alignment is not necessary, but makes the output a bit more
// pretty when viewed as plain markdown.
</span><span class="macro">writeln!</span>(
platform_table_file,
<span class="string">&quot;| {:&lt;16} | {:&lt;5} | {:&lt;5} | {:&lt;7} | {:&lt;7} | {:&lt;7} |&quot;</span>,
<span class="macro">format!</span>(<span class="string">&quot;**{name}**&quot;</span>),
check_supported(name, <span class="string">&quot;linux&quot;</span>),
check_supported(name, <span class="string">&quot;macos&quot;</span>),
check_supported(name, <span class="string">&quot;windows&quot;</span>),
check_supported(name, <span class="string">&quot;unix&quot;</span>),
check_supported(name, <span class="string">&quot;unix_android&quot;</span>),
)<span class="question-mark">?</span>;
}
}
<span class="macro">println!</span>(<span class="string">&quot;Writing to utils&quot;</span>);
<span class="kw">for </span>(<span class="kw-2">&amp;</span>name, (<span class="kw">_</span>, command)) <span class="kw">in </span>utils {
<span class="kw">if </span>name == <span class="string">&quot;[&quot; </span>{
<span class="kw">continue</span>;
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long