-
Notifications
You must be signed in to change notification settings - Fork 1k
upysh: Added rm, rmdir, clear and simplified help #76
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
Conversation
- commands added: rm, rmdir and clear - comands simplified: help does not need brackets any more - help text rearranged - pwd replaces empty string by "/"
Hello Paul. I really love that little script of yours and immediately added it to the Micropython board images. Even if urgently needed on PyBoard and Wipy, I find myself often issuing sh command at the REPL prompt. I polished and extended it a little bit, hopefully in your intent. |
Show file info similar to ls -l
9802eef
to
ceab4f3
Compare
@robert-hh : Thanks. This contains some good ideas, but I'm not sure they all suitable for upysh as-is and right away. I've added rm, rmdir commands for now. I like an idea to use "man" for help, but people should know it's man, so I've made help to print on module load for now. But: upysh is intended to be a filesystem shell, so things like "clear" are outside of its scope. It's also intended to be a very minimal shell, so printing date/time are also outside of its scope, at least for now (I find a file size to be a valuable info, and myself almost always pay attention to file size; contrary, I rather rarely consult file's time). |
Hello Paul, On 12.06.2016 20:59, Paul Sokolovsky wrote:
|
I use "clear" a lot and would be +1 on including it. It is related to "file" interaction, eg clearing the screen before cat'ing or ls'ing so you can see things clearly. |
@dpgeorge : Well, if you use it, what can we do? ;-). But mind my concern: I started upysh because I considered @dhylands' upy-shell too big. I don't want it to grow to be just a fork of upy-shell. Of course, any single function, we can add, but it's main purpose is to run on some 2K-heap (where it of course already won't run). Anyway, are you sure it should be "clear" and not "cls" for example? |
'clear' is the unix/linux command, 'cls' is windows/dos. Since upysh mimics unix, it would be 'clear'. The aspect of RAM usage could be get less important for esp8266, if Damien's PR2067 would get mainstream. |
"cls" is what random human walking down the street would remember about clearing screen, because s/he read a BASIC book somehere in childhood (or for whatever) reason. It's also shorter.
upysh has nothing to do with esp8266, it's just a most minimal to still be useful file shell. Nor any hacks would help it - it itself a hack, made to influence as little as possible anything ride side by side with it. And memory will always be a scarce resource. |
@dpgeorge : ping |
I've implemented "man" command now, thanks for the idea, @robert-hh ! |
I'd say it should be "clear", since, as @robert-hh says, all other commands are unixy. But if its addition is controversial then don't worry about it. BTW, if minimal is the goal then making extra clases for, eg, ls, just so you don't need to type parenthesis, seems a bit excessive. But then, balancing minimal with usability is always hard (and I'd say the addition of "clear" is a usability thing). |
When placing upysh into frozen bytecode, the variant with classes uses about 1300 bytes of heap space, whereas a version without classes uses 640 bytes. That's my private copy, which is a little bit larger than Paul's, including clear and date & time on ls. From my previous fights for space I recall, that every class defintion take about 200 bytes of heap. That matches the difference roughly. |
... because there's no uos.rmdir() on ESP8266.
works (on ESP8266), I'm not sure if it would be the correct solution for all platforms? (I therefore canceled #81). |
Based on patch by @robert-hh: #76 .
Based on patch by @robert-hh: #76 .
os.rmdir() was implemented in esp8266 port. "clear" command was added, based on implementation in this patch. Thanks! |
Based on patch by @robert-hh: micropython/micropython-lib#76 .
Uh oh!
There was an error while loading. Please reload this page.