Skip to content

Commit 755e2ba

Browse files
committed
Renaming some variables for clarity
1 parent bfb5f3f commit 755e2ba

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

internal/cli/compile/compile.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const (
5252
showPropertiesModeExpanded
5353
)
5454

55-
func parseShowPropertiesMode(showProperties string) (showPropertiesMode, error) {
55+
func parseShowPropertiesArg(showProperties string) (showPropertiesMode, error) {
5656
val, ok := map[string]showPropertiesMode{
5757
"disabled": showPropertiesModeDisabled,
5858
"unexpanded": showPropertiesModeUnexpanded,
@@ -67,7 +67,7 @@ func parseShowPropertiesMode(showProperties string) (showPropertiesMode, error)
6767
var (
6868
fqbnArg arguments.Fqbn // Fully Qualified Board Name, e.g.: arduino:avr:uno.
6969
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.
7171
preprocess bool // Print preprocessed code to stdout.
7272
buildCachePath string // Builds of 'core.a' are saved into this path to be cached and reused.
7373
buildPath string // Path where to save compiled files.
@@ -115,10 +115,7 @@ func NewCommand() *cobra.Command {
115115
fqbnArg.AddToCommand(compileCommand)
116116
profileArg.AddToCommand(compileCommand)
117117
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",
122119
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.`),
123120
)
124121
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) {
213210
overrides = o.Overrides
214211
}
215212

216-
showPropertiesM, err := parseShowPropertiesMode(showProperties)
213+
showProperties, err := parseShowPropertiesArg(showPropertiesArg)
217214
if err != nil {
218215
feedback.Fatal(tr("Error parsing --show-properties flag: %v", err), feedback.ErrGeneric)
219216
}
220217

221218
var stdOut, stdErr io.Writer
222219
var stdIORes func() *feedback.OutputStreamsResult
223-
if showPropertiesM != showPropertiesModeDisabled {
220+
if showProperties != showPropertiesModeDisabled {
224221
stdOut, stdErr, stdIORes = feedback.NewBufferedStreams()
225222
} else {
226223
stdOut, stdErr, stdIORes = feedback.OutputStreams()
@@ -238,7 +235,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
238235
Instance: inst,
239236
Fqbn: fqbn,
240237
SketchPath: sketchPath.String(),
241-
ShowProperties: showPropertiesM != showPropertiesModeDisabled,
238+
ShowProperties: showProperties != showPropertiesModeDisabled,
242239
Preprocess: preprocess,
243240
BuildCachePath: buildCachePath,
244241
BuildPath: buildPath,
@@ -355,7 +352,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
355352
BuilderResult: compileRes,
356353
ProfileOut: profileOut,
357354
Success: compileError == nil,
358-
showPropertiesMode: showPropertiesM,
355+
showPropertiesMode: showProperties,
359356
}
360357

361358
if compileError != nil {
@@ -390,7 +387,7 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
390387
}
391388
feedback.FatalResult(res, feedback.ErrGeneric)
392389
}
393-
if showPropertiesM == showPropertiesModeExpanded {
390+
if showProperties == showPropertiesModeExpanded {
394391
expandPropertiesInResult(res)
395392
}
396393
feedback.PrintResult(res)

0 commit comments

Comments
 (0)