refactor: rename engine to prompt

This commit is contained in:
Jan De Dobbeleer 2024-07-01 21:14:52 +02:00 committed by Jan De Dobbeleer
parent 3c6abf6163
commit 0a4a589125
11 changed files with 22 additions and 22 deletions

View file

@ -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,
}

View file

@ -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,

View file

@ -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()
}

View file

@ -1,4 +1,4 @@
package engine
package prompt
import (
"fmt"

View file

@ -1,4 +1,4 @@
package engine
package prompt
import (
"strings"

View file

@ -1,4 +1,4 @@
package engine
package prompt
import (
"errors"

View file

@ -20,7 +20,7 @@
// https://github.com/homeport/termshot
package engine
package prompt
import (
"archive/zip"

View file

@ -1,4 +1,4 @@
package engine
package prompt
import (
"os"

View file

@ -1,4 +1,4 @@
package engine
package prompt
import (
"github.com/jandedobbeleer/oh-my-posh/src/config"

View file

@ -1,4 +1,4 @@
package engine
package prompt
import (
"fmt"

View file

@ -1,4 +1,4 @@
package engine
package prompt
import (
"strings"