kopia lustrzana https://github.com/micropython/micropython-lib
upysh: Use "man" command for upysh help, leaving Python's help() alone.
Idea by @robert-hh.pull/81/head
rodzic
d316ee22f0
commit
fafc3ef2c5
|
@ -55,18 +55,20 @@ def newfile(path):
|
||||||
f.write(l)
|
f.write(l)
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
|
|
||||||
def help():
|
class Man():
|
||||||
print("""
|
|
||||||
This is 'upysh' help, for builtin Python help run:
|
|
||||||
import builtins
|
|
||||||
builtins.help()
|
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return("""
|
||||||
upysh is intended to be imported using:
|
upysh is intended to be imported using:
|
||||||
from upysh import *
|
from upysh import *
|
||||||
|
|
||||||
|
To see this help text again, type "man".
|
||||||
|
|
||||||
upysh commands:
|
upysh commands:
|
||||||
pwd, cd("new_dir"), ls, ls(...), head(...), cat(...)
|
pwd, cd("new_dir"), ls, ls(...), head(...), cat(...)
|
||||||
newfile(...), rm(...), mkdir(...), rmdir(...)
|
newfile(...), rm(...), mkdir(...), rmdir(...)
|
||||||
""")
|
""")
|
||||||
|
|
||||||
help()
|
man = Man()
|
||||||
|
|
||||||
|
print(man)
|
||||||
|
|
Ładowanie…
Reference in New Issue