diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 10 | ||||
-rw-r--r-- | src/options.rs | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 91d0fce..a47fc22 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,11 @@ #![forbid(unsafe_code)] #![allow(clippy::match_bool)] -use crate::interactive::{Interaction, TerminalApp}; -use anyhow::{Context, Result}; -use crosstermion::terminal::{tui::new_terminal, AlternateRawScreen}; +use anyhow::Result; use dua::{ByteFormat, Color, TraversalSorting}; use std::{fs, io, io::Write, path::PathBuf, process}; use structopt::StructOpt; +#[cfg(any(feature = "tui-unix", feature = "tui-crossplatform"))] mod interactive; mod options; @@ -28,7 +27,12 @@ fn main() -> Result<()> { cross_filesystems: !opt.stay_on_filesystem, }; let res = match opt.command { + #[cfg(any(feature = "tui-unix", feature = "tui-crossplatform"))] Some(Interactive { input }) => { + use crate::interactive::{Interaction, TerminalApp}; + use anyhow::Context; + use crosstermion::terminal::{tui::new_terminal, AlternateRawScreen}; + let mut terminal = new_terminal( AlternateRawScreen::try_from(io::stdout()) .with_context(|| "Interactive mode requires a connected terminal")?, diff --git a/src/options.rs b/src/options.rs index 992f823..a7d7618 100644 --- a/src/options.rs +++ b/src/options.rs @@ -72,6 +72,7 @@ pub struct Args { #[derive(Debug, StructOpt)] pub enum Command { /// Launch the terminal user interface + #[cfg(any(feature = "tui-unix", feature = "tui-crossplatform"))] #[structopt(name = "interactive", visible_alias = "i")] Interactive { /// One or more input files or directories. If unset, we will use all entries in the current working directory. |