diff --git a/README.md b/README.md index 9e59d91..6ffff31 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,9 @@ All API calls can be called from the command line. The command will convert doma $ cli4 [-h|--help] [-v|--verbose] [-q|--quiet] [--get|--patch|--post|-put|--delete] [item=value ...] /command... ``` +For API calls that need a set of date or parameters passed there is a item=value format. +If you want a numeric value passed, then _**_ can be used to force the value to be treated as a numeric value. + The output from the CLI command is in json format (and human readable). ### Simple CLI examples diff --git a/cli4/cli4.py b/cli4/cli4.py index 8607076..3c0280d 100644 --- a/cli4/cli4.py +++ b/cli4/cli4.py @@ -124,13 +124,13 @@ def cli4(args): # next grab the params. These are in the form of tag=value params = {} while len(args) > 0 and '=' in args[0]: - tag, value = args.pop(0).split('=') + tag, value = args.pop(0).split('=', 1) if value == 'true': value = True elif value == 'false': value = False - elif digits_only.match(value): - value = int(value) + elif value[0] is '=' and digits_only.match(value[1:]): + value = int(value[1:]) elif value[0] is '[' and value[-1] is ']': value = value[1:-1].split(',') params[tag] = value