Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
print-options.hh
Go to the documentation of this file.
1#pragma once
6
7#include <limits>
8#include <stddef.h>
9
10namespace nix {
11
34
39{
43 bool ansiColors = false;
44
48 bool force = false;
49
54 bool derivationPaths = false;
55
60 bool trackRepeated = true;
61
65 size_t maxDepth = std::numeric_limits<size_t>::max();
66
73 size_t maxAttrs = std::numeric_limits<size_t>::max();
74
81 size_t maxListItems = std::numeric_limits<size_t>::max();
82
86 size_t maxStringLength = std::numeric_limits<size_t>::max();
87
93 size_t prettyIndent = 0;
94
99
103 inline bool shouldPrettyPrint()
104 {
105 return prettyIndent > 0;
106 }
107};
108
113static PrintOptions errorPrintOptions = PrintOptions {
114 .ansiColors = true,
115 .maxDepth = 10,
116 .maxAttrs = 10,
117 .maxListItems = 10,
118 .maxStringLength = 1024,
119};
120
121}
ErrorPrintBehavior
Definition print-options.hh:15
@ Print
Definition print-options.hh:19
@ Throw
Definition print-options.hh:24
@ ThrowTopLevel
Definition print-options.hh:32
Definition print-options.hh:39
bool derivationPaths
Definition print-options.hh:54
bool shouldPrettyPrint()
Definition print-options.hh:103
size_t maxAttrs
Definition print-options.hh:73
size_t maxStringLength
Definition print-options.hh:86
size_t maxListItems
Definition print-options.hh:81
bool force
Definition print-options.hh:48
bool ansiColors
Definition print-options.hh:43
size_t maxDepth
Definition print-options.hh:65
size_t prettyIndent
Definition print-options.hh:93
ErrorPrintBehavior errors
Definition print-options.hh:98
bool trackRepeated
Definition print-options.hh:60