summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorSimone Robutti <simone.robutti@protonmail.com>2020-01-16 20:12:25 +0100
committerAram Drevekenin <aram@poor.dev>2020-01-16 20:12:25 +0100
commitceaf8b8167b7ae4eb490e50d6771094d4bacb94b (patch)
treeac576abf96cdd89aa56799741cd8f9812ec0d0ee /src/main.rs
parent6cdce9701f80949fa72fd42863c3891f83620322 (diff)
feat(ui): select windows to display from CLI (#107)
* added first version (no tests) * fixed layout * added support for 2 windows * comments * breathing windows * added tests * format * fixed rebase * review * added more tests * simplified table creation * fix(table): do not overflow on max size Co-authored-by: Aram Drevekenin <aram@poor.dev>
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 30a9b25..1e35289 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -28,7 +28,6 @@ use ::std::io;
use ::std::time::Instant;
use ::termion::raw::IntoRawMode;
use ::tui::backend::TermionBackend;
-
use structopt::StructOpt;
const DISPLAY_DELTA: time::Duration = time::Duration::from_millis(1000);
@@ -45,6 +44,15 @@ pub struct Opt {
#[structopt(short, long)]
/// Do not attempt to resolve IPs to their hostnames
no_resolve: bool,
+ #[structopt(flatten)]
+ render_opts: RenderOpts,
+}
+
+#[derive(StructOpt, Debug)]
+pub struct RenderOpts {
+ processes: bool,
+ connections: bool,
+ addresses: bool,
}
fn main() {
@@ -114,7 +122,7 @@ where
let raw_mode = opts.raw;
let network_utilization = Arc::new(Mutex::new(Utilization::new()));
- let ui = Arc::new(Mutex::new(Ui::new(terminal_backend)));
+ let ui = Arc::new(Mutex::new(Ui::new(terminal_backend, opts.render_opts)));
if !raw_mode {
active_threads.push(