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

Improve CLI usability (positional arguments order) #239

Open
jkbrzt opened this issue Jul 14, 2014 · 3 comments
Open

Improve CLI usability (positional arguments order) #239

jkbrzt opened this issue Jul 14, 2014 · 3 comments
Labels
cli CLI output enhanchement

Comments

@jkbrzt
Copy link
Member

jkbrzt commented Jul 14, 2014

Either allow request items to be specified before URL or improve the error message.

https://twitter.com/akrabat/status/488285985672019968

image

@jkbrzt jkbrzt added the cli CLI output enhanchement label Sep 7, 2014
@jkbrzt
Copy link
Member Author

jkbrzt commented Feb 10, 2021

Positional arguments:

  • The URL argument is the first positional one. It’s the only required argument.
  • After that, other positional arguments—request items—may optionally follow.

Arguments order:

  • If we allow random order of the positional arguments, then we’d have to introduce a detection for which of the arguments represent the URL. We can no longer rely on it being first.
  • This might be doable, but there’ll be a bunch of edge cases where it’s not straightforward or impossible, for example, the one below.
  • Detecting a request item type easy, because they differ in the separator used.
# An example of an ambiguous random-order positional argument set:
$ http     pie.dev/post            httpie.io/a=a
           ^^^^^^^^^^^^            ^^^^^^^^^^^^^^
             Valid URL       Both valid URL & data field 

@jkbrzt jkbrzt changed the title Improve CLI usability Improve CLI usability (positional arguments order) Feb 10, 2021
@RakshithRAcharya
Copy link

Can I take up this issue??...... Is it still open??

@sabberworm
Copy link

sabberworm commented Feb 6, 2024

I don’t think REQUEST_ITEMs need to be allowed to come before the URL but it sure would be great if the ---prefixed options would be allowed everywhere.

Specifically, I often need to switch the HTTP verb. The fact that it cannot be simply added after http but instead needs to be inserted between the last option and the URL, makes it difficult to edit an existing command.

I.e. allow http post --auth admin in addition to http --auth admin post.

While we’re at it, a shorthand for --verify=no would also be appreciated.

EDIT: See #125 and #1536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli CLI output enhanchement
Projects
None yet
Development

No branches or pull requests

3 participants