-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added 'lib examples' command #905
Conversation
A provocative thought 😺: what about having a |
b6d5c34
to
f97fdd0
Compare
ok, pushed another iteration, now I've added an
as a bonus we can apply the same filters to the
BTW |
As a verification, I am going to integrate the new APIs into the Pro IDE. |
@@ -261,6 +266,8 @@ message Library { | |||
LibraryLocation location = 24; | |||
// The library format type. | |||
LibraryLayout layout = 25; | |||
// The example sketches provided by the library | |||
repeated string examples = 26; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider moving the examples
from Library
to LibraryRelease
.
For me, a Library
is the unique identifier (with its name
) and it has 1..*
LibraryReleases
.
A Library
can have, for example, two releases, 1.0.0
and 1.1.0
.
The 1.0.0
version can have two examples:
[
'/path/to/example/A',
'/path/to/example/B'
]
And the latest, 1.1.0
LibraryRelease
version can have an update, so it has comes with three examples:
[
'/path/to/example/A',
'/path/to/example/B',
'/path/to/example/NewFeatureFrom_1_1_0',
]
Possible related: #928
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for merging this PR as-is; we can handle #928 later together with the currently unnecessary instance
.
Still missing tests. I don't know if the current UX is correct, at the moment we have:
this command will show the examples for all the instances of Wire installed.
The json version:
arduino-cli lib examples Audio --format=json
will output the same metadata as
lib list
with an addedexample
field` on top of the json structure:this will help to figure out at which library the examples belongs if we have multilple libraries spread across platforms (like the Wire example above) since all the metadata is there, but still we can easily filter only the examples if required: