You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openserverless.apache.org by ms...@apache.org on 2024/08/06 21:12:02 UTC

(openserverless-cli) branch main updated (068d40c -> c71a91c)

This is an automated email from the ASF dual-hosted git repository.

msciabarra pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-cli.git


    from 068d40c  fix install.sh
     new fdf2050  correct branch
     new 5c61fce  0.1.0-2408060903.dev
     new 0a08f7f  change: reworking documentation
     new c71a91c  reworked main help menu

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Taskfile.yml           |  13 ++-
 _patches/patch-task.sh |  14 ++-
 _patches/task          |   2 +-
 auth/login.go          |   2 +-
 go.mod                 |   2 +-
 go.sum                 |   2 +
 install.sh             |  13 +--
 main.go                | 239 +++++++++++++++++++++++++++++--------------------
 tests/mvrmem.bats      |  68 --------------
 tools/tools.go         |   6 +-
 version.txt            |   2 +-
 11 files changed, 177 insertions(+), 186 deletions(-)
 delete mode 100644 tests/mvrmem.bats


(openserverless-cli) 02/04: 0.1.0-2408060903.dev

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-cli.git

commit 5c61fce62494fa9778e501d5474541589c14864f
Author: Michele Sciabarra <mi...@sciabarra.com>
AuthorDate: Tue Aug 6 09:03:26 2024 +0200

    0.1.0-2408060903.dev
---
 version.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/version.txt b/version.txt
index f5e541b..a912604 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-0.1.0-2408051340.dev
+0.1.0-2408060903.dev


(openserverless-cli) 01/04: correct branch

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-cli.git

commit fdf20505c756a741acf742cbac27517b1b2acf35
Author: Michele Sciabarra <mi...@sciabarra.com>
AuthorDate: Mon Aug 5 18:12:09 2024 +0200

    correct branch
---
 install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/install.sh b/install.sh
index 218e235..d213583 100644
--- a/install.sh
+++ b/install.sh
@@ -32,7 +32,7 @@ case "$OS-$ARCH" in
 ;;
 esac
 
