Finished template for manpage, added --version flag.

This commit is contained in:
Michael Lazar
2015-09-27 18:19:00 -07:00
parent dfc5ddef1a
commit ba71453b7c
6 changed files with 132 additions and 185 deletions

View File

@@ -61,7 +61,7 @@ def main():
try:
print('Connecting...')
reddit = praw.Reddit(user_agent=AGENT)
reddit = praw.Reddit(user_agent=AGENT.format(__version__))
reddit.config.decode_html_entities = False
with curses_session() as stdscr:
oauth = OAuthTool(reddit, stdscr, LoadScreen(stdscr))

View File

@@ -5,7 +5,7 @@ import os
import argparse
from six.moves import configparser
from . import docs
from . import docs, __version__
HOME = os.path.expanduser('~')
XDG_HOME = os.getenv('XDG_CONFIG_HOME', os.path.join(HOME, '.config'))
@@ -25,12 +25,11 @@ oauth_scope = ['edit', 'history', 'identity', 'mysubreddits', 'privatemessages',
'read', 'report', 'save', 'submit', 'subscribe', 'vote']
def build_parser():
parser = argparse.ArgumentParser(
prog='rtv', description=docs.SUMMARY, epilog=docs.CONTROLS+docs.HELP,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument(
'-V', '--version', action='version', version='rtv '+docs.__version__,
'-V', '--version', action='version', version='rtv '+__version__,
)
parser.add_argument(
'-s', dest='subreddit',

View File

@@ -1,11 +1,10 @@
from .__version__ import __version__
__all__ = ['AGENT', 'SUMMARY', 'CONTROLS', 'HELP', 'COMMENT_FILE',
'SUBMISSION_FILE', 'COMMENT_EDIT_FILE']
AGENT = """\
desktop:https://github.com/michael-lazar/rtv:{} (by /u/civilization_phaze_3)\
""".format(__version__)
desktop:https://github.com/michael-lazar/rtv:{version}\
(by /u/civilization_phaze_3)\
"""
SUMMARY = """
Reddit Terminal Viewer is a lightweight browser for www.reddit.com built into a