interactive: add doc() function

... that prints the welcoming message
This commit is contained in:
Ivan A. Melnikov 2019-07-01 12:41:36 +04:00
parent aba8162676
commit f60a82557c

View File

@ -35,6 +35,8 @@ What's in the box:
- dump
- append_to
- pager
* other:
- doc(): print this message.
You can also enjoy autocompletion with <TAB>.
"""
@ -288,6 +290,10 @@ def stats(names=None, to=dump):
to(reports.color_totals(BY_COLOR, names, total, summary=True))
def doc(to=dump):
to(__doc__)
def interactive_setup():
# Bind TAB to complete
readline.parse_and_bind('tab:complete')
@ -319,4 +325,4 @@ def interactive_setup():
if __name__ == '__main__':
interactive_setup()
print(__doc__)
doc()