mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-13 14:33:47 +00:00
stash: replace atty with is_terminal from std::io
It's deprecated, oops. Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a69646dc5a20ff1fde23ea9a846a7a3fdd16a
This commit is contained in:
parent
ea721a6eb2
commit
df31f5e67c
3 changed files with 4 additions and 27 deletions
|
|
@ -1,11 +1,10 @@
|
|||
use std::{
|
||||
env,
|
||||
io::{self},
|
||||
io::{self, IsTerminal},
|
||||
path::PathBuf,
|
||||
process,
|
||||
};
|
||||
|
||||
use atty::Stream;
|
||||
use clap::{CommandFactory, Parser, Subcommand};
|
||||
use inquire::Confirm;
|
||||
|
||||
|
|
@ -44,7 +43,7 @@ struct Cli {
|
|||
#[arg(long, default_value_t = 100)]
|
||||
preview_width: u32,
|
||||
|
||||
/// Path to the SQLite clipboard database file.
|
||||
/// Path to the `SQLite` clipboard database file.
|
||||
#[arg(long)]
|
||||
db_path: Option<PathBuf>,
|
||||
|
||||
|
|
@ -187,7 +186,7 @@ fn main() {
|
|||
log::error!("Unsupported format: {other}");
|
||||
},
|
||||
None => {
|
||||
if atty::is(Stream::Stdout) {
|
||||
if std::io::stdout().is_terminal() {
|
||||
report_error(
|
||||
db.list_tui(cli.preview_width),
|
||||
"Failed to list entries in TUI",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue