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
@@ -1,4 +1,5 @@
|
||||
(function() {var implementors = {
|
||||
"uu_nl":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.70.0/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"uu_nl/struct.Settings.html\" title=\"struct uu_nl::Settings\">Settings</a>"]],
|
||||
"uu_numfmt":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.70.0/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"uu_numfmt/options/struct.FormatOptions.html\" title=\"struct uu_numfmt::options::FormatOptions\">FormatOptions</a>"]],
|
||||
"uu_sort":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.70.0/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"uu_sort/struct.GlobalSettings.html\" title=\"struct uu_sort::GlobalSettings\">GlobalSettings</a>"]],
|
||||
"uu_stty":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.70.0/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"uu_stty/struct.TermSize.html\" title=\"struct uu_stty::TermSize\">TermSize</a>"]],
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+24
-18
@@ -401,6 +401,9 @@
|
||||
<a href="#401" id="401">401</a>
|
||||
<a href="#402" id="402">402</a>
|
||||
<a href="#403" id="403">403</a>
|
||||
<a href="#404" id="404">404</a>
|
||||
<a href="#405" id="405">405</a>
|
||||
<a href="#406" id="406">406</a>
|
||||
</pre></div><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
|
||||
// *
|
||||
// * (c) Tobias Bohumir Schottdorf <tobias.schottdorf@gmail.com>
|
||||
@@ -409,8 +412,6 @@
|
||||
// * file that was distributed with this source code.
|
||||
// *
|
||||
|
||||
// spell-checker:ignore (ToDO) corasick memchr
|
||||
|
||||
</span><span class="kw">use </span>clap::{crate_version, Arg, ArgAction, Command};
|
||||
<span class="kw">use </span>std::fs::File;
|
||||
<span class="kw">use </span>std::io::{stdin, BufRead, BufReader, Read};
|
||||
@@ -421,8 +422,8 @@
|
||||
|
||||
<span class="kw">mod </span>helper;
|
||||
|
||||
<span class="kw">static </span>ABOUT: <span class="kw-2">&</span>str = <span class="macro">help_about!</span>(<span class="string">"nl.md"</span>);
|
||||
<span class="kw">static </span>USAGE: <span class="kw-2">&</span>str = <span class="macro">help_usage!</span>(<span class="string">"nl.md"</span>);
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="macro">help_about!</span>(<span class="string">"nl.md"</span>);
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="macro">help_usage!</span>(<span class="string">"nl.md"</span>);
|
||||
|
||||
<span class="comment">// Settings store options used by nl to produce its output.
|
||||
</span><span class="kw">pub struct </span>Settings {
|
||||
@@ -445,6 +446,24 @@
|
||||
</span>number_separator: String,
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Default <span class="kw">for </span>Settings {
|
||||
<span class="kw">fn </span>default() -> <span class="self">Self </span>{
|
||||
<span class="self">Self </span>{
|
||||
header_numbering: NumberingStyle::NumberForNone,
|
||||
body_numbering: NumberingStyle::NumberForAll,
|
||||
footer_numbering: NumberingStyle::NumberForNone,
|
||||
section_delimiter: [<span class="string">'\\'</span>, <span class="string">':'</span>],
|
||||
starting_line_number: <span class="number">1</span>,
|
||||
line_increment: <span class="number">1</span>,
|
||||
join_blank_lines: <span class="number">1</span>,
|
||||
number_width: <span class="number">6</span>,
|
||||
number_format: NumberFormat::Right,
|
||||
renumber: <span class="bool-val">true</span>,
|
||||
number_separator: String::from(<span class="string">"\t"</span>),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// NumberingStyle stores which lines are to be numbered.
|
||||
// The possible options are:
|
||||
// 1. Number all lines
|
||||
@@ -490,20 +509,7 @@
|
||||
|
||||
<span class="kw">let </span>matches = uu_app().try_get_matches_from(args)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// A mutable settings object, initialized with the defaults.
|
||||
</span><span class="kw">let </span><span class="kw-2">mut </span>settings = Settings {
|
||||
header_numbering: NumberingStyle::NumberForNone,
|
||||
body_numbering: NumberingStyle::NumberForAll,
|
||||
footer_numbering: NumberingStyle::NumberForNone,
|
||||
section_delimiter: [<span class="string">'\\'</span>, <span class="string">':'</span>],
|
||||
starting_line_number: <span class="number">1</span>,
|
||||
line_increment: <span class="number">1</span>,
|
||||
join_blank_lines: <span class="number">1</span>,
|
||||
number_width: <span class="number">6</span>,
|
||||
number_format: NumberFormat::Right,
|
||||
renumber: <span class="bool-val">true</span>,
|
||||
number_separator: String::from(<span class="string">"\t"</span>),
|
||||
};
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>settings = Settings::default();
|
||||
|
||||
<span class="comment">// Update the settings from the command line options, and terminate the
|
||||
// program if some options could not successfully be parsed.
|
||||
|
||||
@@ -615,7 +615,7 @@
|
||||
// For the full copyright and license information, please view the LICENSE file
|
||||
// that was distributed with this source code.
|
||||
|
||||
// spell-checker:ignore (ToDO) filetime strptime utcoff strs datetime MMDDhhmm clapv PWSTR lpszfilepath hresult mktime YYYYMMDDHHMM YYMMDDHHMM DATETIME YYYYMMDDHHMMS subsecond humantime
|
||||
// spell-checker:ignore (ToDO) filetime datetime MMDDhhmm lpszfilepath mktime YYYYMMDDHHMM YYMMDDHHMM DATETIME YYYYMMDDHHMMS subsecond humantime
|
||||
|
||||
</span><span class="kw">use </span>clap::builder::ValueParser;
|
||||
<span class="kw">use </span>clap::{crate_version, Arg, ArgAction, ArgGroup, Command};
|
||||
@@ -638,7 +638,7 @@
|
||||
<span class="kw">pub mod </span>sources {
|
||||
<span class="kw">pub static </span>DATE: <span class="kw-2">&</span>str = <span class="string">"date"</span>;
|
||||
<span class="kw">pub static </span>REFERENCE: <span class="kw-2">&</span>str = <span class="string">"reference"</span>;
|
||||
<span class="kw">pub static </span>CURRENT: <span class="kw-2">&</span>str = <span class="string">"current"</span>;
|
||||
<span class="kw">pub static </span>TIMESTAMP: <span class="kw-2">&</span>str = <span class="string">"timestamp"</span>;
|
||||
}
|
||||
<span class="kw">pub static </span>HELP: <span class="kw-2">&</span>str = <span class="string">"help"</span>;
|
||||
<span class="kw">pub static </span>ACCESS: <span class="kw-2">&</span>str = <span class="string">"access"</span>;
|
||||
@@ -729,12 +729,12 @@
|
||||
(timestamp, timestamp)
|
||||
}
|
||||
(<span class="prelude-val">None</span>, <span class="prelude-val">None</span>) => {
|
||||
<span class="kw">let </span>timestamp =
|
||||
<span class="kw">if let </span><span class="prelude-val">Some</span>(current) = matches.get_one::<String>(options::sources::CURRENT) {
|
||||
parse_timestamp(current)<span class="question-mark">?
|
||||
</span>} <span class="kw">else </span>{
|
||||
local_dt_to_filetime(time::OffsetDateTime::now_local().unwrap())
|
||||
};
|
||||
<span class="kw">let </span>timestamp = <span class="kw">if let </span><span class="prelude-val">Some</span>(ts) = matches.get_one::<String>(options::sources::TIMESTAMP)
|
||||
{
|
||||
parse_timestamp(ts)<span class="question-mark">?
|
||||
</span>} <span class="kw">else </span>{
|
||||
local_dt_to_filetime(time::OffsetDateTime::now_local().unwrap())
|
||||
};
|
||||
(timestamp, timestamp)
|
||||
}
|
||||
};
|
||||
@@ -852,7 +852,7 @@
|
||||
.action(ArgAction::SetTrue),
|
||||
)
|
||||
.arg(
|
||||
Arg::new(options::sources::CURRENT)
|
||||
Arg::new(options::sources::TIMESTAMP)
|
||||
.short(<span class="string">'t'</span>)
|
||||
.help(<span class="string">"use [[CC]YY]MMDDhhmm[.ss] instead of the current time"</span>)
|
||||
.value_name(<span class="string">"STAMP"</span>),
|
||||
@@ -864,7 +864,7 @@
|
||||
.allow_hyphen_values(<span class="bool-val">true</span>)
|
||||
.help(<span class="string">"parse argument and use it instead of current time"</span>)
|
||||
.value_name(<span class="string">"STRING"</span>)
|
||||
.conflicts_with(options::sources::CURRENT),
|
||||
.conflicts_with(options::sources::TIMESTAMP),
|
||||
)
|
||||
.arg(
|
||||
Arg::new(options::MODIFICATION)
|
||||
@@ -897,7 +897,7 @@
|
||||
.value_name(<span class="string">"FILE"</span>)
|
||||
.value_parser(ValueParser::os_string())
|
||||
.value_hint(clap::ValueHint::AnyPath)
|
||||
.conflicts_with(options::sources::CURRENT),
|
||||
.conflicts_with(options::sources::TIMESTAMP),
|
||||
)
|
||||
.arg(
|
||||
Arg::new(options::TIME)
|
||||
@@ -920,7 +920,7 @@
|
||||
.group(
|
||||
ArgGroup::new(options::SOURCES)
|
||||
.args([
|
||||
options::sources::CURRENT,
|
||||
options::sources::TIMESTAMP,
|
||||
options::sources::DATE,
|
||||
options::sources::REFERENCE,
|
||||
])
|
||||
|
||||
+1
-1
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
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
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user