-OPSROOT="https://raw.githubusercontent.com/apache/openserverless-task/main/opsroot.json"
+OPSROOT="https://raw.githubusercontent.com/apache/openserverless-task/0.1.0/opsroot.json"
 VERSION="$(curl -sL $OPSROOT | sed -n 's/^.*"version": "\([^"]*\)",/\1/p')"
 FILE="openserverless-cli_${VERSION}$SUFFIX$EXT"
 URL="https://github.com/apache/openserverless-cli/releases/download/v$VERSION/$FILE"


(openserverless-cli) 03/04: change: reworking documentation

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-cli.git

commit 0a08f7f536954d788b3a8090772b497d65c9517f
Author: Michele Sciabarra <mi...@sciabarra.com>
AuthorDate: Tue Aug 6 10:56:56 2024 +0200

    change: reworking documentation
---
 Taskfile.yml   |  13 +++-
 install.sh     |  11 ++--
 main.go        | 184 +++++++++++++++++++++++++++++++++++----------------------
 tools/tools.go |   5 +-
 4 files changed, 133 insertions(+), 80 deletions(-)

diff --git a/Taskfile.yml b/Taskfile.yml
index 55cfc4f..3642490 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -73,11 +73,20 @@ tasks:
       - dlv exec ./ops -- {{.CLI_ARGS}}
 
   install:
-    desc: install ops in usr/local/bin
+    desc: install ops in ~./local/bin
     deps:
       - build
     cmds:
-      - sudo cp ops /usr/local/bin
+      - cp ops $HOME/.local/bin
+      - |
+        if ! which ops | grep $HOME/.local/bin
+        then 
+          echo "$HOME/.local/bin is not in the path - adding it"
+          echo 'export PATH="$HOME/.local/bin:$PATH"' >>$HOME/.bashrc
+          echo 'export PATH="$HOME/.local/bin:$PATH"' >>$HOME/.zshrc
+          echo please restart your terminal to find ops in your path
+        fi
+
 
   tests:
     desc: all tests
diff --git a/install.sh b/install.sh
index d213583..f611d54 100644
--- a/install.sh
+++ b/install.sh
@@ -53,11 +53,12 @@ then echo "cannot install ops - download and unpack it in a folder in the path f
      exit 1
 fi
 
-if ! which ops
+if ! which ops | grep $HOME/.local/bin
 then 
-    echo "$HOME/.local/bin is not in the path - adding it"
-    echo 'export PATH=~/.local/bin:"$PATH"' >>~/.bashrc
-    echo 'export PATH=~/.local/bin:"$PATH"' >>~/.zshrc
-    echo please restart your terminal to find ops in your path
+  echo "$HOME/.local/bin is not in the path - adding it"
+  echo 'export PATH="$HOME/.local/bin:$PATH"' >>$HOME/.bashrc
+  echo 'export PATH="$HOME/.local/bin:$PATH"' >>$HOME/.zshrc
+  echo please restart your terminal to find ops in your path
 fi
+
 exit 0
\ No newline at end of file
diff --git a/main.go b/main.go
index 7234d2c..ad9910d 100644
--- a/main.go
+++ b/main.go
@@ -91,7 +91,7 @@ func setOpsRootPluginEnv() {
 }
 
 func info() {
-	fmt.Println("OPS_CMD:", os.Getenv("OPS_CMD"))
+	fmt.Println("OPS & OPS_CMD:", os.Getenv("OPS_CMD"))
 	fmt.Println("OPS_VERSION:", os.Getenv("OPS_VERSION"))
 	fmt.Println("OPS_BRANCH:", os.Getenv("OPS_BRANCH"))
 	fmt.Println("OPS_BIN:", os.Getenv("OPS_BIN"))
@@ -106,39 +106,56 @@ func info() {
 	//fmt.Println("OPS_COREUTILS:", os.Getenv("OPS_COREUTILS"))
 }
 
-// not available in taskfiles
 var mainTools = []string{
-	"task", "version", "info", "help", "serve", "update", "retry", "login", "config", "plugin", "reset",
+	"task", "info", "update", "login", "config",
+	"retry", "plugin", "reset", "serve",
 }
 
-func executeMainToolsAndExit(cmd string, args []string, opsHome string) int {
-	if cmd == "" || cmd == "-" || cmd == "task" {
+// simple tools provide info and exit
+func InfoAndExit(args []string) {
+	if len(args) < 2 {
+		fmt.Println("Welcome to ops, the all-mighty, extensibile apache OPenServerless CLI Tool.")
+		fmt.Println("Let's start with the basics:")
+		fmt.Println("-v | --version version       (mention this when you ask for help)")
+		fmt.Println("-h | --help    help          (the manuale is here)")
+		fmt.Println("-u | --update  update        (get the latest version of everything)")
+		fmt.Println("-i | --info    CLI infos     (let's check the CLI)")
+		fmt.Println("-c | --config  manage config (let's check the server configuration)")
+		fmt.Println("-l | --login   login         (you have to login first, you know)")
+		fmt.Println("--i-really-want-to-reset     (if you are desperate and nothing works)")
+		fmt.Println("But wait! There is more, much much more. Please RTFM.")
+		os.Exit(0)
+	}
+	// if we have at least one arg
+	switch args[1] {
+	case "-v", "--version":
+		fmt.Println(OpsVersion)
+		os.Exit(0)
+
+	case "-h", "--help":
+		tools.Help(mainTools)
+		os.Exit(0)
+	default:
+		return
+	}
+}
+
+// CLI: ops -<cmd> <args>...
+func executeTools(cmd string, args []string, opsHome string) int {
+
+	switch cmd {
+	case "", "task":
 		exitCode, err := Task(args[2:]...)
 		if err != nil {
 			log.Println(err)
 		}
 		return exitCode
-	}
-
-	switch cmd {
-	case "version":
-		fmt.Println(OpsVersion)
-	case "v":
-		fmt.Println(OpsVersion)
 
-	case "info":
+	case "i", "info":
 		info()
+		return 0
 
-	case "help":
-		tools.Help(mainTools)
-
-	case "serve":
-		opsRootDir := getRootDirOrExit()
-		if err := Serve(opsRootDir, args[1:]); err != nil {
-			log.Fatalf("error: %v", err)
-		}
-
-	case "update":
+	case "u", "update":
 		// ok no up, nor down, let's download it
 		dir, err := pullTasks(true, true)
 		if err != nil {
@@ -147,8 +164,41 @@ func executeMainToolsAndExit(cmd string, args []string, opsHome string) int {
 		if err := setOpsOlarisHash(dir); err != nil {
 			log.Fatal("unable to set OPS_OLARIS...", err.Error())
 		}
+		return 0
+
+	case "l", "login":
+		os.Args = args
+		loginResult, err := auth.LoginCmd()
+		if err != nil {
+			log.Fatalf("error: %s", err.Error())
+		}
+
+		if loginResult == nil {
+			return 1
+		}
+
+		fmt.Println("Successfully logged in as " + loginResult.Login + ".")
+		if err := wskPropertySet(loginResult.ApiHost, loginResult.Auth); err != nil {
+			log.Fatalf("error: %s", err.Error())
+		}
+		fmt.Println("OpenServerless host and auth set successfully. You are now ready to use ops!")
+		return 0
 
-	case "reset":
+	case "c", "config":
+		os.Args = args
+		opsRootPath := joinpath(getRootDirOrExit(), OPSROOT)
+		configPath := joinpath(opsHome, CONFIGFILE)
+		configMap, err := buildConfigMap(opsRootPath, configPath)
+		if err != nil {
+			log.Fatalf("error: %s", err.Error())
+		}
+
+		if err := config.ConfigTool(*configMap); err != nil {
+			log.Fatalf("error: %s", err.Error())
+		}
+		return 0
+
+	case "i-really-want-to-reset", "reset":
 		home := os.Getenv("OPS_HOME")
 		if home == "" {
 			log.Fatal("cannot determine the ops home dir")
@@ -179,47 +229,26 @@ func executeMainToolsAndExit(cmd string, args []string, opsHome string) int {
 		if err := tools.ExpBackoffRetry(args[1:]); err != nil {
 			log.Fatalf("error: %s", err.Error())
 		}
-
-	case "login":
-		os.Args = args[1:]
-		loginResult, err := auth.LoginCmd()
-		if err != nil {
-			log.Fatalf("error: %s", err.Error())
-		}
-
-		if loginResult == nil {
-			os.Exit(1)
-		}
-
-		fmt.Println("Successfully logged in as " + loginResult.Login + ".")
-		if err := wskPropertySet(loginResult.ApiHost, loginResult.Auth); err != nil {
-			log.Fatalf("error: %s", err.Error())
-		}
-		fmt.Println("OpenServerless host and auth set successfully. You are now ready to use ops!")
-
-	case "config":
-		os.Args = args[1:]
-		opsRootPath := joinpath(getRootDirOrExit(), OPSROOT)
-		configPath := joinpath(opsHome, CONFIGFILE)
-		configMap, err := buildConfigMap(opsRootPath, configPath)
-		if err != nil {
-			log.Fatalf("error: %s", err.Error())
-		}
-
-		if err := config.ConfigTool(*configMap); err != nil {
-			log.Fatalf("error: %s", err.Error())
-		}
+		return 0
 
 	case "plugin":
-		os.Args = args[1:]
+		os.Args = args
 		if err := pluginTool(); err != nil {
 			log.Fatalf("error: %s", err.Error())
 		}
+		return 0
+
+	case "serve":
+		opsRootDir := getRootDirOrExit()
+		if err := Serve(opsRootDir, args); err != nil {
+			log.Fatalf("error: %v", err)
+		}
+		return 0
 
 	default:
 		// check if it is an embedded to and invoke it
 		if tools.IsTool(cmd) {
-			code, err := tools.RunTool(cmd, args[2:])
+			code, err := tools.RunTool(cmd, args[1:])
 			if err != nil {
 				log.Print(err.Error())
 			}
@@ -227,17 +256,21 @@ func executeMainToolsAndExit(cmd string, args []string, opsHome string) int {
 		}
 		// no embeded tool found
 		warn("unknown tool", "-"+cmd)
+		return 1
 	}
-	return 0
+	return 0 // unreachable - or it should be!
 }
 
 func Main() {
 	var err error
-	args := os.Args
 
 	// disable log prefix
 	log.SetFlags(0)
 
+	// CLI: ops -v | --version | -h | --help
+	// provide infos without downloading anything
+	InfoAndExit(os.Args)
+
 	// set default runtime.json
 	if os.Getenv("WSK_RUNTIMES_JSON") == "" {
 		os.Setenv("WSK_RUNTIMES_JSON", WSK_RUNTIMES_JSON)
@@ -253,7 +286,8 @@ func Main() {
 	}
 
 	// setup OPS_CMD
-	me := args[0]
+	// CLI: ops ...
+	me := os.Args[0]
 	if strings.Contains("ops ops.exe", filepath.Base(me)) {
 		_, err = setupCmd(me)
 		if err != nil {
@@ -307,8 +341,8 @@ func Main() {
 			if err != nil {
 				log.Fatalf("cannot locate or download OPS_ROOT: %s", err.Error())
 			}
-			// just updated, do not repeat
-			if len(args) == 2 && args[1] == "-update" {
+			// if just updated, do not repeat
+			if len(os.Args) > 1 && os.Args[1] == "-update" {
 				os.Exit(0)
 			}
 		} else {
@@ -316,6 +350,7 @@ func Main() {
 			checkUpdated(opsHome, 24*time.Hour)
 		}
 	}
+
 	if err = setOpsOlarisHash(olarisDir); err != nil {
 		os.Setenv("OPS_OLARIS", "<local>")
 	}
@@ -334,19 +369,20 @@ func Main() {
 	}
 
 	// in case args[1] is a wsk wrapper command invoke it and exit
-	if len(args) > 1 {
-		if cmd, ok := IsWskWrapperCommand(args[1]); ok {
+	// CLI: ops action ... (wsk wrapper)
+	if len(os.Args) > 1 {
+		if expand, ok := IsWskWrapperCommand(os.Args[1]); ok {
 			trace("wsk wrapper command")
-			debug("extracted cmd", cmd)
-			rest := args[2:]
+			debug("extracted cmd", expand)
+			rest := os.Args[2:]
 			debug("extracted args", rest)
 
 			// if "invoke" is in the command, parse all a=b into -p a b
-			if (len(cmd) > 2 && cmd[2] == "invoke") || slices.Contains(rest, "invoke") {
+			if (len(expand) > 2 && expand[2] == "invoke") || slices.Contains(rest, "invoke") {
 				rest = parseInvokeArgs(rest)
 			}
 
-			if err := tools.Wsk(cmd, rest...); err != nil {
+			if err := tools.Wsk(expand, rest...); err != nil {
 				log.Fatalf("error: %s", err.Error())
 			}
 			os.Exit(0)
@@ -355,15 +391,19 @@ func Main() {
 
 	// first argument with prefix "-" is considered an embedded tool
 	// using "-" or "--" or "-task" invokes the embedded task
-	if len(args) > 1 && len(args[1]) > 0 && args[1][0] == '-' {
-		cmd := args[1][1:]
-		trace("executing embedded tool", cmd, args)
+	// CLI: ops -<tool> (embedded tool)
+	if len(os.Args) > 1 && len(os.Args[1]) > 0 && os.Args[1][0] == '-' {
+		cmd := os.Args[1]
+		// remove extra hyphen if any
+		if len(cmd) > 0 && cmd[0] == '-' {
+			cmd = cmd[1:]
+		}
 		// execute the embeded tool and exit
-		exitCode := executeMainToolsAndExit(cmd, args, opsHome)
+		exitCode := executeTools(cmd, os.Args[1:], opsHome)
 		os.Exit(exitCode)
 	}
 
-	if err := runOps(opsRootDir, args); err != nil {
+	if err := runOps(opsRootDir, os.Args[1:]); err != nil {
 		log.Fatalf("task execution error: %s", err.Error())
 	}
 }
diff --git a/tools/tools.go b/tools/tools.go
index 204b7fb..d1d9303 100644
--- a/tools/tools.go
+++ b/tools/tools.go
@@ -188,7 +188,10 @@ func RunTool(name string, args []string) (int, error) {
 }
 
 func Help(mainTools []string) {
-	fmt.Println("Available tools:")
+	fmt.Println("Infos:")
+	fmt.Println("-v | --version")
+	fmt.Println("-h | --help")
+	fmt.Println("Tools (use -<tool> -h for help):")
 	availableTools := append(mainTools, ToolList...)
 	slices.Sort(availableTools)
 	for _, x := range availableTools {


(openserverless-cli) 04/04: reworked main help menu

Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-cli.git

commit c71a91c621ee18bed9f2e68e1295fd924648eafa
Author: Michele Sciabarra <mi...@sciabarra.com>
AuthorDate: Tue Aug 6 23:11:47 2024 +0200

    reworked main help menu
---
 _patches/patch-task.sh |  14 ++++--
 _patches/task          |   2 +-
 auth/login.go          |   2 +-
 go.mod                 |   2 +-
 go.sum                 |   2 +
 main.go                | 117 +++++++++++++++++++++++++------------------------
 tests/mvrmem.bats      |  68 ----------------------------
 tools/tools.go         |   7 +--
 8 files changed, 76 insertions(+), 138 deletions(-)

diff --git a/_patches/patch-task.sh b/_patches/patch-task.sh
index b6b1b4a..54a9be8 100644
--- a/_patches/patch-task.sh
+++ b/_patches/patch-task.sh
@@ -21,18 +21,22 @@ cd "$(dirname $0)"
 HERE=$PWD
 SHVER=$(git ls-remote https://github.com/sciabarracom/sh | awk '/refs\/heads\/openserverless/{print $1}')
 STAG="v3.38.0"
-DTAG="v3.38.10"
+DTAG="v3.38.11"
 cd task
 git reset --hard
 go clean -cache -modcache
 git checkout "$STAG" -B openserverless
 mkdir -p cmd/taskmain
+
+sed -i -e 's/func init/func FlagInit/' internal/flags/flags.go
+sed -i -e 's/func init/func FlagInit/' internal/experiments/experiments.go
+
 cat cmd/task/task.go \
 | sed -e 's/package main/package taskmain/' \
 | sed -e 's/func main()/func _main()/' \
 | tee cmd/taskmain/task.go
-sed -i -e 's/func init/func FlagInit/' internal/flags/flags.go
-cat   <<EOF >>cmd/taskmain/task.go
+
+cat  <<EOF >>cmd/taskmain/task.go
 
 var todoFlagInit = true
 
@@ -40,6 +44,7 @@ func Task(_args []string) (int, error) {
 	os.Args = _args
 	if todoFlagInit {
 		flags.FlagInit()
+		experiments.FlagInit()
 		todoFlagInit = false
 	}
 	if err := run(); err != nil {
@@ -77,7 +82,8 @@ sed -i -e '/mvdan.cc/g' go.mod
 go get github.com/sciabarracom/sh/v3@$SHVER
 go mod tidy
 git commit -m "patching sh for ops" -a
-go build
+go build 
+
 git tag $DTAG
 git push origin-auth openserverless -f --tags
 VER=$(git rev-parse HEAD)
diff --git a/_patches/task b/_patches/task
index 2c3fdce..c14dc1e 160000
--- a/_patches/task
+++ b/_patches/task
@@ -1 +1 @@
-Subproject commit 2c3fdcebad1da59613ec3e30d6fb96fac35e167c
+Subproject commit c14dc1e4fdb5203df0a57db124d5ccb75dd47832
diff --git a/auth/login.go b/auth/login.go
index 5006fd4..b7864dd 100644
--- a/auth/login.go
+++ b/auth/login.go
@@ -43,7 +43,7 @@ type LoginResult struct {
 const usage = `Usage:
 ops login <apihost> [<user>]
 
-Login to an OpenServerless instance. If no user is specified, the default user "opsolaris" is used.
+Login to an OpenServerless instance. If no user is specified, the default user "nuvolaris" is used.
 You can set the environment variables OPS_APIHOST and OPS_USER to avoid specifying them on the command line.
 You can set OPS_PASSWORD to avoid entering the password interactively.
 
diff --git a/go.mod b/go.mod
index 0a81b76..62b0d83 100644
--- a/go.mod
+++ b/go.mod
@@ -21,7 +21,7 @@ require (
 	github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
 	github.com/sciabarracom/openwhisk-cli v1.2.1
 	github.com/sciabarracom/sh/v3 v3.8.3
-	github.com/sciabarracom/task/v3 v3.38.10
+	github.com/sciabarracom/task/v3 v3.38.11
 	github.com/stretchr/testify v1.9.0
 	github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
 	github.com/zalando/go-keyring v0.2.5
diff --git a/go.sum b/go.sum
index 6f1a296..d55390a 100644
--- a/go.sum
+++ b/go.sum
@@ -347,6 +347,8 @@ github.com/sciabarracom/sh/v3 v3.8.3 h1:5afHdZzNkW5vgUMP7gHUpBYHezn3BoQsyNgKXKdT
 github.com/sciabarracom/sh/v3 v3.8.3/go.mod h1:CeMVr3PRLhlUrS+VPLTp8dS5/6xNzmmX0h/WVHRR6DA=
 github.com/sciabarracom/task/v3 v3.38.10 h1:KSu6B2CuHWail7rlTx5W72qM1klJbED3z2k7RzBvMkE=
 github.com/sciabarracom/task/v3 v3.38.10/go.mod h1:EMjHs6YrTofApnomes/CNiGQ1odZUZF6PTqmYW9EBic=
+github.com/sciabarracom/task/v3 v3.38.11 h1:TZeaepSVc9Lx7TowAqIV3K9IZQh+jYgKNDpBNIg38uU=
+github.com/sciabarracom/task/v3 v3.38.11/go.mod h1:EMjHs6YrTofApnomes/CNiGQ1odZUZF6PTqmYW9EBic=
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
 github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
 github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
diff --git a/main.go b/main.go
index ad9910d..2f3e1cc 100644
--- a/main.go
+++ b/main.go
@@ -23,13 +23,13 @@ import (
 	"os"
 	"os/exec"
 	"path/filepath"
-	"slices"
 	"strings"
 	"time"
 
 	"github.com/apache/openserverless-cli/auth"
 	"github.com/apache/openserverless-cli/config"
 	"github.com/apache/openserverless-cli/tools"
+	"golang.org/x/exp/slices"
 
 	"github.com/mitchellh/go-homedir"
 
@@ -116,23 +116,22 @@ func InfoAndExit(args []string) {
 	if len(args) < 2 {
 		fmt.Println("Welcome to ops, the all-mighty, extensibile apache OPenServerless CLI Tool.")
 		fmt.Println("Let's start with the basics:")
-		fmt.Println("-v | --version version       (mention this when you ask for help)")
-		fmt.Println("-h | --help    help          (the manuale is here)")
-		fmt.Println("-u | --update  update        (get the latest version of everything)")
-		fmt.Println("-i | --info    CLI infos     (let's check the CLI)")
-		fmt.Println("-c | --config  manage config (let's check the server configuration)")
-		fmt.Println("-l | --login   login         (you have to login first, you know)")
-		fmt.Println("--i-really-want-to-reset     (if you are desperate and nothing works)")
-		fmt.Println("But wait! There is more, much much more. Please RTFM.")
+		fmt.Println("-h | -help    list commands   (top level command, start here)")
+		fmt.Println("-t | -tools   list tools      (embedded tools, prefixed by '-')")
+		fmt.Println("-v | -version current version (mention this when you ask for help)")
+		fmt.Println("-i | -info    CLI infos       (let's check the CLI)")
+		fmt.Println("-u | -update  download latest (get the latest commands and prerequisites)")
+		fmt.Println("-l | -login   access system   (you have to login first)")
+		fmt.Println("-c | -config  manage config   (server configuration)")
+		fmt.Println("-reset        clean downloads (if nothing works, try this)")
 		os.Exit(0)
 	}
 	// if we have at least one arg
 	switch args[1] {
-	case "-v", "--version":
+	case "-v", "-version":
 		fmt.Println(OpsVersion)
 		os.Exit(0)
-
-	case "-h", "--help":
+	case "-t", "-tools":
 		tools.Help(mainTools)
 		os.Exit(0)
 	default:
@@ -145,7 +144,7 @@ func executeTools(cmd string, args []string, opsHome string) int {
 
 	switch cmd {
 	case "", "task":
-		exitCode, err := Task(args[2:]...)
+		exitCode, err := Task(args...)
 		if err != nil {
 			log.Println(err)
 		}
@@ -198,7 +197,7 @@ func executeTools(cmd string, args []string, opsHome string) int {
 		}
 		return 0
 
-	case "i-really-want-to-reset", "reset":
+	case "reset":
 		home := os.Getenv("OPS_HOME")
 		if home == "" {
 			log.Fatal("cannot determine the ops home dir")
@@ -222,7 +221,7 @@ func executeTools(cmd string, args []string, opsHome string) int {
 		if err != nil {
 			log.Fatal("ops reset error:", err.Error())
 		}
-		fmt.Println("ops reset complete")
+		fmt.Println("ops -reset complete - execute ops -update to reload")
 		return 0
 
 	case "retry":
@@ -258,7 +257,7 @@ func executeTools(cmd string, args []string, opsHome string) int {
 		warn("unknown tool", "-"+cmd)
 		return 1
 	}
-	return 0 // unreachable - or it should be!
+	//return 0 // unreachable - or it should be!
 }
 
 func Main() {
@@ -277,6 +276,27 @@ func Main() {
 		trace("WSK_RUNTIMES_JSON len=", len(WSK_RUNTIMES_JSON))
 	}
 
+	// in case args[1] is a wsk wrapper command invoke it and exit
+	// CLI: ops action ... (wsk wrapper)
+	if len(os.Args) > 1 {
+		if expand, ok := IsWskWrapperCommand(os.Args[1]); ok {
+			trace("wsk wrapper command")
+			debug("extracted cmd", expand)
+			rest := os.Args[2:]
+			debug("extracted args", rest)
+
+			// if "invoke" is in the command, parse all a=b into -p a b
+			if (len(expand) > 2 && expand[2] == "invoke") || slices.Contains(rest, "invoke") {
+				rest = parseInvokeArgs(rest)
+			}
+
+			if err := tools.Wsk(expand, rest...); err != nil {
+				log.Fatalf("error: %s", err.Error())
+			}
+			os.Exit(0)
+		}
+	}
+
 	// set runtime version as environment variable
 	if os.Getenv("OPS_VERSION") != "" {
 		OpsVersion = os.Getenv("OPS_VERSION")
@@ -368,42 +388,23 @@ func Main() {
 		log.Fatalf("failed preflight check: %s", err.Error())
 	}
 
-	// in case args[1] is a wsk wrapper command invoke it and exit
-	// CLI: ops action ... (wsk wrapper)
-	if len(os.Args) > 1 {
-		if expand, ok := IsWskWrapperCommand(os.Args[1]); ok {
-			trace("wsk wrapper command")
-			debug("extracted cmd", expand)
-			rest := os.Args[2:]
-			debug("extracted args", rest)
-
-			// if "invoke" is in the command, parse all a=b into -p a b
-			if (len(expand) > 2 && expand[2] == "invoke") || slices.Contains(rest, "invoke") {
-				rest = parseInvokeArgs(rest)
-			}
-
-			if err := tools.Wsk(expand, rest...); err != nil {
-				log.Fatalf("error: %s", err.Error())
-			}
-			os.Exit(0)
-		}
-	}
-
 	// first argument with prefix "-" is considered an embedded tool
 	// using "-" or "--" or "-task" invokes the embedded task
 	// CLI: ops -<tool> (embedded tool)
-	if len(os.Args) > 1 && len(os.Args[1]) > 0 && os.Args[1][0] == '-' {
-		cmd := os.Args[1]
-		// remove extra hyphen if any
-		if len(cmd) > 0 && cmd[0] == '-' {
-			cmd = cmd[1:]
+	args := os.Args
+	if len(args) > 1 && len(args[1]) > 0 && args[1][0] == '-' {
+		cmd := args[1][1:]
+		if cmd != "h" && cmd != "help" {
+			// execute the embeded tool and exit
+			exitCode := executeTools(cmd, args[2:], opsHome)
+			os.Exit(exitCode)
+		} else {
+			// remove -t to show tasks
+			args = args[1:]
 		}
-		// execute the embeded tool and exit
-		exitCode := executeTools(cmd, os.Args[1:], opsHome)
-		os.Exit(exitCode)
 	}
 
-	if err := runOps(opsRootDir, os.Args[1:]); err != nil {
+	if err := runOps(opsRootDir, args); err != nil {
 		log.Fatalf("task execution error: %s", err.Error())
 	}
 }
@@ -522,19 +523,19 @@ func buildConfigMap(opsRootPath string, configPath string) (*config.ConfigMap, e
 	return &configMap, nil
 }
 
-func IsWskWrapperCommand(name string) ([]string, bool) {
-	wskWrapperCommands := map[string][]string{
-		"action":     {"wsk", "action"},
-		"activation": {"wsk", "activation"},
-		"invoke":     {"wsk", "action", "invoke", "-r"},
-		"logs":       {"wsk", "activation", "logs"},
-		"package":    {"wsk", "package"},
-		"result":     {"wsk", "activation", "result"},
-		"rule":       {"wsk", "rule"},
-		"trigger":    {"wsk", "trigger"},
-		"url":        {"wsk", "action", "get", "--url"},
-	}
+var wskWrapperCommands = map[string][]string{
+	"action":     {"wsk", "action"},
+	"activation": {"wsk", "activation"},
+	"invoke":     {"wsk", "action", "invoke", "-r"},
+	"logs":       {"wsk", "activation", "logs"},
+	"package":    {"wsk", "package"},
+	"result":     {"wsk", "activation", "result"},
+	"rule":       {"wsk", "rule"},
+	"trigger":    {"wsk", "trigger"},
+	"url":        {"wsk", "action", "get", "--url"},
+}
 
+func IsWskWrapperCommand(name string) ([]string, bool) {
 	cmd, ok := wskWrapperCommands[name]
 	return cmd, ok
 }
diff --git a/tests/mvrmem.bats b/tests/mvrmem.bats
deleted file mode 100644
index 96896d9..0000000
--- a/tests/mvrmem.bats
+++ /dev/null
@@ -1,68 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-setup() {
-    load 'test_helper/bats-support/load'
-    load 'test_helper/bats-assert/load'
-    export NO_COLOR=1
-    rm -f empty_file
-}
-
-@test "-rename -remove" {
-    run ops -rename
-    assert_line "Usage: rename <source> <destination>"
-
-    run ops -rename missing 
-    assert_line "Usage: rename <source> <destination>"
-
-    run ops -rename missing something
-    assert_failure
-    assert_line "rename missing something: no such file or directory" 
-
-    touch something
-    run ops -rename something somethingelse
-    assert_success
-    assert_line "renamed something -> somethingelse"
-
-    run ops -rename somethingelse /dev/null
-    assert_failure
-    assert_line "rename somethingelse /dev/null: invalid cross-device link"
-
-    run ops -remove
-    assert_line "Usage: remove <filename>"
-
-    run ops -remove missing
-    assert_failure
-    assert_line "remove missing: no such file or directory"
-
-    run ops -remove somethingelse
-    assert_success
-    assert_line "removed somethingelse"
-}    
-
-@test "-empty" {
-    run ops -empty
-    assert_line "Usage: filename"
-    run ops -empty empty_file
-    assert test -f empty_file
-    assert_success
-    run ops -empty empty_file
-    assert_failure
-    assert_line "file already exists"
-    rm empty_file
-
-}
\ No newline at end of file
diff --git a/tools/tools.go b/tools/tools.go
index d1d9303..397cea8 100644
--- a/tools/tools.go
+++ b/tools/tools.go
@@ -170,11 +170,11 @@ func RunTool(name string, args []string) (int, error) {
 		return Rename()
 
 	case "remove":
-		os.Args = append([]string{"rename"}, args...)
+		os.Args = append([]string{"remove"}, args...)
 		return Remove()
 
 	case "extract":
-		os.Args = append([]string{"untar"}, args...)
+		os.Args = append([]string{"extract"}, args...)
 		return Extract()
 
 	case "empty":
@@ -188,9 +188,6 @@ func RunTool(name string, args []string) (int, error) {
 }
 
 func Help(mainTools []string) {
-	fmt.Println("Infos:")
-	fmt.Println("-v | --version")
-	fmt.Println("-h | --help")
 	fmt.Println("Tools (use -<tool> -h for help):")
 	availableTools := append(mainTools, ToolList...)
 	slices.Sort(availableTools)