change template

This commit is contained in:
2025-08-27 00:05:04 +02:00
parent 2c109b945e
commit 83b3a23fe4
9 changed files with 66 additions and 25 deletions

View File

@@ -15,6 +15,7 @@ type (
LinkCmd struct {
os string
arch string
name string
out string
}
)
@@ -33,6 +34,7 @@ Options:
func (p *LinkCmd) SetFlags(f *flag.FlagSet) {
f.StringVar(&p.os, "os", "", "set the operating system")
f.StringVar(&p.arch, "architecture", "", "set the instruction set")
f.StringVar(&p.name, "name", "", "set the name or label of the link")
f.StringVar(&p.out, "out", "./config.json", "path to the configuration file")
}
@@ -74,6 +76,7 @@ func (p *LinkCmd) add(link, slug string) subcommands.ExitStatus {
soft.DownloadLinks = append(soft.DownloadLinks, data.DownloadLink{
OS: p.os,
Arch: p.arch,
Name: p.name,
URL: link,
})
d.Softwares[i] = soft
@@ -114,6 +117,10 @@ func (p *LinkCmd) edit(link, slug string) subcommands.ExitStatus {
l.Arch = p.arch
}
if len(p.name) > 0 {
l.Name = p.name
}
soft.DownloadLinks[y] = l
foundLink = true
break