diff options
| author | Mikhail Osipov <mike.osipov@gmail.com> | 2020-01-25 03:51:57 +0300 |
|---|---|---|
| committer | Mikhail Osipov <mike.osipov@gmail.com> | 2020-01-25 03:51:57 +0300 |
| commit | df935315c7201b7d42eb361b3ac3d36fe83e53e6 (patch) | |
| tree | 261f1f216533e0aa4d3adea5bff09151e83c88d4 | |
| parent | f11d4126dca45e14a670dc8086c0ec8d2027af57 (diff) | |
env to var rename
| -rw-r--r-- | pkg/server/env.go | 20 | ||||
| -rwxr-xr-x | test/hello.sh | 10 |
2 files changed, 15 insertions, 15 deletions
diff --git a/pkg/server/env.go b/pkg/server/env.go index 2f6937e..1618c62 100644 --- a/pkg/server/env.go +++ b/pkg/server/env.go @@ -6,11 +6,11 @@ import ( ) func init() { - newCmd(envGet, "env", "get") - newCmd(envSet, "env", "set") - newCmd(envDel, "env", "del") - newCmd(envShow, "env", "show") - newCmd(envClear, "env", "clear") + newCmd(varGet, "var", "get") + newCmd(varSet, "var", "set") + newCmd(varDel, "var", "del") + newCmd(varShow, "var", "show") + newCmd(varClear, "var", "clear") } type env struct { @@ -79,7 +79,7 @@ func (e *env) clear() { e.m = nil } -func envGet(r *request) { +func varGet(r *request) { r.expect(1) if v, ok := r.c.s.env.get(r.args[0]); ok { @@ -89,7 +89,7 @@ func envGet(r *request) { } } -func envSet(r *request) { +func varSet(r *request) { r.expect(2) if !isValidVarName(r.args[0]) { @@ -99,7 +99,7 @@ func envSet(r *request) { r.c.s.env.set(r.args[0], r.args[1]) } -func envDel(r *request) { +func varDel(r *request) { r.expect(1) if !r.c.s.env.del(r.args[0]) { @@ -107,13 +107,13 @@ func envDel(r *request) { } } -func envShow(r *request) { +func varShow(r *request) { r.c.s.env.each(func (k string, v string) bool { r.Println(k, v) return true }) } -func envClear(r *request) { +func varClear(r *request) { r.c.s.env.clear() } diff --git a/test/hello.sh b/test/hello.sh index fefe1da..9893089 100755 --- a/test/hello.sh +++ b/test/hello.sh @@ -3,9 +3,9 @@ ROOT=$(dirname $0)/.. PATH=$ROOT/cmd/tunnel -tunnel env clear -tunnel env set cmd echo -tunnel env set args ^"%x, %y!" -tunnel env set x Hello -tunnel env set y World +tunnel var clear +tunnel var set cmd echo +tunnel var set args ^"%x, %y!" +tunnel var set x Hello +tunnel var set y World tunnel %cmd %args |
