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

Add protocol information to CLI argument help string #252

Closed
wants to merge 1 commit into from

Conversation

spaceone
Copy link

@spaceone spaceone commented May 1, 2015

No description provided.

@bagder
Copy link
Member

bagder commented May 5, 2015

You can use proxy to do non-HTTP protocols too. --request works for at least FTP as well as HTTP, probably more too I can't remember off-hand.

@spaceone
Copy link
Author

spaceone commented May 5, 2015

Ok, yes. It seems the changes in --proxy-* can be used for more than HTTP.
The first time i was reading curl --help it was hard and not very intuitive to understand (e.g. it was not clear that --request COMMAND means HTTP METHOD (the term defined in RFC 7230)). IMHO it should be enhanced to make curl more userfriendly. I think it would be good to improve the following points:
The order is alphabetically instead of grouping sections which belong to each other.
It should be clear for every option to which protocols they belong to.
As you can see here:
https://github.com/spaceone/circuits.http/blob/master/examples/curl.py#L163
I added some example groups like 'Output', 'Connection', 'SSL', $protocols. As options belong to multiple protocols I think the flags [H] / [F], etc. are good enough.

How do you think about this? I could investigate some time to fix these points and make a pull request then.

@bagder bagder removed the needs-info label May 18, 2015
@bagder
Copy link
Member

bagder commented May 18, 2015

It sounds excellent. I would be useful to see how the --help output would look like when you run your code.

Also, it could be an idea to actually include your script into the git repo so that we can generate future --help outputs that way once we agree on the results.

@spaceone
Copy link
Author

My current output looks like this: https://bpaste.net/show/2ea7b5081e50
(it is ofc. WIP).

I'll then see that I will create a nice structure for the --help output!

@bagder
Copy link
Member

bagder commented Jun 5, 2015

I would like to get more users to participate in this discussion but apparently it doesn't happen (here). I'll make a separate post to the curl-users list soon and see if I can attract some interest as the situation with the --help output comes up every now and then as something to improve.

The problems I see with this separation is that you put each option under a single label while they work for more than one. For example lots of the options you now have under HTTP(S) also work for numerous other protocols.

An idea: lets store a set of keywords for each command line option and introduce a new option that can output all options that are related to that keyword. Like "curl --help-list FTP" to get all the ones that work for FTP and "curl --help-list proxy" etc. Then the same option could be listed for several keywords.

If that works decently, maybe the default -h/--help output could be stripped down to only show the most frequently used options and then refer to the --help-list method and the keywords as a way to list the rest?

@spaceone
Copy link
Author

spaceone commented Jun 9, 2015

Yes, the idea of "--help-list" is worth to think about it. I just added myself to the curl-users mailing list. If you already wrote a message please give me a link to it.

@gvanem
Copy link
Contributor

gvanem commented Jun 9, 2015

IMHO adding colours to the --help output would be a great help to improve readability. If a user is interested in only (S)FTP options, it would make sense to colourise all the (H) and (F) markers to find the correct option faster.

tool_help.c could e.g. use ~3(H)~0 and map colour 3 using ANSI, WinConsole calls, etc.

@bagder
Copy link
Member

bagder commented Jun 10, 2015

My post and some replies can be found here: http://article.gmane.org/gmane.comp.web.curl.general/14780

@bagder
Copy link
Member

bagder commented Jul 19, 2015

I'd prefer comments/work to continue in the style as mentioned, unless other/better ways are brought forward. Closing this for now.

@bagder bagder closed this Jul 19, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants