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:
@@ -582,6 +582,13 @@
|
||||
<a href="#582" id="582">582</a>
|
||||
<a href="#583" id="583">583</a>
|
||||
<a href="#584" id="584">584</a>
|
||||
<a href="#585" id="585">585</a>
|
||||
<a href="#586" id="586">586</a>
|
||||
<a href="#587" id="587">587</a>
|
||||
<a href="#588" id="588">588</a>
|
||||
<a href="#589" id="589">589</a>
|
||||
<a href="#590" id="590">590</a>
|
||||
<a href="#591" id="591">591</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
|
||||
//
|
||||
// (c) Sunrin SHIMURA
|
||||
@@ -775,7 +782,14 @@
|
||||
(tmpdir, template.to_string())
|
||||
}
|
||||
<span class="prelude-val">Some</span>(template) => {
|
||||
<span class="kw">let </span>tmpdir = matches.get_one::<String>(OPT_TMPDIR).map(String::from);
|
||||
<span class="kw">let </span>tmpdir = <span class="kw">if </span>matches.contains_id(OPT_TMPDIR) {
|
||||
matches.get_one::<String>(OPT_TMPDIR).map(String::from)
|
||||
} <span class="kw">else if </span>matches.get_flag(OPT_T) {
|
||||
<span class="comment">// mktemp -t foo.xxx should export in TMPDIR
|
||||
</span><span class="prelude-val">Some</span>(env::temp_dir().display().to_string())
|
||||
} <span class="kw">else </span>{
|
||||
matches.get_one::<String>(OPT_TMPDIR).map(String::from)
|
||||
};
|
||||
(tmpdir, template.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,6 +513,16 @@
|
||||
<a href="#513" id="513">513</a>
|
||||
<a href="#514" id="514">514</a>
|
||||
<a href="#515" id="515">515</a>
|
||||
<a href="#516" id="516">516</a>
|
||||
<a href="#517" id="517">517</a>
|
||||
<a href="#518" id="518">518</a>
|
||||
<a href="#519" id="519">519</a>
|
||||
<a href="#520" id="520">520</a>
|
||||
<a href="#521" id="521">521</a>
|
||||
<a href="#522" id="522">522</a>
|
||||
<a href="#523" id="523">523</a>
|
||||
<a href="#524" id="524">524</a>
|
||||
<a href="#525" id="525">525</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
|
||||
// *
|
||||
// * (c) Martin Kysel <code@martinkysel.com>
|
||||
@@ -772,6 +782,11 @@
|
||||
modifiers: KeyModifiers::NONE,
|
||||
..
|
||||
})
|
||||
| Event::Key(KeyEvent {
|
||||
code: KeyCode::PageDown,
|
||||
modifiers: KeyModifiers::NONE,
|
||||
..
|
||||
})
|
||||
| Event::Key(KeyEvent {
|
||||
code: KeyCode::Char(<span class="string">' '</span>),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
@@ -787,6 +802,11 @@
|
||||
code: KeyCode::Up,
|
||||
modifiers: KeyModifiers::NONE,
|
||||
..
|
||||
})
|
||||
| Event::Key(KeyEvent {
|
||||
code: KeyCode::PageUp,
|
||||
modifiers: KeyModifiers::NONE,
|
||||
..
|
||||
}) => {
|
||||
pager.page_up();
|
||||
}
|
||||
|
||||
@@ -564,6 +564,8 @@
|
||||
<a href="#564" id="564">564</a>
|
||||
<a href="#565" id="565">565</a>
|
||||
<a href="#566" id="566">566</a>
|
||||
<a href="#567" id="567">567</a>
|
||||
<a href="#568" id="568">568</a>
|
||||
</pre><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
|
||||
// *
|
||||
// * (c) Alex Lyon <arcterus@mail.com>
|
||||
@@ -573,8 +575,9 @@
|
||||
|
||||
// spell-checker:ignore (path) eacces
|
||||
|
||||
</span><span class="kw">use </span>clap::{crate_version, parser::ValueSource, Arg, ArgAction, Command};
|
||||
</span><span class="kw">use </span>clap::{builder::ValueParser, crate_version, parser::ValueSource, Arg, ArgAction, Command};
|
||||
<span class="kw">use </span>std::collections::VecDeque;
|
||||
<span class="kw">use </span>std::ffi::{OsStr, OsString};
|
||||
<span class="kw">use </span>std::fs::{<span class="self">self</span>, File, Metadata};
|
||||
<span class="kw">use </span>std::io::ErrorKind;
|
||||
<span class="kw">use </span>std::ops::BitOr;
|
||||
@@ -625,9 +628,9 @@
|
||||
</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(AFTER_HELP).try_get_matches_from(args)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span>files: Vec<String> = matches
|
||||
.get_many::<String>(ARG_FILES)
|
||||
.map(|v| v.map(ToString::to_string).collect())
|
||||
<span class="kw">let </span>files: Vec<<span class="kw-2">&</span>OsStr> = matches
|
||||
.get_many::<OsString>(ARG_FILES)
|
||||
.map(|v| v.map(OsString::as_os_str).collect())
|
||||
.unwrap_or_default();
|
||||
|
||||
<span class="kw">let </span>force_flag = matches.get_flag(OPT_FORCE);
|
||||
@@ -797,13 +800,14 @@
|
||||
.arg(
|
||||
Arg::new(ARG_FILES)
|
||||
.action(ArgAction::Append)
|
||||
.value_parser(ValueParser::os_string())
|
||||
.num_args(<span class="number">1</span>..)
|
||||
.value_hint(clap::ValueHint::AnyPath),
|
||||
)
|
||||
}
|
||||
|
||||
<span class="comment">// TODO: implement one-file-system (this may get partially implemented in walkdir)
|
||||
</span><span class="kw">fn </span>remove(files: <span class="kw-2">&</span>[String], options: <span class="kw-2">&</span>Options) -> bool {
|
||||
</span><span class="kw">fn </span>remove(files: <span class="kw-2">&</span>[<span class="kw-2">&</span>OsStr], options: <span class="kw-2">&</span>Options) -> bool {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>had_err = <span class="bool-val">false</span>;
|
||||
|
||||
<span class="kw">for </span>filename <span class="kw">in </span>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
Reference in New Issue
Block a user