Print the parsed options to the debug log

It adds a lot of lines to the output, so I’m not convinced it’s worth it, but…
This commit is contained in:
Benjamin Sago 2017-08-19 22:39:34 +01:00
parent d980f3ef85
commit 965bc9e37a
2 changed files with 4 additions and 1 deletions

View File

@ -70,6 +70,9 @@ impl<'args, 'w, W: Write + 'w> Exa<'args, 'w, W> {
pub fn new<I>(args: I, writer: &'w mut W) -> Result<Exa<'args, 'w, W>, Misfire>
where I: Iterator<Item=&'args OsString> {
Options::parse(args, &LiveVars).map(move |(options, args)| {
debug!("Dir action from arguments: {:#?}", options.dir_action);
debug!("Filter from arguments: {:#?}", options.filter);
debug!("View from arguments: {:#?}", options.view.mode);
Exa { options, writer, args }
})
}

View File

@ -195,7 +195,7 @@ $exa -ll 2>&1 | diff -q - $results/error_twice || exit 1
# Debug mode
# (uses an empty directory so it prints nothing to stdout)
EXA_DEBUG="1" $exa $testcases/attributes/dirs/no-xattrs_empty -lh 2>&1 | diff -q - $results/debug || exit 1
EXA_DEBUG="1" $exa $testcases/attributes/dirs/no-xattrs_empty -lh 2>&1 | tail -n 2 | diff -q - $results/debug || exit 1
# And finally...