stefankoegl / python-json-pointer

Resolve JSON Pointers in Python
https://python-json-pointer.readthedocs.org/
Other
140 stars 43 forks source link

cli: update command line arguments (breaking change) #44

Open andreasgerstmayr opened 3 years ago

andreasgerstmayr commented 3 years ago

This commit updates the CLI arguments to accept either a file containing a json pointer expression, or an expression as a commandline argument:

usage: jsonpointer [-h] (-f [POINTER_FILE] | -p [POINTER]) [--indent INDENT] [-v] FILE [FILE ...]

Without this commit

jsonpointer "/a" a.json b.json

works fine, however using a file doesn't work:

$ jsonpointer -f ptr.json a.json b.json
usage: jsonpointer [-h] [-f [POINTER_FILE]] [--indent INDENT] [-v] [POINTER] FILE [FILE ...]
jsonpointer: error: argument POINTER: not allowed with argument -f/--pointer-file

This commit also improves the usage message by explaining the mutually exclusive arguments, adds tests for the changes, updates the documentation and adds a new CHANGELOG.md file.

Resolves #43

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling e0c81d703d8eae28e769464c6a6681db39f01b21 on andreasgerstmayr:fix-cli-args into 7d146bd7caf196bd04b44bdb6d395e91256fa88c on stefankoegl:master.