diff --git a/CHANGELOG.md b/CHANGELOG.md index a36b77a3..f0d70fe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/internal/app/wwctl/overlay/list/main.go b/internal/app/wwctl/overlay/list/main.go index 19ac1818..ac02a619 100644 --- a/internal/app/wwctl/overlay/list/main.go +++ b/internal/app/wwctl/overlay/list/main.go @@ -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))