misc: hide not found text when flag plain is enabled

This commit is contained in:
Sheen Capadngan
2024-08-06 21:21:45 +08:00
parent 3028bdd424
commit 14c1b4f07b
+2
View File
@@ -415,6 +415,7 @@ func getSecretsByNames(cmd *cobra.Command, args []string) {
if value, ok := secretsMap[secretKeyFromArg]; ok { if value, ok := secretsMap[secretKeyFromArg]; ok {
requestedSecrets = append(requestedSecrets, value) requestedSecrets = append(requestedSecrets, value)
} else { } else {
if !(plainOutput || showOnlyValue) {
requestedSecrets = append(requestedSecrets, models.SingleEnvironmentVariable{ requestedSecrets = append(requestedSecrets, models.SingleEnvironmentVariable{
Key: secretKeyFromArg, Key: secretKeyFromArg,
Type: "*not found*", Type: "*not found*",
@@ -422,6 +423,7 @@ func getSecretsByNames(cmd *cobra.Command, args []string) {
}) })
} }
} }
}
// showOnlyValue deprecated in favor of --plain, below only for backward compatibility // showOnlyValue deprecated in favor of --plain, below only for backward compatibility
if plainOutput || showOnlyValue { if plainOutput || showOnlyValue {