File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ if ($args->{color_on}) {
53
53
$color_forced = 1;
54
54
}
55
55
56
+ if ($args -> {debug }) {
57
+ show_debug_info();
58
+ exit ();
59
+ }
60
+
56
61
# `git add --patch` requires our output to match the number of lines from the
57
62
# input. So, when patch mode is active, we print out empty lines to pad our
58
63
# output to match any lines we've consumed.
@@ -924,4 +929,31 @@ sub get_terminal_width {
924
929
return $width ;
925
930
}
926
931
932
+ sub show_debug_info {
933
+ my $git_ver = trim(` git --version` );
934
+ $git_ver =~ s / [^\d .]// g ;
935
+
936
+ print " Diff-so-fancy : v$VERSION \n " ;
937
+ print " Git : v$git_ver \n " ;
938
+ print " Perl : $^V\n " ;
939
+ print " \n " ;
940
+
941
+ print " Supports Unicode: " . yes_no(should_print_unicode()) . " \n " ;
942
+ print " Unicode Ruler : " . yes_no($use_unicode_dash_for_ruler ) . " \n " ;
943
+ print " Terminal width : " . get_terminal_width() . " \n " ;
944
+ print " Terminal \$ LANG : " . $ENV {LANG } . " \n " ;
945
+ print " Is Windows : " . yes_no(is_windows()) . " \n " ;
946
+ print " Operating System: $^O\n " ;
947
+ }
948
+
949
+ sub yes_no {
950
+ my $val = shift ();
951
+
952
+ if ($val ) {
953
+ return " Yes" ;
954
+ } else {
955
+ return " No" ;
956
+ }
957
+ }
958
+
927
959
# vim: tabstop=4 shiftwidth=4 noexpandtab autoindent softtabstop=4
You can’t perform that action at this time.
0 commit comments