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

[21720] Modify help command of XML CLI tool (backport #5246) #5250

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading