tested version flag and subcmd on exec and pidproxy; some clean up
This commit is contained in:
parent
dc6d575fae
commit
fe31698724
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
|||||||
/cmd/wingmate/wingmate
|
/cmd/wingmate/wingmate
|
||||||
|
/cmd/wingmate/version.txt
|
||||||
/cmd/pidproxy/pidproxy
|
/cmd/pidproxy/pidproxy
|
||||||
|
/cmd/pidproxy/version.txt
|
||||||
/cmd/exec/exec
|
/cmd/exec/exec
|
||||||
|
/cmd/exec/version.txt
|
||||||
@ -34,7 +34,7 @@ func (v Version) Flag(cmd *cobra.Command) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v Version) FlagHook() {
|
func (v Version) FlagHook() {
|
||||||
if viper.GetInt(versionFlag) > 0 {
|
if viper.GetBool(versionFlag) {
|
||||||
v.Print()
|
v.Print()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,16 +4,17 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.suyono.dev/suyono/wingmate"
|
|
||||||
"gitea.suyono.dev/suyono/wingmate/cmd/cli"
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
"github.com/spf13/viper"
|
|
||||||
"golang.org/x/sys/unix"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"gitea.suyono.dev/suyono/wingmate"
|
||||||
|
"gitea.suyono.dev/suyono/wingmate/cmd/cli"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
type execApp struct {
|
type execApp struct {
|
||||||
@ -61,6 +62,7 @@ func main() {
|
|||||||
_ = viper.BindPFlag(EnvUser, rootCmd.PersistentFlags().Lookup(userFlag))
|
_ = viper.BindPFlag(EnvUser, rootCmd.PersistentFlags().Lookup(userFlag))
|
||||||
|
|
||||||
app.version.Flag(rootCmd)
|
app.version.Flag(rootCmd)
|
||||||
|
app.version.Cmd(rootCmd)
|
||||||
|
|
||||||
viper.SetEnvPrefix(wingmate.EnvPrefix)
|
viper.SetEnvPrefix(wingmate.EnvPrefix)
|
||||||
_ = viper.BindEnv(EnvUser)
|
_ = viper.BindEnv(EnvUser)
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
dev
|
|
||||||
1
cmd/experiment/.gitignore
vendored
1
cmd/experiment/.gitignore
vendored
@ -7,3 +7,4 @@
|
|||||||
/spawner/spawner
|
/spawner/spawner
|
||||||
/spawner/version.txt
|
/spawner/version.txt
|
||||||
/bg/bg
|
/bg/bg
|
||||||
|
/bg/version.txt
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
dev
|
|
||||||
@ -1 +0,0 @@
|
|||||||
dev
|
|
||||||
@ -1 +0,0 @@
|
|||||||
dev
|
|
||||||
Loading…
x
Reference in New Issue
Block a user