Finished template for manpage, added --version flag.
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user