A virtual jailed shell environment for Go apps backed by an io/fs#FS.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(command): add true and false

Port the true and false coreutils from just-bash. true exits 0,
false exits 1. Register both with the coreutils registry alongside
hostname and ls.

Assisted-by: Claude Opus 4.7 via Claude Code
Signed-off-by: Xe Iaso <me@xeiaso.net>

Xe Iaso 3390bb31 e51d0bc8

+31
+14
command/internal/falsecmd/falsecmd.go
··· 1 + package falsecmd 2 + 3 + import ( 4 + "context" 5 + 6 + "mvdan.cc/sh/v3/interp" 7 + "tangled.org/xeiaso.net/kefka/command" 8 + ) 9 + 10 + type Impl struct{} 11 + 12 + func (Impl) Exec(ctx context.Context, ec *command.ExecContext, args []string) error { 13 + return interp.ExitStatus(1) 14 + }
+13
command/internal/truecmd/truecmd.go
··· 1 + package truecmd 2 + 3 + import ( 4 + "context" 5 + 6 + "tangled.org/xeiaso.net/kefka/command" 7 + ) 8 + 9 + type Impl struct{} 10 + 11 + func (Impl) Exec(ctx context.Context, ec *command.ExecContext, args []string) error { 12 + return nil 13 + }
+4
command/registry/coreutils/coreutils.go
··· 1 1 package coreutils 2 2 3 3 import ( 4 + "tangled.org/xeiaso.net/kefka/command/internal/falsecmd" 4 5 "tangled.org/xeiaso.net/kefka/command/internal/hostname" 5 6 "tangled.org/xeiaso.net/kefka/command/internal/ls" 7 + "tangled.org/xeiaso.net/kefka/command/internal/truecmd" 6 8 "tangled.org/xeiaso.net/kefka/command/registry" 7 9 ) 8 10 9 11 func Register(reg *registry.Impl) { 12 + reg.Register("false", falsecmd.Impl{}) 10 13 reg.Register("hostname", hostname.Impl{}) 11 14 reg.Register("ls", ls.Impl{}) 15 + reg.Register("true", truecmd.Impl{}) 12 16 }