mirror of
https://github.com/gotify/cli.git
synced 2024-01-28 15:20:39 +03:00
29 lines
618 B
Go
29 lines
618 B
Go
package command
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gotify/cli/v2/config"
|
|
"github.com/gotify/cli/v2/utils"
|
|
"gopkg.in/urfave/cli.v1"
|
|
)
|
|
|
|
func Config() cli.Command {
|
|
return cli.Command{
|
|
Name: "config",
|
|
Usage: "Shows the config",
|
|
Action: func(ctx *cli.Context) {
|
|
locations := config.GetLocations()
|
|
conf, err := config.ReadConfig(locations)
|
|
if err != nil {
|
|
utils.Exit1With("cannot read config:", err)
|
|
return
|
|
}
|
|
fmt.Println("Used Config:", conf.FromLocation)
|
|
fmt.Println("URL:", conf.URL)
|
|
fmt.Println("Default Priority:", conf.DefaultPriority)
|
|
fmt.Println("Token:", conf.Token)
|
|
},
|
|
}
|
|
}
|