]> Sergey Matveev's repositories - meta4ra.git/commitdiff
Ability to add identity
authorSergey Matveev <stargrave@stargrave.org>
Wed, 18 Feb 2026 14:39:40 +0000 (17:39 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 18 Feb 2026 14:57:18 +0000 (17:57 +0300)
cmd/create.go
internal/scheme.go

index 1ef2a832ffa93c173ccb0402e2373d2e95eac88c..8f718297265e4934858a66d2e756ff7b635ed219 100644 (file)
@@ -32,6 +32,7 @@ import (
 
 func runCreate() {
        fn := flag.String("fn", "", "Filename")
+       id := flag.String("id", "", "Optional file's identity")
        add := flag.String("add", "", "Add file to specified .meta4")
        mtime := flag.String("mtime", "", "Take that file's mtime as a Published date")
        desc := flag.String("desc", "", "Description")
@@ -94,6 +95,7 @@ will be the priority and "cc" (may be empty) is location.
        }
        f := meta4ra.File{
                Name:        path.Base(*fn),
+               Identity:    *id,
                Description: *desc,
                Size:        uint64(size),
                URLs:        urls,
index e8214c7f4a131a37dc91b04edab2c9702343ece7..8f757d7e7462ad4b9f02777f092ce2b74db9008a 100644 (file)
@@ -30,6 +30,7 @@ type Metalink struct {
 type File struct {
        XMLName     xml.Name    `xml:"file"`
        Name        string      `xml:"name,attr"`
+       Identity    string      `xml:"identity,,omitempty"`
        Description string      `xml:"description,,omitempty"`
        Hashes      []Hash      `xml:"hash,,omitempty"`
        MetaURLs    []MetaURL   `xml:"metaurl,,omitempty"`