82c1288cb25b1567b4d17f33a75192de1b9f4634

Author
Andrew Janke <andrew@apjanke.net>
Committer
Andrew Janke <andrew@apjanke.net>
Date

Message

Include some bash rc files; improve formatting; more version info

Diff

 1diff --git a/lib/diagnostics.zsh b/lib/diagnostics.zsh
 2index cca13f4e4305084b731559550787aa098c3062b7..7991b64c84421df662f7cb63ebe3a8dd2bce7601 100644
 3--- a/lib/diagnostics.zsh
 4+++ b/lib/diagnostics.zsh
 5@@ -104,12 +104,12 @@ function _omz_diag_dump_one_big_text() {
 6   command date
 7   command uname -a
 8   builtin echo OSTYPE=$OSTYPE
 9-  command zsh --version
10+  builtin echo ZSH_VERSION=$ZSH_VERSION
11   builtin echo User: $USER
12   builtin echo
13 
14   # Installed programs
15-  programs=(sh zsh ksh bash sed cat grep find git posh)
16+  programs=(sh zsh ksh bash sed cat grep ls find git posh)
17   for program in $programs; do
18     local md5_str="" md5="" link_str="" extra_str=""
19     progfile=$(builtin which $program)
20@@ -119,7 +119,7 @@ function _omz_diag_dump_one_big_text() {
21           extra_str+=" $(md5 -q $progfile)"
22         fi
23         if [[ -h "$progfile" ]]; then
24-          extra_str+=" ( -> ${file:A} )"
25+          extra_str+=" ( -> ${progfile:A} )"
26         fi
27       fi
28       builtin printf '%-9s %-20s %s\n' "$program is" "$progfile" "$extra_str"
29@@ -128,8 +128,9 @@ function _omz_diag_dump_one_big_text() {
30     fi
31   done
32   builtin echo
33-  builtin echo Versions:
34+  builtin echo Command Versions:
35   builtin echo "zsh: $(zsh --version)"
36+  builtin echo "this zsh session: $ZSH_VERSION"
37   builtin echo "bash: $(bash --version | command grep bash)"
38   builtin echo "git: $(git --version)"
39   builtin echo "grep: $(grep --version)"
40@@ -199,8 +200,12 @@ function _omz_diag_dump_one_big_text() {
41   local zdotdir=${ZDOTDIR:-$HOME}
42   builtin echo "Zsh configuration files:"
43   local cfgfile cfgfiles
44+  # Some files for bash that zsh does not use are intentionally included
45+  # to help with diagnosing behavior differences between bash and zsh
46   cfgfiles=( /etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin /etc/zlogout 
47-    $zdotdir/.zshenv $zdotdir/.zprofile $zdotdir/.zshrc $zdotdir/.zlogin $zdotdir/.zlogout )
48+    $zdotdir/.zshenv $zdotdir/.zprofile $zdotdir/.zshrc $zdotdir/.zlogin $zdotdir/.zlogout
49+    ~/.zsh-pre-oh-my-zsh
50+    /etc/bashrc /etc/profile ~/.bashrc ~/.profile ~/.bash_profile ~/.bash_logout )
51   command ls -lad $cfgfiles 2>&1
52   builtin echo
53   if [[ $verbose -ge 1 ]]; then
54@@ -208,6 +213,7 @@ function _omz_diag_dump_one_big_text() {
55       _omz_diag_dump_echo_file_w_header $cfgfile
56     done
57   fi
58+  builtin echo
59   builtin echo "Zsh compdump files:"
60   local dumpfile dumpfiles
61   command ls -lad $zdotdir/.zcompdump*
62@@ -274,6 +280,12 @@ function _omz_diag_dump_echo_file_w_header() {
63     command cat $file
64     builtin echo "========== end $file =========="
65     builtin echo
66+  elif [[ -d $file ]]; then
67+    builtin echo "File '$file' is a directory"
68+  elif [[ ! -e $file ]]; then
69+    builtin echo "File '$file' does not exist"
70+  else
71+    command ls -lad "$file"
72   fi
73 }
74