@main.command(short_help="<STR_LIT>")<EOL>@click.argument('<STR_LIT>', nargs=-<NUM_LIT:1>, type=click.Path())<EOL>@click.option('<STR_LIT>', default=True, show_default=True, help="<STR_LIT>") <EOL>@click.pass_context<EOL>def validate(ctx, mapfiles, expand):
all_mapfiles = get_mapfiles(mapfiles)<EOL>if len(all_mapfiles) == <NUM_LIT:0>:<EOL><INDENT>click.echo("<STR_LIT>".format("<STR_LIT:U+002C>".join(mapfiles)))<EOL>return<EOL><DEDENT>validation_count = <NUM_LIT:0><EOL>errors = <NUM_LIT:0><EOL>for fn in all_mapfiles:<EOL><INDENT>fn = click.format_filename(fn)<EOL>d = mappyfile.open(fn, expand_includes=expand, include_position=True)<EOL>validation_messages = mappyfile.validate(d)<EOL>if validation_messages:<EOL><INDENT>for v in validation_messages:<EOL><INDENT>v["<STR_LIT>"] = fn<EOL>msg = "<STR_LIT>".format(**v)<EOL>click.echo(msg)<EOL>errors += <NUM_LIT:1><EOL><DEDENT><DEDENT>else:<EOL><INDENT>click.echo("<STR_LIT>".format(fn))<EOL>validation_count += <NUM_LIT:1><EOL><DEDENT><DEDENT>click.echo("<STR_LIT>".format(len(all_mapfiles), validation_count))<EOL>sys.exit(errors)<EOL>
Validate Mapfile(s) against the Mapfile schema

The MAPFILES argument is a list of paths, either to individual Mapfiles, or a folders containing Mapfiles.
Wildcards are supported (natively on Linux, and up to one level deep on Windows).
Validation errors are reported to the console. The program returns the error count - this will be 0 if no
validation errors are encountered.

Example of validating a single Mapfile:

    mappyfile validate C:/Temp/valid.map

Example of validating two folders containing Mapfiles, without expanding INCLUDES:

    mappyfile validate C:/Temp/*.map D:/GitHub/mappyfile/tests/mapfiles/*.map --no-expand