mirror of
https://github.com/KrystianD/mikrotik_configurator.git
synced 2025-06-21 10:08:15 +02:00
added printing line numbers when option --generate-only is not used
This commit is contained in:
parent
d184aca537
commit
062862f193
@ -71,10 +71,13 @@ def main():
|
|||||||
base_path = "flash/" if has_flash else ""
|
base_path = "flash/" if has_flash else ""
|
||||||
script_name = "output.rsc"
|
script_name = "output.rsc"
|
||||||
|
|
||||||
print(script)
|
|
||||||
if args.generate_only:
|
if args.generate_only:
|
||||||
|
print(script)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
for index, line in enumerate(script.splitlines(), start=1):
|
||||||
|
print('{:4d}: {}'.format(index, line.rstrip()))
|
||||||
|
|
||||||
with tempfile.NamedTemporaryFile(mode="wt") as f:
|
with tempfile.NamedTemporaryFile(mode="wt") as f:
|
||||||
f.write(script)
|
f.write(script)
|
||||||
f.flush()
|
f.flush()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user