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

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

Open
lidel opened this issue Aug 11, 2021 · 2 comments · May be fixed by #8683
Open

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

lidel opened this issue Aug 11, 2021 · 2 comments · May be fixed by #8683
Assignees
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/triage Needs initial labeling and prioritization

Comments

@lidel
Copy link
Member

lidel commented Aug 11, 2021

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
@lidel lidel added kind/enhancement A net-new feature or improvement to an existing feature need/triage Needs initial labeling and prioritization labels Aug 11, 2021
@lidel lidel changed the title Support "-o | --output= <file>" in commands that return data to stdout Support "--output=<file>" in cmds that return data to stdout Aug 11, 2021
@schomatis schomatis self-assigned this Dec 23, 2021
@schomatis schomatis added this to Weekly Candidates in Maintenance Priorities - Go Dec 23, 2021
@schomatis schomatis moved this from Weekly Candidates to In Progress in Maintenance Priorities - Go Jan 14, 2022
@schomatis
Copy link
Contributor

Working on this.

@schomatis
Copy link
Contributor

The go-ipfs-cmds way seems doable. Will push a prototype for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/triage Needs initial labeling and prioritization
Projects
Status: 🔎 In Review
Development

Successfully merging a pull request may close this issue.

3 participants