refactor: Change implementation of human output `workspace list` in preparation for adding support for JSON output

These changes follow patterns in other commands that support JSON output. Both human and JSON output converge on a single `build<command name here>Cmd` method that expects arguments to include flags specific to the type of output expected. Configuration that's common between both outputs, e.g use of reattached providers, is handled in this shared location.
diff --git a/tfexec/workspace_list.go b/tfexec/workspace_list.go
index 57c6060..6162fd8 100644
--- a/tfexec/workspace_list.go
+++ b/tfexec/workspace_list.go
@@ -38,13 +38,12 @@
 		return nil, "", err
 	}
 
-	ws, current := parseWorkspaceList(outBuf.String())
+	// Parse human output into a list of workspaces and the current workspace
+	ws, current := parseWorkspaceListHumanOutput(outBuf.String())
 
 	return ws, current, nil
 }
 
-const currentWorkspacePrefix = "* "
-
 func (tf *Terraform) workspaceListCmd(ctx context.Context, opts ...WorkspaceListOption) (*exec.Cmd, error) {
 	c := defaultWorkspaceListOptions
 
@@ -52,19 +51,15 @@
 		o.configureWorkspaceList(&c)
 	}
 
-	mergeEnv := map[string]string{}
-	if c.reattachInfo != nil {
-		reattachStr, err := c.reattachInfo.marshalString()
-		if err != nil {
-			return nil, err
-		}
-		mergeEnv[reattachEnvVar] = reattachStr
-	}
-
-	return tf.buildTerraformCmd(ctx, mergeEnv, "workspace", "list", "-no-color"), nil
+	args := []string{"workspace", "list", "-no-color"}
+	return tf.buildWorkspaceListCmd(ctx, c, args)
 }
 
-func parseWorkspaceList(stdout string) ([]string, string) {
+// parseWorkspaceListHumanOutput parses human output from the workspace list command
+// to return a slice of workspace names and the current workspace name
+func parseWorkspaceListHumanOutput(stdout string) ([]string, string) {
+	var currentWorkspacePrefix string = "* "
+
 	lines := strings.Split(stdout, "\n")
 
 	current := ""
@@ -83,3 +78,16 @@
 
 	return workspaces, current
 }
+
+func (tf *Terraform) buildWorkspaceListCmd(ctx context.Context, c workspaceListConfig, args []string) (*exec.Cmd, error) {
+	mergeEnv := map[string]string{}
+	if c.reattachInfo != nil {
+		reattachStr, err := c.reattachInfo.marshalString()
+		if err != nil {
+			return nil, err
+		}
+		mergeEnv[reattachEnvVar] = reattachStr
+	}
+
+	return tf.buildTerraformCmd(ctx, mergeEnv, args...), nil
+}
diff --git a/tfexec/workspace_list_test.go b/tfexec/workspace_list_test.go
index 0ad7938..917cea1 100644
--- a/tfexec/workspace_list_test.go
+++ b/tfexec/workspace_list_test.go
@@ -59,7 +59,7 @@
 	})
 }
 
-func TestParseWorkspaceList(t *testing.T) {
+func TestParseWorkspaceListHumanOutput(t *testing.T) {
 	for i, c := range []struct {
 		expected        []string
 		expectedCurrent string
@@ -96,7 +96,7 @@
 		},
 	} {
 		t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
-			actualList, actualCurrent := parseWorkspaceList(c.stdout)
+			actualList, actualCurrent := parseWorkspaceListHumanOutput(c.stdout)
 
 			if actualCurrent != c.expectedCurrent {
 				t.Fatalf("expected selected %q, got %q", c.expectedCurrent, actualCurrent)