Skip to content

Commit

Permalink
added --raw flag to cli4 so that paging values can be returned
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Oct 17, 2016
1 parent 02df169 commit 1d41949
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cli4/cli4.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,23 @@ def cli4(args):

verbose = False
output = 'json'
raw = False
method = 'GET'

usage = ('usage: cli4 '
+ '[-V|--version] [-h|--help] [-v|--verbose] [-q|--quiet] [-j|--json] [-y|--yaml] '
+ '[-r|--raw] '
+ '[--get|--patch|--post|-put|--delete] '
+ '[item=value ...] '
+ '/command...')

try:
opts, args = getopt.getopt(args,
'VhvqjyGPOUD',
'VhvqjyrGPOUD',
[
'version',
'help', 'version' 'verbose', 'quiet', 'json', 'yaml',
'help', 'verbose', 'quiet', 'json', 'yaml',
'raw',
'get', 'patch', 'post', 'put', 'delete'
])
except getopt.GetoptError:
Expand All @@ -147,6 +150,8 @@ def cli4(args):
output = 'json'
elif opt in ('-y', '--yaml'):
output = 'yaml'
elif opt in ('-r', '--raw'):
raw = True
elif opt in ('-G', '--get'):
method = 'GET'
elif opt in ('-P', '--patch'):
Expand Down Expand Up @@ -206,7 +211,7 @@ def cli4(args):

hex_only = re.compile('^[0-9a-fA-F]+$')

cf = CloudFlare.CloudFlare(debug=verbose)
cf = CloudFlare.CloudFlare(debug=verbose, raw=raw)

m = cf
for element in parts:
Expand Down

0 comments on commit 1d41949

Please sign in to comment.