Permalink
Browse files

Handle missing args

  • Loading branch information...
Seth Fitzsimmons
Seth Fitzsimmons committed Oct 28, 2010
1 parent bc74780 commit 30e4ff631f8d7e281c51e54d4b77ecaa8038c2d7
Showing with 6 additions and 2 deletions.
  1. +6 −2 oauth_proxy/oauth_proxy.py
@@ -53,8 +53,8 @@ def __init__(self, consumerKey, consumerSecret, token = None, tokenSecret = None
class Options(usage.Options):
- synopsis = "Usage: oauth_proxy --consumer-key <consumer key> --consumer-secret <consumer secret> [--token <token>] [--token-secret <token secret>] [-p <proxy port>] [--ssl]"
- longdesc = "An OAuth HTTP proxy server.."
+ synopsis = "--consumer-key <consumer key> --consumer-secret <consumer secret> [--token <token>] [--token-secret <token secret>] [-p <proxy port>] [--ssl]"
+ longdesc = "An OAuth HTTP proxy server."
optParameters = [
['consumer-key', None, None, "OAuth Consumer Key"],
['consumer-secret', None, None, "OAuth Consumer Secret"],
@@ -65,6 +65,10 @@ class Options(usage.Options):
optFlags = [['ssl', 's']]
+ def postOptions(self):
+ if self['consumer-key'] is None or self['consumer-secret'] is None:
+ raise usage.UsageError, "Your consumer key and secret must be provided."
+
class OAuthProxyClient(proxy.ProxyClient):
def connectionMade(self):

0 comments on commit 30e4ff6

Please sign in to comment.