Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
rm prettytable
Browse files Browse the repository at this point in the history
  • Loading branch information
guni1192 committed Apr 25, 2019
1 parent e2d8d9c commit 3c6933d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 61 deletions.
53 changes: 0 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ dirs = "1.0"
log = "0.4"
env_logger = "0.6.0"
rand = "0.6"
prettytable-rs = "^0.8"
9 changes: 2 additions & 7 deletions src/pids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ use std::path::Path;
use clap::ArgMatches;
use dirs::home_dir;
use nix::unistd::Pid;
use prettytable::{cell, row, Table};

pub fn show(_sub_m: &ArgMatches) -> io::Result<()> {
// Create the table
let mut table = Table::new();

table.add_row(row!["Container ID", "PID"]);
println!("|{} \t| {} \t|", "Container ID", "PID");

let home = home_dir().expect("Could not get your home_dir");
let home = home.to_str().expect("Could not PathBuf to str");
Expand All @@ -27,10 +23,9 @@ pub fn show(_sub_m: &ArgMatches) -> io::Result<()> {
continue;
}
let pidfile = Pidfile::read(&path).expect("Failed to read pidfile");
table.add_row(row![pidfile.container_id, pidfile.pid]);
println!("|{} \t| {} \t|", pidfile.container_id, pidfile.pid);
}
}
table.printstd();
Ok(())
}

Expand Down

0 comments on commit 3c6933d

Please sign in to comment.