mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-29 10:21:01 -06:00
67203dade8
After some refactoring, this helper method had an unused argument (vars) and an always-nil error return value. This commit cleans this up.
49 lines
989 B
Go
49 lines
989 B
Go
package command
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/posener/complete"
|
|
)
|
|
|
|
type WorkspaceShowCommand struct {
|
|
Meta
|
|
}
|
|
|
|
func (c *WorkspaceShowCommand) Run(args []string) int {
|
|
args = c.Meta.process(args)
|
|
cmdFlags := c.Meta.extendedFlagSet("workspace show")
|
|
cmdFlags.Usage = func() { c.Ui.Error(c.Help()) }
|
|
if err := cmdFlags.Parse(args); err != nil {
|
|
c.Ui.Error(fmt.Sprintf("Error parsing command-line flags: %s\n", err.Error()))
|
|
return 1
|
|
}
|
|
|
|
workspace := c.Workspace()
|
|
c.Ui.Output(workspace)
|
|
|
|
return 0
|
|
}
|
|
|
|
func (c *WorkspaceShowCommand) AutocompleteArgs() complete.Predictor {
|
|
return complete.PredictNothing
|
|
}
|
|
|
|
func (c *WorkspaceShowCommand) AutocompleteFlags() complete.Flags {
|
|
return nil
|
|
}
|
|
|
|
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"
|
|
}
|