Skip to content

Commit

Permalink
Add data-file and build-log as command-line overrides
Browse files Browse the repository at this point in the history
This means, we have all top-level settings as overrides for the command line.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information
smarr committed Jun 16, 2018
1 parent dbd4999 commit ebad5ed
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions rebench/rebench.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
RandomScheduler
from .persistence import DataStore
from .reporter import CliReporter
from .configurator import Configurator
from .configurator import Configurator, load_config
from .configuration_error import ConfigurationError


Expand Down Expand Up @@ -114,9 +114,12 @@ def shell_options(self):
data.add_argument('-f', '--faulty', action='store_true',
dest='include_faulty', default=False,
help='Include results of faulty or failing runs')
data.add_argument('-o', '--out', dest='output_file', default=None,
help='Report is saved to the given file. '
'The report is always verbose.')
data.add_argument('-df', '--data-file', dest='data_file', default=None,
help='Record all data into given file. '
'This overrides the configuration\'s settings.')
data.add_argument('-b', '--build-log', dest='build_log', default=None,
help='File for the output of build commands.'
'This overrides the configuration\'s setting.')

codespeed = parser.add_argument_group(
'Reporting to Codespeed',
Expand Down Expand Up @@ -177,10 +180,10 @@ def run(self, argv=None):
exp_name, exp_filter = self.determine_exp_name_and_filters(args.exp_filter)

try:
config_filename = args.config[0]
self._config = Configurator(config_filename, data_store, args,
cli_reporter, exp_name, None,
exp_filter)
config = load_config(args.config[0])
self._config = Configurator(config, data_store, args,
cli_reporter, exp_name, args.data_file,
args.build_log, exp_filter)
except ConfigurationError as exc:
logging.error(exc.message)
sys.exit(-1)
Expand Down

0 comments on commit ebad5ed

Please sign in to comment.