python-json-pointer icon indicating copy to clipboard operation
python-json-pointer copied to clipboard

cli: update command line arguments (breaking change)

Open andreasgerstmayr opened this issue 4 years ago • 1 comments

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

andreasgerstmayr avatar Aug 05 '21 16:08 andreasgerstmayr

Coverage Status

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

coveralls avatar Aug 05 '21 16:08 coveralls