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:
@@ -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 <mg@ebfe.org>
|
||||
@@ -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">&</span>str = <span class="string">"Compare two sorted files line by line"</span>;
|
||||
<span class="kw">static </span>LONG_HELP: <span class="kw-2">&</span>str = <span class="string">""</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"{} [OPTION]... FILE1 FILE2"</span>;
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="macro">help_about!</span>(<span class="string">"comm.md"</span>);
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="macro">help_usage!</span>(<span class="string">"comm.md"</span>);
|
||||
|
||||
<span class="kw">mod </span>options {
|
||||
<span class="kw">pub const </span>COLUMN_1: <span class="kw-2">&</span>str = <span class="string">"1"</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(
|
||||
|
||||
@@ -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 <derekchiang93@gmail.com>
|
||||
@@ -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">&</span>str = <span class="string">"Strip last component from file name"</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"{} [OPTION] NAME..."</span>;
|
||||
<span class="kw">const </span>LONG_USAGE: <span class="kw-2">&</span>str = <span class="string">"\
|
||||
Output each NAME with its last non-slash component and trailing slashes \n\
|
||||
removed; if NAME contains no /'s, output '.' (meaning the current directory)."</span>;
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="macro">help_about!</span>(<span class="string">"dirname.md"</span>);
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="macro">help_usage!</span>(<span class="string">"dirname.md"</span>);
|
||||
<span class="kw">const </span>AFTER_HELP: <span class="kw-2">&</span>str = <span class="macro">help_section!</span>(<span class="string">"after help"</span>, <span class="string">"dirname.md"</span>);
|
||||
|
||||
<span class="kw">mod </span>options {
|
||||
<span class="kw">pub const </span>ZERO: <span class="kw-2">&</span>str = <span class="string">"zero"</span>;
|
||||
@@ -116,7 +112,7 @@
|
||||
</span><span class="kw">pub fn </span>uumain(args: <span class="kw">impl </span>uucore::Args) -> UResult<()> {
|
||||
<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">"\0"
|
||||
|
||||
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
Reference in New Issue
Block a user