Skip to content

Commit 6722d63

Browse files
author
Federico Fissore
committed
Added CLI param "lib-discovery-recursion-depth", which allows to specify a
different recursion depth (defaults to 3) Signed-off-by: Federico Fissore <[email protected]>
1 parent ee36877 commit 6722d63

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ This tool generates function prototypes and gathers library paths, providing `gc
3333

3434
* `-logger`: Optional, can be "human" or "machine". Defaults to "human". If "machine", messages emitted will be in a format which the Arduino IDE understands and that it uses for I18N.
3535

36+
* `-lib-discovery-recursion-depth`: Optional. Defaults to 3. How deep should library discovery go down looking for included libraries.
37+
3638
* `-version`: if specified, prints version and exits.
3739

3840
Final mandatory parameter is the sketch to compile (of course).

main.go

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ var ideVersionFlag *string
7979
var buildPathFlag *string
8080
var verboseFlag *bool
8181
var debugLevelFlag *int
82+
var libraryDiscoveryRecursionDepthFlag *int
8283
var warningsLevelFlag *string
8384
var loggerFlag *string
8485
var versionFlag *bool
@@ -97,6 +98,7 @@ func init() {
9798
debugLevelFlag = flag.Int("debug-level", builder.DEFAULT_DEBUG_LEVEL, "Turns on debugging messages. The higher, the chattier")
9899
warningsLevelFlag = flag.String("warnings", "", "Sets warnings level. Available values are 'none', 'default', 'more' and 'all'")
99100
loggerFlag = flag.String("logger", "human", "Sets type of logger. Available values are 'human', 'machine'")
101+
libraryDiscoveryRecursionDepthFlag = flag.Int("lib-discovery-recursion-depth", builder.DEFAULT_LIBRARY_DISCOVERY_RECURSION_DEPTH, "How deep should library discovery go down looking for included libraries")
100102
versionFlag = flag.Bool("version", false, "prints version and exits")
101103
}
102104

@@ -242,6 +244,10 @@ func main() {
242244
context[constants.CTX_DEBUG_LEVEL] = *debugLevelFlag
243245
}
244246

247+
if *libraryDiscoveryRecursionDepthFlag > 0 {
248+
context[constants.CTX_LIBRARY_DISCOVERY_RECURSION_DEPTH] = *libraryDiscoveryRecursionDepthFlag
249+
}
250+
245251
if *loggerFlag == "machine" {
246252
context[constants.CTX_LOGGER] = i18n.MachineLogger{}
247253
} else {

0 commit comments

Comments
 (0)