Nix  2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
print-options.hh
Go to the documentation of this file.
1#pragma once
7#include <limits>
8
9namespace nix {
10
18 Print,
23 Throw,
32};
33
38{
42 bool ansiColors = false;
43
47 bool force = false;
48
53 bool derivationPaths = false;
54
59 bool trackRepeated = true;
60
64 size_t maxDepth = std::numeric_limits<size_t>::max();
65
72 size_t maxAttrs = std::numeric_limits<size_t>::max();
73
80 size_t maxListItems = std::numeric_limits<size_t>::max();
81
85 size_t maxStringLength = std::numeric_limits<size_t>::max();
86
92 size_t prettyIndent = 0;
93
97 ErrorPrintBehavior errors = ErrorPrintBehavior::Print;
98
102 inline bool shouldPrettyPrint()
103 {
104 return prettyIndent > 0;
105 }
106};
107
112static PrintOptions errorPrintOptions = PrintOptions {
113 .ansiColors = true,
114 .maxDepth = 10,
115 .maxAttrs = 10,
116 .maxListItems = 10,
117 .maxStringLength = 1024,
118};
119
120}
ErrorPrintBehavior
Definition print-options.hh:14
Definition print-options.hh:38
bool derivationPaths
Definition print-options.hh:53
bool shouldPrettyPrint()
Definition print-options.hh:102
size_t maxAttrs
Definition print-options.hh:72
size_t maxStringLength
Definition print-options.hh:85
size_t maxListItems
Definition print-options.hh:80
bool force
Definition print-options.hh:47
bool ansiColors
Definition print-options.hh:42
size_t maxDepth
Definition print-options.hh:64
size_t prettyIndent
Definition print-options.hh:92
ErrorPrintBehavior errors
Definition print-options.hh:97
bool trackRepeated
Definition print-options.hh:59