func()

in cmd/version_command.go [44:74]


func (c *VersionCommand) Run(args []string) int {
	f := c.flags()
	if err := f.Parse(args); err != nil {
		c.Ui.Error(fmt.Sprintf("Error parsing command-line flags: %s", err))
		return 1
	}

	output := VersionOutput{
		Version: c.Version,
		BuildInfo: &BuildInfo{
			GoVersion: runtime.Version(),
			GoOS:      runtime.GOOS,
			GoArch:    runtime.GOARCH,
			Compiler:  runtime.Compiler,
		},
	}

	if c.jsonOutput {
		jsonOutput, err := json.MarshalIndent(output, "", "  ")
		if err != nil {
			c.Ui.Error(fmt.Sprintf("\nError marshalling JSON: %s", err))
			return 1
		}
		c.Ui.Output(string(jsonOutput))
		return 0
	}

	ver := fmt.Sprintf("%s\nazurerm: %s\nplatform: %s/%s\ngo: %s\ncompiler: %s", c.Version, schema.ProviderVersion, output.GoOS, output.GoArch, output.GoVersion, output.Compiler)
	c.Ui.Output(ver)
	return 0
}