@@ -24,6 +24,7 @@ impl Args {
24 pub fn parse_args() -> Result<Args> {
24 pub fn parse_args() -> Result<Args> {
25 let mut args = Args::default();
25 let mut args = Args::default();
26 let mut argv = std::env::args().peekable();
26 let mut argv = std::env::args().peekable();
27+ let mut line_number = 0;
28 argv.next(); // skip the program, we don't care about that
29 argv.next(); // skip the program, we don't care about that
@@ -88,6 +89,13 @@ impl Args {
92+ arg if arg.starts_with('+') => {
94+ line_number = match arg.parse::<usize>() {
95+ Ok(n) => n.saturating_sub(1),
96+ _ => anyhow::bail!("bad line number after +"),
91 arg => args.files.push(parse_file(arg)),
99 arg => args.files.push(parse_file(arg)),
@@ -97,6 +105,12 @@ impl Args {
97 args.files.push(parse_file(&arg));
105 args.files.push(parse_file(&arg));
108+ if let Some(file) = args.files.first_mut() {
109+ if line_number != 0 {
110+ file.1.row = line_number;