Skip to content

Commit

Permalink
Impl tui.style, tui.color, tui.render
Browse files Browse the repository at this point in the history
  • Loading branch information
semperos committed Aug 30, 2024
1 parent 9022fb8 commit 318e00b
Show file tree
Hide file tree
Showing 3 changed files with 387 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cmd/ari/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ func cliModeFromString(s string) (cliMode, error) {
func ariMain(cmd *cobra.Command, args []string) int {
dataSourceName := viper.GetString("database")
ariContext, err := ari.NewContext(dataSourceName)
registerCliGoalBindings(ariContext)
ariContext.GoalContext.AssignGlobal("ARGS", goal.NewAS(args))
if err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
Expand Down Expand Up @@ -260,6 +261,13 @@ func ariMain(cmd *cobra.Command, args []string) int {
return 0
}

func registerCliGoalBindings(ariContext *ari.Context) {
goalContext := ariContext.GoalContext
goalContext.RegisterMonad("tui.color", VFTuiColor)
goalContext.RegisterMonad("tui.style", VFTuiStyle)
goalContext.RegisterDyad("tui.render", VFTuiRender)
}

func readEvalPrintLoop(mainCliSystem CliSystem) {
cliEditor := mainCliSystem.cliEditor
for {
Expand Down
Loading

0 comments on commit 318e00b

Please sign in to comment.