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

tstack / lnav / 18882433814-2607

28 Oct 2025 04:45PM UTC coverage: 68.89% (-1.1%) from 70.002%
18882433814-2607

push

github

tstack
[hasher] fixup hasher::to_string() for sse2

5 of 5 new or added lines in 1 file covered. (100.0%)

2926 existing lines in 57 files now uncovered.

50208 of 72881 relevant lines covered (68.89%)

424460.54 hits per line

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

75.0
/src/help_text.cc
1
/**
2
 * Copyright (c) 2020, Timothy Stack
3
 *
4
 * All rights reserved.
5
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions are met:
8
 *
9
 * * Redistributions of source code must retain the above copyright notice, this
10
 * list of conditions and the following disclaimer.
11
 * * Redistributions in binary form must reproduce the above copyright notice,
12
 * this list of conditions and the following disclaimer in the documentation
13
 * and/or other materials provided with the distribution.
14
 * * Neither the name of Timothy Stack nor the names of its contributors
15
 * may be used to endorse or promote products derived from this software
16
 * without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
19
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
22
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 */
29

30
#include "help_text.hh"
31

32
#include "config.h"
33

34
help_text&
35
help_text::with_parameters(
×
36
    const std::initializer_list<help_text>& params) noexcept
37
{
38
    this->ht_parameters = params;
×
39
    for (auto& param : this->ht_parameters) {
×
40
        param.ht_context = help_context_t::HC_PARAMETER;
×
41
    }
42
    return *this;
×
43
}
44

45
help_text&
46
help_text::with_parameter(const help_text& ht) noexcept
468,311✔
47
{
48
    this->ht_parameters.emplace_back(ht);
468,311✔
49
    this->ht_parameters.back().ht_context = help_context_t::HC_PARAMETER;
468,311✔
50
    return *this;
468,311✔
51
}
52

53
help_text&
54
help_text::with_result(const help_text& ht) noexcept
53,416✔
55
{
56
    this->ht_results.emplace_back(ht);
53,416✔
57
    this->ht_results.back().ht_context = help_context_t::HC_RESULT;
53,416✔
58
    return *this;
53,416✔
59
}
60

61
help_text&
62
help_text::with_examples(
4,875✔
63
    const std::initializer_list<help_example>& examples) noexcept
64
{
65
    this->ht_example = examples;
4,875✔
66
    return *this;
4,875✔
67
}
68

69
help_text&
70
help_text::with_example(const help_example& example) noexcept
336,909✔
71
{
72
    this->ht_example.emplace_back(example);
336,909✔
73
    return *this;
336,909✔
74
}
75

76
bool
UNCOV
77
help_text::is_trailing_arg() const
×
78
{
UNCOV
79
    switch (this->ht_format) {
×
80
        case help_parameter_format_t::HPF_TEXT:
×
81
        case help_parameter_format_t::HPF_TIME_FILTER_POINT:
82
        case help_parameter_format_t::HPF_MULTILINE_TEXT:
83
        case help_parameter_format_t::HPF_REGEX:
84
        case help_parameter_format_t::HPF_SQL:
85
        case help_parameter_format_t::HPF_SQL_EXPR:
86
            return true;
×
UNCOV
87
        default:
×
UNCOV
88
            return false;
×
89
    }
90
}
91

92
help_text&
93
help_text::with_enum_values(
8,761✔
94
    const std::initializer_list<string_fragment>& enum_values) noexcept
95
{
96
    this->ht_enum_values = enum_values;
8,761✔
97
    return *this;
8,761✔
98
}
99

100
help_text&
101
help_text::with_tags(const std::initializer_list<const char*>& tags) noexcept
220,369✔
102
{
103
    this->ht_tags = tags;
220,369✔
104
    return *this;
220,369✔
105
}
106

107
help_text&
108
help_text::with_opposites(
23,236✔
109
    const std::initializer_list<const char*>& opps) noexcept
110
{
111
    this->ht_opposites = opps;
23,236✔
112
    return *this;
23,236✔
113
}
114

115
help_text&
116
help_text::with_prql_path(
37,590✔
117
    const std::initializer_list<const char*>& prql) noexcept
118
{
119
    this->ht_prql_path = prql;
37,590✔
120
    return *this;
37,590✔
121
}
122

123
std::multimap<std::string, help_text*>&
124
help_text::tag_map()
223,475✔
125
{
126
    static std::multimap<std::string, help_text*> retval;
223,475✔
127

128
    return retval;
223,475✔
129
}
130

131
void
132
help_text::index_tags()
275,560✔
133
{
134
    for (const auto& tag : this->ht_tags) {
497,837✔
135
        tag_map().insert(std::make_pair(tag, this));
222,277✔
136
    }
137
}
275,560✔
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