Skip to content

Body from file rework #11

Description

@jim-ec

Currently, bodies can be added from files by prefixing with @:

fetchr <url> -b @content.json

This is how it works in curl.

However, I am not satisfied with that approach:

  • What if the user really wants a @ at the start of the body?
  • Since you need to prefix with @, you don't get file path completions.

The main obstacle is that fetchr needs to be track of the order of individual body arguments, so adding a new option like --read is not an option. clap, the argument parser, does not give any information about the ordering of arguments.

A possible solution would be to manually parse the process arguments, but that would side-step clap, and also lead to a redundant CLI parse run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions