• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbits-os / quick_dra / 22054814568

16 Feb 2026 08:08AM UTC coverage: 95.449% (+8.4%) from 87.008%
22054814568

Pull #39

github

web-flow
Merge c1ce10f54 into 7d773e4d9
Pull Request #39: testing

50 of 54 new or added lines in 22 files covered. (92.59%)

5 existing lines in 4 files now uncovered.

4195 of 4395 relevant lines covered (95.45%)

1613.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.08
/libs/cli/src/xml/xml_command.cpp
1
// Copyright (c) 2026 midnightBITS
2
// This code is licensed under MIT license (see LICENSE for details)
3

4
#include <fmt/format.h>
5
#include <args_parser.hpp>
6
#include <chrono>
7
#include <filesystem>
8
#include <fstream>
9
#include <quick_dra/base/paths.hpp>
10
#include <quick_dra/base/verbose.hpp>
11
#include <quick_dra/docs/file_set.hpp>
12
#include <quick_dra/docs/forms.hpp>
13
#include <quick_dra/docs/summary.hpp>
14
#include <quick_dra/docs/xml.hpp>
15
#include <quick_dra/docs/xml_builder.hpp>
16
#include <quick_dra/models/types.hpp>
17
#include <quick_dra/version.hpp>
18
#include "../commands.hpp"
19
#include "cli_options.hpp"
20

21
using namespace std::literals;
22

23
namespace quick_dra::builtin::xml {
24
        int handle(std::string_view tool_name,
33✔
25
                   args::arglist arguments,
26
                   std::string_view description) {
1✔
27
                auto const opt = options_from_cli({tool_name, arguments}, description);
100✔
28

66✔
29
                if (opt.verbose_level > verbose::none) {
31✔
30
                        fmt::print("-- config used: {}\n", opt.config_path.string());
109✔
31
                }
54✔
32

66✔
33
                if (opt.verbose_level >= verbose::names_and_summary) {
31✔
34
                        fmt::print("-- today: {}-{:02}-{:02}\n",
89✔
35
                                   static_cast<int>(opt.today.year()),
80✔
36
                                   static_cast<unsigned>(opt.today.month()),
80✔
37
                                   static_cast<unsigned>(opt.today.day()));
96✔
38
                }
48✔
39

66✔
40
                fmt::print("-- report: #{} {}-{:02}\n", opt.report_index,
117✔
41
                           static_cast<int>(opt.date.year()),
106✔
42
                           static_cast<unsigned>(opt.date.month()));
106✔
43

66✔
44
                auto cfg = parse_config(opt.verbose_level, opt.date, opt.config_path,
117✔
45
                                        opt.tax_config_path);
106✔
46
                if (!cfg) {
31✔
47
                        return 1;
×
48
                }
49

66✔
50
                auto raw_templates = quick_dra::templates::parse_yaml(
11✔
51
                    platform::config_data_dir() / "templates.yaml"sv);
96✔
52
                if (!raw_templates) {
31✔
NEW
53
                        return 1;
×
54
                }
55

66✔
56
                auto const forms = prepare_form_set(opt.verbose_level, opt.report_index,
31✔
57
                                                    opt.date, opt.today, *cfg);
96✔
58
                auto const file = build_file_set(
77✔
59
                    opt, forms, compiled_templates::compile(*raw_templates));
96✔
60
                store_xml(file, set_filename(opt.report_index, opt.date),
97✔
61
                          opt.indent_xml);
96✔
62

66✔
63
                if (!opt.print_info && opt.verbose_level != verbose::none) {
31✔
64
                        fmt::print("-- use --info to print summary of amounts to pay\n");
28✔
65
                }
18✔
66

66✔
67
                if (opt.print_info) {
31✔
68
                        auto const lines = gather_summary_data(forms);
64✔
69
                        print_summary(lines);
64✔
70
                }
64✔
71

66✔
72
                if (opt.verbose_level >= verbose::last) {
31✔
73
                        fmt::print("-- (no more info to unveil)\n");
10✔
74
                }
6✔
75

66✔
76
                return 0;
97✔
77
        }
97✔
78
}  // namespace quick_dra::builtin::xml
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc