Skip to content

Commit

Permalink
Modify help command of XML CLI tool (#5246) (#5249)
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <[email protected]>
(cherry picked from commit 37cd84d)

Co-authored-by: Carlos Ferreira González <[email protected]>
  • Loading branch information
mergify[bot] and cferreiragonz committed Sep 24, 2024
1 parent 28a2729 commit b287e91
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/fastdds/xml_ci/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, argv):
usage='fastdds xml [<xml-command>]',
)
parser.add_argument(
'xml_command',
'validate',
nargs='*',
help='validate XML profiles files using an XSD schema'
)
Expand All @@ -88,13 +88,13 @@ def __init__(self, argv):
except TypeError:
args.xsd_file = self.xsd_dir() # get default schema path

if args.xml_command:
if args.xml_command[0] == 'validate':
args.xml_command.pop(0)
if not Validate(args.xsd_file).run(args.xml_command):
if args.validate:
if args.validate[0] == 'validate':
args.validate.pop(0)
if not Validate(args.xsd_file).run(args.validate):
exit(1)
else:
print(f'xml-command "{args.xml_command[0]}" is not valid')
print(f'xml-command "{args.validate[0]}" is not valid')
else:
parser.print_help()
exit(1)
Expand Down

0 comments on commit b287e91

Please sign in to comment.