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

fix(console): blob download args #1729

Merged

Conversation

divagant-martian
Copy link
Contributor

@divagant-martian divagant-martian commented Oct 25, 2023

Description

  • modifies the blob download ux to make it clear, and properly enforce having either a ticket or arguments for a download
  • All arguments apply to both ticket and hash but with different constrains. In the case of the ticket options can be used to override/remove ticket parts
  • makes sure failures still report the help text

Notes & open questions

Sample output:

This would previously only show an error

> blob download
Download data to the running node's database and provide it

Usage: blob download <COMMAND>

Commands:
  ticket  Use a blob ticket to download the data
  hash    Supply the content and node-addressing information directly to perform a download
  help    Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help (see more with '--help')

Calling commands:

With a ticket:

> blob download ticket blobedjoqrkky753mdwphqrxbr2wjzkizv4hkb5s5ovav73c2zfuaja7aaibaiah6aaaahcfoaiaaaaaaaaaaaaaaaaaaaaaaaabyvlqcz2d7d7ouqasz36mapwfxqf2dx3zznb25nx32phl7kbgum23wtegaa

With args:

> blob download hash bafkr4ibzusj4ulmrhrbymsgklwlcencx63jwcurmoimjhk4mutqdsqhnqa --node 2luekswh7o3a5tz4enymovsoksgnpb2qpmxlvifp6ywwjnacihya --derp-region 1

Both
NOTE: Adding this a a subcommand is a consequence of clap-rs/clap#2621

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.

@divagant-martian divagant-martian changed the title blob download args fix(console): blob download args Oct 25, 2023
@divagant-martian divagant-martian marked this pull request as ready for review October 25, 2023 17:00
@dignifiedquire dignifiedquire added this to the v0.9.0 milestone Oct 30, 2023
@divagant-martian divagant-martian marked this pull request as draft October 30, 2023 18:18
@dignifiedquire dignifiedquire modified the milestones: v0.9.0, v0.10.0 Oct 31, 2023
@divagant-martian
Copy link
Contributor Author

@b5 this is still a subcommand but I think it has a nice feel, give it a look 🙏

@divagant-martian divagant-martian marked this pull request as ready for review October 31, 2023 15:16
@divagant-martian divagant-martian self-assigned this Nov 1, 2023
Copy link
Member

@b5 b5 left a comment

Choose a reason for hiding this comment

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

big improvement!

@b5
Copy link
Member

b5 commented Nov 2, 2023

loving these colours
Screenshot 2023-11-01 at 9 29 17 PM

@divagant-martian divagant-martian added this pull request to the merge queue Nov 2, 2023
Merged via the queue into n0-computer:main with commit a916d4c Nov 2, 2023
15 checks passed
@divagant-martian divagant-martian deleted the blob-download-help branch December 10, 2023 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

console: blob download help text makes it look like tickets are not supported
3 participants