add some fields for instance command
This commit is contained in:
parent
5d863ccf79
commit
2ccbcfe14d
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
|
|
||||||
"github.com/mattn/go-mastodon"
|
"github.com/mattn/go-mastodon"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
|
@ -18,5 +19,26 @@ func cmdInstance(c *cli.Context) error {
|
||||||
fmt.Fprintf(c.App.Writer, "Title : %s\n", instance.Title)
|
fmt.Fprintf(c.App.Writer, "Title : %s\n", instance.Title)
|
||||||
fmt.Fprintf(c.App.Writer, "Description: %s\n", instance.Description)
|
fmt.Fprintf(c.App.Writer, "Description: %s\n", instance.Description)
|
||||||
fmt.Fprintf(c.App.Writer, "EMail : %s\n", instance.EMail)
|
fmt.Fprintf(c.App.Writer, "EMail : %s\n", instance.EMail)
|
||||||
|
if instance.Version != "" {
|
||||||
|
fmt.Fprintf(c.App.Writer, "Version : %s\n", instance.Version)
|
||||||
|
}
|
||||||
|
if instance.Thumbnail != "" {
|
||||||
|
fmt.Fprintf(c.App.Writer, "Thumbnail : %s\n", instance.Thumbnail)
|
||||||
|
}
|
||||||
|
if instance.URLs != nil {
|
||||||
|
var keys []string
|
||||||
|
for _, k := range instance.URLs {
|
||||||
|
keys = append(keys, k)
|
||||||
|
}
|
||||||
|
sort.Strings(keys)
|
||||||
|
for _, k := range keys {
|
||||||
|
fmt.Fprintf(c.App.Writer, "%s: %s\n", k, instance.URLs[k])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if instance.Stats != nil {
|
||||||
|
fmt.Fprintf(c.App.Writer, "User Count : %v\n", instance.Stats.UserCount)
|
||||||
|
fmt.Fprintf(c.App.Writer, "Status Count : %v\n", instance.Stats.StatusCount)
|
||||||
|
fmt.Fprintf(c.App.Writer, "Domain Count : %v\n", instance.Stats.DomainCount)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user