mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
backport of commit 6fc78315f7 (#17267)
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d6d8435dc0
commit
0c8e7de76a
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -262,6 +262,10 @@ func TestArgWarnings(t *testing.T) {
|
||||
[]string{"--x=" + globalFlagDetailed},
|
||||
"--x=" + globalFlagDetailed,
|
||||
},
|
||||
{
|
||||
[]string{"policy", "write", "my-policy", "-"},
|
||||
"",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
||||
Reference in New Issue
Block a user