Skip to content

Commit e7c1a32

Browse files
committed
Refactor warning message for incompatible flags in --run-file
Signed-off-by: twinguy <[email protected]>
1 parent ce0b9fb commit e7c1a32

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

cmd/run.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ dapr run --run-file /path/to/directory -k
146146
incompatibleFlags := detectIncompatibleFlags(cmd)
147147
if len(incompatibleFlags) > 0 {
148148
// Print warning message about incompatible flags
149-
warningMsg := generateWarningMessage(incompatibleFlags)
149+
warningMsg := "The following flags are ignored when using --run-file and should be configured in the run file instead: " + strings.Join(incompatibleFlags, ", ")
150150
print.WarningStatusEvent(os.Stdout, warningMsg)
151151
}
152152

@@ -1102,11 +1102,3 @@ func detectIncompatibleFlags(cmd *cobra.Command) []string {
11021102

11031103
return incompatibleFlags
11041104
}
1105-
1106-
// generateWarningMessage creates an appropriate warning message based on the
1107-
// number and types of incompatible flags
1108-
func generateWarningMessage(incompatibleFlags []string) string {
1109-
return fmt.Sprintf(
1110-
"The following flags are ignored when using --run-file and should be configured in the run file instead: %s",
1111-
strings.Join(incompatibleFlags, ", "))
1112-
}

0 commit comments

Comments
 (0)