2020-11-23 10:38:43 -05:00
|
|
|
package base
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path"
|
|
|
|
)
|
|
|
|
|
|
|
|
// CommandEnvHolder is a struct holds the environment info of commands
|
|
|
|
type CommandEnvHolder struct {
|
2020-11-28 09:06:03 -05:00
|
|
|
// Excutable name of current binary
|
2020-11-23 10:38:43 -05:00
|
|
|
Exec string
|
2020-11-28 09:06:03 -05:00
|
|
|
// commands column width of current command
|
|
|
|
CommandsWidth int
|
2020-11-23 10:38:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// CommandEnv holds the environment info of commands
|
|
|
|
var CommandEnv CommandEnvHolder
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
exec, err := os.Executable()
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
CommandEnv.Exec = path.Base(exec)
|
|
|
|
}
|