Skip to content

Commit

Permalink
fixed usage string - missing spaces, allowed PUT & POST for file uplo…
Browse files Browse the repository at this point in the history
…ading to handle graphql API call
  • Loading branch information
mahtin committed Apr 28, 2020
1 parent 65f3cba commit 1e949db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cli4/cli4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 1e949db

Please sign in to comment.