Skip to content
Snippets Groups Projects
Commit a7701513 authored by Massimiliano Culpo's avatar Massimiliano Culpo
Browse files

module : minor improvement to output formatting

parent ba87937f
No related branches found
No related tags found
No related merge requests found
...@@ -77,7 +77,7 @@ import llnl.util.tty as tty ...@@ -77,7 +77,7 @@ import llnl.util.tty as tty
from llnl.util.tty.color import * from llnl.util.tty.color import *
import spack import spack
from spack.error import SpackError from spack.error import SpackError
import argparse from external import argparse
# Command parsing # Command parsing
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
......
...@@ -95,9 +95,10 @@ def module_refresh(name, specs, args): ...@@ -95,9 +95,10 @@ def module_refresh(name, specs, args):
tty.msg('No package matches your query') tty.msg('No package matches your query')
return return
tty.msg('You are about to regenerate the {name} module files for the following specs:'.format(name=name)) tty.msg('You are about to regenerate the {name} module files for the following specs:\n'.format(name=name))
for s in specs: for s in specs:
print(s.format(color=True)) print(s.format(color=True))
print('')
ask_for_confirmation('Do you want to proceed ? ') ask_for_confirmation('Do you want to proceed ? ')
cls = module_types[name] cls = module_types[name]
...@@ -112,10 +113,9 @@ def module_refresh(name, specs, args): ...@@ -112,10 +113,9 @@ def module_refresh(name, specs, args):
message = 'Name clashes detected in module files:\n' message = 'Name clashes detected in module files:\n'
for filename, writer_list in file2writer.items(): for filename, writer_list in file2writer.items():
if len(writer_list) > 1: if len(writer_list) > 1:
message += 'file : {0}\n'.format(filename) message += '\nfile : {0}\n'.format(filename)
for x in writer_list: for x in writer_list:
message += 'spec : {0}\n'.format(x.spec.format(color=True)) message += 'spec : {0}\n'.format(x.spec.format(color=True))
message += '\n'
tty.error(message) tty.error(message)
tty.error('Operation aborted') tty.error('Operation aborted')
raise SystemExit(1) raise SystemExit(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment