func BuildOsArgs(cliArgs map[string]interface{}) {
	os.Args = make([]string, len(cliArgs)+1)
	i := 0
	os.Args[i] = "cmd"
	i++
	for key, value := range cliArgs {
		if _, ok := value.(bool); ok || value != nil {
			os.Args[i] = formatCliArg(key, value)
			i++
		}
	}
}
BuildOsArgs builds os.Args from a map of key-value pairs containing arguments.
package test
import (
	"bytes"
	"compress/gzip"
	"fmt"
	"os"
)
func BackupOsArgs() func() {
	oldArgs := os.Args
	return func() { os.Args = oldArgs }
}