diff options
Diffstat (limited to 'src/doc/rustc-dev-guide/ci')
| -rw-r--r-- | src/doc/rustc-dev-guide/ci/date-check/src/main.rs | 8 |
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(); |
