-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add mpremote fs tree
command to show a tree of the device's files.
#17112
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #17112 +/- ##
=======================================
Coverage 98.54% 98.54%
=======================================
Files 169 169
Lines 21890 21898 +8
=======================================
+ Hits 21572 21580 +8
Misses 318 318 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code size report:
|
This is great, thank you!
Honestly, I find non-human-readable sizes, ie just byte sizes, more readable. Because the size/length of the number shows how big the file is, and it's much easier to spot small/big files when So, maybe add a |
Should be no problem to add both -s and -h |
mpremote tree now takes either Details
$ mpremote tree -s
tree :
:/
└── boards
├── [ 46] 96b_carbon.conf
├── [ 163] bbc_microbit_v2.conf
├── [ 97] beagleconnect_freedom.conf
├── [ 77] disco_l475_iot1.conf
├── [ 264] frdm_k64f.conf
├── [ 122] frdm_kw41z.conf
├── [ 206] mimxrt1050_evk.conf
├── [ 33] mimxrt685_evk_cm33.conf
├── [ 273] nrf52840dk_nrf52840.conf
├── [ 146] nucleo_h743zi.conf
├── [ 467] nucleo_h743zi.overlay
├── [ 131] nucleo_wb55rg.conf
├── [ 172] qemu_cortex_m3.conf
├── [ 172] qemu_x86.conf
├── [ 81] reel_board.conf
└── [ 50] rv32m1_vega_ri5cy.conf
$ mpremote tree --human
tree :
:/
└── boards
├── [ 46 B] 96b_carbon.conf
├── [ 163 B] bbc_microbit_v2.conf
├── [ 97 B] beagleconnect_freedom.conf
├── [ 77 B] disco_l475_iot1.conf
├── [ 264 B] frdm_k64f.conf
├── [ 122 B] frdm_kw41z.conf
├── [ 206 B] mimxrt1050_evk.conf
├── [ 33 B] mimxrt685_evk_cm33.conf
├── [ 273 B] nrf52840dk_nrf52840.conf
├── [ 146 B] nucleo_h743zi.conf
├── [ 467 B] nucleo_h743zi.overlay
├── [ 131 B] nucleo_wb55rg.conf
├── [ 172 B] qemu_cortex_m3.conf
├── [ 172 B] qemu_x86.conf
├── [ 81 B] reel_board.conf
└── [ 50 B] rv32m1_vega_ri5cy.conf
|
b680f54
to
cf8fecf
Compare
|
@dpgeorge , I propose to implement option 1) below 1) not outlined - no []
2) outlined - no []
3) outlined , []
4) outlined , [ 0]
|
234a834
to
abf9829
Compare
FWIW I prefer option 1) too. A small request though: Could you add two spaces after the closing square bracket (as unix tree does)? Dramatically improves readability IMO. I prefer the human readable output, though I note that it's different to unix tree (which is always 4 chars, I believe). In any case, thanks @Josverl! This is a handy addition. |
3056b5b
to
a1d4e1d
Compare
@mattytrentini This was the reasoning
And one additional space coming up |
Add `mpremote fs tree` command to show a tree of the device's files. Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Summary
This PR adds a new command to
mpremote
that displays the file system of a connected device in a tree format.While working on mpremote rm -r I developed a desire to see a tree-view of files on the device.
I build a PoC for this and asked for feedback
where there appears to be a common need for this.
The
mpremote fs tree
command :This PR also fixes a limitation where
ls
can be run without specifying a path, but this would result in an error if an option was specified.As
tree
also uses the same logic I wanted to fix this for both commands.Example tree view:
Testing
Automated tests for valid and error cases have been added, but can only be verified on unix based systems.
The -v option cannot be tested reliably with the
.exp
output approach as devices can, and will, be assigned to different port names. So this has been omitted from automated tests.Note that there is now 3x duplication of the
ramdisk.py
script across multiple test scripts.It would be best to reduce this to a single file and use it in all tests.
Manual testing:
Documentation
Documentation and samples for the
fs tree
command have been added to the mpremote doc page.A few sub sections have been added to the fs section to improve readability,
A few paragraphs have been moved to a more appropriate location to better fit this structure.