Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
weyh committed Jan 13, 2024
1 parent 5c6ba80 commit f00fe8e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 41 deletions.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@

The goal of this project is to create a MTPuTTY like cli app, where you can easily store/group all your telnet and ssh sessions.

If you find anything that isn't rusty enough feel free to correct me. :)
If you find anything that isn't rusty enough feel free to correct me. 🙂

## Args
```
USAGE:
gcoma [OPTIONS] --user-config <USER_CONFIG>
OPTIONS:
-c, --connect <SESSION_INDEX> Connect to session by index
-h, --help Print help information
-l, --list List all sessions
-r, --remove <SESSION_GROUP_NAME> Remove session group by name
-u, --user-config <USER_CONFIG> Path to user config file
-V, --version Print version information
Usage: gcoma --user-config <USER_CONFIG>
Options:
-u, --user-config <USER_CONFIG> Path to user config file
-h, --help Print help
-V, --version Print version
```

## Screenshot
Expand Down
Binary file modified img/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 0 additions & 23 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,5 @@ pub fn get_args() -> ArgMatches {
.value_name("USER_CONFIG")
.required(true),
)
.arg(
Arg::new("list")
.short('l')
.long("list")
.conflicts_with_all(["connect", "remove"])
.help("List all sessions"),
)
.arg(
Arg::new("connect")
.short('c')
.long("connect")
.value_name("SESSION_INDEX")
.conflicts_with_all(["list", "remove"])
.help("Connect to session by index"),
)
.arg(
Arg::new("remove")
.short('r')
.long("remove")
.value_name("SESSION_GROUP_NAME")
.conflicts_with_all(["list", "connect"])
.help("Remove session group by name"),
)
.get_matches()
}
12 changes: 5 additions & 7 deletions src/ui/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Navigate:
Actions:
q/ESC: quit
a: add Session Group
a: add session group
r: remove
R: Reload config";
R: reload config";

/// helper function to create a centered rect using up certain percentage of the available rect `r`
fn create_centered_rect(percent_x: u16, percent_y: u16, r: Rect) -> Rect {
Expand Down Expand Up @@ -204,14 +204,12 @@ fn handle_events(cfg_path: &str, state: &mut ViewState) -> io::Result<bool> {
}

fn table_ui(state: &mut ViewState, frame: &mut Frame, area: &Rect) {
let selected_style = Style::default().add_modifier(Modifier::REVERSED);
let normal_style = Style::default().bg(Color::Blue);
let header_cells = ["Group Name", "Session Name", "Username", "IP", "Port"]
.iter()
.map(|h| Cell::from(*h).style(Style::default().fg(Color::Red)));
.map(|h| Cell::from(*h).style(Style::default().fg(Color::White)));

let header = Row::new(header_cells)
.style(normal_style)
.style(Style::default().bg(Color::DarkGray))
.height(1)
.bottom_margin(1);

Expand Down Expand Up @@ -251,7 +249,7 @@ fn table_ui(state: &mut ViewState, frame: &mut Frame, area: &Rect) {
)
.header(header)
.block(Block::default().borders(Borders::ALL).title("Sessions"))
.highlight_style(selected_style)
.highlight_style(Style::default().add_modifier(Modifier::REVERSED))
.highlight_symbol(">> ");

frame.render_stateful_widget(t, *area, &mut state.table_state);
Expand Down

0 comments on commit f00fe8e

Please sign in to comment.