/
githubmirror
/
terraform
Обзор
Документация
Войти
/
githubmirror
/
terraform
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
internal/command/arguments/workspace.go
29 строк
896 B
Sarah French
refactor: Update `workspace select` and `new` subcommands to use the arguments package for parsing arguments and flags (#38430)
01 май 2026, 18:39
Не верифицирован
01 май 2026, 18:39
6554bda
Код
Авторство
О чём код?
// Copyright IBM Corp. 2014, 2026 // SPDX-License-Identifier: BUSL-1.1 package arguments import "net/url" // Workspace represents the command-line arguments common between all workspace subcommands. // // Subcommands that accept additional arguments should have a specific struct that embeds this struct. type Workspace struct { // ViewType specifies which output format to use ViewType ViewType } // ValidWorkspaceName returns true is this name is valid to use as a workspace name. // Since most named states are accessed via a filesystem path or URL, check if // escaping the name would be required. func ValidWorkspaceName(name string) bool { if name == "" { return false } return name == url.PathEscape(name) } const EnvInvalidName = ` The workspace name %q is not allowed. The name must contain only URL safe characters, contain no path separators, and not be an empty string. `