ipfs / ipfs/kubo

Support "--output=<file>" in cmds that return data to stdout

Open
#8,335 2 comments 0 reactions 1 assignee Claimed by @schomatis View on GitHub
kind/enhancement need/triage
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

## Problem

@aschmahmann noted that printing to stdout is not the best ergonomics when working with commands like:
- `ipfs block get`
- `ipfs multibase encode|decode`.

They take input from a file OR stdout, but return data to stdout only, which is problematic:
- awkward when using in non-posix shells like Powershell
- there is a general inconsistency: `--output=` IS supported in `ipfs get`, but not in mentioned `block` or `dag export`.

## Solution

- A) simply add `-o | --output=` to mentioned commands
- B) (nice to have) find a more elegant way to add `-o | --output=` as part of https://github.com/ipfs/go-ipfs-cmds
- we want to ensure that every place where we return data to stdout support outputing to a file
- does not need to be fully automatic: if it is possible to detect stdout just panic and ask to add the `-o --output` parameter to the command definition

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.