aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-10-12 00:15:36 +0700
committerShulhan <ms@kilabit.info>2023-10-12 01:40:22 +0700
commitd2fa84d24d12b5e6e1e6a7a93c164f3f4f9ce969 (patch)
tree161d9f5d9292bdfa3054443a2b8b0018a063ce84
parenta4711d0c2ede5decfb03b5f3ffbd522ba3bbb359 (diff)
downloadawwan-d2fa84d24d12b5e6e1e6a7a93c164f3f4f9ce969.tar.xz
all: fix printing the statement to be executed
This fix missing magic command not printed in stdout.
-rw-r--r--session.go6
-rw-r--r--statement.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/session.go b/session.go
index 6432884..d68637a 100644
--- a/session.go
+++ b/session.go
@@ -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.