backport of commit 6fc78315f7 (#17267)

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
hc-github-team-secure-vault-core
2022-09-23 07:41:22 -04:00
committed by GitHub
parent d6d8435dc0
commit 0c8e7de76a
2 changed files with 6 additions and 1 deletions

View File

@@ -296,7 +296,8 @@ func parseFlagFile(raw string) (string, error) {
func generateFlagWarnings(args []string) string {
var trailingFlags []string
for _, arg := range args {
if !strings.HasPrefix(arg, "-") {
// "-" can be used where a file is expected to denote stdin.
if !strings.HasPrefix(arg, "-") || arg == "-" {
continue
}

View File

@@ -262,6 +262,10 @@ func TestArgWarnings(t *testing.T) {
[]string{"--x=" + globalFlagDetailed},
"--x=" + globalFlagDetailed,
},
{
[]string{"policy", "write", "my-policy", "-"},
"",
},
}
for _, tc := range cases {