11package runconfig
22
33import (
4+ "github.com/docker/docker/api/types"
45 flag "github.com/docker/docker/pkg/mflag"
56)
67
7- // ExecConfig is a small subset of the Config struct that hold the configuration
8- // for the exec feature of docker.
9- type ExecConfig struct {
10- User string // User that will run the command
11- Privileged bool // Is the container in privileged mode
12- Tty bool // Attach standard streams to a tty.
13- Container string // Name of the container (to execute in)
14- AttachStdin bool // Attach the standard input, makes possible user interaction
15- AttachStderr bool // Attach the standard output
16- AttachStdout bool // Attach the standard error
17- Detach bool // Execute in detach mode
18- Cmd []string // Execution commands and args
19- }
20-
218// ParseExec parses the specified args for the specified command and generates
229// an ExecConfig from it.
2310// If the minimal number of specified args is not right or if specified args are
2411// not valid, it will return an error.
25- func ParseExec (cmd * flag.FlagSet , args []string ) (* ExecConfig , error ) {
12+ func ParseExec (cmd * flag.FlagSet , args []string ) (* types. ExecConfig , error ) {
2613 var (
2714 flStdin = cmd .Bool ([]string {"i" , "-interactive" }, false , "Keep STDIN open even if not attached" )
2815 flTty = cmd .Bool ([]string {"t" , "-tty" }, false , "Allocate a pseudo-TTY" )
@@ -40,7 +27,7 @@ func ParseExec(cmd *flag.FlagSet, args []string) (*ExecConfig, error) {
4027 parsedArgs := cmd .Args ()
4128 execCmd = parsedArgs [1 :]
4229
43- execConfig := & ExecConfig {
30+ execConfig := & types. ExecConfig {
4431 User : * flUser ,
4532 Privileged : * flPrivileged ,
4633 Tty : * flTty ,
0 commit comments