Browse Source

Print unknown links.

master
Stephen McQuay 4 years ago
parent
commit
a35a09511c
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      main.go

+ 14
- 0
main.go View File

@@ -70,6 +70,7 @@ func main() {
}
}
case "list", "ls":
known := map[string]bool{}
dirs, err := ioutil.ReadDir(saves)
if err != nil {
fmt.Fprintf(os.Stderr, "could not read saves dir: %+v\n", err)
@@ -82,6 +83,19 @@ func main() {
status = "m"
}
fmt.Printf("%s %s\n", status, dir.Name())
known[dir.Name()] = true
}
dirs, err = ioutil.ReadDir(appSupport)
if err != nil {
fmt.Fprintf(os.Stderr, "could not read saves dir: %+v\n", err)
os.Exit(1)
}
for _, dir := range dirs {
if dir.Mode()&os.ModeSymlink == os.ModeSymlink {
if _, ok := known[dir.Name()]; !ok {
fmt.Fprintf(os.Stderr, "? %s\n", dir.Name())
}
}
}
default:
fmt.Fprintf(os.Stderr, "%s\n", usage)


Loading…
Cancel
Save