mlr --csv --irs/--ors crlf is OK, sine autodetected per platform

This commit is contained in:
John Kerl 2021-11-17 23:39:16 -05:00
parent 2ea267eaa9
commit a73089be20
6 changed files with 7 additions and 9 deletions

View file

@ -2959,4 +2959,4 @@ SEE ALSO
2021-11-15 MILLER(1)
2021-11-18 MILLER(1)

View file

@ -22,8 +22,8 @@ type RecordReaderCSV struct {
// ----------------------------------------------------------------
func NewRecordReaderCSV(readerOptions *cli.TReaderOptions) (*RecordReaderCSV, error) {
if readerOptions.IRS != "\n" {
return nil, errors.New("CSV IRS cannot be altered; LF vs CR/LF is autodetected.")
if readerOptions.IRS != "\n" && readerOptions.IRS != "\r\n" {
return nil, errors.New("CSV IRS cannot be altered; LF vs CR/LF is autodetected")
}
if len(readerOptions.IFS) != 1 {
return nil, errors.New("CSV IFS can only be a single character")

View file

@ -25,7 +25,7 @@ func NewRecordWriterCSV(writerOptions *cli.TWriterOptions) (*RecordWriterCSV, er
if len(writerOptions.OFS) != 1 {
return nil, errors.New("CSV OFS can only be a single character")
}
if writerOptions.ORS != "\n" {
if writerOptions.ORS != "\n" && writerOptions.ORS != "\r\n" {
return nil, errors.New("CSV ORS cannot be altered")
}
return &RecordWriterCSV{

View file

@ -2959,4 +2959,4 @@ SEE ALSO
2021-11-15 MILLER(1)
2021-11-18 MILLER(1)

View file

@ -2,12 +2,12 @@
.\" Title: mlr
.\" Author: [see the "AUTHOR" section]
.\" Generator: ./mkman.rb
.\" Date: 2021-11-15
.\" Date: 2021-11-18
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "MILLER" "1" "2021-11-15" "\ \&" "\ \&"
.TH "MILLER" "1" "2021-11-18" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Portability definitions
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -9,10 +9,8 @@ PUNCHDOWN LIST
- cmp-matrices
- all-contribs: twi dm
- license triple-checks
- csv irs lf/crlf ignores -- ? already is so?
- `mlr put` -> coverart
- 0b1011 olh/webdoc
- help approx-match even if exact exists (e.g. 'map')
* release ordering?
conda
brew macports chocolatey