diff options
author | Tobias Hunger | 2022-09-20 07:11:30 +0000 |
---|---|---|
committer | GitHub | 2022-09-20 07:11:30 +0000 |
commit | 130793dfd06306d1f9d25c150c2dc456cda3f9ed (patch) | |
tree | 843854ea3bf08c251d440fca7c80303f5150b9b5 /helix-term/src/args.rs | |
parent | 8988c1ecc757bb4d1c2372d8b8a78bae6a1fd85e (diff) |
Add command line parameter to specify log file (#3807)
* Add command line parameter to specify log file
I had the logs of my debug helix mixed in with the logs from the
production helix.
Add a `--log` command line argument to redirect any logs to other
files, making my debugging easier :-)
* Update completion files with `--log` argument
Diffstat (limited to 'helix-term/src/args.rs')
-rw-r--r-- | helix-term/src/args.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index d16d7dfd..48c86633 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -14,6 +14,7 @@ pub struct Args { pub build_grammars: bool, pub split: Option<Layout>, pub verbosity: u64, + pub log_file: Option<PathBuf>, pub config_file: Option<PathBuf>, pub files: Vec<(PathBuf, Position)>, } @@ -48,6 +49,10 @@ impl Args { Some(path) => args.config_file = Some(path.into()), None => anyhow::bail!("--config must specify a path to read"), }, + "--log" => match argv.next().as_deref() { + Some(path) => args.log_file = Some(path.into()), + None => anyhow::bail!("--log must specify a path to write"), + }, arg if arg.starts_with("--") => { anyhow::bail!("unexpected double dash argument: {}", arg) } |