Skip to content

Commit

Permalink
Include hashes on -l option
Browse files Browse the repository at this point in the history
  • Loading branch information
xypwn committed Jan 16, 2025
1 parent e70db95 commit 7678bbe
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions cmd/filediver-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,7 @@ extractor config:
}

getFileName := func(id stingray.FileID) string {
name, ok := a.Hashes[id.Name]
if !ok {
name = id.Name.String()
}
typ, ok := a.Hashes[id.Type]
if !ok {
typ = id.Type.String()
}
return name + "." + typ
return a.LookupHash(id.Name) + "." + a.LookupHash(id.Type)
}

var sortedFileIDs []stingray.FileID
Expand Down Expand Up @@ -214,7 +206,16 @@ extractor config:

if *modeList {
for _, id := range sortedFileIDs {
fmt.Println(getFileName(id))
if name, ok := a.Hashes[id.Name]; ok {
fmt.Print(name)
}
fmt.Print(".")
if typ, ok := a.Hashes[id.Type]; ok {
fmt.Print(typ)
}
fmt.Print(", ")
fmt.Print(id.Name.String() + "." + id.Type.String())
fmt.Println()
}
} else {
prt.Infof("Extracting files...")
Expand Down

0 comments on commit 7678bbe

Please sign in to comment.