Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for escaped commas in CLI input #330

Merged
merged 4 commits into from
Sep 10, 2023
Merged

Conversation

dadrian
Copy link
Member

@dadrian dadrian commented May 5, 2023

Fixes #329

You're in luck, I was on a plane with Wifi and time to spare.

s, err := r.Read()
if err != nil || len(s) == 0 {
return line, ""
}
if len(s) == 1 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it is duplicative of L74?

@@ -68,7 +69,11 @@ func parseMetadataInputLine(line string) (string, string) {
}

func parseNormalInputLine(line string) (string, string) {
s := strings.SplitN(line, ",", 2)
r := csv.NewReader(strings.NewReader(line))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this cheap enough that we're not worried about creating a new reader for every line? Docs look like expected to be reused across a whole file.

@dadrian dadrian merged commit fa7d67d into main Sep 10, 2023
@dadrian dadrian deleted the dadrian/use-csv-in-input branch September 10, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing domains that have a comma as part of the string
2 participants