about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/ci
diff options
context:
space:
mode:
authorTshepang Mbambo <tshepang@gmail.com>2022-08-19 07:19:14 +0200
committerNoah Lev <camelidcamel@gmail.com>2022-08-25 19:56:58 -0700
commitdfb4949c40b11431df80a51b47fd87a56a8aff17 (patch)
treea74e5a324ffcf339f0bf51caacfb4137440383c1 /src/doc/rustc-dev-guide/ci
parentba6d4a9a1cf2d2e94602aa08ce37df3401e02a05 (diff)
address review comment
https://github.com/rust-lang/rustc-dev-guide/pull/1428#discussion_r948143840
Diffstat (limited to 'src/doc/rustc-dev-guide/ci')
-rw-r--r--src/doc/rustc-dev-guide/ci/date-check/src/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/doc/rustc-dev-guide/ci/date-check/src/main.rs b/src/doc/rustc-dev-guide/ci/date-check/src/main.rs
index ea8b24315e5..70fce8b1c16 100644
--- a/src/doc/rustc-dev-guide/ci/date-check/src/main.rs
+++ b/src/doc/rustc-dev-guide/ci/date-check/src/main.rs
@@ -3,6 +3,7 @@ use std::{
     convert::TryInto as _,
     env, fmt, fs,
     path::{Path, PathBuf},
+    process,
     str::FromStr,
 };
 
@@ -124,7 +125,12 @@ fn filter_dates(
 }
 
 fn main() {
-    let root_dir = env::args().nth(1).unwrap_or(".".into());
+    let mut args = env::args();
+    if args.len() == 1 {
+        eprintln!("error: expected root Markdown directory as CLI argument");
+        process::exit(1);
+    }
+    let root_dir = args.nth(1).unwrap();
     let root_dir_path = Path::new(&root_dir);
     let glob_pat = format!("{}/**/*.md", root_dir);
     let today_chrono = Utc::today();