From fafc3ef2c556bc8cf221941c0e279698c9f6b0c9 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 3 Jul 2016 15:50:46 +0300 Subject: [PATCH] upysh: Use "man" command for upysh help, leaving Python's help() alone. Idea by @robert-hh. --- upysh/upysh.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/upysh/upysh.py b/upysh/upysh.py index d4e4cdba..4832365d 100644 --- a/upysh/upysh.py +++ b/upysh/upysh.py @@ -55,18 +55,20 @@ def newfile(path): f.write(l) f.write("\n") -def help(): - print(""" -This is 'upysh' help, for builtin Python help run: -import builtins -builtins.help() +class Man(): + def __repr__(self): + return(""" upysh is intended to be imported using: from upysh import * +To see this help text again, type "man". + upysh commands: pwd, cd("new_dir"), ls, ls(...), head(...), cat(...) newfile(...), rm(...), mkdir(...), rmdir(...) """) -help() +man = Man() + +print(man)