circup icon indicating copy to clipboard operation
circup copied to clipboard

The arguments to `circup example` are mysterious

Open dhalbert opened this issue 6 months ago • 5 comments

The arguments to circup example are not at all obvious, and the help message doesn't help too much.

I finally figured out it was circup example ble/ble_uart_echo_test. This is not a real pathname, despite the /.

It is not:

circup example adafruit_ble/examples/ble_uart_echo_test
circup example adafruit_ble/examples/ble_uart_echo_test.py
circup example adafruit_ble/ble_uart_echo_test
circup example adafruit_ble/ble_uart_echo_test.py
circup example ble/ble_uart_echo_test.py
circup example ble ble_uart_echo_test

I found circup example --list and then discovered I could do circup example ble --list, but some examples in the help text would be helpful.

dhalbert avatar Jun 23 '25 22:06 dhalbert

I did try some variations on skipping Adafruit [sometimes skipped] and circuitpython [mostly skipped]. If the user includes a strippable phrase in their library name to search then we should do so [or test both / fallback].

I just wanted -a or some way of showing / installing all examples for a library, not to have to -ls a different library name and then copy examples one by one,

The default for circup example (and wrong arguments) should be to display help too, not to say nothing, or try help.

Image

tyeth avatar Oct 12 '25 20:10 tyeth

And yes, the help text should be expanded to include what a "named example" is, bearing in mind it matches no existing naming scheme or file structure that the user could guess (while knowing the lib name and example file path from github for example).

tyeth avatar Oct 12 '25 20:10 tyeth

I also strongly feel that inconsistently removing/skipping sections of library names is a recipe for disaster, as the user has no way of knowing this, and we therefore have to do it consistently across the ecosystem, or in a helpful fallback way (assume full name is correct, then drop circuitpython and retest, then drop adafruit and retest).

tyeth avatar Oct 12 '25 20:10 tyeth

Tagging @FoamyGuy for his 2cents

tyeth avatar Oct 12 '25 20:10 tyeth

The other thing that maybe lead to my confusion, was I installed circup freshly, and did not download the bundles (I didn't install any libraries as already there - I just wanted examples). I may have therefore received no results for circup example --list as the bundles didn't exist locally yet. This should be tested (if the example command should also fetch bundles if needed).

tyeth avatar Oct 12 '25 20:10 tyeth