Skip to content

Commit

Permalink
ncdu: add ! (errror) and . (unreadable) file flags to go with e (empty)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncw committed Dec 28, 2020
1 parent b218bc5 commit 5601652
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/ncdu/ncdu.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,18 @@ func (u *UI) Draw() error {
if isDir {
mark = '/'
}
fileFlag := ' '
message := ""
if !readable {
message = " [not read yet]"
}
if entriesHaveErrors {
message = " [some subdirectories could not be read, size may be underestimated]"
fileFlag = '.'
}
if err != nil {
message = fmt.Sprintf(" [%s]", err)
fileFlag = '!'
}
extras := ""
if u.showCounts {
Expand All @@ -388,12 +391,9 @@ func (u *UI) Draw() error {
}

}
emptyDir := ""
if showEmptyDir {
if isDir && count == 0 {
emptyDir = "e"
} else {
emptyDir = " "
if isDir && count == 0 && fileFlag == ' ' {
fileFlag = 'e'
}
}
if u.showGraph {
Expand All @@ -406,7 +406,7 @@ func (u *UI) Draw() error {
}
extras += "[" + graph[graphBars-bars:2*graphBars-bars] + "] "
}
Linef(0, y, w, fg, bg, ' ', "%s %8v %s%c%s%s", emptyDir, fs.SizeSuffix(size), extras, mark, path.Base(entry.Remote()), message)
Linef(0, y, w, fg, bg, ' ', "%c %8v %s%c%s%s", fileFlag, fs.SizeSuffix(size), extras, mark, path.Base(entry.Remote()), message)
y++
}
}
Expand Down

0 comments on commit 5601652

Please sign in to comment.