@@ -44,8 +44,8 @@ type noopLogger struct{}
4444
4545func (noopLogger) InfoPersist(msg string, keysAndValues ...interface{}) {}
4646
47−// CommandBlockFunc is a function that determines if a command should be blocked
48−type CommandBlockFunc func(args []string) bool
47+// BlockFunc is a function that determines if a command should be blocked
48+type BlockFunc func(args []string) bool
4949
5050// Shell provides cross-platform shell execution with optional state persistence
5151type Shell struct {
@@ -53,7 +53,7 @@ type Shell struct {
5353 cwd string
5454 mu sync.Mutex
5555 logger Logger
56− blockFuncs []CommandBlockFunc
56+ blockFuncs []BlockFunc
5757}
5858
5959// Options for creating a new shell
@@ -61,7 +61,7 @@ type Options struct {
6161 WorkingDir string
6262 Env []string
6363 Logger Logger
64− BlockFuncs []CommandBlockFunc
64+ BlockFuncs []BlockFunc
6565}
6666
6767// NewShell creates a new shell instance with the given options
@@ -159,7 +159,7 @@ func (s *Shell) SetEnv(key, value string) {
159159}
160160
161161// SetBlockFuncs sets the command block functions for the shell
162−func (s *Shell) SetBlockFuncs(blockFuncs []CommandBlockFunc) {
162+func (s *Shell) SetBlockFuncs(blockFuncs []BlockFunc) {
163163 s.mu.Lock()
164164 defer s.mu.Unlock()
165165 s.blockFuncs = blockFuncs
@@ -216,13 +216,13 @@ func (s *Shell) determineShellType(command string) ShellType {
216216 return ShellTypePOSIX
217217}
218218
219−// CreateSimpleCommandBlocker creates a CommandBlockFunc that blocks exact command matches
220−func CreateSimpleCommandBlocker(bannedCommands []string) CommandBlockFunc {
219+// CommandsBlocker creates a BlockFunc that blocks exact command matches
220+func CommandsBlocker(bannedCommands []string) BlockFunc {
221221 bannedSet := make(map[string]bool)
222222 for _, cmd := range bannedCommands {
223223 bannedSet[cmd] = true
224224 }
225−
225+
226226 return func(args []string) bool {
227227 if len(args) == 0 {
228228 return false
@@ -231,8 +231,8 @@ func CreateSimpleCommandBlocker(bannedCommands []string) CommandBlockFunc {
231231 }
232232}
233233
234−// CreateSubCommandBlocker creates a CommandBlockFunc that blocks specific subcommands
235−func CreateSubCommandBlocker(blockedSubCommands [][]string) CommandBlockFunc {
234+// ArgumentsBlocker creates a BlockFunc that blocks specific subcommands
235+func ArgumentsBlocker(blockedSubCommands [][]string) BlockFunc {
236236 return func(args []string) bool {
237237 for _, blocked := range blockedSubCommands {
238238 if len(args) >= len(blocked) {
@@ -251,7 +251,8 @@ func CreateSubCommandBlocker(blockedSubCommands [][]string) CommandBlockFunc {
251251 return false
252252 }
253253}
254−func (s *Shell) createCommandBlockHandler() func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc {
254+
255+func (s *Shell) blockHandler() func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc {
255256 return func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc {
256257 return func(ctx context.Context, args []string) error {
257258 if len(args) == 0 {
@@ -357,7 +358,7 @@ func (s *Shell) execPOSIX(ctx context.Context, command string) (string, string,
357358 interp.Interactive(false),
358359 interp.Env(expand.ListEnviron(s.env...)),
359360 interp.Dir(s.cwd),
360− interp.ExecHandlers(s.createCommandBlockHandler()),
361+ interp.ExecHandlers(s.blockHandler()),
361362 )
362363 if err != nil {
363364 return "", "", fmt.Errorf("could not run command: %w", err)