aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/print-elided.cc
blob: 75357e5bc99f314c2b6c0240d13564907fbd0915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "print-elided.hh"
#include "ansicolor.hh"
#include "english.hh"

namespace nix {

void printElided(
    std::ostream & output,
    unsigned int value,
    const std::string_view single,
    const std::string_view plural,
    bool ansiColors)
{
    if (ansiColors)
        output << ANSI_FAINT;
    output << "«";
    pluralize(output, value, single, plural);
    output << " elided»";
    if (ansiColors)
        output << ANSI_NORMAL;
}

}