MCPcopy Create free account
hub / github.com/containerd/nerdctl / attachOptions

Function attachOptions

cmd/nerdctl/container/container_attach.go:65–90  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

63}
64
65func attachOptions(cmd *cobra.Command) (types.ContainerAttachOptions, error) {
66 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)
67 if err != nil {
68 return types.ContainerAttachOptions{}, err
69 }
70 detachKeys, err := cmd.Flags().GetString("detach-keys")
71 if err != nil {
72 return types.ContainerAttachOptions{}, err
73 }
74 noStdin, err := cmd.Flags().GetBool("no-stdin")
75 if err != nil {
76 return types.ContainerAttachOptions{}, err
77 }
78
79 var stdin io.Reader
80 if !noStdin {
81 stdin = cmd.InOrStdin()
82 }
83 return types.ContainerAttachOptions{
84 GOptions: globalOptions,
85 Stdin: stdin,
86 Stdout: cmd.OutOrStdout(),
87 Stderr: cmd.ErrOrStderr(),
88 DetachKeys: detachKeys,
89 }, nil
90}
91
92func attachAction(cmd *cobra.Command, args []string) error {
93 options, err := attachOptions(cmd)

Callers 1

attachActionFunction · 0.85

Calls 1

ProcessRootCmdFlagsFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…