Skip to content

Commit

Permalink
update rustyline
Browse files Browse the repository at this point in the history
  • Loading branch information
carueda committed Oct 31, 2023
1 parent 482063e commit 3d9314a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 95 deletions.
106 changes: 15 additions & 91 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ anstyle = "1.0.1" # for coloring clap help
clap = { version = "4.3.10", features = ["derive", "unstable-styles"] }

colored = "2.0.4"
rustyline = "10.1.1"
rustyline = "12.0.0"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ See a quick demo [here](demo/index.md).

## Change log

- 2023-10: rustyline updated
- 2023-06: just some dep updates
- 2022-11-13: do various dep updates and set 2021 edition
- 2022-09-17: fix #1 to address critical dependabot notification
Expand Down
8 changes: 8 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ dev: test format
# dev + clippy; good to run before committing changes
all: dev clippy

# cargo watch
watch *cmd='check':
cargo watch -c -x '{{ cmd }}'

# cargo check
check:
cargo check

# Run tests
test:
cargo test
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ fn stdin_loop(
to_server: &TcpStream,
from_server_thread: thread::JoinHandle<()>,
) -> Result<()> {
let mut rl = Editor::<()>::new()?; // `()` can be used when no completer is required
let mut rl = Editor::<(), _>::new()?; // `()` can be used when no completer is required
if rl.load_history(HISTORY_FILE).is_err() {
println!("{}", "(no previous history)".bright_black());
}

send_line(&opts.name, to_server, opts.debug);
if !opts.cmd.trim().is_empty() {
rl.add_history_entry(&opts.cmd);
let _ = rl.add_history_entry(&opts.cmd);
send_line(&opts.cmd, to_server, opts.debug);
}

Expand All @@ -175,7 +175,7 @@ fn stdin_loop(
exit("exiting...", done_sender, from_server_thread);
break;
} else {
rl.add_history_entry(line);
let _ = rl.add_history_entry(line);
send_line(line, to_server, opts.debug);
}
}
Expand Down

0 comments on commit 3d9314a

Please sign in to comment.