mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-15 13:17:53 -08:00
refactor(main): move simple command up
This commit is contained in:
parent
4960f8a2b7
commit
9b15054378
17
src/main.go
17
src/main.go
|
@ -172,9 +172,17 @@ func main() {
|
|||
"Print a plain prompt without ANSI"),
|
||||
}
|
||||
flag.Parse()
|
||||
if *args.Version {
|
||||
fmt.Println(Version)
|
||||
return
|
||||
}
|
||||
env := &environment{}
|
||||
env.init(args)
|
||||
defer env.close()
|
||||
if *args.PrintShell {
|
||||
fmt.Println(env.getShellName())
|
||||
return
|
||||
}
|
||||
if *args.Millis {
|
||||
fmt.Print(time.Now().UnixNano() / 1000000)
|
||||
return
|
||||
|
@ -194,15 +202,6 @@ func main() {
|
|||
return
|
||||
}
|
||||
cfg := GetConfig(env)
|
||||
if *args.PrintShell {
|
||||
fmt.Println(env.getShellName())
|
||||
return
|
||||
}
|
||||
if *args.Version {
|
||||
fmt.Println(Version)
|
||||
return
|
||||
}
|
||||
|
||||
ansi := &ansiUtils{}
|
||||
ansi.init(env.getShellName())
|
||||
var writer promptWriter
|
||||
|
|
Loading…
Reference in a new issue