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"
|
"fmt"
|
||||||
|
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/config"
|
"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/platform"
|
||||||
|
"github.com/jandedobbeleer/oh-my-posh/src/prompt"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/shell"
|
"github.com/jandedobbeleer/oh-my-posh/src/shell"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/terminal"
|
"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.BackgroundColor = shell.ConsoleBackgroundColor(env, cfg.TerminalBackground)
|
||||||
terminal.AnsiColors = cfg.MakeColors()
|
terminal.AnsiColors = cfg.MakeColors()
|
||||||
|
|
||||||
eng := &engine.Engine{
|
eng := &prompt.Engine{
|
||||||
Config: cfg,
|
Config: cfg,
|
||||||
Env: env,
|
Env: env,
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt := eng.Primary()
|
primaryPrompt := eng.Primary()
|
||||||
|
|
||||||
imageCreator := &engine.ImageRenderer{
|
imageCreator := &prompt.ImageRenderer{
|
||||||
AnsiString: prompt,
|
AnsiString: primaryPrompt,
|
||||||
Author: author,
|
Author: author,
|
||||||
BgColor: bgColor,
|
BgColor: bgColor,
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ import (
|
||||||
|
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/build"
|
"github.com/jandedobbeleer/oh-my-posh/src/build"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/config"
|
"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/platform"
|
||||||
|
"github.com/jandedobbeleer/oh-my-posh/src/prompt"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/shell"
|
"github.com/jandedobbeleer/oh-my-posh/src/shell"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/terminal"
|
"github.com/jandedobbeleer/oh-my-posh/src/terminal"
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ var debugCmd = &cobra.Command{
|
||||||
terminal.AnsiColors = cfg.MakeColors()
|
terminal.AnsiColors = cfg.MakeColors()
|
||||||
terminal.Plain = plain
|
terminal.Plain = plain
|
||||||
|
|
||||||
eng := &engine.Engine{
|
eng := &prompt.Engine{
|
||||||
Config: cfg,
|
Config: cfg,
|
||||||
Env: env,
|
Env: env,
|
||||||
Plain: plain,
|
Plain: plain,
|
||||||
|
|
|
@ -3,8 +3,8 @@ package cli
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/engine"
|
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/platform"
|
"github.com/jandedobbeleer/oh-my-posh/src/platform"
|
||||||
|
"github.com/jandedobbeleer/oh-my-posh/src/prompt"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
@ -68,26 +68,26 @@ var printCmd = &cobra.Command{
|
||||||
Column: column,
|
Column: column,
|
||||||
}
|
}
|
||||||
|
|
||||||
eng := engine.New(flags)
|
eng := prompt.New(flags)
|
||||||
defer eng.Env.Close()
|
defer eng.Env.Close()
|
||||||
|
|
||||||
switch args[0] {
|
switch args[0] {
|
||||||
case "debug":
|
case "debug":
|
||||||
fmt.Print(eng.ExtraPrompt(engine.Debug))
|
fmt.Print(eng.ExtraPrompt(prompt.Debug))
|
||||||
case "primary":
|
case "primary":
|
||||||
fmt.Print(eng.Primary())
|
fmt.Print(eng.Primary())
|
||||||
case "secondary":
|
case "secondary":
|
||||||
fmt.Print(eng.ExtraPrompt(engine.Secondary))
|
fmt.Print(eng.ExtraPrompt(prompt.Secondary))
|
||||||
case "transient":
|
case "transient":
|
||||||
fmt.Print(eng.ExtraPrompt(engine.Transient))
|
fmt.Print(eng.ExtraPrompt(prompt.Transient))
|
||||||
case "right":
|
case "right":
|
||||||
fmt.Print(eng.RPrompt())
|
fmt.Print(eng.RPrompt())
|
||||||
case "tooltip":
|
case "tooltip":
|
||||||
fmt.Print(eng.Tooltip(command))
|
fmt.Print(eng.Tooltip(command))
|
||||||
case "valid":
|
case "valid":
|
||||||
fmt.Print(eng.ExtraPrompt(engine.Valid))
|
fmt.Print(eng.ExtraPrompt(prompt.Valid))
|
||||||
case "error":
|
case "error":
|
||||||
fmt.Print(eng.ExtraPrompt(engine.Error))
|
fmt.Print(eng.ExtraPrompt(prompt.Error))
|
||||||
default:
|
default:
|
||||||
_ = cmd.Help()
|
_ = cmd.Help()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package engine
|
package prompt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
|
@ -1,4 +1,4 @@
|
||||||
package engine
|
package prompt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
|
@ -1,4 +1,4 @@
|
||||||
package engine
|
package prompt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
// https://github.com/homeport/termshot
|
// https://github.com/homeport/termshot
|
||||||
|
|
||||||
package engine
|
package prompt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"archive/zip"
|
"archive/zip"
|
|
@ -1,4 +1,4 @@
|
||||||
package engine
|
package prompt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
|
@ -1,4 +1,4 @@
|
||||||
package engine
|
package prompt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/config"
|
"github.com/jandedobbeleer/oh-my-posh/src/config"
|
|
@ -1,4 +1,4 @@
|
||||||
package engine
|
package prompt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
|
@ -1,4 +1,4 @@
|
||||||
package engine
|
package prompt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
Loading…
Reference in a new issue