Merge pull request #667 from anderbubble/485-fix-overlay-ls-header

Correct header for overlay list -al
This commit is contained in:
Jonathon Anderson
2023-02-18 23:23:13 -07:00
committed by GitHub
2 changed files with 17 additions and 11 deletions

View File

@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Fixed
- The correct header is now displayed when `-al` flags are specified to overlay
list.
## [4.4.0] 2023-01-18
### Added

View File

@@ -39,16 +39,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
files := util.FindFiles(path)
wwlog.Debug("Iterating overlay path: %s", path)
if ListContents {
var fileCount int
for file := range files {
fmt.Printf("%-30s /%-12s\n", name, files[file])
fileCount++
}
if fileCount == 0 {
fmt.Printf("%-30s %-12d\n", name, 0)
}
} else if ListLong {
if ListLong {
for file := range files {
s, err := os.Stat(files[file])
if err != nil {
@@ -61,7 +52,15 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
sys := s.Sys()
fmt.Printf("%v %5d %-5d %-18s /%s\n", perms, sys.(*syscall.Stat_t).Uid, sys.(*syscall.Stat_t).Gid, overlays[o], files[file])
}
} else if ListContents {
var fileCount int
for file := range files {
fmt.Printf("%-30s /%-12s\n", name, files[file])
fileCount++
}
if fileCount == 0 {
fmt.Printf("%-30s %-12d\n", name, 0)
}
} else {
fmt.Printf("%-30s %-12d\n", name, len(files))