diff options
| author | Shulhan <ms@kilabit.info> | 2023-10-12 00:15:36 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-10-12 01:40:22 +0700 |
| commit | d2fa84d24d12b5e6e1e6a7a93c164f3f4f9ce969 (patch) | |
| tree | 161d9f5d9292bdfa3054443a2b8b0018a063ce84 | |
| parent | a4711d0c2ede5decfb03b5f3ffbd522ba3bbb359 (diff) | |
| download | awwan-d2fa84d24d12b5e6e1e6a7a93c164f3f4f9ce969.tar.xz | |
all: fix printing the statement to be executed
This fix missing magic command not printed in stdout.
| -rw-r--r-- | session.go | 6 | ||||
| -rw-r--r-- | statement.go | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -330,7 +330,7 @@ func (ses *Session) executeScriptOnLocal(req *Request, pos linePosition) { continue } - fmt.Fprintf(req.stdout, "\n--> local: %3d: %s\n", x, stmt.raw) + fmt.Fprintf(req.stdout, "\n--> local: %3d: %s\n", x, stmt.String()) var err error switch stmt.kind { @@ -373,8 +373,8 @@ func (ses *Session) executeScriptOnRemote(req *Request, pos linePosition) { continue } - fmt.Fprintf(req.stdout, "\n--> %s: %3d: %s %s\n", - ses.sshc.conn, x, stmt.cmd, stmt.args) + fmt.Fprintf(req.stdout, "\n--> %s: %3d: %s\n", + ses.sshc.conn, x, stmt.String()) var err error switch stmt.kind { diff --git a/statement.go b/statement.go index bd7bc35..288399c 100644 --- a/statement.go +++ b/statement.go @@ -112,7 +112,7 @@ func ParseStatement(raw []byte) (stmt *Statement, err error) { } func (stmt *Statement) String() string { - return fmt.Sprintf("%s %s", stmt.cmd, strings.Join(stmt.args, " ")) + return fmt.Sprintf("%s%s %s", magicCmdGetPut[stmt.kind], stmt.cmd, strings.Join(stmt.args, " ")) } // parseStatementGetPut parse the raw "#get" or "#put" statement. |
