picker

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MakefileDocsURL = "https://95ninefive.dev/docs#make"

MakefileDocsURL is the deep-link anchor on the docs page that explains the Makefile convention (must produce ./app, etc). Exported so cmd/init.go can print it after a successful init as well, keeping the message consistent.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the bubbletea picker model.

func New

func New(enabled map[string]string) Model

New returns a fresh picker starting at language selection. If enabled is non-nil, only languages whose name appears in the map are shown.

func (Model) Chosen

func (m Model) Chosen() *Option

Chosen returns the selected option, or nil if cancelled.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Language

func (m Model) Language() string

Language returns the name of the selected language.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type Option

type Option struct {
	Label       string
	Build       string
	Run         string
	Description string
}

Option represents a predefined build+run pair for a language.

Why two fields instead of one shell string? Some testers (git, http-server) change CWD before invoking your_program.sh. The server runs Build inside the submission dir in a subshell, then exec's Run from the tester's CWD. Splitting them lets compiled languages still find their sources, and lets the run step stay writable to the tester's working directory (needed for things like `git init` writing .git there).

Conventions used in the presets below:

  • Compiled outputs go to /tmp/app (absolute path, always writable in our Alpine runner, cleared between submissions by Docker --rm).
  • Interpreted runs reference "$_dir/<file>" so they don't break when the tester chdirs. $_dir is defined in the your_program.sh header on the server.
  • `make` presets assume the user's Makefile emits ./app at CWD — this is documented in the Description. If the user needs something else, they need a custom command (not yet supported).

func (Option) IsMakePreset added in v1.3.1

func (o Option) IsMakePreset() bool

IsMakePreset is a cheap heuristic — the two make presets share the literal build command "make", and no other preset does. Kept as a helper so callers don't hardcode the string in multiple places.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL