From f77e44491df8da4530d87dc5209647a6c9ce8219 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Sun, 20 Oct 2013 15:10:14 +0200 Subject: [PATCH] added man command to lish and a man/ dir for manual pages which can be accessed in less style from within lish --- linspector/frontends/lish.py | 15 ++++++++++++++- man/jobs.md | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 man/jobs.md diff --git a/linspector/frontends/lish.py b/linspector/frontends/lish.py index 5301474..e4de62f 100644 --- a/linspector/frontends/lish.py +++ b/linspector/frontends/lish.py @@ -280,4 +280,17 @@ class LishCommander(Exit, ShellCommander, LogCommander): os.system("less " + os.path.dirname(os.path.abspath(__file__)) + "/../../LICENSE") def help_license(self): - print '''Show license information''' \ No newline at end of file + print '''Show license information''' + + def do_man(self, text): + try: + with open(os.path.dirname(os.path.abspath(__file__)) + "/../../man/" + text + ".md"): + os.system("less " + os.path.dirname(os.path.abspath(__file__)) + "/../../man/" + text + ".md") + except IOError: + self.print_color(RED, "Manual page \"" + text + "\" not found.") + self.help_man() + + def help_man(self): + print '''usage: + man Show manual page + ''' \ No newline at end of file diff --git a/man/jobs.md b/man/jobs.md new file mode 100644 index 0000000..c66793b --- /dev/null +++ b/man/jobs.md @@ -0,0 +1,4 @@ +This is the manual page for the jobs command. +============================================= + +Just for testing some stuff...