Open
Conversation
lidel
requested changes
Jan 26, 2022
Member
There was a problem hiding this comment.
I suspect stdout is not enough. My concern is that stderr would not end up in the (empty) file, but would go to terminal:
$ ipfs id --command-output=stdout.txt
Error: no IPFS repo found in /home/lidel/tmp/go-ipfs-out.
please run: 'ipfs init'
$ ipfs get invalidcid --command-output=stdout.txt
Error: invalid path "invalidcid": selected encoding not supportedIf someone runs a command in bash script, they may not monitor stderr and the message may be lost.
Perhaps an elegant way of handling this is to have explicit --stdout (or --output) and --stderr (or --errors) ?
$ ipfs get invalidcid --stdout=stdout.txt --stderr=stderr.txt
$ cat stdout.txt
$ cat stderr.txt
Error: invalid path "invalidcid": selected encoding not supportedcc @aschmahmann you may have better intuition about what would be the most useful on windows
Contributor
Author
|
@lidel Added error output option (we can review the option names at the end; I'm leaving for now the conspicuous |
lidel
requested changes
Apr 22, 2022
Co-authored-by: Marcin Rataj <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an option to save command output to a file instead of the
stdoutargument (which was always set to stdout bygo-ipfsconsumer). We have removed the option and assumed stdout except the option is set (this was intended to loudly flag the output is being set by an option since the argument could be misleadingly overridden, but we can restore the argument and have the two coexist).Used in ipfs/kubo#8683.
Related to ipfs/kubo#8335.