@@ -87,6 +87,33 @@ def get_config(args):
87
87
help = "The proportion of string values permitted to be empty without "
88
88
"preventing the pattern from being reported; the proportion of "
89
89
'"empty" data permitted in a field (default: %(default)s)' )
90
+ parser .add_argument (
91
+ '--str-limit' , type = num , metavar = 'NUM' , default = 20 ,
92
+ help = "The length beyond which only the lengths of strs will be "
93
+ "reported; below this the actual value of the string will be "
94
+ "displayed (default: %(default)s)" )
95
+ parser .add_argument (
96
+ '--hide-count' , action = 'store_false' , dest = 'show_count' ,
97
+ default = False )
98
+ parser .add_argument (
99
+ '--show-count' , action = 'store_true' ,
100
+ help = "If set, show the count of items in containers, the count of "
101
+ "unique scalar values, and the count of all sample values (if "
102
+ "--show-samples is set). If disabled, counts will be hidden" )
103
+ parser .add_argument (
104
+ '--hide-lengths' , action = 'store_false' , dest = 'show_lengths' ,
105
+ default = False )
106
+ parser .add_argument (
107
+ '--show-lengths' , action = 'store_true' ,
108
+ help = "If set, display the range of lengths of string fields in the "
109
+ "same format as specified by --show-range" )
110
+ parser .add_argument (
111
+ '--hide-pattern' , action = 'store_false' , dest = 'show_pattern' ,
112
+ default = True )
113
+ parser .add_argument (
114
+ '--show-pattern' , action = 'store_true' ,
115
+ help = "If set, show the pattern determined for fixed length string "
116
+ "fields. If disabled, pattern information will be hidden" )
90
117
parser .add_argument (
91
118
'--hide-range' , action = 'store_const' , dest = 'show_range' ,
92
119
const = 'hidden' , default = 'limits' )
@@ -99,19 +126,12 @@ def get_config(args):
99
126
"displays a crude chart showing the positions of the quartiles "
100
127
"relative to the limits. Use --hide-range to hide all range info" )
101
128
parser .add_argument (
102
- '--hide-pattern' , action = 'store_false' , dest = 'show_pattern' ,
103
- default = True )
104
- parser .add_argument (
105
- '--show-pattern' , action = 'store_true' ,
106
- help = "If set, show the pattern determined for fixed length string "
107
- "fields. If disabled, pattern information will be hidden" )
108
- parser .add_argument (
109
- '--hide-lengths' , action = 'store_false' , dest = 'show_lengths' ,
129
+ '--hide-samples' , action = 'store_false' , dest = 'show_samples' ,
110
130
default = False )
111
131
parser .add_argument (
112
- '--show-lengths ' , action = 'store_true' ,
113
- help = "If set, display the range of lengths of string fields in the "
114
- "same format as specified by --show-range " )
132
+ '--show-samples ' , action = 'store_true' ,
133
+ help = "If set, show samples of non-unique scalar values including the "
134
+ "most and least common values. If disabled, samples will be hidden " )
115
135
parser .add_argument (
116
136
'--min-timestamp' , type = min_timestamp , metavar = 'WHEN' ,
117
137
default = '20 years' ,
@@ -200,22 +220,25 @@ def get_structure(config):
200
220
def print_structure (config , structure ):
201
221
term = Terminal ()
202
222
styles = {
203
- 'normal-style' : term .normal ,
204
- 'unique-style' : term .red ( '*' ) ,
205
- 'key -style' : '' ,
206
- 'type -style' : term .cyan ,
207
- 'stats -style' : term .normal ,
208
- 'pattern-style' : term .bold ,
209
- 'literal-style' : term .normal ,
210
- 'req-style' : '' ,
211
- 'opt-style' : term .red ('?' ),
212
- 'ellipsis' : term .green ('..' ),
213
- 'truncation' : term .green ('$' ),
223
+ 'normal-style' : term .normal ,
224
+ 'unique-style' : term .underline ,
225
+ 'type -style' : term . cyan ,
226
+ 'fill -style' : term .green ,
227
+ 'suffix -style' : term .green ,
228
+ 'pattern-style' : term .yellow ,
229
+ 'literal-style' : term .normal ,
230
+ 'required-suffix' : '' ,
231
+ 'optional-suffix' : term .red ('?' ),
232
+ 'ellipsis' : term .green ('..' ),
233
+ 'truncation' : term .green ('$' ),
214
234
}
215
235
params = {
216
- 'show-pattern' : str (int (config .show_pattern )),
217
- 'show-lengths' : str (int (config .show_lengths )),
218
- 'show-range' : str (RANGE_CONFIGS [config .show_range ]),
236
+ 'show-count' : str (int (config .show_count )),
237
+ 'show-pattern' : str (int (config .show_pattern )),
238
+ 'show-samples' : str (int (config .show_samples )),
239
+ 'show-lengths' : str (int (config .show_lengths )),
240
+ 'show-range' : str (RANGE_CONFIGS [config .show_range ]),
241
+ 'str-limit' : str (int (config .str_limit )),
219
242
}
220
243
transform = get_transform ('cli.xsl' )
221
244
# XML 1.0 doesn't permit controls characters (other than whitespace) so
0 commit comments