Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andreasgerstmayr
Copy link

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
Copy link

coveralls commented Aug 5, 2021

Coverage Status

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

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 stefankoegl#43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parsing of command-line arguments is broken
2 participants