@@ -52,7 +52,7 @@ const (
52
52
showPropertiesModeExpanded
53
53
)
54
54
55
- func parseShowPropertiesMode (showProperties string ) (showPropertiesMode , error ) {
55
+ func parseShowPropertiesArg (showProperties string ) (showPropertiesMode , error ) {
56
56
val , ok := map [string ]showPropertiesMode {
57
57
"disabled" : showPropertiesModeDisabled ,
58
58
"unexpanded" : showPropertiesModeUnexpanded ,
@@ -67,7 +67,7 @@ func parseShowPropertiesMode(showProperties string) (showPropertiesMode, error)
67
67
var (
68
68
fqbnArg arguments.Fqbn // Fully Qualified Board Name, e.g.: arduino:avr:uno.
69
69
profileArg arguments.Profile // Profile to use
70
- showProperties string // Show all build preferences used instead of compiling.
70
+ showPropertiesArg string // Show all build preferences used instead of compiling.
71
71
preprocess bool // Print preprocessed code to stdout.
72
72
buildCachePath string // Builds of 'core.a' are saved into this path to be cached and reused.
73
73
buildPath string // Path where to save compiled files.
@@ -115,10 +115,7 @@ func NewCommand() *cobra.Command {
115
115
fqbnArg .AddToCommand (compileCommand )
116
116
profileArg .AddToCommand (compileCommand )
117
117
compileCommand .Flags ().BoolVar (& dumpProfile , "dump-profile" , false , tr ("Create and print a profile configuration from the build." ))
118
- compileCommand .Flags ().StringVar (
119
- & showProperties ,
120
- "show-properties" ,
121
- "disabled" ,
118
+ compileCommand .Flags ().StringVar (& showPropertiesArg , "show-properties" , "disabled" ,
122
119
tr (`Show build properties instead of compiling. The properties are returned exactly as they are defined. Use "--show-properties=expanded" to replace placeholders with compilation context values.` ),
123
120
)
124
121
compileCommand .Flags ().Lookup ("show-properties" ).NoOptDefVal = "unexpanded" // default if the flag is present with no value
@@ -213,14 +210,14 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
213
210
overrides = o .Overrides
214
211
}
215
212
216
- showPropertiesM , err := parseShowPropertiesMode ( showProperties )
213
+ showProperties , err := parseShowPropertiesArg ( showPropertiesArg )
217
214
if err != nil {
218
215
feedback .Fatal (tr ("Error parsing --show-properties flag: %v" , err ), feedback .ErrGeneric )
219
216
}
220
217
221
218
var stdOut , stdErr io.Writer
222
219
var stdIORes func () * feedback.OutputStreamsResult
223
- if showPropertiesM != showPropertiesModeDisabled {
220
+ if showProperties != showPropertiesModeDisabled {
224
221
stdOut , stdErr , stdIORes = feedback .NewBufferedStreams ()
225
222
} else {
226
223
stdOut , stdErr , stdIORes = feedback .OutputStreams ()
@@ -238,7 +235,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
238
235
Instance : inst ,
239
236
Fqbn : fqbn ,
240
237
SketchPath : sketchPath .String (),
241
- ShowProperties : showPropertiesM != showPropertiesModeDisabled ,
238
+ ShowProperties : showProperties != showPropertiesModeDisabled ,
242
239
Preprocess : preprocess ,
243
240
BuildCachePath : buildCachePath ,
244
241
BuildPath : buildPath ,
@@ -355,7 +352,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
355
352
BuilderResult : compileRes ,
356
353
ProfileOut : profileOut ,
357
354
Success : compileError == nil ,
358
- showPropertiesMode : showPropertiesM ,
355
+ showPropertiesMode : showProperties ,
359
356
}
360
357
361
358
if compileError != nil {
@@ -390,7 +387,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
390
387
}
391
388
feedback .FatalResult (res , feedback .ErrGeneric )
392
389
}
393
- if showPropertiesM == showPropertiesModeExpanded {
390
+ if showProperties == showPropertiesModeExpanded {
394
391
expandPropertiesInResult (res )
395
392
}
396
393
feedback .PrintResult (res )
0 commit comments