@@ -35,6 +35,7 @@ run gogo.exe -- -i 127.0.0.1 -p http
3535 carapace .ActionValues ().Usage ("command to execute" ),
3636 carapace .ActionValues ().Usage ("arguments to the command" ),
3737 )
38+ common .BindOutputFlags (runCmd )
3839
3940 executeCmd := & cobra.Command {
4041 Use : consts .ModuleAliasExecute + " [cmdline]" ,
@@ -60,6 +61,7 @@ execute gogo.exe -- -i 127.0.0.1 -p http
6061 common .BindArgCompletions (executeCmd , nil ,
6162 carapace .ActionValues ().Usage ("command to execute" ),
6263 )
64+ common .BindOutputFlags (executeCmd )
6365
6466 shellCmd := & cobra.Command {
6567 Use : consts .ModuleAliasShell + " [cmdline]" ,
@@ -83,6 +85,7 @@ execute gogo.exe -- -i 127.0.0.1 -p http
8385 common .BindFlag (shellCmd , func (f * pflag.FlagSet ) {
8486 f .BoolP ("quiet" , "q" , false , "disable output" )
8587 })
88+ common .BindOutputFlags (shellCmd )
8689
8790 execLocalCmd := & cobra.Command {
8891 Use : consts .ModuleExecuteLocal + " [local_exe]" ,
@@ -108,6 +111,7 @@ execute_local local_exe --ppid 1234 --block_dll --etw --argue "argue"
108111 f .StringP ("process" , "n" , "" , "custom process path" )
109112 f .BoolP ("output" , "o" , false , "disable output" )
110113 })
114+ common .BindOutputFlags (execLocalCmd )
111115
112116 inlineLocalCmd := & cobra.Command {
113117 Use : consts .ModuleInlineLocal + " [local_exe]" ,
@@ -133,6 +137,7 @@ inline_local whoami
133137 f .StringP ("process" , "n" , "" , "custom process path" )
134138 f .BoolP ("output" , "o" , false , "disable output" )
135139 })
140+ common .BindOutputFlags (inlineLocalCmd )
136141
137142 powershellCmd := & cobra.Command {
138143 Use : consts .ModuleAliasPowershell + " [cmdline]" ,
@@ -160,6 +165,7 @@ powershell dir
160165 common .BindFlag (powershellCmd , func (f * pflag.FlagSet ) {
161166 f .BoolP ("quiet" , "q" , false , "disable output" )
162167 })
168+ common .BindOutputFlags (powershellCmd )
163169
164170 execAssemblyCmd := & cobra.Command {
165171 Use : consts .ModuleExecuteAssembly + " [file]" ,
@@ -185,6 +191,7 @@ execute_assembly potato.exe "whoami"
185191 carapace .ActionValues ().Usage ("arguments to pass to the assembly args" ))
186192
187193 common .BindFlag (execAssemblyCmd , common .SacrificeFlagSet , common .CLRFlagSet )
194+ common .BindOutputFlags (execAssemblyCmd )
188195
189196 inlineAssemblyCmd := & cobra.Command {
190197 Use : consts .ModuleInlineAssembly + " [file]" ,
@@ -216,6 +223,7 @@ inline_assembly --amsi potato.exe -- cmd /c whoami
216223 carapace .ActionValues ().Usage ("arguments to pass to the assembly args" ))
217224
218225 common .BindFlag (inlineAssemblyCmd , common .CLRFlagSet )
226+ common .BindOutputFlags (inlineAssemblyCmd )
219227
220228 execShellcodeCmd := & cobra.Command {
221229 Use : consts .ModuleExecuteShellcode + " [shellcode_file]" ,
@@ -242,6 +250,7 @@ execute_shellcode example.bin
242250 carapace .ActionValues ().Usage ("arguments to pass to the assembly entrypoint" ))
243251
244252 common .BindFlag (execShellcodeCmd , common .ExecuteFlagSet , common .SacrificeFlagSet )
253+ common .BindOutputFlags (execShellcodeCmd )
245254
246255 inlineShellcodeCmd := & cobra.Command {
247256 Use : consts .ModuleAliasInlineShellcode + " [shellcode_file]" ,
@@ -269,6 +278,7 @@ inline_shellcode example.bin
269278 common .BindArgCompletions (inlineShellcodeCmd , nil ,
270279 carapace .ActionFiles ().Usage ("path the shellcode file" ))
271280 common .BindFlag (inlineShellcodeCmd , common .ExecuteFlagSet )
281+ common .BindOutputFlags (inlineShellcodeCmd )
272282
273283 execDLLCmd := & cobra.Command {
274284 Use : consts .ModuleExecuteDll + " [dll]" ,
@@ -304,6 +314,7 @@ execute_dll example.dll -e entrypoint -- arg1 arg2
304314 f .StringP ("entrypoint" , "e" , "" , "custom entrypoint" )
305315 f .StringP ("binPath" , "" , "" , "custom process path" )
306316 })
317+ common .BindOutputFlags (execDLLCmd )
307318
308319 common .BindFlagCompletions (execDLLCmd , func (comp carapace.ActionMap ) {
309320 comp ["binPath" ] = carapace .ActionFiles ()
@@ -334,6 +345,7 @@ dllspawn example.dll
334345 f .StringP ("entrypoint" , "e" , "" , "custom entrypoint" )
335346 f .StringP ("binPath" , "" , "" , "custom process path" )
336347 })
348+ common .BindOutputFlags (execDLLSpawnCmd )
337349
338350 common .BindFlagCompletions (execDLLSpawnCmd , func (comp carapace.ActionMap ) {
339351 comp ["binPath" ] = carapace .ActionFiles ()
@@ -371,6 +383,7 @@ inline_dll example.dll -e RunFunction -- arg1 arg2
371383 common .BindFlag (inlineDLLCmd , common .ExecuteFlagSet , func (f * pflag.FlagSet ) {
372384 f .StringP ("entrypoint" , "e" , "" , "entrypoint" )
373385 })
386+ common .BindOutputFlags (inlineDLLCmd )
374387
375388 execExeCmd := & cobra.Command {
376389 Use : consts .ModuleExecuteExe + " [exe]" ,
@@ -395,6 +408,7 @@ execute_exe gogo.exe -- -i 123.123.123.123 -p top2
395408 carapace .ActionValues ().Usage ("arguments to pass to the assembly entrypoint" ))
396409
397410 common .BindFlag (execExeCmd , common .ExecuteFlagSet , common .SacrificeFlagSet )
411+ common .BindOutputFlags (execExeCmd )
398412
399413 inlinePECmd := & cobra.Command {
400414 Use : consts .ModuleAliasInlineExe + " [exe]" ,
@@ -421,6 +435,7 @@ inline_exe hackbrowserdata.exe -- -h
421435` ,
422436 }
423437 common .BindFlag (inlinePECmd , common .ExecuteFlagSet )
438+ common .BindOutputFlags (inlinePECmd )
424439 common .BindArgCompletions (inlinePECmd , nil ,
425440 carapace .ActionFiles ().Usage ("path the PE file" ))
426441
@@ -456,6 +471,7 @@ bof dir.x64.o -- wstr:"C:\\Windows\\System32"
456471 common .BindArgCompletions (execBofCmd , nil ,
457472 carapace .ActionFiles ().Usage ("path the BOF file" ),
458473 carapace .ActionValues ().Usage ("arguments to pass to the assembly entrypoint" ))
474+ common .BindOutputFlags (execBofCmd )
459475
460476 powerpickCmd := & cobra.Command {
461477 Use : consts .ModulePowerpick + " [args]" ,
@@ -483,6 +499,7 @@ powerpick -s powerview.ps1 -- Get-NetUser
483499 common .BindFlagCompletions (powerpickCmd , func (comp carapace.ActionMap ) {
484500 comp ["script" ] = carapace .ActionFiles ()
485501 })
502+ common .BindOutputFlags (powerpickCmd )
486503
487504 return []* cobra.Command {
488505 runCmd ,
0 commit comments