Skip to content

Commit fafc3ef

Browse files
committed
upysh: Use "man" command for upysh help, leaving Python's help() alone.
Idea by @robert-hh.
1 parent d316ee2 commit fafc3ef

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

upysh/upysh.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,20 @@ def newfile(path):
5555
f.write(l)
5656
f.write("\n")
5757

58-
def help():
59-
print("""
60-
This is 'upysh' help, for builtin Python help run:
61-
import builtins
62-
builtins.help()
58+
class Man():
6359

60+
def __repr__(self):
61+
return("""
6462
upysh is intended to be imported using:
6563
from upysh import *
6664
65+
To see this help text again, type "man".
66+
6767
upysh commands:
6868
pwd, cd("new_dir"), ls, ls(...), head(...), cat(...)
6969
newfile(...), rm(...), mkdir(...), rmdir(...)
7070
""")
7171

72-
help()
72+
man = Man()
73+
74+
print(man)

0 commit comments

Comments
 (0)