diff --git a/main-mshell.go b/main-mshell.go index 226c6452..7cb4836b 100644 --- a/main-mshell.go +++ b/main-mshell.go @@ -298,6 +298,10 @@ func parseClientOpts() (*shexec.ClientOpts, error) { opts.Cwd = iter.Next() continue } + if argStr == "--debug" { + opts.Debug = true + continue + } } if opts.IsSSH { // parse SSH opts diff --git a/pkg/shexec/shexec.go b/pkg/shexec/shexec.go index 9bf98a56..74b98aa2 100644 --- a/pkg/shexec/shexec.go +++ b/pkg/shexec/shexec.go @@ -219,6 +219,7 @@ type ClientOpts struct { Command string Fds []packet.RemoteFd Cwd string + Debug bool } func (opts *ClientOpts) MakeRunPacket() *packet.RunPacketType { @@ -318,6 +319,9 @@ func RunClientSSHCommandAndWait(opts *ClientOpts) (*packet.CmdDonePacketType, er } runPacket := opts.MakeRunPacket() sender.SendPacket(runPacket) + if opts.Debug { + cmd.Multiplexer.Debug = true + } remoteDonePacket := cmd.Multiplexer.RunIOAndWait(packetCh, sender, false, true, true) donePacket := cmd.WaitForCommand() if remoteDonePacket != nil {