2017-07-05 23:35:46 +02:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
type WorkspaceShowCommand struct {
|
|
|
|
Meta
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *WorkspaceShowCommand) Run(args []string) int {
|
2017-03-08 05:09:48 +01:00
|
|
|
args, err := c.Meta.process(args, true)
|
|
|
|
if err != nil {
|
|
|
|
return 1
|
|
|
|
}
|
2017-07-05 23:35:46 +02:00
|
|
|
|
|
|
|
cmdFlags := c.Meta.flagSet("workspace show")
|
|
|
|
cmdFlags.Usage = func() { c.Ui.Error(c.Help()) }
|
|
|
|
if err := cmdFlags.Parse(args); err != nil {
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
workspace := c.Workspace()
|
|
|
|
c.Ui.Output(workspace)
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *WorkspaceShowCommand) Help() string {
|
|
|
|
helpText := `
|
|
|
|
Usage: terraform workspace show
|
|
|
|
|
|
|
|
Show the name of the current workspace.
|
|
|
|
`
|
|
|
|
return strings.TrimSpace(helpText)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *WorkspaceShowCommand) Synopsis() string {
|
|
|
|
return "Show the name of the current workspace"
|
|
|
|
}
|