Skip to content

Commit c5eda25

Browse files
committed
Command line utility: add epilog and version
1 parent 10e5dc8 commit c5eda25

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

pushover.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
import time
1818
from ConfigParser import RawConfigParser, NoSectionError
19-
from argparse import ArgumentParser
19+
from argparse import ArgumentParser, RawDescriptionHelpFormatter
2020
import os
2121

2222
import requests
@@ -265,7 +265,10 @@ def _get_config(profile='Default', config_path='~/.pushoverrc',
265265

266266

267267
def main():
268-
parser = ArgumentParser(description="Send a message to pushover.")
268+
parser = ArgumentParser(description="Send a message to pushover.",
269+
formatter_class=RawDescriptionHelpFormatter,
270+
epilog="""
271+
For more details and bug reports, see: https://github.com/Thibauth/python-pushover""")
269272
parser.add_argument("--api-token", help="Pushover application token")
270273
parser.add_argument("--user-key", "-u", help="Pushover user key")
271274
parser.add_argument("message", help="message to send")
@@ -278,6 +281,14 @@ def main():
278281
parser.add_argument("--profile", help="profile to read in the\
279282
configuration file (default: Default)",
280283
default="Default")
284+
parser.add_argument("--version", "-v", action="version",
285+
help="output version information and exit",
286+
version="""
287+
%(prog)s 0.2
288+
Copyright (C) 2013-2014 Thibaut Horel <thibaut.horel@gmail.com>
289+
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
290+
This is free software: you are free to change and redistribute it.
291+
There is NO WARRANTY, to the extent permitted by law.""")
281292

282293
args = parser.parse_args()
283294
Client(args.user_key, None, args.api_token, args.config,

0 commit comments

Comments
 (0)