Skip to content

Commit

Permalink
allow people to use version and help without asking for credentials. f…
Browse files Browse the repository at this point in the history
…ixes #120
  • Loading branch information
edsu committed Dec 1, 2016
1 parent 8d64005 commit 21a2066
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup

# Also in twarc.py
__version__ = '1.0.0'
__version__ = '1.0.1'

if sys.version_info[0] < 3:
dependencies = open(join('requirements', 'python2.txt')).read().split()
Expand Down
13 changes: 12 additions & 1 deletion twarc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import print_function

__version__ = '1.0.0' # also in setup.py
__version__ = '1.0.1' # also in setup.py

import os
import re
Expand Down Expand Up @@ -58,6 +58,17 @@ def main():
format="%(asctime)s %(levelname)s %(message)s"
)

if command == "version":
print("twarc v%s" % __version__)
sys.exit()
elif command == "help" or not command:
parser.print_help()
print("\nPlease use one of the following commands:\n")
for cmd in commands:
print(" - %s" % cmd)
print("\nFor example:\n\n twarc search blacklivesmatter")
sys.exit(1)

t = Twarc(
consumer_key=args.consumer_key,
consumer_secret=args.consumer_secret,
Expand Down

0 comments on commit 21a2066

Please sign in to comment.