diff --git a/oxrlib/commands/historical.py b/oxrlib/commands/historical.py index c7d7f705a83bfed9c93a6a84885b55e19be2ce9b..075fa8386d13c994058ab6ec7ab0c32a62ba244b 100644 --- a/oxrlib/commands/historical.py +++ b/oxrlib/commands/historical.py @@ -12,6 +12,8 @@ def run(config, stdout, stderr): loaders = config.get_loaders() with loaders.historical(config.args.date, config.args.base) as rate_json: rate = oxrrate.Rate.from_json_file(rate_json) + if loaders.should_cache(): + config.cache.save_rate(rate) if not config.args.from_currency: for from_curr in sorted(rate.rates): print(*format_rate_pair(rate, from_curr, config.args.to_currency),