@@ -24,6 +24,7 @@ impl Args {
2424 pub fn parse_args() -> Result<Args> {
2525 let mut args = Args::default();
2626 let mut argv = std::env::args().peekable();
27+ let mut line_number = 0;
2728
2829 argv.next(); // skip the program, we don't care about that
2930
@@ -88,6 +89,13 @@ impl Args {
8889 }
8990 }
9091 }
92+ arg if arg.starts_with('+') => {
93+ let arg = &arg[1..];
94+ line_number = match arg.parse::<usize>() {
95+ Ok(n) => n.saturating_sub(1),
96+ _ => anyhow::bail!("bad line number after +"),
97+ };
98+ }
9199 arg => args.files.push(parse_file(arg)),
92100 }
93101 }
@@ -97,6 +105,12 @@ impl Args {
97105 args.files.push(parse_file(&arg));
98106 }
99107
108+ if let Some(file) = args.files.first_mut() {
109+ if line_number != 0 {
110+ file.1.row = line_number;
111+ }
112+ }
113+
100114 Ok(args)
101115 }
102116}