MCPcopy Index your code
hub / github.com/peak/s5cmd / NewPipeCommand

Function NewPipeCommand

command/pipe.go:107–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105}
106
107func NewPipeCommand() *cli.Command {
108 cmd := &cli.Command{
109 Name: "pipe",
110 HelpName: "pipe",
111 Usage: "stream to remote from stdin",
112 Flags: NewPipeCommandFlags(),
113 CustomHelpTemplate: pipeHelpTemplate,
114 Before: func(c *cli.Context) error {
115 err := validatePipeCommand(c)
116 if err != nil {
117 printError(commandFromContext(c), c.Command.Name, err)
118 }
119 return err
120 },
121 Action: func(c *cli.Context) (err error) {
122 defer stat.Collect(c.Command.FullName(), &err)()
123
124 pipe, err := NewPipe(c, false)
125 if err != nil {
126 return err
127 }
128 return pipe.Run(c.Context)
129 },
130 }
131
132 cmd.BashComplete = getBashCompleteFn(cmd, false, false)
133 return cmd
134}
135
136// Pipe holds pipe operation flags and states.
137type Pipe struct {

Callers 1

CommandsFunction · 0.85

Calls 8

RunMethod · 0.95
CollectFunction · 0.92
NewPipeCommandFlagsFunction · 0.85
validatePipeCommandFunction · 0.85
printErrorFunction · 0.85
commandFromContextFunction · 0.85
NewPipeFunction · 0.85
getBashCompleteFnFunction · 0.85

Tested by

no test coverage detected