@@ -57,12 +57,16 @@ var (
57
57
// NewCommand created a new `compile` command
58
58
func NewCommand () * cobra.Command {
59
59
command := & cobra.Command {
60
- Use : "compile" ,
61
- Short : "Compiles Arduino sketches." ,
62
- Long : "Compiles Arduino sketches." ,
63
- Example : " " + os .Args [0 ] + " compile -b arduino:avr:uno /home/user/Arduino/MySketch" ,
64
- Args : cobra .MaximumNArgs (1 ),
65
- Run : run ,
60
+ Use : "compile" ,
61
+ Short : "Compiles Arduino sketches." ,
62
+ Long : "Compiles Arduino sketches." ,
63
+ Example : "" +
64
+ " " + os .Args [0 ] + " compile -b arduino:avr:uno /home/user/Arduino/MySketch\n " +
65
+ " " + os .Args [0 ] + " compile -b arduino:avr:uno --build-property='build.extra_flags=\" -DMY_DEFINE=\" hello world\" \" ' /home/user/Arduino/MySketch\n " +
66
+ " " + os .Args [0 ] + " compile -b arduino:avr:uno --build-property='build.extra_flags=-DPIN=2 \" -DMY_DEFINE=\" hello world\" \" ' /home/user/Arduino/MySketch\n " +
67
+ " " + os .Args [0 ] + " compile -b arduino:avr:uno --build-property=build.extra_flags=-DPIN=2 --build-property='compiler.cpp.extra_flags=\" -DSSID=\" hello world\" \" '-DMY_DEFINE=\" hello world\" ' /home/user/Arduino/MySketch\n " ,
68
+ Args : cobra .MaximumNArgs (1 ),
69
+ Run : run ,
66
70
}
67
71
68
72
command .Flags ().StringVarP (& fqbn , "fqbn" , "b" , "" , "Fully Qualified Board Name, e.g.: arduino:avr:uno" )
@@ -72,8 +76,10 @@ func NewCommand() *cobra.Command {
72
76
command .Flags ().StringVarP (& exportDir , "output-dir" , "" , "" , "Save build artifacts in this directory." )
73
77
command .Flags ().StringVar (& buildPath , "build-path" , "" ,
74
78
"Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS." )
75
- command .Flags ().StringArrayVar (& buildProperties , "build-properties" , []string {},
76
- "List of custom build properties separated by spaces. Or can be used multiple times for multiple properties." )
79
+ command .Flags ().StringSliceVar (& buildProperties , "build-properties" , []string {},
80
+ "List of custom build properties separated by commas. Or can be used multiple times for multiple properties." )
81
+ command .Flags ().StringArrayVar (& buildProperties , "build-property" , []string {},
82
+ "Override a build property with a custom value. Can be used multiple times for multiple properties." )
77
83
command .Flags ().StringVar (& warnings , "warnings" , "none" ,
78
84
`Optional, can be "none", "default", "more" and "all". Defaults to "none". Used to tell gcc which warning level to use (-W flag).` )
79
85
command .Flags ().BoolVarP (& verbose , "verbose" , "v" , false , "Optional, turns on verbose mode." )
@@ -95,6 +101,8 @@ func NewCommand() *cobra.Command {
95
101
96
102
configuration .Settings .BindPFlag ("sketch.always_export_binaries" , command .Flags ().Lookup ("export-binaries" ))
97
103
104
+ command .Flags ().MarkDeprecated ("build-properties" , "please use --build-property instead." )
105
+
98
106
return command
99
107
}
100
108
0 commit comments