This commit is contained in:
sylvestre
2023-02-28 02:53:13 +00:00
parent 8dae411076
commit 108226c885
8 changed files with 14 additions and 22 deletions
+3 -7
View File
@@ -204,8 +204,6 @@
<a href="#204" id="204">204</a>
<a href="#205" id="205">205</a>
<a href="#206" id="206">206</a>
<a href="#207" id="207">207</a>
<a href="#208" id="208">208</a>
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
//
// (c) Michael Gehring &lt;mg@ebfe.org&gt;
@@ -221,13 +219,12 @@
<span class="kw">use </span>std::path::Path;
<span class="kw">use </span>uucore::error::FromIo;
<span class="kw">use </span>uucore::error::UResult;
<span class="kw">use </span>uucore::format_usage;
<span class="kw">use </span>uucore::{format_usage, help_about, help_usage};
<span class="kw">use </span>clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
<span class="kw">static </span>ABOUT: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Compare two sorted files line by line&quot;</span>;
<span class="kw">static </span>LONG_HELP: <span class="kw-2">&amp;</span>str = <span class="string">&quot;&quot;</span>;
<span class="kw">const </span>USAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;{} [OPTION]... FILE1 FILE2&quot;</span>;
<span class="kw">const </span>ABOUT: <span class="kw-2">&amp;</span>str = <span class="macro">help_about!</span>(<span class="string">&quot;comm.md&quot;</span>);
<span class="kw">const </span>USAGE: <span class="kw-2">&amp;</span>str = <span class="macro">help_usage!</span>(<span class="string">&quot;comm.md&quot;</span>);
<span class="kw">mod </span>options {
<span class="kw">pub const </span>COLUMN_1: <span class="kw-2">&amp;</span>str = <span class="string">&quot;1&quot;</span>;
@@ -368,7 +365,6 @@
Command::new(uucore::util_name())
.version(<span class="macro">crate_version!</span>())
.about(ABOUT)
.after_help(LONG_HELP)
.override_usage(format_usage(USAGE))
.infer_long_args(<span class="bool-val">true</span>)
.arg(
+5 -9
View File
@@ -86,8 +86,6 @@
<a href="#86" id="86">86</a>
<a href="#87" id="87">87</a>
<a href="#88" id="88">88</a>
<a href="#89" id="89">89</a>
<a href="#90" id="90">90</a>
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
//
// (c) Derek Chiang &lt;derekchiang93@gmail.com&gt;
@@ -99,13 +97,11 @@
<span class="kw">use </span>std::path::Path;
<span class="kw">use </span>uucore::display::print_verbatim;
<span class="kw">use </span>uucore::error::{UResult, UUsageError};
<span class="kw">use </span>uucore::format_usage;
<span class="kw">use </span>uucore::{format_usage, help_about, help_section, help_usage};
<span class="kw">const </span>ABOUT: <span class="kw-2">&amp;</span>str = <span class="string">&quot;Strip last component from file name&quot;</span>;
<span class="kw">const </span>USAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;{} [OPTION] NAME...&quot;</span>;
<span class="kw">const </span>LONG_USAGE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;\
Output each NAME with its last non-slash component and trailing slashes \n\
removed; if NAME contains no /&#39;s, output &#39;.&#39; (meaning the current directory).&quot;</span>;
<span class="kw">const </span>ABOUT: <span class="kw-2">&amp;</span>str = <span class="macro">help_about!</span>(<span class="string">&quot;dirname.md&quot;</span>);
<span class="kw">const </span>USAGE: <span class="kw-2">&amp;</span>str = <span class="macro">help_usage!</span>(<span class="string">&quot;dirname.md&quot;</span>);
<span class="kw">const </span>AFTER_HELP: <span class="kw-2">&amp;</span>str = <span class="macro">help_section!</span>(<span class="string">&quot;after help&quot;</span>, <span class="string">&quot;dirname.md&quot;</span>);
<span class="kw">mod </span>options {
<span class="kw">pub const </span>ZERO: <span class="kw-2">&amp;</span>str = <span class="string">&quot;zero&quot;</span>;
@@ -116,7 +112,7 @@
</span><span class="kw">pub fn </span>uumain(args: <span class="kw">impl </span>uucore::Args) -&gt; UResult&lt;()&gt; {
<span class="kw">let </span>args = args.collect_lossy();
<span class="kw">let </span>matches = uu_app().after_help(LONG_USAGE).try_get_matches_from(args)<span class="question-mark">?</span>;
<span class="kw">let </span>matches = uu_app().after_help(AFTER_HELP).try_get_matches_from(args)<span class="question-mark">?</span>;
<span class="kw">let </span>separator = <span class="kw">if </span>matches.get_flag(options::ZERO) {
<span class="string">&quot;\0&quot;
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