summaryrefslogtreecommitdiff
path: root/pkg/server/echo.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/server/echo.go')
-rw-r--r--pkg/server/echo.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/pkg/server/echo.go b/pkg/server/echo.go
index 0387a3e..2ac54b9 100644
--- a/pkg/server/echo.go
+++ b/pkg/server/echo.go
@@ -5,7 +5,19 @@ import (
)
func echo(r *request) {
- r.Print(strings.Join(r.args, " "))
+ expand := false
+ args := r.args
+
+ if r.argc > 0 && r.args[0] == "-e" {
+ expand = true
+ args = args[1:]
+ }
+
+ s := strings.Join(args, " ")
+ if expand {
+ s = r.c.s.env.Expand(s)
+ }
+ r.Print(s)
}
func init() {