Skip to content

Commit

Permalink
feat(cli-validate): Use argument -v to print errors on stderr
Browse files Browse the repository at this point in the history
The argument -v (verbosity) is not yet used in the validate function.
The specification of -v is now used in xmlschema-validate to obtain a
detailed error report on the stderr. This helps users to find the error
in their XML files at the mentioned place.

Signed-off-by: Sven Sager <s.sager@kunbus.com>
  • Loading branch information
naruxde committed Mar 11, 2024
1 parent e6f31c1 commit c2c4c2b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xmlschema/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,5 +269,8 @@ def validate():
else:
tot_errors += len(errors)
sys.stderr.write(f"{filepath} is not valid\n")
if args.verbosity > 0:
for error in errors:
sys.stderr.write(f"{error}\n")

sys.exit(tot_errors)

0 comments on commit c2c4c2b

Please sign in to comment.