Print unknown links.
This commit is contained in:
parent
429eb02d64
commit
a35a09511c
14
main.go
14
main.go
@ -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…
Reference in New Issue
Block a user