Skip to content

Commit

Permalink
fix: read the log cmd flag
Browse files Browse the repository at this point in the history
- We only expect a boolean value, so [...] is not necessary.
- Use `get_flag()` instead of `contains_id()` since the latter always
  returns true in this case. (according to the doc)
  • Loading branch information
kanna5 authored and polarmutex committed Oct 10, 2023
1 parent 44d46f2 commit 1b685ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/lsp/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ use tracing_subscriber::{filter::Directive, EnvFilter};
fn main() {
let matches = Command::new("beancount-language-server")
.args(&[
arg!(--stdio ... "specifies to use stdio to communicate with lsp"),
arg!(--log ... "write log to file"),
arg!(--stdio "specifies to use stdio to communicate with lsp"),
arg!(--log "write log to file"),
])
.get_matches();

setup_logging(matches.contains_id("log"));
setup_logging(matches.get_flag("log"));

beancount_language_server::run_server()
.map_err(|e| anyhow::anyhow!("{}", e))
Expand Down

0 comments on commit 1b685ed

Please sign in to comment.