]> Sergey Matveev's repositories - meta4ra.git/commitdiff
meta4ra-list -hashes
authorSergey Matveev <stargrave@stargrave.org>
Fri, 6 Mar 2026 07:36:21 +0000 (10:36 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 6 Mar 2026 07:36:21 +0000 (10:36 +0300)
cmd/list.go

index fdf0f549736caafd35a7cd4e838c67718c44a085..e1e0acccfceea5ffca64dc3bf3393c2af2824ed3 100644 (file)
@@ -29,6 +29,7 @@ import (
 
 func runList() {
        doSize := flag.Bool("size", false, "Print file's size")
+       doHashes := flag.Bool("hashes", false, "Print file's hashes")
        doSig := flag.Bool("sig", false, "Extract signature files")
        flag.Usage = func() {
                fmt.Fprintf(flag.CommandLine.Output(),
@@ -101,6 +102,12 @@ Otherwise list all URLs of the given FILE.
                                fmt.Println(f.Size)
                                break
                        }
+                       if *doHashes {
+                               for _, h := range f.Hashes {
+                                       fmt.Println(h.Type, h.Hash)
+                               }
+                               break
+                       }
                        for _, u := range f.URLs {
                                fmt.Println(u.String())
                        }