git-lfs/commands/command_env.go

35 lines
587 B
Go
Raw Normal View History

package commands
import (
2015-03-19 19:30:55 +00:00
"github.com/github/git-lfs/lfs"
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) {
2015-03-19 19:30:55 +00:00
config := lfs.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))
}
2015-03-19 19:30:55 +00:00
for _, env := range lfs.Environ() {
Print(env)
}
}
func init() {
2014-06-26 20:09:14 +00:00
RootCmd.AddCommand(envCmd)
}