You've already forked uutils.github.io
mirror of
https://github.com/uutils/uutils.github.io.git
synced 2026-06-10 16:12:28 -07:00
deploy: f0e8d44e6e
This commit is contained in:
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
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
File diff suppressed because one or more lines are too long
+1
-1
@@ -12,7 +12,7 @@ var searchIndex = JSON.parse('{\
|
||||
"chroot":{"doc":"","t":"F","n":["main"],"q":["chroot"],"d":[""],"i":[0],"f":[[[]]],"p":[]},\
|
||||
"cksum":{"doc":"","t":"F","n":["main"],"q":["cksum"],"d":[""],"i":[0],"f":[[[]]],"p":[]},\
|
||||
"comm":{"doc":"","t":"F","n":["main"],"q":["comm"],"d":[""],"i":[0],"f":[[[]]],"p":[]},\
|
||||
"coreutils":{"doc":"","t":"GRFFFFFFFFF","n":["UtilityMap","VERSION","binary_path","gen_completions","gen_coreutils_app","gen_manpage","main","name","not_found","usage","util_map"],"q":["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,0],"f":[0,0,[[],1],[[2,3],4],[3,5],[[2,3],4],[[]],[6,7],[8,4],[[3,7]],[[],[[3,[7]]]]],"p":[[3,"PathBuf"],[8,"Iterator"],[3,"Map"],[15,"never"],[3,"Command"],[3,"Path"],[15,"str"],[3,"OsStr"]]},\
|
||||
"coreutils":{"doc":"","t":"GRFFFFFFFFF","n":["UtilityMap","VERSION","binary_path","gen_completions","gen_coreutils_app","gen_manpage","main","name","not_found","usage","util_map"],"q":["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,0],"f":[0,0,[[],1],[[2,3],4],[3,5],[[2,3],4],[[]],[6,[[8,[7]]]],[9,4],[[3,7]],[[],[[3,[7]]]]],"p":[[3,"PathBuf"],[8,"Iterator"],[3,"Map"],[15,"never"],[3,"Command"],[3,"Path"],[15,"str"],[4,"Option"],[3,"OsStr"]]},\
|
||||
"cp":{"doc":"","t":"F","n":["main"],"q":["cp"],"d":[""],"i":[0],"f":[[[]]],"p":[]},\
|
||||
"csplit":{"doc":"","t":"F","n":["main"],"q":["csplit"],"d":[""],"i":[0],"f":[[[]]],"p":[]},\
|
||||
"cut":{"doc":"","t":"F","n":["main"],"q":["cut"],"d":[""],"i":[0],"f":[[[]]],"p":[]},\
|
||||
|
||||
@@ -213,6 +213,9 @@
|
||||
<a href="#213" id="213">213</a>
|
||||
<a href="#214" id="214">214</a>
|
||||
<a href="#215" id="215">215</a>
|
||||
<a href="#216" id="216">216</a>
|
||||
<a href="#217" id="217">217</a>
|
||||
<a href="#218" id="218">218</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
|
||||
//
|
||||
// (c) Michael Gehring <mg@ebfe.org>
|
||||
@@ -258,8 +261,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>name(binary_path: <span class="kw-2">&</span>Path) -> <span class="kw-2">&</span>str {
|
||||
binary_path.file_stem().unwrap().to_str().unwrap()
|
||||
<span class="kw">fn </span>name(binary_path: <span class="kw-2">&</span>Path) -> <span class="prelude-ty">Option</span><<span class="kw-2">&</span>str> {
|
||||
binary_path.file_stem()<span class="question-mark">?</span>.to_str()
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>main() {
|
||||
@@ -269,7 +272,10 @@
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>args = uucore::args_os();
|
||||
|
||||
<span class="kw">let </span>binary = binary_path(<span class="kw-2">&mut </span>args);
|
||||
<span class="kw">let </span>binary_as_util = name(<span class="kw-2">&</span>binary);
|
||||
<span class="kw">let </span>binary_as_util = name(<span class="kw-2">&</span>binary).unwrap_or_else(|| {
|
||||
usage(<span class="kw-2">&</span>utils, <span class="string">"<unknown binary name>"</span>);
|
||||
process::exit(<span class="number">0</span>);
|
||||
});
|
||||
|
||||
<span class="comment">// binary name equals util name?
|
||||
</span><span class="kw">if let </span><span class="prelude-val">Some</span>(<span class="kw-2">&</span>(uumain, <span class="kw">_</span>)) = utils.get(binary_as_util) {
|
||||
|
||||
@@ -229,6 +229,14 @@
|
||||
<a href="#229" id="229">229</a>
|
||||
<a href="#230" id="230">230</a>
|
||||
<a href="#231" id="231">231</a>
|
||||
<a href="#232" id="232">232</a>
|
||||
<a href="#233" id="233">233</a>
|
||||
<a href="#234" id="234">234</a>
|
||||
<a href="#235" id="235">235</a>
|
||||
<a href="#236" id="236">236</a>
|
||||
<a href="#237" id="237">237</a>
|
||||
<a href="#238" id="238">238</a>
|
||||
<a href="#239" id="239">239</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
|
||||
// *
|
||||
// * (c) Alex Lyon <arcterus@mail.com>
|
||||
@@ -243,7 +251,7 @@
|
||||
<span class="kw">use </span>std::fs::File;
|
||||
<span class="kw">use </span>std::io::{stdin, stdout, BufRead, BufReader, Read, Write};
|
||||
<span class="kw">use </span>std::path::Path;
|
||||
<span class="kw">use </span>uucore::error::{FromIo, UResult};
|
||||
<span class="kw">use </span>uucore::error::{FromIo, UResult, USimpleError};
|
||||
<span class="kw">use </span>uucore::{format_usage, help_about, help_usage};
|
||||
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="macro">help_about!</span>(<span class="string">"paste.md"</span>);
|
||||
@@ -360,6 +368,16 @@
|
||||
files.push(file);
|
||||
}
|
||||
|
||||
<span class="kw">if </span>delimiters.ends_with(<span class="string">'\\'</span>) && !delimiters.ends_with(<span class="string">"\\\\"</span>) {
|
||||
<span class="kw">return </span><span class="prelude-val">Err</span>(USimpleError::new(
|
||||
<span class="number">1</span>,
|
||||
<span class="macro">format!</span>(
|
||||
<span class="string">"delimiter list ends with an unescaped backslash: {}"</span>,
|
||||
delimiters
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
<span class="kw">let </span>delimiters: Vec<char> = unescape(delimiters).chars().collect();
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>delim_count = <span class="number">0</span>;
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>delim_length = <span class="number">1</span>;
|
||||
@@ -453,12 +471,10 @@
|
||||
}
|
||||
|
||||
<span class="comment">// Unescape all special characters
|
||||
// TODO: this will need work to conform to GNU implementation
|
||||
</span><span class="kw">fn </span>unescape(s: <span class="kw-2">&</span>str) -> String {
|
||||
s.replace(<span class="string">"\\n"</span>, <span class="string">"\n"</span>)
|
||||
.replace(<span class="string">"\\t"</span>, <span class="string">"\t"</span>)
|
||||
.replace(<span class="string">"\\\\"</span>, <span class="string">"\\"</span>)
|
||||
.replace(<span class="string">'\\'</span>, <span class="string">""</span>)
|
||||
}
|
||||
</code></pre></div>
|
||||
</section></main><div id="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="uu_paste" data-themes="" data-resource-suffix="" data-rustdoc-version="1.69.0 (84c898d65 2023-04-16)" data-search-js="search-8a59a8356673ec1f.js" data-settings-js="settings-f0c5c39777a9a2f6.js" data-settings-css="settings-0bcba95ff279c1db.css" ></div></body></html>
|
||||
@@ -167,7 +167,6 @@
|
||||
<a href="#167" id="167">167</a>
|
||||
<a href="#168" id="168">168</a>
|
||||
<a href="#169" id="169">169</a>
|
||||
<a href="#170" id="170">170</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
|
||||
// *
|
||||
// * (c) T. Jameson Little <t.jameson.little@gmail.com>
|
||||
@@ -183,11 +182,10 @@
|
||||
<span class="kw">use </span>std::path::Path;
|
||||
<span class="kw">use </span>uucore::display::Quotable;
|
||||
<span class="kw">use </span>uucore::error::{FromIo, UResult, USimpleError};
|
||||
<span class="kw">use </span>uucore::{format_usage, show};
|
||||
<span class="kw">use </span>uucore::{format_usage, help_about, help_usage, show};
|
||||
|
||||
<span class="kw">static </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"{} [OPTION]... [FILE]..."</span>;
|
||||
<span class="kw">static </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Checksum and count the blocks in a file.\n\n\
|
||||
With no FILE, or when FILE is -, read standard input."</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="macro">help_usage!</span>(<span class="string">"sum.md"</span>);
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="macro">help_about!</span>(<span class="string">"sum.md"</span>);
|
||||
|
||||
<span class="comment">// This can be replaced with usize::div_ceil once it is stabilized.
|
||||
// This implementation approach is optimized for when `b` is a constant,
|
||||
|
||||
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
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user