+
+def parse_arguments():
+
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('-t', '--token', help='The Twitter Access Token.')
+ parser.add_argument('-ts', '--token-secret', help='The Twitter Access Token Secret.')
+ parser.add_argument('-ck', '--consumer-key', help='The Twitter Consumer Key.')
+ parser.add_argument('-cs', '--consumer-secret', help='The Twitter Consumer Secret.')
+ parser.add_argument('-us', '--user-stream', action='store_true', help='Connect to the user stream endpoint.')
+ parser.add_argument('-ss', '--site-stream', action='store_true', help='Connect to the site stream endpoint.')
+ parser.add_argument('-to', '--timeout', help='Timeout for the stream (seconds)')
+ parser.add_argument('-nb', '--no-block', action='store_true', help='Set stream to non-blocking')
+ return parser.parse_args()
+
+def main():
+ args = parse_arguments()
+
+ if not all((args.token, args.token_secret, args.consumer_key, args.consumer_secret)):