Skip to content

Commit 84aa1ff

Browse files
committed
Output an error if dump-profile is used with json output
1 parent 78275fc commit 84aa1ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/compile/compile.go

+4
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ func NewCommand() *cobra.Command {
146146
func runCompileCommand(cmd *cobra.Command, args []string) {
147147
logrus.Info("Executing `arduino-cli compile`")
148148

149+
if dumpProfile && feedback.GetFormat() != feedback.Text {
150+
feedback.Errorf(tr("You cannot use the %[1]s flag together with %[2]s.", "--dump-profile", "--format json"))
151+
os.Exit(errorcodes.ErrBadArgument)
152+
}
149153
if profileArg.Get() != "" {
150154
if len(libraries) > 0 {
151155
feedback.Errorf(tr("You cannot use the %s flag while compiling with a profile.", "--libraries"))

0 commit comments

Comments
 (0)