aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/app/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/app/app.go')
-rw-r--r--cmd/app/app.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmd/app/app.go b/cmd/app/app.go
index 4e4f314d..9679413f 100644
--- a/cmd/app/app.go
+++ b/cmd/app/app.go
@@ -4,6 +4,7 @@ import (
"bufio"
"fmt"
"io"
+ "os"
"strconv"
"strings"
@@ -335,3 +336,19 @@ func parse(
return &c, nil
}
+
+// list prints names of non-hidden entries in pathname.
+func list(pathname *check.Absolute, dir bool) error {
+ dents, err := os.ReadDir(pathname.String())
+ if err != nil {
+ return err
+ }
+ for _, dent := range dents {
+ name := dent.Name()
+ if (dent.IsDir() != dir) || (len(name) > 0 && name[0] == '.') {
+ continue
+ }
+ fmt.Println(dent.Name())
+ }
+ return nil
+}