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:
@@ -375,11 +375,6 @@
|
||||
<a href="#375" id="375">375</a>
|
||||
<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>
|
||||
<a href="#382" id="382">382</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
|
||||
//
|
||||
// (c) Alex Lyon <arcterus@mail.com>
|
||||
@@ -401,8 +396,14 @@
|
||||
</span><span class="kw">use </span>uucore::mode;
|
||||
<span class="kw">use </span>uucore::{format_usage, show_error};
|
||||
|
||||
<span class="kw">static </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Change the mode of each FILE to MODE.
|
||||
With --reference, change the mode of each FILE to that of RFILE."</span>;
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Change the mode of each FILE to MODE.\n\
|
||||
With --reference, change the mode of each FILE to that of RFILE."</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"\
|
||||
{} [OPTION]... MODE[,MODE]... FILE...
|
||||
{} [OPTION]... OCTAL-MODE FILE...
|
||||
{} [OPTION]... --reference=RFILE FILE..."</span>;
|
||||
<span class="kw">const </span>LONG_USAGE: <span class="kw-2">&</span>str =
|
||||
<span class="string">"Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'."</span>;
|
||||
|
||||
<span class="kw">mod </span>options {
|
||||
<span class="kw">pub const </span>CHANGES: <span class="kw-2">&</span>str = <span class="string">"changes"</span>;
|
||||
@@ -416,15 +417,6 @@
|
||||
<span class="kw">pub const </span>FILE: <span class="kw-2">&</span>str = <span class="string">"FILE"</span>;
|
||||
}
|
||||
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"\
|
||||
{} [OPTION]... MODE[,MODE]... FILE...
|
||||
{} [OPTION]... OCTAL-MODE FILE...
|
||||
{} [OPTION]... --reference=RFILE FILE..."</span>;
|
||||
|
||||
<span class="kw">fn </span>get_long_usage() -> <span class="kw-2">&</span><span class="lifetime">'static </span>str {
|
||||
<span class="string">"Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'."
|
||||
</span>}
|
||||
|
||||
<span class="attr">#[uucore::main]
|
||||
</span><span class="kw">pub fn </span>uumain(args: <span class="kw">impl </span>uucore::Args) -> UResult<()> {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>args = args.collect_lossy();
|
||||
@@ -433,9 +425,7 @@
|
||||
// a possible MODE prefix '-' needs to be removed (e.g. "chmod -x FILE").
|
||||
</span><span class="kw">let </span>mode_had_minus_prefix = mode::strip_minus_from_mode(<span class="kw-2">&mut </span>args);
|
||||
|
||||
<span class="kw">let </span>after_help = get_long_usage();
|
||||
|
||||
<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>matches = uu_app().after_help(LONG_USAGE).try_get_matches_from(args)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span>changes = matches.get_flag(options::CHANGES);
|
||||
<span class="kw">let </span>quiet = matches.get_flag(options::QUIET);
|
||||
|
||||
@@ -88,10 +88,6 @@
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
|
||||
//
|
||||
// (c) Derek Chiang <derekchiang93@gmail.com>
|
||||
@@ -105,26 +101,22 @@
|
||||
<span class="kw">use </span>uucore::error::{UResult, UUsageError};
|
||||
<span class="kw">use </span>uucore::format_usage;
|
||||
|
||||
<span class="kw">static </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Strip last component from file name"</span>;
|
||||
<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">mod </span>options {
|
||||
<span class="kw">pub const </span>ZERO: <span class="kw-2">&</span>str = <span class="string">"zero"</span>;
|
||||
<span class="kw">pub const </span>DIR: <span class="kw-2">&</span>str = <span class="string">"dir"</span>;
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>get_long_usage() -> <span class="kw-2">&</span><span class="lifetime">'static </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="attr">#[uucore::main]
|
||||
</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(get_long_usage())
|
||||
.try_get_matches_from(args)<span class="question-mark">?</span>;
|
||||
<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>separator = <span class="kw">if </span>matches.get_flag(options::ZERO) {
|
||||
<span class="string">"\0"
|
||||
|
||||
@@ -214,10 +214,6 @@
|
||||
<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>
|
||||
<a href="#219" id="219">219</a>
|
||||
<a href="#220" id="220">220</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
|
||||
// *
|
||||
// * (c) Nicholas Juszczak <juszczakn@gmail.com>
|
||||
@@ -242,8 +238,10 @@
|
||||
|
||||
<span class="kw">static </span>DEFAULT_PERM: u32 = <span class="number">0o755</span>;
|
||||
|
||||
<span class="kw">static </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Create the given DIRECTORY(ies) if they do not exist"</span>;
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Create the given DIRECTORY(ies) if they do not exist"</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"{} [OPTION]... [USER]"</span>;
|
||||
<span class="kw">const </span>LONG_USAGE: <span class="kw-2">&</span>str =
|
||||
<span class="string">"Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'."</span>;
|
||||
|
||||
<span class="kw">mod </span>options {
|
||||
<span class="kw">pub const </span>MODE: <span class="kw-2">&</span>str = <span class="string">"mode"</span>;
|
||||
@@ -252,10 +250,6 @@
|
||||
<span class="kw">pub const </span>DIRS: <span class="kw-2">&</span>str = <span class="string">"dirs"</span>;
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>get_long_usage() -> <span class="kw-2">&</span><span class="lifetime">'static </span>str {
|
||||
<span class="string">"Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'."
|
||||
</span>}
|
||||
|
||||
<span class="attr">#[cfg(windows)]
|
||||
</span><span class="kw">fn </span>get_mode(_matches: <span class="kw-2">&</span>ArgMatches, _mode_had_minus_prefix: bool) -> <span class="prelude-ty">Result</span><u32, String> {
|
||||
<span class="prelude-val">Ok</span>(DEFAULT_PERM)
|
||||
@@ -312,9 +306,7 @@
|
||||
<span class="comment">// Linux-specific options, not implemented
|
||||
// opts.optflag("Z", "context", "set SELinux security context" +
|
||||
// " of each created directory to CTX"),
|
||||
</span><span class="kw">let </span>matches = uu_app()
|
||||
.after_help(get_long_usage())
|
||||
.try_get_matches_from(args)<span class="question-mark">?</span>;
|
||||
</span><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>dirs = matches
|
||||
.get_many::<OsString>(options::DIRS)
|
||||
|
||||
+16
-26
@@ -574,11 +574,6 @@
|
||||
<a href="#574" id="574">574</a>
|
||||
<a href="#575" id="575">575</a>
|
||||
<a href="#576" id="576">576</a>
|
||||
<a href="#577" id="577">577</a>
|
||||
<a href="#578" id="578">578</a>
|
||||
<a href="#579" id="579">579</a>
|
||||
<a href="#580" id="580">580</a>
|
||||
<a href="#581" id="581">581</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
|
||||
// *
|
||||
// * (c) Alex Lyon <arcterus@mail.com>
|
||||
@@ -618,8 +613,22 @@
|
||||
verbose: bool,
|
||||
}
|
||||
|
||||
<span class="kw">static </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Remove (unlink) the FILE(s)"</span>;
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Remove (unlink) the FILE(s)"</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"{} [OPTION]... FILE..."</span>;
|
||||
<span class="kw">const </span>LONG_USAGE: <span class="kw-2">&</span>str = <span class="string">"\
|
||||
By default, rm does not remove directories. Use the --recursive (-r or -R)
|
||||
option to remove each listed directory, too, along with all of its contents
|
||||
|
||||
To remove a file whose name starts with a '-', for example '-foo',
|
||||
use one of these commands:
|
||||
rm -- -foo
|
||||
|
||||
rm ./-foo
|
||||
|
||||
Note that if you use rm to remove a file, it might be possible to recover
|
||||
some of its contents, given sufficient expertise and/or time. For greater
|
||||
assurance that the contents are truly unrecoverable, consider using shred."</span>;
|
||||
|
||||
<span class="kw">static </span>OPT_DIR: <span class="kw-2">&</span>str = <span class="string">"dir"</span>;
|
||||
<span class="kw">static </span>OPT_INTERACTIVE: <span class="kw-2">&</span>str = <span class="string">"interactive"</span>;
|
||||
<span class="kw">static </span>OPT_FORCE: <span class="kw-2">&</span>str = <span class="string">"force"</span>;
|
||||
@@ -634,28 +643,9 @@
|
||||
|
||||
<span class="kw">static </span>ARG_FILES: <span class="kw-2">&</span>str = <span class="string">"files"</span>;
|
||||
|
||||
<span class="kw">fn </span>get_long_usage() -> String {
|
||||
String::from(
|
||||
<span class="string">"By default, rm does not remove directories. Use the --recursive (-r or -R)
|
||||
option to remove each listed directory, too, along with all of its contents
|
||||
|
||||
To remove a file whose name starts with a '-', for example '-foo',
|
||||
use one of these commands:
|
||||
rm -- -foo
|
||||
|
||||
rm ./-foo
|
||||
|
||||
Note that if you use rm to remove a file, it might be possible to recover
|
||||
some of its contents, given sufficient expertise and/or time. For greater
|
||||
assurance that the contents are truly unrecoverable, consider using shred."</span>,
|
||||
)
|
||||
}
|
||||
|
||||
<span class="attr">#[uucore::main]
|
||||
</span><span class="kw">pub fn </span>uumain(args: <span class="kw">impl </span>uucore::Args) -> UResult<()> {
|
||||
<span class="kw">let </span>matches = uu_app()
|
||||
.after_help(get_long_usage())
|
||||
.try_get_matches_from(args)<span class="question-mark">?</span>;
|
||||
<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>files: Vec<String> = matches
|
||||
.get_many::<String>(ARG_FILES)
|
||||
|
||||
@@ -931,63 +931,6 @@
|
||||
<a href="#931" id="931">931</a>
|
||||
<a href="#932" id="932">932</a>
|
||||
<a href="#933" id="933">933</a>
|
||||
<a href="#934" id="934">934</a>
|
||||
<a href="#935" id="935">935</a>
|
||||
<a href="#936" id="936">936</a>
|
||||
<a href="#937" id="937">937</a>
|
||||
<a href="#938" id="938">938</a>
|
||||
<a href="#939" id="939">939</a>
|
||||
<a href="#940" id="940">940</a>
|
||||
<a href="#941" id="941">941</a>
|
||||
<a href="#942" id="942">942</a>
|
||||
<a href="#943" id="943">943</a>
|
||||
<a href="#944" id="944">944</a>
|
||||
<a href="#945" id="945">945</a>
|
||||
<a href="#946" id="946">946</a>
|
||||
<a href="#947" id="947">947</a>
|
||||
<a href="#948" id="948">948</a>
|
||||
<a href="#949" id="949">949</a>
|
||||
<a href="#950" id="950">950</a>
|
||||
<a href="#951" id="951">951</a>
|
||||
<a href="#952" id="952">952</a>
|
||||
<a href="#953" id="953">953</a>
|
||||
<a href="#954" id="954">954</a>
|
||||
<a href="#955" id="955">955</a>
|
||||
<a href="#956" id="956">956</a>
|
||||
<a href="#957" id="957">957</a>
|
||||
<a href="#958" id="958">958</a>
|
||||
<a href="#959" id="959">959</a>
|
||||
<a href="#960" id="960">960</a>
|
||||
<a href="#961" id="961">961</a>
|
||||
<a href="#962" id="962">962</a>
|
||||
<a href="#963" id="963">963</a>
|
||||
<a href="#964" id="964">964</a>
|
||||
<a href="#965" id="965">965</a>
|
||||
<a href="#966" id="966">966</a>
|
||||
<a href="#967" id="967">967</a>
|
||||
<a href="#968" id="968">968</a>
|
||||
<a href="#969" id="969">969</a>
|
||||
<a href="#970" id="970">970</a>
|
||||
<a href="#971" id="971">971</a>
|
||||
<a href="#972" id="972">972</a>
|
||||
<a href="#973" id="973">973</a>
|
||||
<a href="#974" id="974">974</a>
|
||||
<a href="#975" id="975">975</a>
|
||||
<a href="#976" id="976">976</a>
|
||||
<a href="#977" id="977">977</a>
|
||||
<a href="#978" id="978">978</a>
|
||||
<a href="#979" id="979">979</a>
|
||||
<a href="#980" id="980">980</a>
|
||||
<a href="#981" id="981">981</a>
|
||||
<a href="#982" id="982">982</a>
|
||||
<a href="#983" id="983">983</a>
|
||||
<a href="#984" id="984">984</a>
|
||||
<a href="#985" id="985">985</a>
|
||||
<a href="#986" id="986">986</a>
|
||||
<a href="#987" id="987">987</a>
|
||||
<a href="#988" id="988">988</a>
|
||||
<a href="#989" id="989">989</a>
|
||||
<a href="#990" id="990">990</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
|
||||
//
|
||||
// (c) Jian Zeng <anonymousknight96@gmail.com>
|
||||
@@ -1003,7 +946,7 @@
|
||||
pretty_filetype, pretty_fstype, pretty_time, read_fs_list, statfs, BirthTime, FsMeta,
|
||||
};
|
||||
<span class="kw">use </span>uucore::libc::mode_t;
|
||||
<span class="kw">use </span>uucore::{entries, format_usage, show_error, show_warning};
|
||||
<span class="kw">use </span>uucore::{entries, format_usage, help_section, help_usage, show_error, show_warning};
|
||||
|
||||
<span class="kw">use </span>clap::{crate_version, Arg, ArgAction, ArgMatches, Command};
|
||||
<span class="kw">use </span>std::borrow::Cow;
|
||||
@@ -1014,8 +957,9 @@
|
||||
<span class="kw">use </span>std::os::unix::prelude::OsStrExt;
|
||||
<span class="kw">use </span>std::path::Path;
|
||||
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Display file or file system status."</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"{} [OPTION]... FILE..."</span>;
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="macro">help_section!</span>(<span class="string">"about"</span>, <span class="string">"stat.md"</span>);
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="macro">help_usage!</span>(<span class="string">"stat.md"</span>);
|
||||
<span class="kw">const </span>LONG_USAGE: <span class="kw-2">&</span>str = <span class="macro">help_section!</span>(<span class="string">"long usage"</span>, <span class="string">"stat.md"</span>);
|
||||
|
||||
<span class="kw">mod </span>options {
|
||||
<span class="kw">pub const </span>DEREFERENCE: <span class="kw-2">&</span>str = <span class="string">"dereference"</span>;
|
||||
@@ -1741,67 +1685,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>get_long_usage() -> <span class="kw-2">&</span><span class="lifetime">'static </span>str {
|
||||
<span class="string">"
|
||||
The valid format sequences for files (without --file-system):
|
||||
|
||||
%a access rights in octal (note '#' and '0' printf flags)
|
||||
%A access rights in human readable form
|
||||
%b number of blocks allocated (see %B)
|
||||
%B the size in bytes of each block reported by %b
|
||||
%C SELinux security context string
|
||||
%d device number in decimal
|
||||
%D device number in hex
|
||||
%f raw mode in hex
|
||||
%F file type
|
||||
%g group ID of owner
|
||||
%G group name of owner
|
||||
%h number of hard links
|
||||
%i inode number
|
||||
%m mount point
|
||||
%n file name
|
||||
%N quoted file name with dereference if symbolic link
|
||||
%o optimal I/O transfer size hint
|
||||
%s total size, in bytes
|
||||
%t major device type in hex, for character/block device special files
|
||||
%T minor device type in hex, for character/block device special files
|
||||
%u user ID of owner
|
||||
%U user name of owner
|
||||
%w time of file birth, human-readable; - if unknown
|
||||
%W time of file birth, seconds since Epoch; 0 if unknown
|
||||
%x time of last access, human-readable
|
||||
%X time of last access, seconds since Epoch
|
||||
%y time of last data modification, human-readable
|
||||
%Y time of last data modification, seconds since Epoch
|
||||
%z time of last status change, human-readable
|
||||
%Z time of last status change, seconds since Epoch
|
||||
|
||||
Valid format sequences for file systems:
|
||||
|
||||
%a free blocks available to non-superuser
|
||||
%b total data blocks in file system
|
||||
%c total file nodes in file system
|
||||
%d free file nodes in file system
|
||||
%f free blocks in file system
|
||||
%i file system ID in hex
|
||||
%l maximum length of filenames
|
||||
%n file name
|
||||
%s block size (for faster transfers)
|
||||
%S fundamental block size (for block counts)
|
||||
%t file system type in hex
|
||||
%T file system type in human readable form
|
||||
|
||||
NOTE: your shell may have its own version of stat, which usually supersedes
|
||||
the version described here. Please refer to your shell's documentation
|
||||
for details about the options it supports.
|
||||
"
|
||||
</span>}
|
||||
|
||||
<span class="attr">#[uucore::main]
|
||||
</span><span class="kw">pub fn </span>uumain(args: <span class="kw">impl </span>uucore::Args) -> UResult<()> {
|
||||
<span class="kw">let </span>matches = uu_app()
|
||||
.after_help(get_long_usage())
|
||||
.try_get_matches_from(args)<span class="question-mark">?</span>;
|
||||
<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>stater = Stater::new(<span class="kw-2">&</span>matches)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>exit_status = stater.exec();
|
||||
|
||||
@@ -169,11 +169,6 @@
|
||||
<a href="#169" id="169">169</a>
|
||||
<a href="#170" id="170">170</a>
|
||||
<a href="#171" id="171">171</a>
|
||||
<a href="#172" id="172">172</a>
|
||||
<a href="#173" id="173">173</a>
|
||||
<a href="#174" id="174">174</a>
|
||||
<a href="#175" id="175">175</a>
|
||||
<a href="#176" id="176">176</a>
|
||||
</pre><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
|
||||
@@ -195,8 +190,11 @@
|
||||
<span class="kw">use </span>uucore::display::Quotable;
|
||||
<span class="kw">use </span>uucore::error::{UResult, USimpleError, UUsageError};
|
||||
|
||||
<span class="kw">static </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Translate or delete characters"</span>;
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Translate or delete characters"</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"{} [OPTION]... SET1 [SET2]"</span>;
|
||||
<span class="kw">const </span>LONG_USAGE: <span class="kw-2">&</span>str = <span class="string">"\
|
||||
Translate, squeeze, and/or delete characters from standard input, \
|
||||
writing to standard output."</span>;
|
||||
|
||||
<span class="kw">mod </span>options {
|
||||
<span class="kw">pub const </span>COMPLEMENT: <span class="kw-2">&</span>str = <span class="string">"complement"</span>;
|
||||
@@ -206,19 +204,11 @@
|
||||
<span class="kw">pub const </span>SETS: <span class="kw-2">&</span>str = <span class="string">"sets"</span>;
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>get_long_usage() -> String {
|
||||
<span class="string">"Translate, squeeze, and/or delete characters from standard input, \
|
||||
writing to standard output."
|
||||
</span>.to_string()
|
||||
}
|
||||
|
||||
<span class="attr">#[uucore::main]
|
||||
</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(get_long_usage())
|
||||
.try_get_matches_from(args)<span class="question-mark">?</span>;
|
||||
<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>delete_flag = matches.get_flag(options::DELETE);
|
||||
<span class="kw">let </span>complement_flag = matches.get_flag(options::COMPLEMENT);
|
||||
|
||||
@@ -461,11 +461,6 @@
|
||||
<a href="#461" id="461">461</a>
|
||||
<a href="#462" id="462">462</a>
|
||||
<a href="#463" id="463">463</a>
|
||||
<a href="#464" id="464">464</a>
|
||||
<a href="#465" id="465">465</a>
|
||||
<a href="#466" id="466">466</a>
|
||||
<a href="#467" id="467">467</a>
|
||||
<a href="#468" id="468">468</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
|
||||
// *
|
||||
// * (c) Alex Lyon <arcterus@mail.com>
|
||||
@@ -541,8 +536,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">static </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Shrink or extend the size of each file to the specified size."</span>;
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Shrink or extend the size of each file to the specified size."</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"{} [OPTION]... [FILE]..."</span>;
|
||||
<span class="kw">const </span>LONG_USAGE: <span class="kw-2">&</span>str = <span class="string">"\
|
||||
SIZE is an integer with an optional prefix and optional unit.
|
||||
The available units (K, M, G, T, P, E, Z, and Y) use the following format:
|
||||
'KB' => 1000 (kilobytes)
|
||||
'K' => 1024 (kibibytes)
|
||||
'MB' => 1000*1000 (megabytes)
|
||||
'M' => 1024*1024 (mebibytes)
|
||||
'GB' => 1000*1000*1000 (gigabytes)
|
||||
'G' => 1024*1024*1024 (gibibytes)
|
||||
SIZE may also be prefixed by one of the following to adjust the size of each
|
||||
file based on its current size:
|
||||
'+' => extend by
|
||||
'-' => reduce by
|
||||
'<' => at most
|
||||
'>' => at least
|
||||
'/' => round down to multiple of
|
||||
'%' => round up to multiple of"</span>;
|
||||
|
||||
<span class="kw">pub mod </span>options {
|
||||
<span class="kw">pub static </span>IO_BLOCKS: <span class="kw-2">&</span>str = <span class="string">"io-blocks"</span>;
|
||||
@@ -552,32 +564,10 @@
|
||||
<span class="kw">pub static </span>ARG_FILES: <span class="kw-2">&</span>str = <span class="string">"files"</span>;
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>get_long_usage() -> String {
|
||||
String::from(
|
||||
<span class="string">"
|
||||
SIZE is an integer with an optional prefix and optional unit.
|
||||
The available units (K, M, G, T, P, E, Z, and Y) use the following format:
|
||||
'KB' => 1000 (kilobytes)
|
||||
'K' => 1024 (kibibytes)
|
||||
'MB' => 1000*1000 (megabytes)
|
||||
'M' => 1024*1024 (mebibytes)
|
||||
'GB' => 1000*1000*1000 (gigabytes)
|
||||
'G' => 1024*1024*1024 (gibibytes)
|
||||
SIZE may also be prefixed by one of the following to adjust the size of each
|
||||
file based on its current size:
|
||||
'+' => extend by
|
||||
'-' => reduce by
|
||||
'<' => at most
|
||||
'>' => at least
|
||||
'/' => round down to multiple of
|
||||
'%' => round up to multiple of"</span>,
|
||||
)
|
||||
}
|
||||
|
||||
<span class="attr">#[uucore::main]
|
||||
</span><span class="kw">pub fn </span>uumain(args: <span class="kw">impl </span>uucore::Args) -> UResult<()> {
|
||||
<span class="kw">let </span>matches = uu_app()
|
||||
.after_help(get_long_usage())
|
||||
.after_help(LONG_USAGE)
|
||||
.try_get_matches_from(args)
|
||||
.map_err(|e| {
|
||||
e.print().expect(<span class="string">"Error writing clap::Error"</span>);
|
||||
|
||||
@@ -434,11 +434,6 @@
|
||||
<a href="#434" id="434">434</a>
|
||||
<a href="#435" id="435">435</a>
|
||||
<a href="#436" id="436">436</a>
|
||||
<a href="#437" id="437">437</a>
|
||||
<a href="#438" id="438">438</a>
|
||||
<a href="#439" id="439">439</a>
|
||||
<a href="#440" id="440">440</a>
|
||||
<a href="#441" id="441">441</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
|
||||
// *
|
||||
// * (c) Chirag B Jadwani <chirag.jadwani@gmail.com>
|
||||
@@ -456,8 +451,14 @@
|
||||
<span class="kw">use </span>uucore::error::{FromIo, UResult, USimpleError, UUsageError};
|
||||
<span class="kw">use </span>uucore::format_usage;
|
||||
|
||||
<span class="kw">static </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Report or omit repeated lines."</span>;
|
||||
<span class="kw">const </span>ABOUT: <span class="kw-2">&</span>str = <span class="string">"Report or omit repeated lines."</span>;
|
||||
<span class="kw">const </span>USAGE: <span class="kw-2">&</span>str = <span class="string">"{} [OPTION]... [INPUT [OUTPUT]]..."</span>;
|
||||
<span class="kw">const </span>LONG_USAGE: <span class="kw-2">&</span>str = <span class="string">"\
|
||||
Filter adjacent matching lines from INPUT (or standard input),\n\
|
||||
writing to OUTPUT (or standard output).\n\n\
|
||||
Note: 'uniq' does not detect repeated lines unless they are adjacent.\n\
|
||||
You may want to sort the input first, or use 'sort -u' without 'uniq'."</span>;
|
||||
|
||||
<span class="kw">pub mod </span>options {
|
||||
<span class="kw">pub static </span>ALL_REPEATED: <span class="kw-2">&</span>str = <span class="string">"all-repeated"</span>;
|
||||
<span class="kw">pub static </span>CHECK_CHARS: <span class="kw-2">&</span>str = <span class="string">"check-chars"</span>;
|
||||
@@ -682,20 +683,9 @@
|
||||
})
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>get_long_usage() -> String {
|
||||
String::from(
|
||||
<span class="string">"Filter adjacent matching lines from INPUT (or standard input),\n\
|
||||
writing to OUTPUT (or standard output).
|
||||
Note: 'uniq' does not detect repeated lines unless they are adjacent.\n\
|
||||
You may want to sort the input first, or use 'sort -u' without 'uniq'.\n"</span>,
|
||||
)
|
||||
}
|
||||
|
||||
<span class="attr">#[uucore::main]
|
||||
</span><span class="kw">pub fn </span>uumain(args: <span class="kw">impl </span>uucore::Args) -> UResult<()> {
|
||||
<span class="kw">let </span>matches = uu_app()
|
||||
.after_help(get_long_usage())
|
||||
.try_get_matches_from(args)<span class="question-mark">?</span>;
|
||||
<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>files: Vec<String> = matches
|
||||
.get_many::<String>(ARG_FILES)
|
||||
|
||||
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