Skip to content

Conversation

@triole
Copy link
Contributor

@triole triole commented Oct 17, 2025

Hi there, thanks for this nice tool.

I added a write to file option and made a few small improvements. Feel free to merge this stuff in case you are interested. Otherwise just leave it.

Have a a nice day.

@uchiiii
Copy link
Owner

uchiiii commented Oct 17, 2025

Hi @triole, thank you for the PR. I will fix the CI and check your PR in a few days. Please wait for a while.

Copy link
Owner

@uchiiii uchiiii left a comment

Choose a reason for hiding this comment

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

Thank you for the pr. I left some comments.

Could you rebase your branch to the latest main?

.gitignore Outdated
@@ -1 +1,2 @@
.go-version
build/
Copy link
Owner

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the gitignore rule to exclude my build folder. So we probably do not need this. It was just for my build process. Others might do this differently.

Copy link
Owner

@uchiiii uchiiii Oct 26, 2025

Choose a reason for hiding this comment

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

I see, could you revert this, simply because it is not the same across developers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, the line is removed although I do not see how it does any harm.

af75fa8

Comment on lines 33 to 39
&cli.StringFlag{
Name: "output",
Aliases: []string{"o"},
Value: "",
Usage: "Write output to file",
Destination: &args.OutputFile,
},
Copy link
Owner

Choose a reason for hiding this comment

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

How about csv2md example.csv > test.txt? Is there any use case where you cannot cope with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, there are cases in which I use other tools for CI pipelines for example. Some of them do not support piping because they have their own environments to run shell commands, which sometimes are different from the usual shell in the terminal. I think it does not hurt to have this option and sometimes you will benefit from it.

Copy link
Owner

@uchiiii uchiiii left a comment

Choose a reason for hiding this comment

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

Could you rebase on the latest main and run test?

convert.go Outdated
if args.OutputFile == "" {
fmt.Println(md)
} else {
os.WriteFile(args.OutputFile, []byte(md), 0644)
Copy link
Owner

Choose a reason for hiding this comment

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

os.WriteFile overwrites the content of a file if it exists. Do you think this is user-friendly? Or should we add another option like --force and avoid overwirting by default?
https://pkg.go.dev/os#WriteFile

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a good idea actually. If would also not overwrite existing files. I added this to my fork. Feel free to have a look.

b8c5017

Copy link
Owner

@uchiiii uchiiii left a comment

Choose a reason for hiding this comment

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

@triole Thank you for your amazing work! LGTM!

@uchiiii uchiiii merged commit 58c0a42 into uchiiii:master Nov 5, 2025
2 checks passed
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.

2 participants