added man command to lish and a man/ dir for manual pages which can be accessed in less style from within lish

This commit is contained in:
Johannes Findeisen 2013-10-20 15:10:14 +02:00
commit f77e44491d
2 changed files with 18 additions and 1 deletions

View file

@ -280,4 +280,17 @@ class LishCommander(Exit, ShellCommander, LogCommander):
os.system("less " + os.path.dirname(os.path.abspath(__file__)) + "/../../LICENSE") os.system("less " + os.path.dirname(os.path.abspath(__file__)) + "/../../LICENSE")
def help_license(self): def help_license(self):
print '''Show license information''' 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 <PAGE> Show manual page
'''

4
man/jobs.md Normal file
View file

@ -0,0 +1,4 @@
This is the manual page for the jobs command.
=============================================
Just for testing some stuff...