Don't crash on zero arguments

html_output
Wilfred Hughes 2022-02-12 11:04:52 +07:00
parent f2410bb600
commit 46301dbfa5
2 changed files with 3 additions and 1 deletions

@ -18,6 +18,8 @@ Difftastic will now use a text dif for large files that are too big to
parse in a reasonable amount of time. This threshold is
configurable with `--byte-limit` and `DFT_BYTE_LIMIT`.
Fixed a crash when called with zero arguments.
## 0.19 (released 7th February 2022)
### Parsing

@ -144,7 +144,7 @@ pub fn parse_args() -> Mode {
}
// TODO: Use OsString rather than forcing paths to be valid UTF-8.
let args: Vec<_> = matches.values_of_lossy("paths").unwrap();
let args: Vec<_> = matches.values_of_lossy("paths").unwrap_or_default();
info!("CLI arguments: {:?}", args);
// TODO: document these different ways of calling difftastic.