From 1e949db4ad705d1fd0ec6387d77f99cd08ca0198 Mon Sep 17 00:00:00 2001 From: Martin Levy Date: Tue, 28 Apr 2020 14:09:04 -0700 Subject: [PATCH] fixed usage string - missing spaces, allowed PUT & POST for file uploading to handle graphql API call --- cli4/cli4.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli4/cli4.py b/cli4/cli4.py index cb03b93..009cf11 100644 --- a/cli4/cli4.py +++ b/cli4/cli4.py @@ -241,13 +241,13 @@ def do_it(args): usage = ('usage: cli4 ' + '[-V|--version] [-h|--help] [-v|--verbose] [-q|--quiet] ' - + '[-j|--json] [-y|--yaml] [-n|ndjson]' + + '[-j|--json] [-y|--yaml] [-n|ndjson] ' + '[-r|--raw] ' + '[-d|--dump] ' + '[-p|--profile profile-name] ' + '[--get|--patch|--post|--put|--delete] ' + '[item=value|item=@filename|@filename ...] ' - + '/command...') + + '/command ...') try: opts, args = getopt.getopt(args, @@ -314,8 +314,8 @@ def do_it(args): if arg[0] == '@': # a file to be uploaded - used in workers/script - only via PUT filename = arg[1:] - if method != 'PUT': - sys.exit('cli4: %s - raw file upload only with PUT' % (filename)) + if method not in ['PUT','POST']: + sys.exit('cli4: %s - raw file upload only with PUT or POST' % (filename)) try: if filename == '-': content = sys.stdin.read()