add the --skip-empty option

Former-commit-id: ec9cb0ecaf90a61bf9289cf4c089b5cc2fcb65a5
This commit is contained in:
2023-07-17 14:24:02 +02:00
parent b44fcfb2a0
commit be47ec909c
10 changed files with 65 additions and 12 deletions

View File

@ -16,6 +16,7 @@ type __options__ struct {
closefile bool
appendfile bool
compressed bool
skip_empty bool
csv_id bool
csv_sequence bool
csv_quality bool
@ -48,6 +49,7 @@ func MakeOptions(setters []WithOption) Options {
closefile: false,
appendfile: false,
compressed: false,
skip_empty: false,
csv_id: true,
csv_definition: false,
csv_count: false,
@ -110,6 +112,10 @@ func (opt Options) CompressedFile() bool {
return opt.pointer.compressed
}
func (opt Options) SkipEmptySequence() bool {
return opt.pointer.skip_empty
}
func (opt Options) CSVId() bool {
return opt.pointer.csv_id
}
@ -194,6 +200,14 @@ func OptionsCompressed(compressed bool) WithOption {
return f
}
func OptionsSkipEmptySequence(skip bool) WithOption {
f := WithOption(func(opt Options) {
opt.pointer.skip_empty = skip
})
return f
}
func OptionsNewFile() WithOption {
f := WithOption(func(opt Options) {
opt.pointer.appendfile = false