diff --git a/cmd/cmd.go b/cmd/cmd.go index 0f0671e..1137fa8 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -69,8 +69,10 @@ or $ gg git clone https://github.com/mzz2017/gg.git`) return } - // auto su - AutoSu() + // auto su if use 'gg sudo' or 'gg su' + if os.Args[1] == "sudo" || os.Args[1] == "su" { + AutoSu() + } // initiate config from args and config file log := GetLogger(verbose) log.Traceln("Version:", Version)