INNER CODE UNIT · Go
NewCommand
iximiuz/cdebug · cmd/exec/exec.go:100
func NewCommand(cli cliutil.CLI) *cobra.Command {
var opts options
cmd := &cobra.Command{
Use: "exec [OPTIONS] [schema://][POD][CONTAINER] [COMMAND] [ARG...]",
Short: "Start a debugger shell in the target container or pod.",
Example: fmt.Sprintf(exampleText[1:], strings.TrimPrefix(defaultToolkitImage, "docker.io/library/")),
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
if !opts.stdin {
opts.quiet = true
}
cli.SetQuiet(opts.quiet)
if err := cli.InputStream().CheckTty(opts.stdin, opts.tty); err != nil {
return cliutil.WrapStatusError(err)
}