Skip to content

Commit

Permalink
Modify help command of XML CLI tool (#5246)
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
  • Loading branch information
cferreiragonz authored Sep 20, 2024
1 parent 6e86a4b commit 37cd84d
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 37cd84d

Please sign in to comment.