git-lfs/commands/command_env.go

35 lines
604 B
Go
Raw Normal View History

package commands
import (
"github.com/github/git-media/gitmedia"
2014-06-26 20:09:14 +00:00
"github.com/spf13/cobra"
)
2014-06-26 20:09:14 +00:00
var (
envCmd = &cobra.Command{
Use: "env",
2014-06-26 21:22:24 +00:00
Short: "Show the current environment",
2014-06-26 20:09:14 +00:00
Run: envCommand,
}
)
2014-06-26 20:09:14 +00:00
func envCommand(cmd *cobra.Command, args []string) {
config := gitmedia.Config
if endpoint := config.Endpoint(); len(endpoint) > 0 {
Print("Endpoint=%s", endpoint)
}
for _, remote := range config.Remotes() {
Print("Endpoint (%s)=%s", remote, config.RemoteEndpoint(remote))
}
for _, env := range gitmedia.Environ() {
Print(env)
}
}
func init() {
2014-06-26 20:09:14 +00:00
RootCmd.AddCommand(envCmd)
}