From dfb5fa42ca8c1d21ba32be63cd034329ef8ca309 Mon Sep 17 00:00:00 2001 From: Matthew DeGuzman Date: Wed, 18 Mar 2026 12:51:23 -0400 Subject: [PATCH] refactor!: rename allowed-path flag to allowed-paths --- cmd/rshell/main.go | 2 +- cmd/rshell/main_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/rshell/main.go b/cmd/rshell/main.go index fd1f000f..7db4ef33 100644 --- a/cmd/rshell/main.go +++ b/cmd/rshell/main.go @@ -104,7 +104,7 @@ func run(args []string, stdin io.Reader, stdout, stderr io.Writer) int { cmd.Flags().StringVarP(&command, "command", "c", "", "shell command string to execute") cmd.Flags().MarkHidden("command") //nolint:errcheck // flag is guaranteed to exist - cmd.Flags().StringVarP(&allowedPaths, "allowed-path", "p", "", "comma-separated list of directories the shell is allowed to access") + cmd.Flags().StringVarP(&allowedPaths, "allowed-paths", "p", "", "comma-separated list of directories the shell is allowed to access") cmd.Flags().StringVar(&allowedCommands, "allowed-commands", "", "comma-separated list of namespaced commands (e.g. rshell:cat,rshell:find)") cmd.Flags().BoolVar(&allowAllCmds, "allow-all-commands", false, "allow execution of all commands (builtins and external)") diff --git a/cmd/rshell/main_test.go b/cmd/rshell/main_test.go index aef82c10..d475413a 100644 --- a/cmd/rshell/main_test.go +++ b/cmd/rshell/main_test.go @@ -118,7 +118,7 @@ func TestAllowedPathCommaSeparated(t *testing.T) { if runtime.GOOS == "windows" { extraDir = filepath.ToSlash(extraDir) } - code, stdout, _ := runCLI(t, "--allow-all-commands", "-c", `cat `+filePath, "--allowed-path", dir+","+extraDir) + code, stdout, _ := runCLI(t, "--allow-all-commands", "-c", `cat `+filePath, "--allowed-paths", dir+","+extraDir) assert.Equal(t, 0, code) assert.Contains(t, stdout, "hello from testfile") } @@ -138,7 +138,7 @@ func TestVariableExpansion(t *testing.T) { func TestHelp(t *testing.T) { code, stdout, _ := runCLI(t, "--help") assert.Equal(t, 0, code) - assert.Contains(t, stdout, "--allowed-path") + assert.Contains(t, stdout, "--allowed-paths") assert.Contains(t, stdout, "--allowed-commands") assert.Contains(t, stdout, "--allow-all-commands") assert.NotContains(t, stdout, "--command", "-c/--command should be hidden from help")