Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 1e949db

Browse files
committed
fixed usage string - missing spaces, allowed PUT & POST for file uploading to handle graphql API call
1 parent 65f3cba commit 1e949db

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cli4/cli4.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,13 @@ def do_it(args):
241241

242242
usage = ('usage: cli4 '
243243
+ '[-V|--version] [-h|--help] [-v|--verbose] [-q|--quiet] '
244-
+ '[-j|--json] [-y|--yaml] [-n|ndjson]'
244+
+ '[-j|--json] [-y|--yaml] [-n|ndjson] '
245245
+ '[-r|--raw] '
246246
+ '[-d|--dump] '
247247
+ '[-p|--profile profile-name] '
248248
+ '[--get|--patch|--post|--put|--delete] '
249249
+ '[item=value|item=@filename|@filename ...] '
250-
+ '/command...')
250+
+ '/command ...')
251251

252252
try:
253253
opts, args = getopt.getopt(args,
@@ -314,8 +314,8 @@ def do_it(args):
314314
if arg[0] == '@':
315315
# a file to be uploaded - used in workers/script - only via PUT
316316
filename = arg[1:]
317-
if method != 'PUT':
318-
sys.exit('cli4: %s - raw file upload only with PUT' % (filename))
317+
if method not in ['PUT','POST']:
318+
sys.exit('cli4: %s - raw file upload only with PUT or POST' % (filename))
319319
try:
320320
if filename == '-':
321321
content = sys.stdin.read()

0 commit comments

Comments
 (0)