@@ -78,7 +78,7 @@ Scheduling:
7878 let segmentId = opts . segmentId ;
7979
8080 if ( ! from ) {
81- if ( ! isInteractive ( ) ) {
81+ if ( ! isInteractive ( ) || globalOpts . json ) {
8282 outputError (
8383 { message : 'Missing --from flag.' , code : 'missing_from' } ,
8484 { json : globalOpts . json } ,
@@ -96,7 +96,7 @@ Scheduling:
9696 }
9797
9898 if ( ! subject ) {
99- if ( ! isInteractive ( ) ) {
99+ if ( ! isInteractive ( ) || globalOpts . json ) {
100100 outputError (
101101 { message : 'Missing --subject flag.' , code : 'missing_subject' } ,
102102 { json : globalOpts . json } ,
@@ -114,7 +114,7 @@ Scheduling:
114114 }
115115
116116 if ( ! segmentId ) {
117- if ( ! isInteractive ( ) ) {
117+ if ( ! isInteractive ( ) || globalOpts . json ) {
118118 outputError (
119119 { message : 'Missing --segment-id flag.' , code : 'missing_segment' } ,
120120 { json : globalOpts . json } ,
@@ -139,7 +139,7 @@ Scheduling:
139139 }
140140
141141 if ( ! html && ! text ) {
142- if ( ! isInteractive ( ) ) {
142+ if ( ! isInteractive ( ) || globalOpts . json ) {
143143 outputError (
144144 {
145145 message : 'Missing body. Provide --html, --html-file, or --text.' ,
0 commit comments