mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-12-26 10:07:32 +00:00
Fix an error being displayed weirdly
The Debug impl was being used instead of the Display one. Also, remove the full stops from the ends of all the error messages because I’ve decided it looks weird.
This commit is contained in:
parent
02350c5a2a
commit
4c16f50565
@ -95,12 +95,13 @@ impl fmt::Display for Misfire {
|
|||||||
InvalidOptions(ref e) => write!(f, "{}", e),
|
InvalidOptions(ref e) => write!(f, "{}", e),
|
||||||
Help(ref text) => write!(f, "{}", text),
|
Help(ref text) => write!(f, "{}", text),
|
||||||
Version(ref version) => write!(f, "{}", version),
|
Version(ref version) => write!(f, "{}", version),
|
||||||
Conflict(ref a, ref b) => write!(f, "Option {} conflicts with option {}.", a, b),
|
Conflict(ref a, ref b) => write!(f, "Option {} conflicts with option {}", a, b),
|
||||||
Duplicate(ref a, ref b) => write!(f, "Flag {:?} conflicts with flag {:?}.", a, b),
|
Duplicate(ref a, ref b) => if a == b { write!(f, "Flag {} was given twice", a) }
|
||||||
Useless(ref a, false, ref b) => write!(f, "Option {} is useless without option {}.", a, b),
|
else { write!(f, "Flag {} conflicts with flag {}", a, b) },
|
||||||
Useless(ref a, true, ref b) => write!(f, "Option {} is useless given option {}.", a, b),
|
Useless(ref a, false, ref b) => write!(f, "Option {} is useless without option {}", a, b),
|
||||||
Useless2(ref a, ref b1, ref b2) => write!(f, "Option {} is useless without options {} or {}.", a, b1, b2),
|
Useless(ref a, true, ref b) => write!(f, "Option {} is useless given option {}", a, b),
|
||||||
TreeAllAll => write!(f, "Option --tree is useless given --all --all."),
|
Useless2(ref a, ref b1, ref b2) => write!(f, "Option {} is useless without options {} or {}", a, b1, b2),
|
||||||
|
TreeAllAll => write!(f, "Option --tree is useless given --all --all"),
|
||||||
FailedParse(ref e) => write!(f, "Failed to parse number: {}", e),
|
FailedParse(ref e) => write!(f, "Failed to parse number: {}", e),
|
||||||
FailedGlobPattern(ref e) => write!(f, "Failed to parse glob pattern: {}", e),
|
FailedGlobPattern(ref e) => write!(f, "Failed to parse glob pattern: {}", e),
|
||||||
}
|
}
|
||||||
|
1
xtests/error_duplicate
Normal file
1
xtests/error_duplicate
Normal file
@ -0,0 +1 @@
|
|||||||
|
Flag -l conflicts with flag --long
|
1
xtests/error_twice
Normal file
1
xtests/error_twice
Normal file
@ -0,0 +1 @@
|
|||||||
|
Flag -l was given twice
|
@ -1 +1 @@
|
|||||||
Option --binary (-b) is useless without option --long (-l).
|
Option --binary (-b) is useless without option --long (-l)
|
||||||
|
@ -189,6 +189,8 @@ $exa --ternary 2>&1 | diff -q - $results/error_long || exit 1
|
|||||||
$exa -4 2>&1 | diff -q - $results/error_short || exit 1
|
$exa -4 2>&1 | diff -q - $results/error_short || exit 1
|
||||||
$exa --time 2>&1 | diff -q - $results/error_value || exit 1
|
$exa --time 2>&1 | diff -q - $results/error_value || exit 1
|
||||||
$exa --long=time 2>&1 | diff -q - $results/error_overvalued || exit 1
|
$exa --long=time 2>&1 | diff -q - $results/error_overvalued || exit 1
|
||||||
|
$exa -l --long 2>&1 | diff -q - $results/error_duplicate || exit 1
|
||||||
|
$exa -ll 2>&1 | diff -q - $results/error_twice || exit 1
|
||||||
|
|
||||||
|
|
||||||
# Debug mode
|
# Debug mode
|
||||||
|
Loading…
Reference in New Issue
Block a user