mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-26 11:34:04 -08:00
refactor: rename engine to prompt
This commit is contained in:
parent
3c6abf6163
commit
0a4a589125
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/config"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/engine"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/platform"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/prompt"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/shell"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/terminal"
|
||||
|
||||
|
@ -72,15 +72,15 @@ Exports the config to an image file using customized output options.`,
|
|||
terminal.BackgroundColor = shell.ConsoleBackgroundColor(env, cfg.TerminalBackground)
|
||||
terminal.AnsiColors = cfg.MakeColors()
|
||||
|
||||
eng := &engine.Engine{
|
||||
eng := &prompt.Engine{
|
||||
Config: cfg,
|
||||
Env: env,
|
||||
}
|
||||
|
||||
prompt := eng.Primary()
|
||||
primaryPrompt := eng.Primary()
|
||||
|
||||
imageCreator := &engine.ImageRenderer{
|
||||
AnsiString: prompt,
|
||||
imageCreator := &prompt.ImageRenderer{
|
||||
AnsiString: primaryPrompt,
|
||||
Author: author,
|
||||
BgColor: bgColor,
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/build"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/config"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/engine"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/platform"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/prompt"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/shell"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/terminal"
|
||||
|
||||
|
@ -46,7 +46,7 @@ var debugCmd = &cobra.Command{
|
|||
terminal.AnsiColors = cfg.MakeColors()
|
||||
terminal.Plain = plain
|
||||
|
||||
eng := &engine.Engine{
|
||||
eng := &prompt.Engine{
|
||||
Config: cfg,
|
||||
Env: env,
|
||||
Plain: plain,
|
||||
|
|
|
@ -3,8 +3,8 @@ package cli
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/engine"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/platform"
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/prompt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
@ -68,26 +68,26 @@ var printCmd = &cobra.Command{
|
|||
Column: column,
|
||||
}
|
||||
|
||||
eng := engine.New(flags)
|
||||
eng := prompt.New(flags)
|
||||
defer eng.Env.Close()
|
||||
|
||||
switch args[0] {
|
||||
case "debug":
|
||||
fmt.Print(eng.ExtraPrompt(engine.Debug))
|
||||
fmt.Print(eng.ExtraPrompt(prompt.Debug))
|
||||
case "primary":
|
||||
fmt.Print(eng.Primary())
|
||||
case "secondary":
|
||||
fmt.Print(eng.ExtraPrompt(engine.Secondary))
|
||||
fmt.Print(eng.ExtraPrompt(prompt.Secondary))
|
||||
case "transient":
|
||||
fmt.Print(eng.ExtraPrompt(engine.Transient))
|
||||
fmt.Print(eng.ExtraPrompt(prompt.Transient))
|
||||
case "right":
|
||||
fmt.Print(eng.RPrompt())
|
||||
case "tooltip":
|
||||
fmt.Print(eng.Tooltip(command))
|
||||
case "valid":
|
||||
fmt.Print(eng.ExtraPrompt(engine.Valid))
|
||||
fmt.Print(eng.ExtraPrompt(prompt.Valid))
|
||||
case "error":
|
||||
fmt.Print(eng.ExtraPrompt(engine.Error))
|
||||
fmt.Print(eng.ExtraPrompt(prompt.Error))
|
||||
default:
|
||||
_ = cmd.Help()
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package engine
|
||||
package prompt
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -1,4 +1,4 @@
|
|||
package engine
|
||||
package prompt
|
||||
|
||||
import (
|
||||
"strings"
|
|
@ -1,4 +1,4 @@
|
|||
package engine
|
||||
package prompt
|
||||
|
||||
import (
|
||||
"errors"
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
// https://github.com/homeport/termshot
|
||||
|
||||
package engine
|
||||
package prompt
|
||||
|
||||
import (
|
||||
"archive/zip"
|
|
@ -1,4 +1,4 @@
|
|||
package engine
|
||||
package prompt
|
||||
|
||||
import (
|
||||
"os"
|
|
@ -1,4 +1,4 @@
|
|||
package engine
|
||||
package prompt
|
||||
|
||||
import (
|
||||
"github.com/jandedobbeleer/oh-my-posh/src/config"
|
|
@ -1,4 +1,4 @@
|
|||
package engine
|
||||
package prompt
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -1,4 +1,4 @@
|
|||
package engine
|
||||
package prompt
|
||||
|
||||
import (
|
||||
"strings"
|
Loading…
Reference in a new issue