Commit c1df7f70 authored by Edward Fauchon-Jones's avatar Edward Fauchon-Jones

Use format field in file as lvcnrcheck default

Falling back to format level 1 if the field is missing in the file to be
checked.
parent 090f64b2
Pipeline #2231 passed with stage
in 1 minute and 48 seconds
......@@ -35,7 +35,11 @@ parser.add_argument(
help='use coloured output', action='store_true')
parser.add_argument(
'-f', '--format',
help='format level to use', type=int, choices=[1, 2, 3], default=1)
help=(
"format level to use, if not provided the format level specified in "
"file will be used, if the format field is missing from file format "
"level 1 will be used"),
type=int, choices=[1, 2, 3])
args = parser.parse_args()
# Define output syntax for a single field report
......@@ -92,7 +96,10 @@ if __name__ == '__main__':
print('')
if args.format > 1:
# Determine format level to check
fmt = args.format or sim.att('Format') or 1
if fmt > 1:
# Format 2
print('# Format 2\n')
......@@ -101,7 +108,7 @@ if __name__ == '__main__':
print('')
if args.format > 2:
if fmt > 2:
# Format 3
print('# Format 3\n')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment