Skip to content

Commit 1d41949

Browse files
committed
added --raw flag to cli4 so that paging values can be returned
1 parent 02df169 commit 1d41949

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

cli4/cli4.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,23 @@ def cli4(args):
116116

117117
verbose = False
118118
output = 'json'
119+
raw = False
119120
method = 'GET'
120121

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

127129
try:
128130
opts, args = getopt.getopt(args,
129-
'VhvqjyGPOUD',
131+
'VhvqjyrGPOUD',
130132
[
131133
'version',
132-
'help', 'version' 'verbose', 'quiet', 'json', 'yaml',
134+
'help', 'verbose', 'quiet', 'json', 'yaml',
135+
'raw',
133136
'get', 'patch', 'post', 'put', 'delete'
134137
])
135138
except getopt.GetoptError:
@@ -147,6 +150,8 @@ def cli4(args):
147150
output = 'json'
148151
elif opt in ('-y', '--yaml'):
149152
output = 'yaml'
153+
elif opt in ('-r', '--raw'):
154+
raw = True
150155
elif opt in ('-G', '--get'):
151156
method = 'GET'
152157
elif opt in ('-P', '--patch'):
@@ -206,7 +211,7 @@ def cli4(args):
206211

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

209-
cf = CloudFlare.CloudFlare(debug=verbose)
214+
cf = CloudFlare.CloudFlare(debug=verbose, raw=raw)
210215

211216
m = cf
212217
for element in parts:

0 commit comments

Comments
 (0)