MCPcopy Create free account
hub / github.com/FalconOpsLLC/goexec / argsOutput

Function argsOutput

cmd/args.go:154–176  ·  view source on GitHub ↗
(methods ...string)

Source from the content-addressed store, hash-verified

152}
153
154func argsOutput(methods ...string) func(cmd *cobra.Command, args []string) error {
155
156 var as []func(*cobra.Command, []string) error
157
158 for _, method := range methods {
159 if method == "smb" {
160 as = append(as, argsSmbClient())
161 }
162 }
163
164 return args(append(as, func(*cobra.Command, []string) (err error) {
165
166 if outputPath != "" {
167 if outputPath == "-" {
168 exec.Output.Writer = os.Stdout
169
170 } else if exec.Output.Writer, err = os.OpenFile(outputPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644); err != nil {
171 log.Fatal().Err(err).Msg("Failed to open output file")
172 }
173 }
174 return
175 })...)
176}

Callers 3

tsch.goFile · 0.85
dcom.goFile · 0.85
wmi.goFile · 0.85

Calls 2

argsSmbClientFunction · 0.85
argsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…