From 24efb546f581d575aadfb3c17ba280ac7af4318a Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 18 Feb 2026 17:39:40 +0300 Subject: [PATCH] Ability to add identity --- cmd/create.go | 2 ++ internal/scheme.go | 1 + 2 files changed, 3 insertions(+) diff --git a/cmd/create.go b/cmd/create.go index 1ef2a83..8f71829 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -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, diff --git a/internal/scheme.go b/internal/scheme.go index e8214c7..8f757d7 100644 --- a/internal/scheme.go +++ b/internal/scheme.go @@ -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"` -- 2.52.0