Merge pull request #582 from Morganamilo/aururl

Add extra fields to -Si[i]
This commit is contained in:
Anna 2018-07-24 13:06:12 +01:00 committed by GitHub
commit f567abe386
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

2
Gopkg.lock generated
View file

@ -17,7 +17,7 @@
branch = "master"
name = "github.com/mikkeloscar/aur"
packages = ["."]
revision = "837b260b8e90895c45737e2e72313fe5bce6f2c4"
revision = "2980c04ca5c926b2cb7c4ac3ac8dc0b7f70d29ba"
[solve-meta]
analyzer-name = "dep"

View file

@ -268,6 +268,10 @@ func printDownloads(repoName string, length int, packages string) {
}
func printInfoValue(str, value string) {
if value == "" {
value = "None"
}
fmt.Printf(bold("%-16s%s")+" %s\n", str, ":", value)
}
@ -275,9 +279,12 @@ func printInfoValue(str, value string) {
func PrintInfo(a *rpc.Pkg) {
printInfoValue("Repository", "aur")
printInfoValue("Name", a.Name)
printInfoValue("Keywords", strings.Join(a.Keywords, " "))
printInfoValue("Version", a.Version)
printInfoValue("Description", a.Description)
printInfoValue("URL", a.URL)
printInfoValue("AUR URL", baseURL+"/packages/"+a.Name)
printInfoValue("Groups", strings.Join(a.Groups, " "))
printInfoValue("Licenses", strings.Join(a.License, " "))
printInfoValue("Provides", strings.Join(a.Provides, " "))
printInfoValue("Depends On", strings.Join(a.Depends, " "))
@ -288,12 +295,22 @@ func PrintInfo(a *rpc.Pkg) {
printInfoValue("Maintainer", a.Maintainer)
printInfoValue("Votes", fmt.Sprintf("%d", a.NumVotes))
printInfoValue("Popularity", fmt.Sprintf("%f", a.Popularity))
printInfoValue("First Submitted", formatTime(a.FirstSubmitted))
printInfoValue("Last Modified", formatTime(a.LastModified))
if a.OutOfDate != 0 {
printInfoValue("Out-of-date", "Yes ["+formatTime(a.OutOfDate)+"]")
} else {
printInfoValue("Out-of-date", "No")
}
if cmdArgs.existsDouble("i") {
printInfoValue("ID", fmt.Sprintf("%d", a.ID))
printInfoValue("Package Base ID", fmt.Sprintf("%d", a.PackageBaseID))
printInfoValue("Package Base", a.PackageBase)
printInfoValue("Snapshot URL", baseURL+a.URLPath)
}
fmt.Println()
}

View file

@ -41,6 +41,7 @@ type Pkg struct {
Provides []string `json:"Provides"`
Replaces []string `json:"Replaces"`
OptDepends []string `json:"OptDepends"`
Groups []string `json:"Groups"`
License []string `json:"License"`
Keywords []string `json:"Keywords"`
}