1
0
Fork 0
mirror of https://gitlab.com/pnx/gosh synced 2026-06-16 07:04:57 +02:00
gosh/internal/builtins/registry.go
2025-10-27 02:03:02 +01:00

18 lines
299 B
Go

package builtins
import (
"gosh/internal/builtins/cd"
"gosh/internal/builtins/exit"
)
type builtinFn func([]string) error
var registry = map[string]builtinFn{
"cd": cd.Exec,
"exit": exit.Exec,
}
func Lookup(program string) (builtinFn, bool) {
fn, ok := registry[program]
return fn, ok
}