Files
teleport/tool/tctl/common/cmds.go
T
Zac Bergquist cfb40186e1 tctl: add edit command (#18826)
This command allows you to modify a resource in place by opening
the resource YAML in your text editor.

The editor is selected by checking the following, in order of
precedence:

- the TELEPORT_EDITOR environment variable
- the VISUAL environment variable
- the EDITOR environment variable
- defaulting to 'vi'

We also prevent renaming resources with this command.
See gravitational/webapps#1465 where we do the same for the web UI.
2022-12-29 17:30:14 -07:00

56 lines
1.4 KiB
Go

// Copyright 2022 Gravitational, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package common
import (
"github.com/gravitational/teleport/tool/tctl/sso/configure"
"github.com/gravitational/teleport/tool/tctl/sso/tester"
)
// Commands returns the set of commands that are to oss and ent
// variants of tctl.
func Commands() []CLICommand {
return []CLICommand{
&UserCommand{},
&NodeCommand{},
&TokensCommand{},
&AuthCommand{},
&StatusCommand{},
&TopCommand{},
&AccessRequestCommand{},
&AppsCommand{},
&DBCommand{},
&KubeCommand{},
&DesktopCommand{},
&LockCommand{},
&BotsCommand{},
&InventoryCommand{},
&RecordingsCommand{},
&AlertCommand{},
&ProxyCommand{},
&ResourceCommand{},
&EditCommand{},
}
}
// OSSCommands returns the oss variants of commands that use different variants
// for oss and ent.
func OSSCommands() []CLICommand {
return []CLICommand{
&configure.SSOConfigureCommand{},
&tester.SSOTestCommand{},
}
}