mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
cargo +1.56.1 update
This commit is contained in:
parent
3acbd1c048
commit
f4df7ea4a0
3 changed files with 338 additions and 223 deletions
543
Cargo.lock
generated
543
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -147,9 +147,7 @@ fn gen_completions<T: uucore::Args>(
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("shell")
|
Arg::new("shell")
|
||||||
.value_parser(clap::builder::PossibleValuesParser::new(
|
.value_parser(clap::builder::EnumValueParser::<Shell>::new())
|
||||||
Shell::possible_values(),
|
|
||||||
))
|
|
||||||
.required(true),
|
.required(true),
|
||||||
)
|
)
|
||||||
.get_matches_from(std::iter::once(OsString::from("completion")).chain(args));
|
.get_matches_from(std::iter::once(OsString::from("completion")).chain(args));
|
||||||
|
|
|
@ -18,6 +18,7 @@ use std::{
|
||||||
extern crate nix;
|
extern crate nix;
|
||||||
|
|
||||||
use clap::{crate_version, Arg, Command};
|
use clap::{crate_version, Arg, Command};
|
||||||
|
use crossterm::event::KeyEventKind;
|
||||||
use crossterm::{
|
use crossterm::{
|
||||||
event::{self, Event, KeyCode, KeyEvent, KeyModifiers},
|
event::{self, Event, KeyCode, KeyEvent, KeyModifiers},
|
||||||
execute, queue,
|
execute, queue,
|
||||||
|
@ -229,13 +230,21 @@ fn more(buff: &str, stdout: &mut Stdout, next_file: Option<&str>, silent: bool)
|
||||||
let mut wrong_key = None;
|
let mut wrong_key = None;
|
||||||
if event::poll(Duration::from_millis(10)).unwrap() {
|
if event::poll(Duration::from_millis(10)).unwrap() {
|
||||||
match event::read().unwrap() {
|
match event::read().unwrap() {
|
||||||
|
Event::Key(KeyEvent {
|
||||||
|
kind: KeyEventKind::Release,
|
||||||
|
..
|
||||||
|
}) => continue,
|
||||||
Event::Key(KeyEvent {
|
Event::Key(KeyEvent {
|
||||||
code: KeyCode::Char('q'),
|
code: KeyCode::Char('q'),
|
||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
|
kind: KeyEventKind::Press,
|
||||||
|
..
|
||||||
})
|
})
|
||||||
| Event::Key(KeyEvent {
|
| Event::Key(KeyEvent {
|
||||||
code: KeyCode::Char('c'),
|
code: KeyCode::Char('c'),
|
||||||
modifiers: KeyModifiers::CONTROL,
|
modifiers: KeyModifiers::CONTROL,
|
||||||
|
kind: KeyEventKind::Press,
|
||||||
|
..
|
||||||
}) => {
|
}) => {
|
||||||
reset_term(stdout);
|
reset_term(stdout);
|
||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
|
@ -243,10 +252,12 @@ fn more(buff: &str, stdout: &mut Stdout, next_file: Option<&str>, silent: bool)
|
||||||
Event::Key(KeyEvent {
|
Event::Key(KeyEvent {
|
||||||
code: KeyCode::Down,
|
code: KeyCode::Down,
|
||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
|
..
|
||||||
})
|
})
|
||||||
| Event::Key(KeyEvent {
|
| Event::Key(KeyEvent {
|
||||||
code: KeyCode::Char(' '),
|
code: KeyCode::Char(' '),
|
||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
|
..
|
||||||
}) => {
|
}) => {
|
||||||
if pager.should_close() {
|
if pager.should_close() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
@ -257,12 +268,14 @@ fn more(buff: &str, stdout: &mut Stdout, next_file: Option<&str>, silent: bool)
|
||||||
Event::Key(KeyEvent {
|
Event::Key(KeyEvent {
|
||||||
code: KeyCode::Up,
|
code: KeyCode::Up,
|
||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
|
..
|
||||||
}) => {
|
}) => {
|
||||||
pager.page_up();
|
pager.page_up();
|
||||||
}
|
}
|
||||||
Event::Key(KeyEvent {
|
Event::Key(KeyEvent {
|
||||||
code: KeyCode::Char('j'),
|
code: KeyCode::Char('j'),
|
||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
|
..
|
||||||
}) => {
|
}) => {
|
||||||
if pager.should_close() {
|
if pager.should_close() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
@ -273,6 +286,7 @@ fn more(buff: &str, stdout: &mut Stdout, next_file: Option<&str>, silent: bool)
|
||||||
Event::Key(KeyEvent {
|
Event::Key(KeyEvent {
|
||||||
code: KeyCode::Char('k'),
|
code: KeyCode::Char('k'),
|
||||||
modifiers: KeyModifiers::NONE,
|
modifiers: KeyModifiers::NONE,
|
||||||
|
..
|
||||||
}) => {
|
}) => {
|
||||||
pager.prev_line();
|
pager.prev_line();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue