go-mastodon/cmd/mstdn/cmd_instance.go
2017-04-15 22:25:20 +09:00

22 lines
473 B
Go

package main
import (
"fmt"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
)
func cmdInstance(c *cli.Context) error {
client := c.App.Metadata["client"].(*mastodon.Client)
instance, err := client.GetInstance()
if err != nil {
return err
}
fmt.Printf("URI : %s\n", instance.URI)
fmt.Printf("Title : %s\n", instance.Title)
fmt.Printf("Description: %s\n", instance.Description)
fmt.Printf("EMail : %s\n", instance.EMail)
return nil
}