Skip to content

Commit dc6fcae

Browse files
tshepangcamelid
authored andcommitted
address review comment
rust-lang#1428 (comment)
1 parent 23ae7bb commit dc6fcae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ci/date-check/src/main.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::{
33
convert::TryInto as _,
44
env, fmt, fs,
55
path::{Path, PathBuf},
6+
process,
67
str::FromStr,
78
};
89

@@ -124,7 +125,12 @@ fn filter_dates(
124125
}
125126

126127
fn main() {
127-
let root_dir = env::args().nth(1).unwrap_or(".".into());
128+
let mut args = env::args();
129+
if args.len() == 1 {
130+
eprintln!("error: expected root Markdown directory as CLI argument");
131+
process::exit(1);
132+
}
133+
let root_dir = args.nth(1).unwrap();
128134
let root_dir_path = Path::new(&root_dir);
129135
let glob_pat = format!("{}/**/*.md", root_dir);
130136
let today_chrono = Utc::today();

0 commit comments

Comments
 (0)