@@ -14,6 +14,7 @@ pub struct Args {
14 pub build_grammars: bool,
14 pub build_grammars: bool,
15 pub split: Option<Layout>,
15 pub split: Option<Layout>,
16 pub verbosity: u64,
16 pub verbosity: u64,
17+ pub log_file: Option<PathBuf>,
17 pub config_file: Option<PathBuf>,
18 pub config_file: Option<PathBuf>,
18 pub files: Vec<(PathBuf, Position)>,
19 pub files: Vec<(PathBuf, Position)>,
@@ -48,6 +49,10 @@ impl Args {
48 Some(path) => args.config_file = Some(path.into()),
49 Some(path) => args.config_file = Some(path.into()),
49 None => anyhow::bail!("--config must specify a path to read"),
50 None => anyhow::bail!("--config must specify a path to read"),
52+ "--log" => match argv.next().as_deref() {
53+ Some(path) => args.log_file = Some(path.into()),
54+ None => anyhow::bail!("--log must specify a path to write"),
51 arg if arg.starts_with("--") => {
56 arg if arg.starts_with("--") => {
52 anyhow::bail!("unexpected double dash argument: {}", arg)
57 anyhow::bail!("unexpected double dash argument: {}", arg)